I’m getting access violation from this example from the red book. please see error log and the attach c and java example files and tell me what’s wrong. Ka-El
I’m getting access violation from this example from the red book. please see error log and the attach c and java example files and tell me what’s wrong. Ka-El
oh, the access violation accurs when left and right mouse button are alternately pressed until the program crashes. my notebook has mobility radeon x600.
The problem is that you’re passing out direct Buffers to be rendered by OpenGL but losing the references to them so they are reclaimed by the garbage collector and the memory is freed out from under OpenGL. Plausibly JOGL should guard against this so I’ve filed Issue 208 to track it. This change to your test case avoids the crash:
*** varray.java.orig Mon Mar 6 22:15:12 2006
--- varray.java Mon Mar 6 22:11:06 2006
***************
*** 40,45 ****
--- 40,48 ----
private static int setupMethod = POINTER;
private static int derefMethod = DRAWARRAY;
+ private static IntBuffer tmpVerticesBuf;
+ private static FloatBuffer tmpColorsBuf;
+
//
public varray()
{
***************
*** 155,160 ****
--- 158,165 ----
//
gl.glVertexPointer(2, GL_INT, 0, verticesBuf);
gl.glColorPointer(3, GL_FLOAT, 0, colorsBuf);
+ tmpVerticesBuf = verticesBuf;
+ tmpColorsBuf = colorsBuf;
}
private void setupInterleave(GL gl)
THanks! that does the job.