Hi all!
I was trying a bit on creating a 4D-Viewer but soon got problems with lack of framerate. Since it was a raw version I decided to implement Arrays for the untextured Objects (About 150.000 vertices, completly in triangles) normals and vertices.
I collected all the necessary data in four Arrays, the normalValues and vertexValues-Arrays of type float[] and the normalIndices and vertexIndices-Arrays of type int[]. Now I tried binding the float-arrays using something like this:
gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
FloatBuffer normalBuffer = BufferUtils.newFloatBuffer(normalArray.length);
normalBuffer.put(normalArray);
FloatBuffer vertexBuffer = BufferUtils.newFloatBuffer(vertexArray.length);
vertexBuffer.put(vertexArray);
gl.glNormalPointer(3, GL.GL_FLOAT, normalBuffer);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertexBuffer);
When I run this I get an
net.java.games.jogl.GLException: Error freeing OpenGL context
I’m not quite sure about this so I was wondering if there is a good demonstrational solution out there I could use for a better understanding what needs to done on java where one cannot simply use some pointer-arithmetics for buffer-playing…
Any suggestions welcome!
Greetz…
…Hoschi