Jump to content
  • Advertisement
Sign in to follow this  
EzkimOrava

Load PNG feat SDL_image wont work

This topic is 3638 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

I have latest SDL_Image and tryig to load PNG image, but nothing appears. i tried to close program if it's null and it was. Here is the loading; SDL_Sufrace *png; png = IMG_Load("data/gfx/tesmi.PNG"); PLEASE i need fast help !

Share this post


Link to post
Share on other sites
Advertisement
Have you tried to print the value of IMG_GetError() somewhere? If on windows, do you have libpng-<version>.dll in the same directory of the executable?

Share this post


Link to post
Share on other sites
It looks like you might be doing error checking in the wrong place.

Try this:

SDL_Sufrace *png = IMG_Load("data/gfx/tesmi.PNG");

if(!png)
{
// print IMG_GetError()
// handle error by quitting or whatever
}



Quote:

Isn't zlib enough, and where to download the dll ?


I just use the DLLs that come in the SDL_Image downloads here. They include libpng.dll, jpeg.dll, zlib.dll and libtiff.dll (in various versions). If you don't have the correct DLL for the format, AFAIK SDL_IMG will still initialise correctly but won't be able to load that format at runtime.

Share this post


Link to post
Share on other sites
Thanks but i already figured out to make "soft ball" without png.


Opacity(png, lapinakuvuus);
for(int i=alku;i<10;i++) {

PiirraOsaKuva(png, x, y, i*20, 0, 20, 20);

}


Just draw littler and littler balls to same point at 10 opacity =)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!