1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

OpenGL: Reduce error checking in Release builds

This commit is contained in:
reuk 2022-09-08 17:41:31 +01:00
parent ff1d5d6da4
commit 18aaa86761
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
2 changed files with 9 additions and 4 deletions

View file

@ -215,7 +215,9 @@ static void checkGLError (const char* file, const int line)
static void clearGLError() noexcept static void clearGLError() noexcept
{ {
#if JUCE_DEBUG
while (glGetError() != GL_NO_ERROR) {} while (glGetError() != GL_NO_ERROR) {}
#endif
} }
struct OpenGLTargetSaver struct OpenGLTargetSaver

View file

@ -228,16 +228,19 @@ private:
{ {
#if JUCE_DEBUG #if JUCE_DEBUG
constexpr auto contextFlags = WGL_CONTEXT_DEBUG_BIT_ARB; constexpr auto contextFlags = WGL_CONTEXT_DEBUG_BIT_ARB;
constexpr auto noErrorChecking = GL_FALSE;
#else #else
constexpr auto contextFlags = 0; constexpr auto contextFlags = 0;
constexpr auto noErrorChecking = GL_TRUE;
#endif #endif
const int attribs[] = const int attribs[] =
{ {
WGL_CONTEXT_MAJOR_VERSION_ARB, components->major, WGL_CONTEXT_MAJOR_VERSION_ARB, components->major,
WGL_CONTEXT_MINOR_VERSION_ARB, components->minor, WGL_CONTEXT_MINOR_VERSION_ARB, components->minor,
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
WGL_CONTEXT_FLAGS_ARB, contextFlags, WGL_CONTEXT_FLAGS_ARB, contextFlags,
WGL_CONTEXT_OPENGL_NO_ERROR_ARB, noErrorChecking,
0 0
}; };