public void Draw()
{
if (VertexCount == 0)
return;
Helper.SafeGLEnable(DrawCaps, () =>
{
GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
Helper.SafeGLEnableClientStates(DrawStates, () =>
{
GL.BindTexture(TextureTarget.Texture2D, TextureID);
GL.BindBuffer(BufferTarget.ArrayBuffer, VboID);
GL.VertexPointer(3, VertexPointerType.Float, BlittableValueType.StrideOf(Vertices), new IntPtr(0));
GL.NormalPointer(NormalPointerType.Float, BlittableValueType.StrideOf(Vertices), new IntPtr(12));
GL.TexCoordPointer(2, TexCoordPointerType.Float, BlittableValueType.StrideOf(Vertices), new IntPtr(24));
GL.ColorPointer(4, ColorPointerType.UnsignedByte, BlittableValueType.StrideOf(Vertices), new IntPtr(32));
// triangles because quads are depreciated in new opengl versions
GL.DrawArrays(BeginMode.Triangles, 0, VertexCount);
});
});
}