enable ogl debug with ifdefs

This commit is contained in:
Eduardo Bart 2012-04-12 16:56:05 -03:00
parent 879827bdbc
commit 0b8d8b4595
2 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,7 @@ void Graphics::init()
if(err != GLEW_OK)
logFatal("Unable to init GLEW: ", glewGetErrorString(err));
#ifndef NDEBUG
#ifdef DEBUG_OPENGL
if(GLEW_ARB_debug_output)
glDebugMessageCallbackARB(oglDebugCallback, NULL);
#endif

View File

@ -368,8 +368,9 @@ void X11Window::internalChooseGLVisual()
#ifndef OPENGL_ES2
static int attrList[] = {
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_DOUBLEBUFFER, True,
//GLX_DEPTH_SIZE, 24,
//GLX_STENCIL_SIZE, 8,
None
};
@ -404,18 +405,18 @@ void X11Window::internalChooseGLVisual()
void X11Window::internalCreateGLContext()
{
#ifndef OPENGL_ES2
#ifdef DEBUG_OPENGL
typedef GLXContext (*GLXCREATECONTEXTATTRIBSARBPROC)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL;
glXCreateContextAttribsARB = (GLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte*) "glXCreateContextAttribsARB");
if(glXCreateContextAttribsARB) {
int attrs[] = {
#ifndef NDEBUG
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
#endif
None
};
m_glxContext = glXCreateContextAttribsARB(m_display, *m_fbConfig, NULL, True, attrs);
} else
#endif
m_glxContext = glXCreateContext(m_display, m_visual, NULL, True);
//m_glxContext = glXCreateContext(m_display, m_visual, NULL, True);