From 390fb4f12e162e63a4a3028b240770943e6a4b87 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Mon, 21 Sep 2020 00:49:09 +0100 Subject: [PATCH] Disable OpenGL Debug stuff when SDL doesn't provide the necessary definitions --- components/debug/gldebug.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/debug/gldebug.cpp b/components/debug/gldebug.cpp index 20448ccbb..3c5ec728a 100644 --- a/components/debug/gldebug.cpp +++ b/components/debug/gldebug.cpp @@ -40,6 +40,7 @@ either expressed or implied, of the FreeBSD Project. void debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam) { +#ifdef GL_DEBUG_OUTPUT std::string srcStr; switch (source) { @@ -96,10 +97,12 @@ void debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsiz } Log(logSeverity) << "OpenGL " << typeStr << " [" << srcStr << "]: " << message; +#endif } void enableGLDebugExtension(unsigned int contextID) { +#ifdef GL_DEBUG_OUTPUT typedef void (GL_APIENTRY *DEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam); typedef void (GL_APIENTRY *GLDebugMessageControlFunction)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (GL_APIENTRY *GLDebugMessageCallbackFunction)(DEBUGPROC, const void* userParam); @@ -132,6 +135,7 @@ void enableGLDebugExtension(unsigned int contextID) Log(Debug::Info) << "OpenGL debug callback attached."; } else +#endif Log(Debug::Error) << "Unable to attach OpenGL debug callback."; }