frillrun/src/engine/surface.c
2024-08-30 01:18:18 -04:00

32 lines
405 B
C

#include "surface.h"
void
surface_rgba_init(SDL_Surface** self, ivec2 size)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
*self = SDL_CreateRGBSurface
(
0,
size[0],
size[1],
32,
0xFF000000,
0x00FF0000,
0x0000FF00,
0x000000FF
);
#else
*self = SDL_CreateRGBSurface
(
0,
size[0],
size[1],
32,
0x000000FF,
0x0000FF00,
0x00FF0000,
0xFF000000
);
#endif
}