GLsizei: ptrdiff_t -> int (like GLEW); add missing FGH_ prefix for OpenGL 2.0 prototy...
authorSylvain Beucler <beuc@beuc.net>
Sun, 1 Apr 2012 13:39:12 +0000 (13:39 +0000)
committerSylvain Beucler <beuc@beuc.net>
Sun, 1 Apr 2012 13:39:12 +0000 (13:39 +0000)
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
src/fg_gl2.h

index cad2fc9..641a813 100644 (file)
@@ -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;
 }
index 18a043c..54076d7 100644 (file)
 #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