Use ARB_DEBUG_OUTPUT on windows in Debug mode.
Hopefully the extension will work properly with every driver...
This commit is contained in:
parent
00cf026051
commit
a1f5e47cba
@ -413,7 +413,8 @@ bool COpenGLDriver::initDriver(CIrrDeviceWin32* device)
|
||||
{
|
||||
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
|
||||
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
|
||||
// WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
||||
//WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
||||
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
|
||||
0
|
||||
};
|
||||
hrc=wglCreateContextAttribs_ARB(HDc, 0, iAttribs);
|
||||
|
@ -52,15 +52,14 @@ PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
|
||||
PFNGLTEXBUFFERPROC glTexBuffer;
|
||||
PFNGLBUFFERSUBDATAPROC glBufferSubData;
|
||||
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
|
||||
PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARB;
|
||||
#endif
|
||||
|
||||
static GLuint quad_buffer;
|
||||
static GLuint ColoredVertex;
|
||||
static bool is_gl_init = false;
|
||||
|
||||
// Please leave this code, it's for debugging purpose
|
||||
//#define ENABLE_ARB_DEBUG_OUTPUT
|
||||
#ifdef ENABLE_ARB_DEBUG_OUTPUT
|
||||
#ifdef DEBUG
|
||||
static
|
||||
void debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length,
|
||||
const GLchar* msg, const void *userparam)
|
||||
@ -178,9 +177,12 @@ void initGL()
|
||||
glUniform4fv = (PFNGLUNIFORM4FVPROC)IRR_OGL_LOAD_EXTENSION("glUniform4fv");
|
||||
glBufferSubData = (PFNGLBUFFERSUBDATAPROC)IRR_OGL_LOAD_EXTENSION("glBufferSubData");
|
||||
glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)IRR_OGL_LOAD_EXTENSION("glVertexAttribIPointer");
|
||||
#ifdef DEBUG
|
||||
glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)IRR_OGL_LOAD_EXTENSION("glDebugMessageCallbackARB");
|
||||
#endif
|
||||
#ifdef ENABLE_ARB_DEBUG_OUTPUT
|
||||
glDebugMessageCallbackARB(debugCallback, NULL);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
glDebugMessageCallbackARB((GLDEBUGPROCARB)debugCallback, NULL);
|
||||
#endif
|
||||
const float quad_vertex[] = {
|
||||
-1., -1., -1., 1., // UpperLeft
|
||||
|
@ -75,6 +75,9 @@ extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
|
||||
extern PFNGLTEXBUFFERPROC glTexBuffer;
|
||||
extern PFNGLBUFFERSUBDATAPROC glBufferSubData;
|
||||
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
|
||||
#ifdef DEBUG
|
||||
extern PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARB;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user