diff options
author | Kenneth Russel <[email protected]> | 2006-03-28 16:11:15 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-03-28 16:11:15 +0000 |
commit | ce8c5cebdfe0570e22c116fbb8ebc83b9a4d3c12 (patch) | |
tree | 731ce85673edc568369b9d9d669ddb3d08b06fc0 /src/classes/com/sun/opengl | |
parent | 032535e2f06136f97e37c7a34fc5e67e0cc35056 (diff) |
Worked around spurious SetPixelFormat failures seen on Intel 82855
hardware with help from Matt Abraham by silently squelching a few
back-to-back failures of this call and indicating that the surface was
not ready yet.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@691 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl')
-rw-r--r-- | src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java index ee8393296..f30b2c4b8 100644 --- a/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java @@ -77,6 +77,10 @@ public class WindowsOnscreenGLDrawable extends WindowsGLDrawable { private int profilingSwapBuffersTicks; private long profilingSwapBuffersTime; + // Workaround for problems on Intel 82855 cards + private int setPixelFormatFailCount; + private static final int MAX_SET_PIXEL_FORMAT_FAIL_COUNT = 5; + public WindowsOnscreenGLDrawable(Component component, GLCapabilities capabilities, GLCapabilitiesChooser chooser) { @@ -196,10 +200,16 @@ public class WindowsOnscreenGLDrawable extends WindowsGLDrawable { if (!pixelFormatChosen) { try { choosePixelFormat(true); + setPixelFormatFailCount = 0; } catch (RuntimeException e) { + // Workaround for problems seen on Intel 82855 cards in particular // Make it look like the lockSurface() call didn't succeed unlockSurface(); - throw e; + if (++setPixelFormatFailCount == MAX_SET_PIXEL_FORMAT_FAIL_COUNT) { + setPixelFormatFailCount = 0; + throw e; + } + return LOCK_SURFACE_NOT_READY; } } if (PROFILING) { |