joelcnz
#1
I’m using a PNG file with transparency, but it’s not working after this code.
foreach(char i; 32 .. 126 + 1) {
SDL_Surface* surf = SDL_CreateRGBSurface(0, width, height - 1, 32, 0,0,0,0x00);
scope(exit)
SDL_FreeSurface(surf);
SDL_Rect rsrc = {1 + (i - 33) * step, 1, width, height - 1};
SDL_BlitSurface(source, &rsrc, surf, null);
tletters[i] = SDL_CreateTextureFromSurface(gRenderer, surf);
}
That code doesn’t do anything with PNG?
also, I don’t think you’re passing the right masks to SDL_CreateRGBSurface() (the last 4 arguments), see https://wiki.libsdl.org/SDL_CreateRGBSurface for how to use it (or use https://wiki.libsdl.org/SDL_CreateRGBSurfaceWithFormat to specify a format directly instead of indirectly via masks)
joelcnz
#3
Yay! Thanks Daniel_Gibson - I got it working.