TGA loader: reverse y-axis

Posted by aVoX on Game Development See other posts from Game Development or by aVoX
Published on 2012-10-20T23:23:33Z Indexed on 2012/10/21 17:21 UTC
Read the original article Hit count: 220

Filed under:
|

I've written a TGA image loader in Java which is working perfectly for files created with GIMP as long as they are saved with the option origin set to Top Left (Note: Actually TGA files are meant to be stored upside down - Bottom Left in GIMP). My problem is that I want my image loader to be capable of reading all different kinds of TGA, so my question is: How do I flip the image upside down?

Note that I store all image data inside a one-dimensional byte array, because OpenGL (glTexImage2D to be specific) requires it that way.

Thanks in advance.

© Game Development or respective owner

Related posts about opengl

Related posts about textures