Jump to content
  • Advertisement
Sign in to follow this  
moonshine

OpenGL PNG loading

This topic is 4971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've downloaded the libPNG binary (DLL) and Ive no idea where to start....Im not using C++, but I want to write a simple wrapper function that opens a PNG, one to close it..... Trouble is, theres very little/no helpful documentation to help I don't want to use a library like DevIL because its too big for my needs and i only wish to use the PNG facilities. Can anybody help? Also, how do I prepare the image for use with OpenGL? Cheers :)

Share this post


Link to post
Share on other sites
Advertisement
To keep final distribution size small, because it has alpha, it has appropriate compression....

Bitmaps are too big, and JPEGs are lossy and have no alpha. TGA is also out of the question.

I'm just unsure on the procedure for loading a PNG file using the libPNG DLL from here (libpng-1.2.8.zip)

Is there a specific function in the DLL that will do the job, or is it slightly more complex?

Share this post


Link to post
Share on other sites
I already said in my first post I didnt want to use it......I may reconsider, depends really. There were some major security flaws addressed in December last year with the PNG format, but the last DevIL was released last summer wasnt it? I dont want to use it if there are security issues. Also, I dont need the rest of the formats - as Im not using C++ I have to use the DLL which is around 800k.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ilankt
use OpenIL (or devIL)


Read the OP.

Anyway, I found the manual rather helpful. Using the data with OpenGL is trivial since you end up with an uncompressed pixmap in memory that can be passed to the GL as-is. I have a very old implementation of such a loader somewhere that I could send you if you need it. I don't know if it'll work with more recent revisions of the library though, and overall code quality sucks.

Share this post


Link to post
Share on other sites
Quote:
Original post by Shadowdancer
Quote:
Original post by Ilankt
use OpenIL (or devIL)


Read the OP.

Anyway, I found the manual rather helpful. Using the data with OpenGL is trivial since you end up with an uncompressed pixmap in memory that can be passed to the GL as-is. I have a very old implementation of such a loader somewhere that I could send you if you need it. I don't know if it'll work with more recent revisions of the library though, and overall code quality sucks.


Thanks! I think I started to read the manual but notepad can be a bit of an eyesore :)

It would be great if I could see your code, like I say I'm not using C++ so quality/compatibility wont matter - I'll just be learning from it and converting it over.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!