Problems Drawing Images


danlorimer

Still Fresh
Joined
Mar 29, 2008
Messages
11
Age
40
Location
Manchester, UK
Website
www.danlorimer.com
I have switched to Code:Blocks and everything has been going great. However, when I use the IMG_Load function my program goes schitzo!!

For example: When I use a .png....
CODE

img_temp = IMG_Load("Data/test.png");
if(img_temp == NULL)
{
printf("LoadTexture : %s\n", SDL_GetError());
}


....my debug string says:
QUOTE

LoadTexture : Unsupported texture format



If I use a .bmp, it just doesn't draw anything.


I have used the installer from yauster, and borrowed code from GuyFawkes sdltest but is still fcuked.

Any ideas, folks?
 
Might try downloading the Open2X library package from here and extracting it somewhere. Copy all the libSDL*.a files out of it and into your current lib directory (making a backup of it first would be prudent). Since the versions might be different, you should also copy the corresponding *.h include files over too.

I guess it might be a bug in Yaustar's package.. that is mighty unusual that you can't load PNGs of all things. I can't think of why it would say unsupported texture unless the library was accidentally compiled without PNG support.
 
This may sound silly, but I have had a similar problem all because the filename had a capitalised extension (i.e. *.PNG instead of *.png)

I was calling the name correctly, but it just couldn't see it as a png until renaming the extension.
 
Have you statically linked all the libraries for the GP2X project? Don't forget that the GP2X is case sensitive on filenames as well.
 
I just copied and pasted the linker statements from the GuyFawkes sdltest that you included with your Code::Blocks installer. I take it that they support png's as the test has one.....(?)
 
Ok, I have given up on png's for now, bitmaps will have to do....
My windows exe is showing me the bmp images like I ask, but my gp2x app just shows me a lovely pink screen (I fill bg as pink so I know that it working).
I have linked all the librarys linked and am just plain confused now


P.S. Yaustar - yes, my pngs were pngs made in photoshop. Just plain non interlaced bg's with "This is a test" written on them.
 
Any problem with your SDL_SetVideoMode flags ? Do you use HWSurface or SWSurface ? Using a SDL_Flip() to refresh the display ?

I remember having trouble trying to use the HWSurface flag for the GP2X, the DOUBLEBUFFER flag didn't work either, so I use SWSurface and still SDL_flip to refresh ( even if DOUBLEBUFFER is not set, the SDL doc says you can use this function in Software rendering ).

GP2X linux is case sensitive ( like any linux ), be sure to have the good ressource name, try numbers to name the image.

I failed compiling the SDL_test too, I suppose that example needs the non official toolchain and a static compilation. I use the GPH DevC++/SDL package and can't make static versions of my apps that work on the GP2X, so I stick at dynamic compilation.
 
Back
Top