參考資訊:
https://wiki.libsdl.org/FrontPage
main.c
#include <stdio.h> #include <stdlib.h> #include <SDL.h> int main(int argc, char **argv) { SDL_Surface *bmp = SDL_LoadBMP("main.bmp"); SDL_SaveBMP(bmp, "saved.bmp"); SDL_FreeSurface(bmp); SDL_Quit(); return 0; }
編譯
$ gcc main.c -o main -lSDL2 -I/usr/include/SDL2