Bug 1241

Summary: Util's Texture.coords (image coordinates) not updated properly
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: utilAssignee: Sven Gothel <sgothel>
Severity: major CC: gouessej, paolo
Priority: P2    
Version: 2.3.2   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
Workaround: ---

Description Sven Gothel 2015-10-02 14:47:59 CEST
See Bug 1218 comment 10.

"The bug is on texture.getImageTexCoords(). It gives [h: 0.0 - 1.0, v: 0.0 - 1.0] also with GL_TEXTURE_RECTANGLE, for this the texture is not displayed correctly.
If you update tex coords by manually calling for example setMustFlipVertically() the returned coords are correct."

'Texture.updateTexCoords()' must be issued if the texture target is changed!

'Texture.setImageSize(final int width, final int height, final int target)'
argument 'target', i.e. texture target is ignored.

'Texture.updateImage(..)' also fails calling 'updateTexCoords()'
on changes texture target.
Comment 1 Sven Gothel 2015-10-03 01:14:55 CEST
commit 670df25aae92079945a83401db9722d543730193
Adding 'imageTarget', i.e. GL target for this texture or 
its sub-components if cubemap.

The imageTarget preserves the used 2D image type
for the 2D Texture coordinates.
Note: 'Texture.updateImage(final GL gl, final TextureData data, final int targetOverride)'
This method needs an overhaul targeted for 2.4.0,
especially the semantics of argument 'targetOverride' 
which currently is quite ambiguous (implementation).

Further this method ignores the current setting of texture target
and w/ 'targetOverride' its implementation seems quite adventurous. 
See Bug 1241