diff options
author | Sven Gothel <[email protected]> | 2011-02-11 08:09:53 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-11 08:09:53 +0100 |
commit | bf75331124d6d0c53b74d5235ec03f5fcbc55cba (patch) | |
tree | 36c9ad23c37826d3e4d6bc16832e271c48bd3682 /src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java | |
parent | ffe215ecf60da12605b29f3fa1d08eafebcb415a (diff) |
Win,GDI,SWT: Fix pfd to caps conversion. Added thorough debug code.
Debug code added for use case: WinXP-32bit, GDI, SWT,
where WGL.wglGetCurrentDC() returns a non null value which is invalid.
Using the value (hdc) on eg GDI.GetObjectType(hdc) return 0 instead of
3 (OBJ_DC) and GDI.GetPixelFormat(hdc) returns 0 with last error 2000.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java index 82d170133..a80f68377 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -83,7 +83,7 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio static WindowsWGLGraphicsConfiguration createFromCurrent(GLDrawableFactory _factory, long hdc, int pfdID, - GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen, boolean usePBuffer) + GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen) { if(_factory==null) { throw new GLException("Null factory"); @@ -105,12 +105,13 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio WGLGLCapabilities caps = null; if(hasARB) { - caps = wglARBPFID2GLCapabilities(sharedContext, hdc, pfdID, glp, onscreen, usePBuffer); - } else if(!usePBuffer) { + caps = wglARBPFID2GLCapabilities(sharedContext, hdc, pfdID, glp, onscreen, true /* pbuffer */); + } else { caps = PFD2GLCapabilities(glp, hdc, pfdID, onscreen); } if(null==caps) { - throw new GLException("Couldn't choose Capabilities by: HDC 0x"+Long.toHexString(hdc)+", pfdID "+pfdID+", hasARB "+hasARB); + throw new GLException("Couldn't choose Capabilities by: HDC 0x"+Long.toHexString(hdc)+ + ", pfdID "+pfdID+", onscreen "+onscreen+", hasARB "+hasARB); } return new WindowsWGLGraphicsConfiguration(screen, caps, caps); |