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/newt | |
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/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 2dcb6345e..bc0d67bfc 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -397,6 +397,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC } drawable.setRealized(true); context = drawable.createContext(sharedContext); + context.setContextCreationFlags(additionalCtxCreationFlags); } if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) { String msg = "GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", fin"; @@ -428,6 +429,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC // private GLContext sharedContext = null; + private int additionalCtxCreationFlags = 0; private GLDrawableFactory factory; private GLDrawable drawable; private GLContext context; @@ -455,6 +457,9 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC public void setContext(GLContext newCtx) { context = newCtx; + if(null != context) { + context.setContextCreationFlags(additionalCtxCreationFlags); + } } public GLContext getContext() { @@ -545,7 +550,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC } } } - + /** This implementation uses a static value */ public void setAutoSwapBufferMode(boolean onOrOff) { if(null!=helper) { @@ -560,13 +565,21 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC } return false; } - + public void swapBuffers() { if(drawable!=null && context != null) { drawable.swapBuffers(); } } + public void setContextCreationFlags(int flags) { + additionalCtxCreationFlags = flags; + } + + public int getContextCreationFlags() { + return additionalCtxCreationFlags; + } + private class InitAction implements Runnable { public final void run() { // Lock: Locked Surface/Window by MakeCurrent/Release |