flipping textures with awtTextureIO?
Posted by imakerobots on Nov 23, 2023; 4:56pm
URL: https://forum.jogamp.org/flipping-textures-with-awtTextureIO-tp4043152.html
In jogamp 2.5.0 I have a method which creates or update a Texture.
private static Texture BufferedImageToTexture(Texture texture,BufferedImage image) {
GL glContext = GLContext.getCurrentGL();
GLProfile glProfile = glContext.getGLProfile();
if(glProfile==null) return texture;
TextureData textureData = AWTTextureIO.newTextureData(glProfile, image, true);
if(texture==null) {
texture = AWTTextureIO.newTexture(textureData);
} else {
texture.updateImage(glContext,textureData);
}
return texture;
}
The Texture appears in app flipped upside down. I have tried using
textureData.setMustFlipVertically(true);
after creating textureData. I have also tried
texture.setMustFlipVertically(true);
before returning. Neither one changes the flip results. Prior to this I was using `TextureIO.newTexture()` to load textures directly from disk. What am I missing?
Also congrats to the team that released 2.5.0. I bet that wasn't easy. I appreciate all your hard work!