Sign in to follow this  

Load PNG feat SDL_image wont work

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

This topic is 3455 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this