From 372767d3faa62d6e95dd8e9ad5c3105bf9614f3d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Oct 2009 07:59:08 -0700 Subject: Add OpenGL 3.x compatibility profile GL3bc, where 'bc' is not a religious remark, but simply means 'backward compatible' :) GL3bc := GL2 + GL3, hence the interface does not define any new values or methods. Moved GL3's 3.1 part from gl3.h to gl3ext.h, so it can be included in gl3bc.c, besides gl2.h. --- .../sun/opengl/impl/windows/wgl/WindowsWGLContext.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com/sun/opengl/impl/windows/wgl') diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java index 418336e3f..497e9f03b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -202,8 +202,18 @@ public class WindowsWGLContext extends GLContextImpl { // if no 3.2 is available creation fails already! attribs[0+1] = 3; attribs[2+1] = 2; - attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; - attribs[6+1] = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + if(glCaps.getGLProfile().isGL3bc()) { + attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; + attribs[6+1] = WGLExt.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + } + /** + * don't stricten requirements any further, even compatible would be fine + * + } else { + attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; + attribs[6+1] = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + } + */ hglrc = wglExt.wglCreateContextAttribsARB(drawable.getNativeWindow().getSurfaceHandle(), hglrc2, attribs, 0); if(0==hglrc) { if(DEBUG) { @@ -212,7 +222,9 @@ public class WindowsWGLContext extends GLContextImpl { // Try >= 3.1 forward compatible - last resort for GL3 ! attribs[0+1] = 3; attribs[2+1] = 1; - attribs[4+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + if(!glCaps.getGLProfile().isGL3bc()) { + attribs[4+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } attribs[6+0] = 0; attribs[6+1] = 0; } else if(DEBUG) { -- cgit v1.2.3