diff --git a/__init__.py b/__init__.py index d30461a..d3070a9 100644 --- a/__init__.py +++ b/__init__.py @@ -279,6 +279,9 @@ INSTANCE_FLAG_VISIBLE = _flag(1) BATCH_MAX_SIZE = 65536 render_initialize = _engine.rk_render_initialize +render_initialize.argtypes = ( + ctypes.c_bool,) # debug + render_terminate = _engine.rk_render_terminate _load_shader = _engine.rk_load_shader diff --git a/cpp/render.hpp b/cpp/render.hpp index a629b76..c33de92 100644 --- a/cpp/render.hpp +++ b/cpp/render.hpp @@ -80,7 +80,8 @@ union rk_mesh { }; }; -RK_EXPORT void rk_render_initialize(); +RK_EXPORT void rk_render_initialize( + rk_bool debug); RK_EXPORT void rk_render_terminate(); diff --git a/cpp/render/render_opengles.cpp b/cpp/render/render_opengles.cpp index 11404a7..1fe9ba2 100644 --- a/cpp/render/render_opengles.cpp +++ b/cpp/render/render_opengles.cpp @@ -49,7 +49,8 @@ static void rk_debug_message_callback( printf("[GL] (id=%d) %s\n", id, message); } -void rk_render_initialize() { +void rk_render_initialize( + rk_bool debug) { GLubyte const * const vendor = glGetString(GL_VENDOR); GLubyte const * const renderer = glGetString(GL_RENDERER); printf("[GL] vendor: %s, renderer: %s\n", vendor, renderer); @@ -57,8 +58,10 @@ void rk_render_initialize() { GLubyte const * const language = glGetString(GL_SHADING_LANGUAGE_VERSION); printf("[GL] version: %s, language: %s\n", version, language); - glDebugMessageCallback(rk_debug_message_callback, nullptr); - glEnable(GL_DEBUG_OUTPUT); + if (debug) { + glDebugMessageCallback(rk_debug_message_callback, nullptr); + glEnable(GL_DEBUG_OUTPUT); + } char const * const gl_exts = reinterpret_cast(glGetString(GL_EXTENSIONS)); // printf("[GL] %s\n", gl_exts);