From 1bf2e32f8b61fa282ba805ff3be13e4589019f1a Mon Sep 17 00:00:00 2001 From: Sylvain Beucler Date: Sun, 1 Apr 2012 13:39:12 +0000 Subject: [PATCH] GLsizei: ptrdiff_t -> int (like GLEW); add missing FGH_ prefix for OpenGL 2.0 prototype typedef's git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1226 7f0cb862-5218-0410-a997-914c9d46530a --- src/fg_gl2.c | 14 +++++++------- src/fg_gl2.h | 30 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/fg_gl2.c b/src/fg_gl2.c index cad2fc9..641a813 100644 --- a/src/fg_gl2.c +++ b/src/fg_gl2.c @@ -40,13 +40,13 @@ void FGAPIENTRY glutSetVertexAttribNormal(GLint attrib) { void fgInitGL2() { fgState.HasOpenGL20 = 0; #define CHECK(func, a) if ((a) == NULL) { fgWarning("fgInitGL2: " func " is NULL"); return; } - CHECK("fghGenBuffers", fghGenBuffers = (PFNGLGENBUFFERSPROC) glutGetProcAddress ("glGenBuffers")); - CHECK("fghDeleteBuffers", fghDeleteBuffers = (PFNGLDELETEBUFFERSPROC) glutGetProcAddress ("glDeleteBuffers")); - CHECK("fghBindBuffer", fghBindBuffer = (PFNGLBINDBUFFERPROC) glutGetProcAddress ("glBindBuffer")); - CHECK("fghBufferData", fghBufferData = (PFNGLBUFFERDATAPROC) glutGetProcAddress ("glBufferData")); - CHECK("fghVertexAttribPointer", fghVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) glutGetProcAddress ("glVertexAttribPointer")); - CHECK("fghEnableVertexAttribArray", fghEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress ("glEnableVertexAttribArray")); - CHECK("fghDisableVertexAttribArray", fghDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress ("glDisnableVertexAttribArray")); + CHECK("fghGenBuffers", fghGenBuffers = (FGH_PFNGLGENBUFFERSPROC) glutGetProcAddress ("glGenBuffers")); + CHECK("fghDeleteBuffers", fghDeleteBuffers = (FGH_PFNGLDELETEBUFFERSPROC) glutGetProcAddress ("glDeleteBuffers")); + CHECK("fghBindBuffer", fghBindBuffer = (FGH_PFNGLBINDBUFFERPROC) glutGetProcAddress ("glBindBuffer")); + CHECK("fghBufferData", fghBufferData = (FGH_PFNGLBUFFERDATAPROC) glutGetProcAddress ("glBufferData")); + CHECK("fghVertexAttribPointer", fghVertexAttribPointer = (FGH_PFNGLVERTEXATTRIBPOINTERPROC) glutGetProcAddress ("glVertexAttribPointer")); + CHECK("fghEnableVertexAttribArray", fghEnableVertexAttribArray = (FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress ("glEnableVertexAttribArray")); + CHECK("fghDisableVertexAttribArray", fghDisableVertexAttribArray = (FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress ("glDisnableVertexAttribArray")); #undef CHECK fgState.HasOpenGL20 = 1; } diff --git a/src/fg_gl2.h b/src/fg_gl2.h index 18a043c..54076d7 100644 --- a/src/fg_gl2.h +++ b/src/fg_gl2.h @@ -36,21 +36,21 @@ #define FGH_STATIC_DRAW 0x88E4 #define FGH_ELEMENT_ARRAY_BUFFER 0x8893 -typedef ptrdiff_t fghGLsizeiptr; -typedef void (APIENTRY *PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef void (APIENTRY *PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRY *PFNGLBUFFERDATAPROC) (GLenum target, fghGLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRY *PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); -typedef void (APIENTRY *PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRY *PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); -typedef void (APIENTRY *PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef int fghGLsizeiptr; +typedef void (APIENTRY *FGH_PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef void (APIENTRY *FGH_PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRY *FGH_PFNGLBUFFERDATAPROC) (GLenum target, fghGLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRY *FGH_PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -PFNGLGENBUFFERSPROC fghGenBuffers; -PFNGLDELETEBUFFERSPROC fghDeleteBuffers; -PFNGLBINDBUFFERPROC fghBindBuffer; -PFNGLBUFFERDATAPROC fghBufferData; -PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; -PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; -PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; +FGH_PFNGLGENBUFFERSPROC fghGenBuffers; +FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; +FGH_PFNGLBINDBUFFERPROC fghBindBuffer; +FGH_PFNGLBUFFERDATAPROC fghBufferData; +FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; +FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; +FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; #endif -- 1.7.10.4