Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Problem with 32-bit PNG


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 18 April 2014 - 04:31 AM

Didn't want to repeat question so see here: http://stackoverflow.com/questions/23150123/loading-png-with-stb-image-for-opengl-texture-gives-wrong-colors

 

Feel free to post answer on here.



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 30969

Like
1Likes
Like

Posted 18 April 2014 - 05:06 AM

With the last parameter to stbi_load, you're telling it that you only want a 3-channel result, regardless of the source data. That parameter should be zero to say that you want however many are in the file.

At the moment, you're branching based on how many channels were in the file, but your pixel data is always being converted to 3-channel for all cases (leading to GL trying to interpret RGB as RGBA -- giving you pixels containing RGBR GBRG BRGB...)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS