예제 #1
0
 public GfxBuffer SetSequence(uint Len, VertexUsageHint Hint = VertexUsageHint.StaticDraw)
 {
     uint[] Arr = new uint[Len];
     for (uint i = 0; i < Len; i++)
     {
         Arr[i] = i;
     }
     return(SetData(Arr, Hint));
 }
예제 #2
0
 public static GfxBuffer CreateFromData <T>(IEnumerable <T> Data, VertexUsageHint Hint = VertexUsageHint.StaticDraw) where T : struct
 {
     return(CreateFromData(Data.ToArray(), Hint));
 }
예제 #3
0
 public virtual GfxBuffer SetData <T>(int Size, T[] Data, VertexUsageHint Hint = VertexUsageHint.StaticDraw) where T : struct
 {
     Length = Data.Length;
     GL.NamedBufferData(ID, Size, Data, (BufferUsageHint)Hint);
     return(this);
 }
예제 #4
0
 public static GfxBuffer CreateFromData <T>(T[] Data, VertexUsageHint Hint = VertexUsageHint.StaticDraw) where T : struct
 {
     return(new DataBuffer(typeof(T)).SetData(Data, Hint));
 }
예제 #5
0
 public virtual GfxBuffer SetData <T>(T[] Data, VertexUsageHint Hint = VertexUsageHint.StaticDraw) where T : struct
 {
     return(SetData(Data.Length * Marshal.SizeOf <T>(), Data, Hint));
 }