How do you load PNGs on a C++ program?
Hi friends!
How do you load PNGs on a C++ program? Now I'm using LodePNG and it seems a bit slow. And if I use PVR it loads ultrafast, but quality is very bad (2d platform game).
I'd like to hear your suggestions about loading PNG files in C++ case (not ObjC).
Thanks.
How do you load PNGs on a C++ program? Now I'm using LodePNG and it seems a bit slow. And if I use PVR it loads ultrafast, but quality is very bad (2d platform game).
I'd like to hear your suggestions about loading PNG files in C++ case (not ObjC).
Thanks.
Google for C++ image libraries ... there are quite a few.
Personally, I wrap everything in PVR files ( which can store uncompressed images as well).
Personally, I wrap everything in PVR files ( which can store uncompressed images as well).
I use libpng. (C API, but equally applicable to C++)
warmi Wrote:Google for C++ image libraries ... there are quite a few.
Personally, I wrap everything in PVR files ( which can store uncompressed images as well).
I already did that, but result in a 2d platform game is horrible.
See this pictures. 1st uses PVR. 2nd uses PNG.
![[Image: img0008gj.png]](http://img195.imageshack.us/img195/8774/img0008gj.png)
![[Image: img0043yr.png]](http://img32.imageshack.us/img32/6550/img0043yr.png)
I also tried SOIL but it does not compile for iphone, there are too much errors.
"PVR files ( which can store uncompressed images as well)."
Mmmm.. Warmi , what do you think if I store my pngs inside a pvr? is it at least faster to load?
Can I use
RGBA 4444
RGB 565 in my PVR loader?
riruilo Wrote:I already did that, but result in a 2d platform game is horrible.
See this pictures. 1st uses PVR. 2nd uses PNG.
I also tried SOIL but it does not compile for iphone, there are too much errors.
"PVR files ( which can store uncompressed images as well)."
Mmmm.. Warmi , what do you think if I store my pngs inside a pvr? is it at least faster to load?
Can I use
RGBA 4444
RGB 565 in my PVR loader?
That's what I am doing ... the only downside is that uncompressed images are stored within PVRs well ... uncompressed ,which means a png which weights at 40 kb, will take 80 kb or so when stored within an uncompressed PVR file.
I get around that by having all my game data reside in a virtual file system within a zip file and it only matters in terms of disk storage because once the image gets loaded into an OpenGL buffer it doesn't matter.
riruilo Wrote:I also tried SOIL but it does not compile for iphone, there are too much errors.I use SOIL's little brother STBI on the iPhone. Works great, but with either of these you need to configure them to exclude stuff that you don't need.
As far as slow-to-load goes, make sure you check load times on release builds. Debug builds can easily be 2X-3X slower for this sort of thing.
Frank C. Wrote:I use SOIL's little brother STBI on the iPhone. Works great, but with either of these you need to configure them to exclude stuff that you don't need.
Hey, cool, thanks I didn't know about that one!

i'd recommend openframeworks... super lightweight framework with a similar style to Processing..
http://www.openframeworks.cc/
loading PNGS, Gifs, JPGS, all super easy and one line of code..
http://www.openframeworks.cc/
loading PNGS, Gifs, JPGS, all super easy and one line of code..
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Unable to load textures | wademcgillis | 15 | 13,128 |
Apr 9, 2010 03:37 PM Last Post: Macmenace |
|
iPhone pre-multiplied alpha (on PNGs) woes.. | Jamie W | 12 | 15,036 |
Feb 22, 2010 02:44 PM Last Post: Frank C. |
|
How can I avoid XCODE transform my PNGs when moved to iPhone? | riruilo | 7 | 8,315 |
Apr 24, 2009 12:02 AM Last Post: smallstepforman |
|
PNGs scaled smaller | jeonghyunhan | 0 | 2,559 |
Feb 10, 2009 06:04 PM Last Post: jeonghyunhan |