sdl_image load tga fails on Windows

Started by
6 comments, last by FGFS 9 years, 9 months ago

Hi

I load tga on Linux/Mac with sdl_image ok. But not on Windows. Is there anything to do differently?

Thanks

Advertisement
What is the error message?

I do catch errors, but no nothing at all.

So IMG_Load returns null but IMG_GetError() doesn't give you an error message?
Can you show us the code that loads the image and how it "catches" errors?

That's what I do. The very same works fine on Linux/Mac but on Windows 64bit I only get white squares. Just ran the debugger through with no errors.

I've problems compiling sdl_image, so thanks if someone could compile that with tga support on win64.

SDL_Surface* image;
image = IMG_Load(pFileName);

if (image) {
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
XPLMGenerateTextureNumbers(&gTexture[TextureId], 1);
XPLMBindTexture2d(gTexture[TextureId], 0);
gluBuild2DMipmaps(GL_TEXTURE_2D, 4, image->w, image->h, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
Stat = TRUE;

} else {
XPLMDebugString("### LoadGLTex(): Error loading texture!\n");
XPLMDebugString(IMG_GetError());
Stat = FALSE;
}

So what you're saying is that you're not getting any output in this XPLMDebugString for IMG_GetError?

Yes nothing, so maybe something's different on win64.

Why do I get lots of errors alike:

Error 7 error LNK2001: unresolved external symbol _SDL_SetError H:\CPP-Win\SDL_image-1.2.12\VisualC\IMG_webp.obj SDL_image
...

when I try to compile sdl_image with vc? I've added the path to sdl and sdl_image libs. I have mostly used Eclipse on Linux so I might have overlooked something.

Thanks

This topic is closed to new replies.

Advertisement