Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The JOGL renderer relies on a very bad practice by storing a GL instance that might become invalid at any time #205

Closed
ghost opened this issue Jan 24, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2014

Hi

The JOGL 2 renderer of the version 1.4 stores GL instances that might become invalid at any time which is a very bad practice:
https://github.com/void256/nifty-gui/blob/1.4/nifty-renderer-jogl2/src/main/java/de/lessvoid/nifty/renderer/jogl/render/JoglGL.java#L19
GL2 gl2 = GLContext.getCurrentGL().getGL2();

Please never do that. I had to remove this kind of thing from several engines as it causes tons of troubles. It only works when the GL instance is never invalidated. Please never store a GL instance except in a LOCAL variable like I do in all reliable APIs based on JOGL 2.

N.B: This kind of weak construct seems to appear in several places in NiftyGUI.

@ghost
Copy link
Author

ghost commented Jan 24, 2014

@ghost
Copy link
Author

ghost commented Jan 24, 2014

Fixed: #207
(untested)

@void256 void256 closed this as completed Feb 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant