From 6c0ad949be979d5fed95a1166d59100f7bf5580f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 24 Apr 2011 12:21:36 +0200 Subject: 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. --- .../classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/windows') diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java index 91a907a09..55e2e478c 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java @@ -273,14 +273,11 @@ public class WindowsWGLContext extends GLContextImpl { } } - int minor[] = new int[1]; - int major[] = new int[1]; - int ctp[] = new int[1]; boolean createContextARBTried = false; // utilize the shared context's GLXExt in case it was using the ARB method and it already exists if( null!=sharedContext && sharedContext.isCreatedWithARBMethod() ) { - contextHandle = createContextARB(share, true, major, minor, ctp); + contextHandle = createContextARB(share, true); createContextARBTried = true; if (DEBUG && 0!=contextHandle) { System.err.println(getThreadName() + ": createImpl: OK (ARB, using sharedContext) share "+share); @@ -306,7 +303,7 @@ public class WindowsWGLContext extends GLContextImpl { if(isCreateContextAttribsARBAvailable && isExtensionAvailable("WGL_ARB_create_context") ) { // initial ARB context creation - contextHandle = createContextARB(share, true, major, minor, ctp); + contextHandle = createContextARB(share, true); createContextARBTried=true; if (DEBUG) { if(0!=contextHandle) { @@ -334,10 +331,10 @@ public class WindowsWGLContext extends GLContextImpl { if(glCaps.getGLProfile().isGL3()) { WGL.wglMakeCurrent(0, 0); WGL.wglDeleteContext(temp_ctx); - throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", "); + throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion()+", "); } if(DEBUG) { - System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation")); + System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion()); } // continue with temp context for GL < 3.0 -- cgit v1.2.3