I have been trying to limit how often I post questions, but this one is just stumping me.
It only occurs after 24 bytes have been added (6 floats), and only to one of the three buffers.
I have a ByteBuffer where I send data to OpenGL with. No matter how I create the buffer, the JVM always crashes.
Portion of log:
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j sun.misc.Unsafe.putInt(JI)V+0
j java.nio.DirectByteBuffer.putFloat(JF)Ljava/nio/ByteBuffer;+33
j java.nio.DirectByteBuffer.putFloat(F)Ljava/nio/ByteBuffer;+11
j com.digiturtle.library.opengl.GLRenderer.addTriangle(Lcom/digiturtle/library/opengl/Renderer$Vertex;Lcom/digiturtle/library/opengl/Renderer$Vertex;Lcom/digiturtle/library/opengl/Renderer$Vertex;Lcom/digiturtle/library/opengl/GLTexture;)V+82
j com.digiturtle.library.opengl.GLGlyph.render(Lcom/digiturtle/library/opengl/Renderer;Lcom/digiturtle/library/util/Color;Lcom/digiturtle/library/opengl/GLTexture;)V+303
j com.digiturtle.library.opengl.GLString.render(Lcom/digiturtle/library/opengl/Renderer;)V+115
Here is how I have tried to create the buffer.
// Method one
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
buffer.rewind();
return buffer;
// Method two
return ByteBuffer.allocate(size).order(ByteOrder.nativeOrder());
// Method three
return ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
// Method four
return org.lwjgl.BufferUtils.createByteBuffer(size);
It was working two days ago, and no updates have happened since then, so I can’t seem to find out what’s wrong. I have googled a lot and have tried to find a solution, with no luck.
Thanks,
CopyableCougar4