From bbfe5d5ce4799dbfb55d4e4d44bc254592529c29 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Tue, 2 Dec 2014 01:21:40 +1100 Subject: Define GL callback func. Improve GL err macro. --- include/mbgl/platform/gl.hpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'include/mbgl') diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp index 02fd64b9a1..73d04b7a9e 100644 --- a/include/mbgl/platform/gl.hpp +++ b/include/mbgl/platform/gl.hpp @@ -21,6 +21,7 @@ #include #include #else + #define GL_GLEXT_PROTOTYPES #include #include #endif @@ -72,18 +73,18 @@ namespace gl { #define GL_TEXTURE 0x1702 #define GL_RENDERBUFFER 0x8D41 #define GL_FRAMEBUFFER 0x8D40 -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (APIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, void **params); -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); -typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (* GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam); +typedef void (* PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (* PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (* PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef GLuint (* PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (* PFNGLGETPOINTERVPROC) (GLenum pname, void **params); +typedef void (* PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (* PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (* PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (* PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (* PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (* PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); extern PFNGLDEBUGMESSAGECONTROLPROC DebugMessageControl; extern PFNGLDEBUGMESSAGEINSERTPROC DebugMessageInsert; extern PFNGLDEBUGMESSAGECALLBACKPROC DebugMessageCallback; @@ -95,7 +96,9 @@ extern PFNGLOBJECTLABELPROC ObjectLabel; extern PFNGLGETOBJECTLABELPROC GetObjectLabel; extern PFNGLOBJECTPTRLABELPROC ObjectPtrLabel; extern PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel; +void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam); +#define GL_VERTEX_ARRAY_BINDING 0x85B5 typedef void (* PFNGLBINDVERTEXARRAYPROC) (GLuint array); typedef void (* PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); typedef void (* PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); -- cgit v1.2.1