[SDL] [MACOSX] OpenGL framework mandatory for SDL programs ?

Patrice Mandin mandin.patrice at wanadoo.fr
Thu Jan 27 02:45:48 PST 2005

> On the other hand, I've been daydreaming about converting a .png file to 
> a .o file, maybe through a .c file that contained
>    unsigned char *my_image = {
>    0, 0, 0, 42, ...
> and then having my image embedded in my binary. The benefits and 
> drawbacks of embedded images aside, is this already possible somehow?

Sure you can. Load it using SDL_Image, get access to the pixel data, and
generate your .c file. To use it, link with the corresponding .o
defining my_image, and create a SDL_Surface from that. You may want to
save the pixel format as well as the raw data.

More information about the SDL mailing list