SDL_Image No image shows in lazyfoo tutorials. need help

I have been following LazyFoo tutorials precisely but when he starts using the png image it does not show up at all, the screen is black. SDL_Image library seems to work since .gif image shows up fine since normal SDL can’t load .gif. I have tried so many things :frowning: the tutorials compile without a single error or warning but the pop up windows is black if I use .png or .jpeg images :frowning: :frowning: :frowning: .

I am using Code::Blocks on Windows XP SP3.

Thank you.

Do you have the right DLLs with your executable? It might just be failing
because it can’t load the DLL. Try printing IMG_GetError().

Jonny DOn Sat, Jan 1, 2011 at 1:58 PM, bingobeawr wrote:

I have been following LazyFoo tutorials precisely but when he starts
using the png image it does not show up at all, the screen is black. SDL_Image
library seems to work since .gif image shows up fine since normal SDL
can’t load .gif. I have tried so many things [image: Sad] the tutorials
compile without a single error or warning but the pop up windows is black
if I use .png or .jpeg images [image: Sad] [image: Sad] [image: Sad] .

I am using Code::Blocks on Windows XP SP3.

Thank you.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I do not think that it’s the DLL problem since I have put DLLs (SDL,SDL_image) to the path with .cpp file and project file and into every possible debug/release folder inside a project. Since I am not a very strong in SDL :frowning: would you please provide a source code with SDL GetError() function implemented. :smiley:

Thank you.

No problem:
http://code.bluedinosaurs.com/SDL/examples/SDL_image test.zip

<http://code.bluedinosaurs.com/SDL/examples/SDL_image test.zip>Jonny DOn Sun, Jan 2, 2011 at 3:06 AM, bingobeawr wrote:

I do not think that it’s the DLL problem since I have put DLLs
(SDL,SDL_image) to the path with .cpp file and project file and into every
possible debug/release folder inside a project. Since I am not a very strong
in SDL [image: Sad] would you please provide a source code with SDL
GetError() function implemented. [image: Very Happy]

Thank you.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ok so the BMP image loads fine then I get red background with bmp image still on and it shuts down with process returned 1. So when I wrote on the test images their formats with paint it seems that jpeg and png can’t load. I am not sure what to do since I can load jpeg fine on Windows. I put DLLs and Image files everywhere in project folder but it seems that is not the case

Thank you

Is stdout.txt created? That code prints the error messages that SDL and
SDL_image create (and of course I forgot SDL_Quit()). If you don’t get that
file, try running the program in console mode (a choice in Code::Blocks:
Project > Properties… > Build targets) or on the command line (Windows:
Start > Run… > cmd.exe) to see the messages. The DLLs (including
something like libpng13.dll and libjpeg.dll) should be in the same directory
as the executable.

Jonny DOn Sun, Jan 2, 2011 at 2:33 PM, bingobeawr wrote:

Ok so the BMP image loads fine then I get red background with bmp image
still on and it shuts down with process returned 1. So when I wrote on the
test images their formats with paint it seems that jpeg and png can’t load.
I am not sure what to do since I can load jpeg fine on Windows. I put DLLs
and Image files everywhere in project folder but it seems that is not the
case

Thank you


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think I have found a problem. The problem is that it can’t find .DLL such a libpng12-0.DLL. I did install libraries with .exe in GnuWin32 on Windows and tried copying whatever DLL for libraries were there but that does not seem to work. The thing is I don’t know where to get those DLLs since I have tried my best to even get the ones I have. I am not sure how to compile it from the sites that SDL_image refers me to and I can’t use them since I don’t know how to compile source things on Windows :frowning: .

Thank you.

Libpng is free software, and you can download the source from the PNG website,
libpng.org, though if they have prebulit Windows DLLs available to download
there they don’t seem to be in any easy-to-find location.

You can also find all the DLLs that my game engine requires, including SDL_Image
dependencies for PNG loading, at my Google Code repository.
http://code.google.com/p/turbu/source/browse/#svn%2Ftrunk%2Fdlls________________________________
From: jadauy2010@hotmail.com (bingobeawr)
To: sdl at lists.libsdl.org
Sent: Mon, January 3, 2011 4:11:57 PM
Subject: Re: [SDL] SDL_Image No image shows in lazyfoo tutorials. need help

I think I have found a problem. The problem is that it can’t find .DLL such a
libpng12-0.DLL. I did install libraries with .exe in GnuWin32 on Windows and
tried copying whatever DLL for libraries were there but that does not seem to
work. The thing is I don’t know where to get those DLLs since I have tried my
best to even get the ones I have. I am not sure how to compile it from the sites
that SDL_image refers me to and I can’t use them since I don’t know how to
compile source things on Windows .

Thank you.