[JOGL2] flip texture vertically

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[JOGL2] flip texture vertically

Djak
Hi,
I was using this code to load and flip vertically a texture in 1.1.1 :

BufferedImage img = ImageIO.read(new File(filename));
ImageUtil.flipImageVertically(img);
texture = TextureIO.newTexture(img, false);

but TextureIO.newTexture(BufferdImage, boolean) doesn't exist anymore.
Anyone could help me to have same result than before ?
Is there any way to do that directly with JOGL2 or do I need to find another way ?
Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: [JOGL2] flip texture vertically

Demoscene Passivist
Administrator
It basically the same with JOGL2, u only need to change some classnames:

BufferedImage tBufferedImage = ImageIO.read(new File(filename));
ImageUtil.flipImageVertically(tBufferedImage);
Texture tTexture = AWTTextureIO.newTexture(GLProfile.getDefault(), tBufferedImage, true);
Reply | Threaded
Open this post in threaded view
|

Re: [JOGL2] flip texture vertically

Djak
Thank you very much, it works fine now :)
I didn't see this class.
bye