Re: Adding multiple GLEventListener to GLCanvas
Posted by
gouessej on
Apr 14, 2015; 9:30am
URL: https://forum.jogamp.org/Adding-multiple-GLEventListener-to-GLCanvas-tp4034265p4034291.html
There is no need to create a thread, rather use an animator. GLEventListener instances can but shouldn't be used that way. Rather create a single GLEventListener, add it once for all into the canvas and this single GLEventListener should loop on all objects. These objects should have some drawing code.
You can use a scenegraph API instead of reinventing the wheel except if you want to use only JOGL.
Edit.: You shouldn't have to swap the buffers by yourself especially if you haven't called setAutoSwapBufferMode(false). The more you go away from the helpers of a framework, the more you become responsible for doing the things the "right" way.
Edit.2: You can look at
this very simple example.