aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-02-20 03:55:30 +0000
committerKenneth Russel <[email protected]>2007-02-20 03:55:30 +0000
commit90168b5adf53cf012595c1b04ceaa9e614da71d9 (patch)
tree4f10b8b6668bff92b2fde4b8ea8189e604794b26 /src/classes/com/sun/opengl
parent62dfabc90f2fee6b275562965b851160603a8b5e (diff)
Fixed Issue 271: wglGetPixelFormatAttribivARB() fails forcing software OpenGL
New code added for support of getChosenGLCapabilities() was causing errors described in bug report. Conditionalized querying of multisample properties based on availability of WGL_ARB_multisample extension. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1141 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl')
-rw-r--r--src/classes/com/sun/opengl/impl/windows/WindowsPbufferGLDrawable.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsPbufferGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/WindowsPbufferGLDrawable.java
index 4f87eaecf..9fb06c18b 100644
--- a/src/classes/com/sun/opengl/impl/windows/WindowsPbufferGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/WindowsPbufferGLDrawable.java
@@ -190,6 +190,8 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable {
throw new GLException("pbuffer creation error: Couldn't find a suitable pixel format");
}
+ boolean haveMultisample = wglExt.isExtensionAvailable("WGL_ARB_multisample");
+
if (DEBUG) {
System.err.println("" + nformats + " suitable pixel formats found");
// query pixel format
@@ -199,7 +201,7 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable {
iattributes[3] = WGLExt.WGL_ALPHA_BITS_ARB;
iattributes[4] = WGLExt.WGL_DEPTH_BITS_ARB;
iattributes[5] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB);
- iattributes[6] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
+ iattributes[6] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB);
iattributes[7] = WGLExt.WGL_SAMPLES_ARB;
iattributes[8] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
int[] ivalues = new int[9];
@@ -214,7 +216,9 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable {
System.err.print(" b: " + ivalues[2]);
System.err.print(" a: " + ivalues[3]);
System.err.print(" depth: " + ivalues[4]);
- System.err.print(" multisample: " + ivalues[6]);
+ if (haveMultisample) {
+ System.err.print(" multisample: " + ivalues[6]);
+ }
System.err.print(" samples: " + ivalues[7]);
if (useFloat) {
if (ati) {
@@ -306,8 +310,8 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable {
iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
iattributes[niattribs++] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB);
- iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
- iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
+ iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB);
iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
int[] ivalues = new int[niattribs];
// FIXME: usually prefer to throw exceptions, but failure here is not critical