From 710d86d31cd278583ee3d74b36595f4148a72133 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 5 Jun 2010 00:03:49 +0200 Subject: Minor additions to nio/Buffers, util/IntIntHashMap and os/NativeLibrary Buffers add 'float[] getFloatArray(double[])' conversion, ready to replace all JOGL InternalBufferUtil's. NativeLibrary/DynamicLinker add global lookup method allowing Unices and OSX to lookup a symbol globally. However, this is not recommended, due to the lookup costs. Windows is not supported here. Primitive type HashMap's (IntIntHashMap): Added putAll() --- src/java/com/jogamp/common/nio/Buffers.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/java/com/jogamp/common/nio/Buffers.java') diff --git a/src/java/com/jogamp/common/nio/Buffers.java b/src/java/com/jogamp/common/nio/Buffers.java index e3bea17..0c16b4d 100755 --- a/src/java/com/jogamp/common/nio/Buffers.java +++ b/src/java/com/jogamp/common/nio/Buffers.java @@ -505,6 +505,14 @@ public class Buffers { //---------------------------------------------------------------------- // Conversion routines // + + public static float[] getFloatArray(double[] source) { + int i=source.length; + float[] dest = new float[i--]; + while(i>=0) { dest[i]=(float)source[i]; i--; } + return dest; + } + public final static FloatBuffer getFloatBuffer(DoubleBuffer source) { source.rewind(); FloatBuffer dest = newDirectFloatBuffer(source.limit()); -- cgit v1.2.3