Fix JOGL context debug logging flag

The flag needs to be set before context is made current and GL is
obtained.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-11-19 10:18:40 +01:00
parent d2d3235554
commit 0d5e3d942f

View File

@@ -243,6 +243,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
glDrawable.setRealized(true);
glContext = glDrawable.createContext(null);
if (log.isDebugEnabled())
{
// Debug config on context needs to be set before .makeCurrent call
glContext.enableGLDebugMessage(true);
}
int res = glContext.makeCurrent();
if (res == GLContext.CONTEXT_NOT_CURRENT)
{
@@ -259,7 +265,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
if (log.isDebugEnabled())
{
glContext.enableGLDebugMessage(true);
gl.glEnable(GL_DEBUG_OUTPUT);
}