程式語言 - FreeBASIC - Simple DirectMedia Layer (SDL) v1.2 - Load BMP



參考資訊:
https://www.freebasic.net/
https://sourceforge.net/projects/fbc/files/
https://www.freebasic.net/wiki/ProPgPointers
https://www.freebasic.net/forum/viewtopic.php?t=23216
https://www.freebasic.net/forum/viewtopic.php?f=14&t=21725

main.bas

#include "SDL.bi"
 
dim bmp as SDL_Surface ptr
dim video as SDL_Surface ptr
  
SDL_Init(SDL_INIT_VIDEO)
video = SDL_SetVideoMode(320, 240, 16, SDL_SWSURFACE)
bmp = SDL_LoadBMP("main.bmp")
SDL_BlitSurface(bmp, null, video, null) 
SDL_Flip(video)
SDL_FreeSurface(bmp)
SDL_Delay(3000)
SDL_Quit

編譯、執行

$ fbc main.bas -i /opt/fbc/include/freebasic/SDL
$ ./main

完成