• Advertisement
Sign in to follow this  

sdl_image load tga fails on Windows

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

Hi

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

Thanks

 

Share this post


Link to post
Share on other sites
Advertisement
So IMG_Load returns null but IMG_GetError() doesn't give you an error message?

Share this post


Link to post
Share on other sites

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;
    }

Share this post


Link to post
Share on other sites

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

Edited by FGFS

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement