From 6a697463c73042b7cfd1af2a5729e79bc43a0406 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 20 Jan 2006 01:31:16 +0000 Subject: Fixed bug in WindowsGLDrawable.iattributes2GLCapabilities pointed out by user hifujava on javagaming.org forums git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@552 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/windows/WindowsGLDrawable.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/classes/com/sun/opengl') diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawable.java index 0f3112824..f4dc725b4 100644 --- a/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/windows/WindowsGLDrawable.java @@ -195,7 +195,7 @@ public abstract class WindowsGLDrawable extends GLDrawableImpl { if (!dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) { throw new GLException("Error getting pixel format attributes for pixel format " + (i + 1) + " of device context"); } - availableCaps[i] = iattributes2GLCapabilities(iattributes, iresults, true); + availableCaps[i] = iattributes2GLCapabilities(iattributes, niattribs, iresults, true); } gotAvailableCaps = true; } else { @@ -497,12 +497,12 @@ public abstract class WindowsGLDrawable extends GLDrawableImpl { } protected static GLCapabilities iattributes2GLCapabilities(int[] iattribs, + int niattribs, int[] iresults, boolean requireRenderToWindow) { GLCapabilities res = new GLCapabilities(); - int attr = 0; - int i = 0; - while ((attr = iattribs[i]) != 0) { + for (int i = 0; i < niattribs; i++) { + int attr = iattribs[i]; switch (attr) { case WGLExt.WGL_DRAW_TO_WINDOW_ARB: if (iresults[i] != GL.GL_TRUE) -- cgit v1.2.3