Login  Register

Re: Want to share JOGL Port of TWL

Posted by gouessej on Aug 22, 2018; 1:29pm
URL: https://forum.jogamp.org/Want-to-share-JOGL-Port-of-TWL-tp4038346p4039135.html

By the way, the new screen capture is better :)

This kind of thing is a very bad idea:
https://github.com/maheshkurmi/jogl-twl-maven/blob/master/jogl-twl-maven/jogl-twl/src/main/java/de/matthiasmann/twl/GUI.java#L175
https://github.com/maheshkurmi/jogl-twl-maven/blob/master/jogl-twl-maven/jogl-twl/src/main/java/de/matthiasmann/twleffects/jogl/JOGLEffectsRenderer.java#L49

You shouldn't store the GL instance into a static variable as you might use it when the OpenGL context isn't current (which doesn't work) and it could become invalid after you stored it (which would drive it unusable too).

Moreover, you assume that you get a GL2 context, maybe you could relax this constraint.

Finally, please allow to pass a GLWindow directly instead of forcing the use of NewtCanvasAWT:
https://github.com/maheshkurmi/jogl-twl-maven/blob/master/jogl-twl-maven/jogl-twl/src/main/java/de/matthiasmann/twl/input/jogl/JOGLInput.java#L30
In my humble opinion, this constructor shouldn't even exist, a developer could still pass NewtCanvas.getNEWTChild() to the constructor that I suggest you to add.
Julien Gouesse | Personal blog | Website