SHARE
TWEET

VertexElement

default_ex Jul 25th, 2012 26 Never
  1. public struct VertexElement
  2. {
  3.     public string Name;
  4.     public int Size;
  5.     public VertexAttribPointerType Type;
  6.     public bool Normalized;
  7.     public IntPtr Offset;
  8.  
  9.     public void Apply(ShaderProgram shaderProgram, int stride = 0)
  10.     {
  11.         int index = GL.GetAttribLocation(shaderProgram.ID, Name);
  12.         if (index != -1)
  13.         {
  14.             GL.VertexAttribPointer(index, Size, Type, Normalized, stride, Offset);
  15.             GL.EnableVertexAttribArray(index);
  16.         }
  17.     }
  18. }
RAW Paste Data
Top