diff options
author | Kenneth Russel <[email protected]> | 2008-06-26 03:49:17 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-06-26 03:49:17 +0000 |
commit | 2a07b5aad1d5dcf9c699e74c7e94d98f827fd4f9 (patch) | |
tree | a1e992a32b537000d81c5e744370d648aa8c1908 /src/classes/com/sun/opengl/impl | |
parent | 126dad53ff9cbc6581390952eadee8a5335cdcab (diff) |
Bug fixes to compile and run on Windows. Added more debugging code.
Not working yet due to mismatch between Newt's getWindowHandle(),
which returns an HWND, and the WGL code, which expects an HDC. Work
still ongoing.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1694 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl')
-rw-r--r-- | src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java | 1 | ||||
-rw-r--r-- | src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java index c6676d36d..150c86526 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -70,6 +70,7 @@ public class WindowsWGLContext extends GLContextImpl { public WindowsWGLContext(WindowsWGLDrawable drawable, GLContext shareWith) { super(shareWith); + this.drawable = drawable; } public Object getPlatformGLExtensions() { diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java index 1b1805e91..322ae3983 100644 --- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java @@ -66,6 +66,9 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { public int lockSurface() throws GLException { int ret = super.lockSurface(); if(NativeWindow.LOCK_SURFACE_NOT_READY == ret) { + if (DEBUG) { + System.err.println("WindowsWGLDrawable.lockSurface: surface not ready"); + } return ret; } if (!pixelFormatChosen) { @@ -73,6 +76,10 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { choosePixelFormat(true); setPixelFormatFailCount = 0; } catch (RuntimeException e) { + if (DEBUG) { + System.err.println("WindowsWGLDrawable.lockSurface: squelching exception"); + e.printStackTrace(); + } // Workaround for problems seen on Intel 82855 cards in particular // Make it look like the lockSurface() call didn't succeed unlockSurface(); @@ -265,10 +272,14 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { pfd = glCapabilities2PFD(capabilities, onscreen); // Remove one-basing of pixel format (added on later) recommendedPixelFormat = WGL.ChoosePixelFormat(hdc, pfd) - 1; + if (DEBUG) { + System.err.println(getThreadName() + ": Recommended pixel format = " + recommendedPixelFormat); + } numFormats = WGL.DescribePixelFormat(hdc, 1, 0, null); if (numFormats == 0) { - throw new GLException("Unable to enumerate pixel formats of window for GLCapabilitiesChooser"); + throw new GLException("Unable to enumerate pixel formats of window " + + toHexString(hdc) + " for GLCapabilitiesChooser"); } availableCaps = new GLCapabilities[numFormats]; for (int i = 0; i < numFormats; i++) { |