I’ve got myself a bit confused about GL contexts with JSR-231 and was hoping the good people here could help me:
The general tactic used in a lot of the utility code seems to be to the current GL from GLU.getCurrentGL () rather than passing it around. This is particularly the case in the JOGL utility code supporting Textures which I’m looking to move to.
However applications may end up using distinct GL contexts particularly if PBuffers are used. In this case textures loaded in one context are invalid when used in another context. In the past I have keyed texture IDs off GLDrawable/GLAutoDrawable.
What is the preferred pattern these days? Should I have a texture wrapper class that keys from GL (or GLAutoDrawable or GLContext…) to com.sun.opengl.util.Texture or extend Texture to handle keying ID to context internally? Or avoid having multiple contexts like the plague…?