summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-06 04:02:14 +0200
committerSven Gothel <[email protected]>2011-10-06 04:02:14 +0200
commit4337e40ae41b21ad758c72cba0b3d05d4d6a07d8 (patch)
treed390efdb1a71d25e9b2298c012cba77a46df0446 /src/jogl/classes/com/jogamp/opengl/util
parentea3d830c4f6c71ea18ebca07418567a6adf2a872 (diff)
ShaderUtils: Use glShaderSource variant w/ NIO only args
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
index 9ccd38bf1..747dd5c49 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
@@ -39,6 +39,8 @@ import java.util.*;
import javax.media.opengl.*;
+import com.jogamp.common.nio.Buffers;
+
public class ShaderUtil {
static abstract class Impl {
public abstract String getShaderInfoLog(GL gl, int shaderObj);
@@ -237,11 +239,11 @@ public class ShaderUtil {
throw new GLException("No sources specified");
}
- int[] lengths = new int[count];
+ IntBuffer lengths = Buffers.newDirectIntBuffer(count);
for(int i=0; i<count; i++) {
- lengths[i] = source[i].length();
+ lengths.put(i, source[i].length());
}
- gl.glShaderSource(shader, count, source, lengths, 0);
+ gl.glShaderSource(shader, count, source, lengths);
}
public void shaderSource(GL _gl, IntBuffer shaders, java.lang.String[][] sources)