PNG loading

Started by
6 comments, last by Ilankt 19 years, 1 month ago
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 :)
Advertisement
Is there a reason why you have to use a .png instead of an bmp or jpeg?
Levi
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?
use OpenIL (or devIL)
How appropriate, you fight like a cow!
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.
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.
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.
Oops, my bad :\ sorry :)
How appropriate, you fight like a cow!

This topic is closed to new replies.

Advertisement