hedgewars/checksdl.dpr
changeset 104 e647d0589bff
child 184 f97a7a3dc8f6
equal deleted inserted replaced
103:8c56db04ea52 104:e647d0589bff
       
     1 program checksdl;
       
     2 {$APPTYPE CONSOLE}
       
     3 uses
       
     4   SDLh;
       
     5 
       
     6 procedure fail;
       
     7 begin
       
     8 writeln('fail');
       
     9 halt
       
    10 end;
       
    11 
       
    12 var SDLPrimSurface: PSDL_Surface;
       
    13     Color: Longword;
       
    14 begin
       
    15 Write('Init SDL... ');
       
    16 if SDL_Init(SDL_INIT_VIDEO) < 0 then fail;
       
    17 WriteLn('ok');
       
    18 
       
    19 Write('Create primsurface... ');
       
    20 SDLPrimSurface:= SDL_SetVideoMode(640, 480, 16, 0);
       
    21 if (SDLPrimSurface = nil) then fail;
       
    22 WriteLn('ok');
       
    23 
       
    24 Write('Try map color... ');
       
    25 Color:= $FFFFFF;
       
    26 Color:= SDL_MapRGB(SDLPrimSurface^.format, (Color shr 16) and $FF, (Color shr 8) and $FF, Color and $FF);
       
    27 Writeln('ok');
       
    28 Writeln('Result = ', Color);
       
    29 
       
    30 SDL_Quit()
       
    31 end.