Bug 826

Summary: GLJPanel not unbinding the texture
Product: [JogAmp] Jogl Reporter: Karel Petranek <karel.petranek>
Component: awtAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: minor    
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
c427ed22244df44b71a0f1f000b0f93e56c283c2 321cac1e125f806eb437e528b343d07379b31163
Workaround: ---

Description Karel Petranek 2013-09-05 17:16:51 CEST
The GLJPanel implementation does not seem to unbind a temporary texture it uses for reading back pixels from the GPU. The texture is bound at line 1266 in GLJPanel:
gl.glBindTexture(GL.GL_TEXTURE_2D, fboTex.getName());

If an application does not use texturing but still specifies texture coordinates (for example allowing an on/off switch for displaying textures), this can cause some hard-to-find rendering issues.

It would be nice to have GLJPanel clean up and possible restore the original texture state.
Comment 2 Sven Gothel 2014-06-13 04:24:41 CEST
Fix Bug 826 Regression caused by commit 41190c3830157abdf9649cbf7767e57108f55075 (Bug 975)
    
Commit 41190c3830157abdf9649cbf7767e57108f55075,
fix for 'Bug 975 GLJPanel's OffscreenDrawable double swap',
caused a regression of commit c427ed22244df44b71a0f1f000b0f93e56c283c2,
fix for 'Bug 826: GLJPanel: Fully restore TextureState and Viewport'.
    
Commit 41190c3830157abdf9649cbf7767e57108f55075 issues offscreenDrawable.swapBuffers()
and hence modifying the texture unit settings before saving the TextureState,
the whole purpose of commit c427ed22244df44b71a0f1f000b0f93e56c283c2.