d-gamedev-team/gfm

Loading images using SDLImage

grogancolin opened this issue · 2 comments

I'm trying to load my sprite sheet using SDLImage.loadImage

Code is as follows:

auto sdl = new SDL2(logger);

auto sdlImage = new SDLImage(sdl);

SDL2Surface spritesheet = sdlImage.load("res/tiles.png");

I believe this should be the minimum amount required...
However, I get

gfm.sdl2.sdl.SDL2Exception@../../.dub/packages/gfm-3.0.8/sdl2/gfm/sdl2/sdlimage.d(79): IMG_Load failed: Unsupported image format

Am I doing something wrong?

Any debugging tips would be welcome!
Thanks.

Oh, I've definitely compiled my SDL2 library with PNG support, so I dont think that is the issue.

I reinstalled all my SDL libraries and it's fixed it!

p0nce commented

Yep, it's when you miss a shared library.