Login  Register

Avoid flipping in AWTTextureIO

Posted by elect on Dec 17, 2014; 8:49am
URL: https://forum.jogamp.org/Avoid-flipping-in-AWTTextureIO-tp4033770.html

If I create a textureData through

TextureIO.newTextureData(GLProfile glp, URL url, boolean bln, String string)

everything fine

If I do through

AWTTextureIO.newTextureData(GLProfile glp, BufferedImage bi, boolean bln)

flips automatically the image

        mustFlipVertically = true;

second line in AWTTextureData.createFromImage


            test = new int[1];
            gl3.glGenTextures(1, test, 0);
            gl3.glBindTexture(GL3.GL_TEXTURE_2D, test[0]);
            {
                System.out.println("textureData.getMustFlipVertically() " + textureData.getMustFlipVertically());
                textureData.setMustFlipVertically(false);
                System.out.println("textureData.getMustFlipVertically() " + textureData.getMustFlipVertically());
                gl3.glTexImage2D(GL3.GL_TEXTURE_2D, 0, textureData.getInternalFormat(), textureData.getWidth(),
                        textureData.getHeight(), textureData.getBorder(), textureData.getPixelFormat(),
                        textureData.getPixelType(), textureData.getBuffer());
                gl3.glTexParameteri(GL3.GL_TEXTURE_2D, GL3.GL_TEXTURE_BASE_LEVEL, 0);
                gl3.glTexParameteri(GL3.GL_TEXTURE_2D, GL3.GL_TEXTURE_MAX_LEVEL, 0);
            }
            gl3.glBindTexture(GL3.GL_TEXTURE_2D, 0);


this print

true
false

but the texture is still rendered flipped