diff options
author | Kenneth Russel <[email protected]> | 2004-04-14 00:08:15 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-04-14 00:08:15 +0000 |
commit | 4b533d294408e0d7ca1010e32d08a861ae0612f5 (patch) | |
tree | 585028cee3ac32e7080e38185fbf774cedd4e069 /src | |
parent | ef6a1983a48dd2c3f52987777862c3583ca24c57 (diff) |
Added test to not try to use WGL_ARB_multisample unless it's supported
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@109 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/games/jogl/impl/windows/WindowsGLContext.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java index 5f032f18e..2ff6769b9 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsGLContext.java +++ b/src/net/java/games/jogl/impl/windows/WindowsGLContext.java @@ -265,6 +265,7 @@ public abstract class WindowsGLContext extends GLContext { int recommendedPixelFormat = -1; pfd = new PIXELFORMATDESCRIPTOR(); boolean haveWGLChoosePixelFormatARB = false; + boolean haveWGLARBMultisample = false; if (dummyGL != null) { // It seems that at this point in initialization, // glGetString(GL.GL_EXTENSIONS) is returning null, so we @@ -272,6 +273,9 @@ public abstract class WindowsGLContext extends GLContext { String availableWGLExtensions = dummyGL.wglGetExtensionsStringARB(hdc); if (availableWGLExtensions.indexOf("WGL_ARB_pixel_format") >= 0) { haveWGLChoosePixelFormatARB = true; + if (availableWGLExtensions.indexOf("WGL_ARB_multisample") >= 0) { + haveWGLARBMultisample = true; + } } } if (dummyGL != null && haveWGLChoosePixelFormatARB) { @@ -328,11 +332,13 @@ public abstract class WindowsGLContext extends GLContext { iattributes[niattribs++] = GL.WGL_ACCUM_ALPHA_BITS_ARB; iattributes[niattribs++] = capabilities.getAccumAlphaBits(); } - if (capabilities.getSampleBuffers()) { - iattributes[niattribs++] = GL.WGL_SAMPLE_BUFFERS_ARB; - iattributes[niattribs++] = GL.GL_TRUE; - iattributes[niattribs++] = GL.WGL_SAMPLES_ARB; - iattributes[niattribs++] = capabilities.getNumSamples(); + if (haveWGLARBMultisample) { + if (capabilities.getSampleBuffers()) { + iattributes[niattribs++] = GL.WGL_SAMPLE_BUFFERS_ARB; + iattributes[niattribs++] = GL.GL_TRUE; + iattributes[niattribs++] = GL.WGL_SAMPLES_ARB; + iattributes[niattribs++] = capabilities.getNumSamples(); + } } int[] pformats = new int[MAX_PFORMATS]; @@ -396,8 +402,10 @@ public abstract class WindowsGLContext extends GLContext { iattributes[niattribs++] = GL.WGL_ACCUM_GREEN_BITS_ARB; iattributes[niattribs++] = GL.WGL_ACCUM_BLUE_BITS_ARB; iattributes[niattribs++] = GL.WGL_ACCUM_ALPHA_BITS_ARB; - iattributes[niattribs++] = GL.WGL_SAMPLE_BUFFERS_ARB; - iattributes[niattribs++] = GL.WGL_SAMPLES_ARB; + if (haveWGLARBMultisample) { + iattributes[niattribs++] = GL.WGL_SAMPLE_BUFFERS_ARB; + iattributes[niattribs++] = GL.WGL_SAMPLES_ARB; + } availableCaps = new GLCapabilities[numFormats]; for (int i = 0; i < numFormats; i++) { |