JSR-231: new GLU() versus GLDrawable.getGLU()

If the validity of the GLU object is going to be limited to the context and thread of the GLDrawable, doesn’t GLDrawable.getGLU() capture this semantic better than “new GLU()”? The latter could be called from invalid contexts, which seems like a ready source of errors.

-Ed

The current GLU implementation in JOGL is context-independent. All of the drawing routines it performs work by grabbing the current context. so in theory the same GLU object can be used with multiple contexts as long as you’re careful about inter-thread synchronization. The GLU objects are not thread-safe but are context-independent. This is why they were broken out of the GLDrawable / GLAutoDrawable interfaces in JSR-231.