hedgewars/SDLh.pas
branchqmlfrontend
changeset 12855 1b2b84315d27
parent 11699 83c40c1eb0e7
parent 12846 e5c461729fe3
equal deleted inserted replaced
11843:01f88c3b7b66 12855:1b2b84315d27
    25     {$DEFINE UNIX}
    25     {$DEFINE UNIX}
    26 {$ENDIF}
    26 {$ENDIF}
    27 {$IFDEF FREEBSD}
    27 {$IFDEF FREEBSD}
    28     {$DEFINE UNIX}
    28     {$DEFINE UNIX}
    29 {$ENDIF}
    29 {$ENDIF}
       
    30 {$IFDEF OPENBSD}
       
    31     {$DEFINE UNIX}
       
    32 {$ENDIF}
    30 {$IFDEF DARWIN}
    33 {$IFDEF DARWIN}
    31     {$DEFINE UNIX}
    34     {$DEFINE UNIX}
    32 {$ENDIF}
    35 {$ENDIF}
    33 {$IFDEF HAIKU}
    36 {$IFDEF HAIKU}
    34     {$DEFINE UNIX}
    37     {$DEFINE UNIX}
    72 
    75 
    73 /////////////////////////////////////////////////////////////////
    76 /////////////////////////////////////////////////////////////////
    74 /////////////////////  CONSTANT DEFINITIONS /////////////////////
    77 /////////////////////  CONSTANT DEFINITIONS /////////////////////
    75 /////////////////////////////////////////////////////////////////
    78 /////////////////////////////////////////////////////////////////
    76 
    79 
       
    80     SDL_FALSE = 0;
       
    81     SDL_TRUE = 1;
       
    82 
    77     // SDL_Init() flags
    83     // SDL_Init() flags
    78     SDL_INIT_TIMER          = $00000001;
    84     SDL_INIT_TIMER          = $00000001;
    79     SDL_INIT_AUDIO          = $00000010;
    85     SDL_INIT_AUDIO          = $00000010;
    80     SDL_INIT_VIDEO          = $00000020; // implies SDL_INIT_EVENTS (sdl2)
    86     SDL_INIT_VIDEO          = $00000020; // implies SDL_INIT_EVENTS (sdl2)
    81     SDL_INIT_JOYSTICK       = $00000200; // implies SDL_INIT_EVENTS (sdl2)
    87     SDL_INIT_JOYSTICK       = $00000200; // implies SDL_INIT_EVENTS (sdl2)
    92     AUDIO_S16LSB         = $8010; // Signed 16-bit samples, in little-endian byte order
    98     AUDIO_S16LSB         = $8010; // Signed 16-bit samples, in little-endian byte order
    93     AUDIO_S16MSB         = $9010; // Signed 16-bit samples, in big-endian byte order
    99     AUDIO_S16MSB         = $9010; // Signed 16-bit samples, in big-endian byte order
    94     AUDIO_S16SYS         = {$IFDEF ENDIAN_LITTLE}AUDIO_S16LSB{$ELSE}AUDIO_S16MSB{$ENDIF};
   100     AUDIO_S16SYS         = {$IFDEF ENDIAN_LITTLE}AUDIO_S16LSB{$ELSE}AUDIO_S16MSB{$ENDIF};
    95 
   101 
    96     // default audio format from SDL_mixer.h
   102     // default audio format from SDL_mixer.h
    97     MIX_DEFAULT_FORMAT   = AUDIO_S16SYS;
   103     //MIX_DEFAULT_FORMAT   = AUDIO_S16SYS;
       
   104     MIX_DEFAULT_FORMAT   = {$IFDEF ENDIAN_LITTLE}AUDIO_S16LSB{$ELSE}AUDIO_S16MSB{$ENDIF};
    98 
   105 
    99     SDL_BUTTON_LEFT      = 1;
   106     SDL_BUTTON_LEFT      = 1;
   100     SDL_BUTTON_MIDDLE    = 2;
   107     SDL_BUTTON_MIDDLE    = 2;
   101     SDL_BUTTON_RIGHT     = 3;
   108     SDL_BUTTON_RIGHT     = 3;
   102     SDL_BUTTON_X1        = 4;
   109     SDL_BUTTON_X1        = 4;
  1052 function  SDL_CreateRGBSurface(flags: LongWord; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName;
  1059 function  SDL_CreateRGBSurface(flags: LongWord; Width, Height, Depth: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName;
  1053 function  SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName;
  1060 function  SDL_CreateRGBSurfaceFrom(pixels: Pointer; width, height, depth, pitch: LongInt; RMask, GMask, BMask, AMask: LongWord): PSDL_Surface; cdecl; external SDLLibName;
  1054 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName;
  1061 procedure SDL_FreeSurface(Surface: PSDL_Surface); cdecl; external SDLLibName;
  1055 function  SDL_SetColorKey(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName;
  1062 function  SDL_SetColorKey(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName;
  1056 function  SDL_SetAlpha(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName;
  1063 function  SDL_SetAlpha(surface: PSDL_Surface; flag, key: LongWord): LongInt; cdecl; external SDLLibName;
  1057 function  SDL_ConvertSurface(src: PSDL_Surface; fmt: PSDL_PixelFormat; flags: LongInt): PSDL_Surface; cdecl; external SDLLibName;
  1064 function  SDL_ConvertSurface(src: PSDL_Surface; fmt: PSDL_PixelFormat; flags: LongWord): PSDL_Surface; cdecl; external SDLLibName;
  1058 
  1065 
  1059 function  SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName;
  1066 function  SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName;
  1060 function  SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: LongWord): LongInt; cdecl; external SDLLibName;
  1067 function  SDL_FillRect(dst: PSDL_Surface; dstrect: PSDL_Rect; color: LongWord): LongInt; cdecl; external SDLLibName;
  1061 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: LongWord); cdecl; external SDLLibName;
  1068 procedure SDL_UpdateRect(Screen: PSDL_Surface; x, y: LongInt; w, h: LongWord); cdecl; external SDLLibName;
  1062 function  SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName;
  1069 function  SDL_Flip(Screen: PSDL_Surface): LongInt; cdecl; external SDLLibName;
  1105 
  1112 
  1106 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName;
  1113 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName;
  1107 function  SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName;
  1114 function  SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName;
  1108 procedure SDL_StartTextInput; cdecl; external SDLLibName;
  1115 procedure SDL_StartTextInput; cdecl; external SDLLibName;
  1109 procedure SDL_StopTextInput; cdecl; external SDLLibName;
  1116 procedure SDL_StopTextInput; cdecl; external SDLLibName;
       
  1117 procedure SDL_FlushEvent(eventType: LongWord); cdecl; external SDLLibName;
  1110 
  1118 
  1111 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
  1119 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
  1112 
  1120 
  1113 function  SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; cdecl; external SDLLibName;
  1121 function  SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; cdecl; external SDLLibName;
  1114 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); cdecl; external SDLLibName;
  1122 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); cdecl; external SDLLibName;