Hi there, i need to draw some simple 2D objects ( lines ) on the top of the
3D drawed canvas. I tried several different solutions without success ( like using tranparency ecc ecc)
without success and i ended up using a style similar to the one showed at this page:
http://www.java-gaming.org/forums/index.php?topic=8241.0 where the autoswapping of the buffer
is disabled. Calling the swapping just before the 2D drawing allow to do it correctly.
I had an old version of JoGL in which swapBuffer was not complained but after i updated two situations happen:
If i use a GLCanvas to make the drawing i “occasionally” get an error similar to:
Xlib: unexpected async reply (sequence 0xb70)!
while if i use GLJPanel as soon as the function setAutoSwapBufferMode during the initialization is called:
canvas_GLJ = new GLJCanvas( caps );
canvas_GLJ.setBounds(150, 150, 255, 255 );
canvas_GLJ.setName(“PANEL_MESH”);
canvas_GLJ.addGLEventListener( this );
canvas_GLJ.setAutoSwapBufferMode( false );
i get the exceptions:
java.lang.NullPointerException
at javax.media.opengl.GLJPanel.setAutoSwapBufferMode(GLJPanel.java:739)
at gui.MyGLPanel.(MyGLPanel.java:58)
at gui.smf_view.initGUI(smf_view.java:433)
at gui.smf_view.(smf_view.java:55)
at gui.smf_view.main(smf_view.java:370)
I have to underline that i don’t need to have high framerates or smooth visualization
since when the 2D content is drawn nothing can move anymore.
Here it is a screenshot of what i am trying to get, obtained using GLCanvas ( in one of the working moments… )
http://img66.imageshack.us/my.php?image=error2gd.jpg
P.S.
an off topic… when i updated jogl with the most recent version, i got several compilation errors asking for a further argument
in most of OpenGL commands. For example:
gl.glVertex3fv( float[] posiiton, int index);
What is this second number??!?