mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
enable opengl debugging on x11
This commit is contained in:
@@ -28,17 +28,28 @@
|
||||
|
||||
Graphics g_graphics;
|
||||
|
||||
void oglDebugCallback(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, int length, const char* message, void* userParam)
|
||||
{
|
||||
logWarning("OGL: ", message);
|
||||
}
|
||||
|
||||
void Graphics::init()
|
||||
{
|
||||
logInfo("GPU ", glGetString(GL_RENDERER));
|
||||
logInfo("OpenGL ", glGetString(GL_VERSION));
|
||||
|
||||
|
||||
#ifndef OPENGL_ES2
|
||||
// init GL extensions
|
||||
GLenum err = glewInit();
|
||||
if(err != GLEW_OK)
|
||||
logFatal("Unable to init GLEW: ", glewGetErrorString(err));
|
||||
|
||||
#ifndef NDEBUG
|
||||
if(GLEW_ARB_debug_output)
|
||||
glDebugMessageCallbackARB(oglDebugCallback, NULL);
|
||||
#endif
|
||||
|
||||
const char *requiredExtensions[] = {
|
||||
"GL_ARB_vertex_program",
|
||||
"GL_ARB_vertex_shader",
|
||||
|
Reference in New Issue
Block a user