From ea075247f44fb4dde2afc5cb9876f54050f941bc Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Sun, 11 Feb 2024 09:52:47 -0500 Subject: [PATCH] add TANGERINE_GL_DEBUG_QUIET environment option --- include/GLDebug.h | 5 +++++ include/tangerine.h | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/GLDebug.h b/include/GLDebug.h index eb13bfc..6f02079 100644 --- a/include/GLDebug.h +++ b/include/GLDebug.h @@ -92,6 +92,11 @@ openglDebugCallback(GLenum source, if (id == 131185) return; +#ifdef TANGERINE_GL_DEBUG_QUIET + if (type != GL_DEBUG_TYPE_ERROR) + return; +#endif + std::cout << "message id: " << id << ", " << ((type == GL_DEBUG_TYPE_ERROR) ? "Error" : "Debug") << (type == GL_DEBUG_TYPE_ERROR ? "** GL Error **" : "") diff --git a/include/tangerine.h b/include/tangerine.h index 7eb2570..34527ef 100644 --- a/include/tangerine.h +++ b/include/tangerine.h @@ -86,6 +86,13 @@ #include "util.h" +// NOTE: can set TANGERINE_GL_DEBUG_QUIET in your application to disable extra +// debug messages from openGL +#ifndef TANGERINE_GL_DEBUG_QUIET + #define TANGERINE_GL_DEBUG_NOISY +#endif + + struct SDLHandles { SDL_Window* window; @@ -94,9 +101,6 @@ struct SDLHandles u32 SDL_flags; }; -// TODO: node/tree structure for entities -struct Node; - struct RenderGroup { ShaderProgram* shader; @@ -106,7 +110,10 @@ struct RenderGroup char* name; }; +// TODO: node/tree structure for entities #if 0 +struct Node; + struct Scene { MemoryArena* rg_arena;