Login  Register

Re: Why does JOGL use Instances of GLContext / GL* instead of exposing a Static API?

Posted by Sven Gothel on Mar 12, 2015; 1:00pm
URL: https://forum.jogamp.org/Why-does-JOGL-use-Instances-of-GLContext-GL-instead-of-exposing-a-Static-API-tp4034144p4034146.html

jmaasing wrote
This: "In JOGL, we do track certain states" is enough motivation to do it the JOGL-way.
I also forgot to mention, that tracking these states allows us not to query the
native OpenGL context via glGet*. The latter most certainly cause a pipeline flush/sync
and slow down rendering, see Bug 1066 <https://jogamp.org/bugzilla/show_bug.cgi?id=1066>.

Tracking itself is cheap, occurring on the Java side simply setting a variable
or using O(1) maps for more advanced stuff (memory objects).