From 6b5ff5ba24b515cefb7b9aa9d0efad983ef9eacb Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 17 Nov 2009 09:59:36 +0000 Subject: [PATCH] Merged fix for [#1386] from branches/1.0. --- Source/OpenTK/Graphics/ES20/Helper.cs | 24 +++++++++++++ Source/OpenTK/Graphics/OpenGL/GLHelper.cs | 42 +++++++++++++++-------- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/Source/OpenTK/Graphics/ES20/Helper.cs b/Source/OpenTK/Graphics/ES20/Helper.cs index 1ba792d9..28d2e883 100644 --- a/Source/OpenTK/Graphics/ES20/Helper.cs +++ b/Source/OpenTK/Graphics/ES20/Helper.cs @@ -313,6 +313,30 @@ namespace OpenTK.Graphics.ES20 #endregion + #region VertexAttribPointer + + public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset) + { + VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset); + } + + [CLSCompliant(false)] + public static void VertexAttribPointer(uint index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset) + { + VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset); + } + + #endregion + + #region DrawElements + + public static void DrawElements(BeginMode mode, int count, DrawElementsType type, int offset) + { + DrawElements(mode, count, type, new IntPtr(offset)); + } + + #endregion + #region public static int GenTexture() public static int GenTexture() diff --git a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs index 49390879..4b76cc4b 100644 --- a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs +++ b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs @@ -697,39 +697,53 @@ namespace OpenTK.Graphics.OpenGL #region [Vertex|Normal|Index|Color|FogCoord|VertexAttrib]Pointer - public static void VertexPointer(int size, VertexPointerType type, int stride, int pointer) + public static void VertexPointer(int size, VertexPointerType type, int stride, int offset) { - VertexPointer(size, type, stride, (IntPtr)pointer); + VertexPointer(size, type, stride, (IntPtr)offset); } - public static void NormalPointer(int size, NormalPointerType type, int stride, int pointer) + public static void NormalPointer(NormalPointerType type, int stride, int offset) { - NormalPointer(type, stride, (IntPtr)pointer); + NormalPointer(type, stride, (IntPtr)offset); } - public static void IndexPointer(IndexPointerType type, int stride, int pointer) + public static void IndexPointer(IndexPointerType type, int stride, int offset) { - IndexPointer(type, stride, (IntPtr)pointer); + IndexPointer(type, stride, (IntPtr)offset); } - public static void ColorPointer(int size, ColorPointerType type, int stride, int pointer) + public static void ColorPointer(int size, ColorPointerType type, int stride, int offset) { - ColorPointer(size, type, stride, (IntPtr)pointer); + ColorPointer(size, type, stride, (IntPtr)offset); } - public static void FogCoordPointer(int size, FogPointerType type, int stride, int pointer) + public static void FogCoordPointer(FogPointerType type, int stride, int offset) { - FogCoordPointer(type, stride, (IntPtr)pointer); + FogCoordPointer(type, stride, (IntPtr)offset); } - public static void EdgeFlagPointer(int stride, int pointer) + public static void EdgeFlagPointer(int stride, int offset) { - EdgeFlagPointer(stride, (IntPtr)pointer); + EdgeFlagPointer(stride, (IntPtr)offset); } - public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int pointer) + public static void TexCoordPointer(int size, TexCoordPointerType type, int stride, int offset) { - VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)pointer); + TexCoordPointer(size, type, stride, offset); + } + + public static void VertexAttribPointer(int index, int size, VertexAttribPointerType type, bool normalized, int stride, int offset) + { + VertexAttribPointer(index, size, type, normalized, stride, (IntPtr)offset); + } + + #endregion + + #region DrawElements + + public static void DrawElements(BeginMode mode, int count, DrawElementsType type, int offset) + { + DrawElements(mode, count, type, new IntPtr(offset)); } #endregion