summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXerxes Rånby <xerxes@zafena.se>2013-07-05 15:18:03 +0200
committerXerxes Rånby <xerxes@zafena.se>2013-07-05 15:18:03 +0200
commitd2d20162fe199b1b7c79d46530d0bb29780beeeb (patch)
treeda6fa5521e2d8714474c9d59a22ebdfc8f6a1e77
parentc2c87e29d324ade3853a91644cf00e6a6650c4f2 (diff)
glredbook1314/mvarray: glMultiDrawElements require direct NIO buffer
Signed-off-by: Xerxes Rånby <xerxes@zafena.se>
-rw-r--r--src/redbook/src/glredbook1314/mvarray.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/redbook/src/glredbook1314/mvarray.java b/src/redbook/src/glredbook1314/mvarray.java
index ffa1d58..e97d2aa 100644
--- a/src/redbook/src/glredbook1314/mvarray.java
+++ b/src/redbook/src/glredbook1314/mvarray.java
@@ -11,6 +11,7 @@ import java.nio.IntBuffer;
import javax.media.opengl.*;
import javax.swing.JFrame;
import com.jogamp.common.nio.PointerBuffer;
+import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.GLBuffers;
import javax.media.opengl.awt.GLJPanel;
import javax.media.opengl.glu.GLU;
@@ -49,6 +50,9 @@ public class mvarray //
private int count[] = { 7, 6 };
+ private IntBuffer countBuf = //
+ Buffers.newDirectIntBuffer(count);
+
// static GLvoid * indices[2] = {oneIndices, twoIndices};
private PointerBuffer indices = PointerBuffer.allocateDirect(2);
@@ -86,7 +90,7 @@ public class mvarray //
gl.glColor3f(1.0f, 1.0f, 1.0f);
if (mde_bug)
- gl.glMultiDrawElements(GL.GL_LINE_STRIP, count, 0,//
+ gl.glMultiDrawElements(GL.GL_LINE_STRIP, countBuf,//
GL.GL_UNSIGNED_BYTE, indices, 2);
else {
// workaround for glMultiDrawElem bug before July