程式語言 - Free Pascal - Simple DirectMedia Layer (SDL) v1.2 - Hello, world!



參考資訊:
https://www.freepascal.org/
https://wiki.lazarus.freepascal.org/FPC_and_SDL
https://sourceforge.net/projects/freepascal/files/

main.pp

program app;

uses sdl, sdl_gfx;

var 
    screen : PSDL_Surface;

begin
    SDL_Init(SDL_INIT_VIDEO);
    screen := SDL_SetVideoMode(320, 240, 16, SDL_SWSURFACE);
    stringRGBA(screen, 100, 100, 'Hello, world!', $ff, $ff, $ff, $ff);
    SDL_Flip(screen);
    SDL_Delay(3000);
    SDL_Quit;
end.

編譯、執行

$ fpc main.pp
$ ./main