hedgewars/SDLh.pas
branchui-scaling
changeset 15663 d92eeb468dad
parent 15365 fcdb6e3a9d36
child 15900 128ace913837
equal deleted inserted replaced
15283:c4fd2813b127 15663:d92eeb468dad
    54     type PByte = ^Byte;
    54     type PByte = ^Byte;
    55     type PInteger = ^Integer;
    55     type PInteger = ^Integer;
    56     type PLongInt = ^LongInt;
    56     type PLongInt = ^LongInt;
    57 {$ENDIF}
    57 {$ENDIF}
    58 
    58 
    59 
       
    60 (*  SDL  *)
    59 (*  SDL  *)
    61 const
    60 const
    62 {$IFDEF WINDOWS}
    61 {$IFDEF WINDOWS}
    63     SDLLibName = 'SDL2.dll';
    62     SDLLibName = {$IFDEF VCPKG_DEBUG}'SDL2d.dll'{$ELSE}'SDL2.dll'{$ENDIF};
    64     SDL_TTFLibName = 'SDL2_ttf.dll';
    63     SDL_TTFLibName = 'SDL2_ttf.dll';
    65     SDL_MixerLibName = 'SDL2_mixer.dll';
    64     SDL_MixerLibName = 'SDL2_mixer.dll';
    66     SDL_ImageLibName = 'SDL2_image.dll';
    65     SDL_ImageLibName = 'SDL2_image.dll';
    67     SDL_NetLibName = 'SDL2_net.dll';
    66     SDL_NetLibName = 'SDL2_net.dll';
    68 {$ELSE}
    67 {$ELSE}
   217     AMask = $FF000000;
   216     AMask = $FF000000;
   218     RShift = 0;
   217     RShift = 0;
   219     GShift = 8;
   218     GShift = 8;
   220     BShift = 16;
   219     BShift = 16;
   221     AShift = 24;
   220     AShift = 24;
       
   221     AByteIndex = 3;
   222 {$ELSE}
   222 {$ELSE}
   223     RMask = $FF000000;
   223     RMask = $FF000000;
   224     GMask = $00FF0000;
   224     GMask = $00FF0000;
   225     BMask = $0000FF00;
   225     BMask = $0000FF00;
   226     AMask = $000000FF;
   226     AMask = $000000FF;
   227     RShift = 24;
   227     RShift = 24;
   228     GShift = 16;
   228     GShift = 16;
   229     BShift = 8;
   229     BShift = 8;
   230     AShift = 0;
   230     AShift = 0;
       
   231     AByteIndex = 0;
   231 {$ENDIF}
   232 {$ENDIF}
   232 
   233 
   233     KMOD_NONE   = $0000;
   234     KMOD_NONE   = $0000;
   234     KMOD_LSHIFT = $0001;
   235     KMOD_LSHIFT = $0001;
   235     KMOD_RSHIFT = $0002;
   236     KMOD_RSHIFT = $0002;
   475     SDL_SCANCODE_KP_C = 190;
   476     SDL_SCANCODE_KP_C = 190;
   476     SDL_SCANCODE_KP_D = 191;
   477     SDL_SCANCODE_KP_D = 191;
   477     SDL_SCANCODE_KP_E = 192;
   478     SDL_SCANCODE_KP_E = 192;
   478     SDL_SCANCODE_KP_F = 193;
   479     SDL_SCANCODE_KP_F = 193;
   479     SDL_SCANCODE_KP_XOR = 194;
   480     SDL_SCANCODE_KP_XOR = 194;
   480     SDL_SCANCODE_KP_POWER = 195;
       
   481     SDL_SCANCODE_KP_PERCENT = 196;
   481     SDL_SCANCODE_KP_PERCENT = 196;
   482     SDL_SCANCODE_KP_LESS = 197;
   482     SDL_SCANCODE_KP_LESS = 197;
   483     SDL_SCANCODE_KP_GREATER = 198;
   483     SDL_SCANCODE_KP_GREATER = 198;
   484     SDL_SCANCODE_KP_AMPERSAND = 199;
   484     SDL_SCANCODE_KP_AMPERSAND = 199;
   485     SDL_SCANCODE_KP_DBLAMPERSAND = 200;
   485     SDL_SCANCODE_KP_DBLAMPERSAND = 200;
   931     TLongWordArray = array[0..16383] of LongWord;
   931     TLongWordArray = array[0..16383] of LongWord;
   932     PLongWordArray = ^TLongWordArray;
   932     PLongWordArray = ^TLongWordArray;
   933 
   933 
   934     PSDL_Thread = Pointer;
   934     PSDL_Thread = Pointer;
   935     PSDL_mutex = Pointer;
   935     PSDL_mutex = Pointer;
       
   936     PSDL_sem = Pointer;
   936 
   937 
   937     TSDL_GLattr = (
   938     TSDL_GLattr = (
   938         SDL_GL_RED_SIZE,
   939         SDL_GL_RED_SIZE,
   939         SDL_GL_GREEN_SIZE,
   940         SDL_GL_GREEN_SIZE,
   940         SDL_GL_BLUE_SIZE,
   941         SDL_GL_BLUE_SIZE,
  1158 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; overload;
  1159 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; overload;
  1159 {$ELSE}
  1160 {$ELSE}
  1160 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
  1161 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
  1161 {$ENDIF}
  1162 {$ENDIF}
  1162 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
  1163 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
       
  1164 procedure SDL_DetachThread(thread: PSDL_Thread); cdecl; external SDLLibName;
  1163 procedure SDL_KillThread(thread: PSDL_Thread); cdecl; external SDLLibName;
  1165 procedure SDL_KillThread(thread: PSDL_Thread); cdecl; external SDLLibName;
  1164 
  1166 
  1165 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
  1167 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
  1166 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
  1168 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
  1167 function  SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName;
  1169 function  SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName;
  1168 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName;
  1170 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName;
       
  1171 
       
  1172 function  SDL_CreateSemaphore(initial_value: Longword): PSDL_sem; cdecl; external SDLLibName;
       
  1173 procedure SDL_DestroySemaphore(sem: PSDL_sem); cdecl; external SDLLibName;
       
  1174 function  SDL_SemWait(sem: PSDL_sem): LongInt; cdecl; external SDLLibName;
       
  1175 function  SDL_SemPost(sem: PSDL_sem): LongInt; cdecl; external SDLLibName;
  1169 
  1176 
  1170 function  SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName;
  1177 function  SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName;
  1171 procedure SDL_GL_SwapBuffers; cdecl; external SDLLibName;
  1178 procedure SDL_GL_SwapBuffers; cdecl; external SDLLibName;
  1172 
  1179 
  1173 procedure SDL_LockAudio; cdecl; external SDLLibName;
  1180 procedure SDL_LockAudio; cdecl; external SDLLibName;
  1252 
  1259 
  1253 function  IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1260 function  IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1254 function  IMG_Load_RW(rwop: PSDL_RWops; freesrc: LongBool): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1261 function  IMG_Load_RW(rwop: PSDL_RWops; freesrc: LongBool): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1255 function  IMG_LoadPNG_RW(rwop: PSDL_RWops): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1262 function  IMG_LoadPNG_RW(rwop: PSDL_RWops): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1256 function  IMG_LoadTyped_RW(rwop: PSDL_RWops; freesrc: LongBool; type_: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
  1263 function  IMG_LoadTyped_RW(rwop: PSDL_RWops; freesrc: LongBool; type_: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
       
  1264 function IMG_SavePNG(surface: PSDL_Surface; const _file: PChar): LongInt; cdecl; external SDL_ImageLibName;
  1257 
  1265 
  1258 (*  SDL_net  *)
  1266 (*  SDL_net  *)
  1259 function  SDLNet_Init: LongInt; cdecl; external SDL_NetLibName;
  1267 function  SDLNet_Init: LongInt; cdecl; external SDL_NetLibName;
  1260 procedure SDLNet_Quit; cdecl; external SDL_NetLibName;
  1268 procedure SDLNet_Quit; cdecl; external SDL_NetLibName;
  1261 
  1269