summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-03-28 16:11:15 +0000
committerKenneth Russel <[email protected]>2006-03-28 16:11:15 +0000
commitce8c5cebdfe0570e22c116fbb8ebc83b9a4d3c12 (patch)
tree731ce85673edc568369b9d9d669ddb3d08b06fc0 /src/classes/com/sun
parent032535e2f06136f97e37c7a34fc5e67e0cc35056 (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')
-rw-r--r--src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java12
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) {