aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--make/stub_includes/win32/wingdi.h3
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java2
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java1
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java10
5 files changed, 15 insertions, 11 deletions
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
index e31cd8c5a..fd4bc16a2 100644
--- a/make/stub_includes/win32/wingdi.h
+++ b/make/stub_includes/win32/wingdi.h
@@ -105,8 +105,9 @@ typedef struct tagPIXELFORMATDESCRIPTOR {
#define PFD_DOUBLEBUFFER_DONTCARE 0x40000000
#define PFD_STEREO_DONTCARE 0x80000000
-/* OpenGL error codes (from winerror.h) */
+/* error codes (from winerror.h) */
/* FIXME: these should have a trailing "L" but apparently PCPP doesn't handle that syntax */
+#define ERROR_SUCCESS 0
#define ERROR_INVALID_PIXEL_FORMAT 2000
#define ERROR_NO_SYSTEM_RESOURCES 1450
#define ERROR_INVALID_DATA 13
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java
index bbbd93435..68bfa97e0 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java
@@ -80,7 +80,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
startTime = System.currentTimeMillis();
}
- if (!GDI.SwapBuffers(getHandle()) && (GDI.GetLastError() != 0)) {
+ if (!GDI.SwapBuffers(getHandle()) && (GDI.GetLastError() != GDI.ERROR_SUCCESS)) {
throw new GLException("Error swapping buffers");
}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
index 80261114f..0180b6c87 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -301,6 +301,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
long err = GDI.GetLastError();
String detail = null;
switch ((int) err) {
+ case GDI.ERROR_SUCCESS: detail = "ERROR_SUCCESS"; break;
case GDI.ERROR_INVALID_PIXEL_FORMAT: detail = "ERROR_INVALID_PIXEL_FORMAT"; break;
case GDI.ERROR_NO_SYSTEM_RESOURCES: detail = "ERROR_NO_SYSTEM_RESOURCES"; break;
case GDI.ERROR_INVALID_DATA: detail = "ERROR_INVALID_DATA"; break;
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 13df54d0e..900d35698 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -154,8 +154,8 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio
int[] out = new int[1];
in[0] = WGLExt.WGL_COLOR_BITS_ARB;
if (!sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0, 1, in, 0, out, 0)) {
- // Intel Extreme graphics 'fails' with a zero error code
- return GDI.GetLastError() == 0 ;
+ // Some GPU's falsely fails with a zero error code (success)
+ return GDI.GetLastError() == GDI.ERROR_SUCCESS ;
}
return true;
}
@@ -315,9 +315,9 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio
}
} else {
long lastErr = GDI.GetLastError();
- // Intel Extreme graphics fails with a zero error code
- if (lastErr != 0) {
- throw new GLException("wglARBAllPFIDs2GLCapabilities: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code " + GDI.GetLastError());
+ // Some GPU's falsely fails with a zero error code (success)
+ if (lastErr != GDI.ERROR_SUCCESS) {
+ throw new GLException("wglARBAllPFIDs2GLCapabilities: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code " + lastErr);
}
}
return availableCaps;
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 6228a80a9..c08ea6395 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -280,8 +280,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio
if (pixelFormatSet <= 0) {
if (!GDI.SetPixelFormat(hdc, pfdID, pfd)) {
- long lastError = GDI.GetLastError();
- throw new GLException("Unable to set pixel format " + pfdID + " for device context " + toHexString(hdc) + ": error code " + lastError);
+ throw new GLException("Unable to set pixel format " + pfdID +
+ " for device context " + toHexString(hdc) +
+ ": error code " + GDI.GetLastError());
}
}
@@ -405,8 +406,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio
if (pixelFormatSet <= 0) {
if (!GDI.SetPixelFormat(hdc, pfdID, pfd)) {
- long lastError = GDI.GetLastError();
- throw new GLException("Unable to set pixel format " + pfdID + " for device context " + toHexString(hdc) + ": error code " + lastError);
+ throw new GLException("Unable to set pixel format " + pfdID +
+ " for device context " + toHexString(hdc) +
+ ": error code " + GDI.GetLastError());
}
}