hedgewars/SDLh.pas
changeset 11533 3189bf281000
parent 11518 02a13be714d2
child 11544 b69f5f22a3ba
child 11686 24710123beae
equal deleted inserted replaced
11532:bf86c6cb9341 11533:3189bf281000
  1012                         numsockets,
  1012                         numsockets,
  1013                         maxsockets: LongInt;
  1013                         maxsockets: LongInt;
  1014                         sockets: PTCPSocket;
  1014                         sockets: PTCPSocket;
  1015                         end;
  1015                         end;
  1016 
  1016 
       
  1017 {$IFDEF WIN32}
       
  1018      TThreadFunction = function (p: pointer): Longword; stdcall;
       
  1019      pfnSDL_CurrentBeginThread = function (
       
  1020         _Security: pointer; 
       
  1021         _StackSize: LongWord;
       
  1022         _StartAddress: TThreadFunction;
       
  1023         _ArgList: pointer;
       
  1024         _InitFlag: Longword;
       
  1025         _ThrdAddr: PLongword): PtrUInt; cdecl;
       
  1026     pfnSDL_CurrentEndThread = procedure (_Retval: LongInt); cdecl;
       
  1027 {$ENDIF} 
  1017 
  1028 
  1018 /////////////////////////////////////////////////////////////////
  1029 /////////////////////////////////////////////////////////////////
  1019 /////////////////////  FUNCTION DEFINITIONS /////////////////////
  1030 /////////////////////  FUNCTION DEFINITIONS /////////////////////
  1020 /////////////////////////////////////////////////////////////////
  1031 /////////////////////////////////////////////////////////////////
  1021 
  1032 
  1123 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
  1134 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
  1124 
  1135 
  1125 
  1136 
  1126 (* remember to mark the threaded functions as 'cdecl; export;'
  1137 (* remember to mark the threaded functions as 'cdecl; export;'
  1127    (or have fun debugging nil arguments) *)
  1138    (or have fun debugging nil arguments) *)
       
  1139 {$IFDEF WIN32}
       
  1140 // SDL uses wrapper in windows
       
  1141 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer; bt: pfnSDL_CurrentBeginThread; et: pfnSDL_CurrentEndThread): PSDL_Thread; cdecl; external SDLLibName;
       
  1142 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; overload;
       
  1143 {$ELSE}
  1128 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
  1144 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
       
  1145 {$ENDIF}
  1129 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
  1146 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
  1130 procedure SDL_KillThread(thread: PSDL_Thread); cdecl; external SDLLibName;
  1147 procedure SDL_KillThread(thread: PSDL_Thread); cdecl; external SDLLibName;
  1131 
  1148 
  1132 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
  1149 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
  1133 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
  1150 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
  1293                   (PByteArray(buf)^[2] shl  8) or
  1310                   (PByteArray(buf)^[2] shl  8) or
  1294                   (PByteArray(buf)^[1] shl 16) or
  1311                   (PByteArray(buf)^[1] shl 16) or
  1295                   (PByteArray(buf)^[0] shl 24)
  1312                   (PByteArray(buf)^[0] shl 24)
  1296 end;
  1313 end;
  1297 
  1314 
       
  1315 {$IFDEF WIN32}
       
  1316 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl;
       
  1317 begin
       
  1318     SDL_CreateThread:= SDL_CreateThread(fn, name, data, nil, nil)
       
  1319 end;  
       
  1320 {$ENDIF}
  1298 
  1321 
  1299 end.
  1322 end.
  1300 
  1323