Bug 386

Summary: TextRenderer incorrectly requires openGL context
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: awtAssignee: Sven Gothel <sgothel>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: P5    
Version: 1   
Hardware: pc_all   
OS: macosx   
Type: --- SCM Refs:
Workaround: ---

Description Sven Gothel 2010-03-24 08:04:17 CET


---- Reported by sgothel@jausoft.com 2010-03-22 12:46:54 -0400 ----




---- Reported by spiraljetty@kenai.com 2009-08-31 19:32:54 ----

Hi, this is similar to the the TextureData bug I think. If I innocently
                try to grab the fontRenderContext for some TextRenderer like so

                [code]
                frc = textRenderer.getFontRenderContext();
                [/code]

                then I get this exception:

                [code]
                javax.media.opengl.GLException: No OpenGL context current on this
                thread
                [/code]

                The actual issue occurs at line 617 of
                com.sun.opengl.util.awt.TextureRenderer.init(int w, int h), which is:

                [code]
                GL2 gl = GLContext.getCurrentGL().getGL2();
                [/code]

                Yet the GL2 variable "gl" is not actually used in the method anywhere!

                There seem to be a number of cases where the getCurrentGL() is called
                unnecessarily which is forcing everything to be processed in the
                display loop.

                -Angus

            (ps, sorry i posted this twice-- once as an email, and then realized there was an issue tracker)



--- Bug imported by sgothel@jausoft.com 2010-03-22 12:46 EDT  ---

This bug was previously known as _bug_ 998 at http://kenai.com/bugzilla/show_bug.cgi?id=998

The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: sgothel@jausoft.com.
   Previous reporter was spiraljetty@kenai.com.





--- Bug imported by sgothel@jausoft.com 2010-03-24 08:04 EDT  ---

This bug was previously known as _bug_ 11 at http://jogamp.org/bugzilla/show_bug.cgi?id=11
Comment 1 Sven Gothel 2012-05-14 08:08:44 CEST
Even though the actual GL context is not being used,
it's GLProfile is being passed to  AWTTextureData to determine
the appropriate texture format.

The GLProfile could be passed as an argument and no current 
GLContext would be required, however this would force an API 
change which I refrain for this AWT text renderer implementation.