I am a freshment !
int vertex[]={
25,25,
100,325,
175,25,
175,325,
250,25,
325,325,
};
IntBuffer ib=IntBuffer.allocate(vertex.length);
ib=ib.put(vertex);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl.glVertexPointer(2, GL.GL_INT, 0, ib);
gl.glBegin…
…
But I got an exception:
Exception in thread “AWT-EventQueue-0” net.java.games.jogl.GLException: Argument “ptr” was not a direct buffer
at net.java.games.jogl.impl.windows.WindowsGLImpl.glColorPointer(WindowsGLImpl.java:2190)
at org.yourorghere.FirstCircleEventListener.drawGraph(FirstCircleEventListener.java:241)
at org.yourorghere.FirstCircleEventListener.display(FirstCircleEventListener.java:34)
at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.java:74)
at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:198)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:268)
at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:186)
at net.java.games.jogl.GLCanvas.display(GLCanvas.java:74)
…
What’s wrong ?
And What can I do ?