openGL png images are upside down

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

openGL png images are upside down

Postby gcarlton » Thu Oct 20, 2005 02:53

Currently when using devil and opengl, I found that png images are upside down!

Looks like CEGUI is flipping loaded textures from devil, which must be done sometimes, rather than always. For example, tga looks like it needs the flip, but png apparently does not. The following fix, taken from here, seems to work:

http://sourceforge.net/forum/forum.php? ... m_id=13560

Old code in OpenGLTexture::loadFromFile:

Code: Select all

      // flip the image
      iluFlipImage();


New code in OpenGLTexture::loadFromFile:

Code: Select all

      // flip the image
      int origin = ilGetInteger(IL_IMAGE_ORIGIN);
      if (origin == IL_ORIGIN_LOWER_LEFT)
      {
         iluFlipImage();
      }    


I'm surprised this issue hasn't come up before.. Or is everybody else using a different (non-broken) version of devil? :roll:

Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests