Steward
分享是一種喜悅、更是一種幸福
程式語言 - Free Pascal - Simple DirectMedia Layer (SDL) v1.2 - Load BMP
參考資訊:
https://www.freepascal.org/
https://wiki.lazarus.freepascal.org/FPC_and_SDL
https://sourceforge.net/projects/freepascal/files/
main.pp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | program app ; uses sdl ; var bmp : PSDL_Surface ; screen : PSDL_Surface ; begin SDL_Init ( SDL_INIT_VIDEO ); screen := SDL_SetVideoMode ( 320 , 240 , 16 , SDL_SWSURFACE ); bmp := SDL_LoadBMP ( 'main.bmp' ); SDL_BlitSurface (bmp, nil , screen, nil ); SDL_Flip (screen); SDL_FreeSurface (bmp); SDL_Delay ( 3000 ); SDL_Quit ; end . |
編譯、執行
$ fpc main.pp $ ./main