diff options
author | Sven Gothel <[email protected]> | 2011-04-24 12:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-04-24 12:21:36 +0200 |
commit | 6c0ad949be979d5fed95a1166d59100f7bf5580f (patch) | |
tree | d69242fabf1f066d43418612209597616fba6cdd /src/jogl/classes/jogamp/opengl/GLPbufferImpl.java | |
parent | ea819ff768d507c37a981c1ab0bdc0cad32c6a87 (diff) |
Add unified support for GL_ARB_debug_output and GL_AMD_debug_output.
If GL_ARB_debug_output is not available, but GL_AMD_debug_output exist, fallback to the latter,
offering generic aliased methods translating the delta (AMD category <-> ARB source/type).
Generic aliased methods reside in GLContext*
Enable/Disable via GLContext and GLAutoDrawable.
To enable the GLDebugOutput feature GLContext.enableGLDebugMessage(true)
or GLContext.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG)
shall be called _before_ context creation via GLContext.makeCurrent()!
In case GLAutoDrawable is being used,
GLAutoDrawable.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG)
shall be issued before context creation via GLContext.makeCurrent()!.
After context creation, the GLDebugOutput feature may be enabled or disabled
at any time using this method.
Verify both unit tests for usability.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLPbufferImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLPbufferImpl.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java index 671390fbb..1d52bedbb 100644 --- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java @@ -64,6 +64,7 @@ public class GLPbufferImpl implements GLPbuffer { private GLContextImpl context; private GLDrawableHelper drawableHelper = new GLDrawableHelper(); private int floatMode; + private int additionalCtxCreationFlags = 0; public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContext parentContext) { @@ -177,6 +178,9 @@ public class GLPbufferImpl implements GLPbuffer { public void setContext(GLContext ctx) { context=(GLContextImpl)ctx; + if(null != context) { + context.setContextCreationFlags(additionalCtxCreationFlags); + } } public GLContext getContext() { @@ -207,6 +211,17 @@ public class GLPbufferImpl implements GLPbuffer { invokeGL(swapBuffersAction); } + public void setContextCreationFlags(int flags) { + additionalCtxCreationFlags = flags; + if(null != context) { + context.setContextCreationFlags(additionalCtxCreationFlags); + } + } + + public int getContextCreationFlags() { + return additionalCtxCreationFlags; + } + public void bindTexture() { // Doesn't make much sense to try to do this on the event dispatch // thread given that it has to be called while the context is current |