Login  Register

Re: JOGL OpenGL ES error in NetBeans

Posted by elect on Oct 27, 2015; 11:17am
URL: https://forum.jogamp.org/JOGL-OpenGL-ES-error-in-NetBeans-tp4035582p4035610.html

Netix wrote
Now, when i am looking at log, maybe there something wrong with my finalize method in IGLTexture class. I am coding in JAVA after i have coded in c++ for years, so i am used to work with destruktors.
First, as Gouessej said, everything OpenGL related should be called from the methods belonging to the GLEventListener.

Second, since you come from C++ word, if you want to optimize your java program memory management, you need to change your approach from destructors to memory pools. Although java GC are, nowadays, quite advanced and efficient, you may want to reduce their interventions to the minimum.

If you know you are going to use a variable for each frame, avoid instantiating it every time, declare it somewhere and re-use.