From 24d5fa1241e17f596ae93dff1656a9317daf6fb3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 30 Oct 2012 17:32:02 +0100 Subject: WGL/WGLExt Robustness: Use NIODirectOnly for all bindings. For these internal APIs, critical array is not required, hence redundant. --- .../windows/wgl/WindowsWGLGraphicsConfigurationFactory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java') diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 10d7fb22b..7b3bc3a01 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -50,12 +50,16 @@ import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; +import com.jogamp.common.nio.Buffers; + import jogamp.nativewindow.windows.GDI; import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR; import jogamp.opengl.GLDrawableImpl; import jogamp.opengl.GLGraphicsConfigurationFactory; import jogamp.opengl.GLGraphicsConfigurationUtil; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -349,8 +353,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat // No given PFD IDs // // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice - int[] iattributes = new int[2 * WindowsWGLGraphicsConfiguration.MAX_ATTRIBS]; - float[] fattributes = new float[1]; + final IntBuffer iattributes = Buffers.newDirectIntBuffer(2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS); + final FloatBuffer fattributes = Buffers.newDirectFloatBuffer(1); int accelerationMode = WGLExt.WGL_FULL_ACCELERATION_ARB; pformats = WindowsWGLGraphicsConfiguration.wglChoosePixelFormatARB(sharedResource, device, capsChosen, hdc, iattributes, accelerationMode, fattributes); -- cgit v1.2.3