From e5692f615a8c40e7ca750261baf5e8ecdb0a34b8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 30 Oct 2012 17:20:17 +0100 Subject: CGL/CGLExt Robustness: Use NIODirectOnly for all bindings. For these internal APIs, critical array is not required, hence redundant. --- .../jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java') diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index ec3156f52..ae2082d67 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -41,6 +41,7 @@ package jogamp.opengl.macosx.cgl; import java.nio.Buffer; +import java.nio.FloatBuffer; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -69,6 +70,7 @@ import jogamp.opengl.GLDynamicLookupHelper; import jogamp.opengl.GLGraphicsConfigurationUtil; import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.nio.Buffers; import com.jogamp.common.util.ReflectionUtil; import com.jogamp.nativewindow.MutableGraphicsConfiguration; import com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice; @@ -430,10 +432,9 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { @Override protected boolean setGammaRamp(float[] ramp) { - return CGL.setGammaRamp(ramp.length, - ramp, 0, - ramp, 0, - ramp, 0); + final FloatBuffer rampNIO = Buffers.newDirectFloatBuffer(ramp); + + return CGL.setGammaRamp(ramp.length, rampNIO, rampNIO, rampNIO); } @Override -- cgit v1.2.3