Skip to content

Commit

Permalink
Guard OpenGL error log behind ENABLE_OPENGL.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcel303 authored and Marcel Smit committed May 7, 2023
1 parent f67139f commit b0cf797
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion framework/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,7 @@ GX_TEXTURE_FORMAT gxGetTextureFormat(GxTextureId texture);

#endif

#if FRAMEWORK_ENABLE_GL_ERROR_LOG
#if FRAMEWORK_ENABLE_GL_ERROR_LOG && ENABLE_OPENGL
void checkErrorGL_internal(const char * function, int line);
#define checkErrorGL() checkErrorGL_internal(__FUNCTION__, __LINE__)
#else
Expand Down
18 changes: 9 additions & 9 deletions framework/internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ std::vector<ShaderOutput> g_shaderOutputs;

// -----

#if FRAMEWORK_ENABLE_GL_ERROR_LOG && ENABLE_OPENGL
void checkErrorGL_internal(const char * function, int line)
{
#if FRAMEWORK_ENABLE_GL_ERROR_LOG
const GLenum error = glGetError();

if (error != GL_NO_ERROR)
{
logError("%s: %d: OpenGL error: %x", function, line, error);
AssertMsg(error == GL_NO_ERROR, "%s: %d: OpenGL error: %x", function, line, error);
}
#endif
const GLenum error = glGetError();

if (error != GL_NO_ERROR)
{
logError("%s: %d: OpenGL error: %x", function, line, error);
AssertMsg(error == GL_NO_ERROR, "%s: %d: OpenGL error: %x", function, line, error);
}
}
#endif

#if FRAMEWORK_ENABLE_GL_DEBUG_CONTEXT && ENABLE_DESKTOP_OPENGL
static void formatDebugOutputGL(char * outStr, size_t outStrSize, GLenum source, GLenum type, GLuint id, GLenum severity, const char * msg)
Expand Down

0 comments on commit b0cf797

Please sign in to comment.