hedgewars/SDLh.pas
changeset 2152 a2811690da1b
parent 2017 7845c77c8d31
child 2171 8208946331ba
equal deleted inserted replaced
2151:541d3a475442 2152:a2811690da1b
    35 
    35 
    36 {$PACKRECORDS C}
    36 {$PACKRECORDS C}
    37 
    37 
    38 {$IFDEF DARWIN}
    38 {$IFDEF DARWIN}
    39 	  {$PASCALMAINNAME SDL_main}
    39 	  {$PASCALMAINNAME SDL_main}
    40 {$IFNDEF IPHONE}
    40 {$IFNDEF IPHONEOS}
    41 	  {$linkframework Cocoa}
    41 	  {$linkframework Cocoa}
    42 	  {$linkframework SDL}
    42 	  {$linkframework SDL}
    43 	  {$linkframework SDL_mixer}
    43 	  {$linkframework SDL_mixer}
    44 	  {$linkframework SDL_net}
    44 	  {$linkframework SDL_net}
    45 	  {$linkframework SDL_image}
    45 	  {$linkframework SDL_image}
    55 const {$IFDEF WIN32}
    55 const {$IFDEF WIN32}
    56       SDLLibName = 'SDL.dll';
    56       SDLLibName = 'SDL.dll';
    57       {$ENDIF}
    57       {$ENDIF}
    58       {$IFDEF UNIX}
    58       {$IFDEF UNIX}
    59 	{$IFDEF DARWIN}
    59 	{$IFDEF DARWIN}
    60 	  SDLLibName = 'libSDL.a';
    60 	  SDLLibName = 'SDL';
    61 	{$ELSE}
    61 	{$ELSE}
    62           SDLLibName = 'libSDL.so';
    62           SDLLibName = 'libSDL.so';
    63         {$ENDIF}
    63         {$ENDIF}
    64       {$ENDIF}
    64       {$ENDIF}
    65       SDL_SWSURFACE   = $00000000;
    65       SDL_SWSURFACE   = $00000000;
   262 function  SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName;
   262 function  SDL_DisplayFormatAlpha(Surface: PSDL_Surface): PSDL_Surface; cdecl; external SDLLibName;
   263 
   263 
   264 function  SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName;
   264 function  SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName;
   265 function  SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName;
   265 function  SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName;
   266 
   266 
       
   267 {$IFDEF SDL13}
       
   268 function  SDL_GetKeyboardState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
       
   269 {$ELSE}
   267 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   270 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
       
   271 {$ENDIF}
   268 function  SDL_GetMouseState(x, y: PInteger): Byte; cdecl; external SDLLibName;
   272 function  SDL_GetMouseState(x, y: PInteger): Byte; cdecl; external SDLLibName;
   269 function  SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName;
   273 function  SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName;
   270 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName;
   274 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName;
   271 
   275 
   272 function  SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName;
   276 function  SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName;
   288 const {$IFDEF WIN32}
   292 const {$IFDEF WIN32}
   289       SDL_TTFLibName = 'SDL_ttf.dll';
   293       SDL_TTFLibName = 'SDL_ttf.dll';
   290       {$ENDIF}
   294       {$ENDIF}
   291       {$IFDEF UNIX}
   295       {$IFDEF UNIX}
   292 	{$IFDEF DARWIN}
   296 	{$IFDEF DARWIN}
   293 	  SDL_TTFLibName = 'libSDL_ttf.a';
   297 	  SDL_TTFLibName = 'SDL_ttf';
   294 	{$ELSE}
   298 	{$ELSE}
   295           SDL_TTFLibName = 'libSDL_ttf.so';
   299           SDL_TTFLibName = 'libSDL_ttf.so';
   296         {$ENDIF}
   300         {$ENDIF}
   297       {$ENDIF}
   301       {$ENDIF}
   298       TTF_STYLE_NORMAL = 0;
   302       TTF_STYLE_NORMAL = 0;
   322 const {$IFDEF WIN32}
   326 const {$IFDEF WIN32}
   323       SDL_MixerLibName = 'SDL_mixer.dll';
   327       SDL_MixerLibName = 'SDL_mixer.dll';
   324       {$ENDIF}
   328       {$ENDIF}
   325       {$IFDEF UNIX}
   329       {$IFDEF UNIX}
   326 	{$IFDEF DARWIN}
   330 	{$IFDEF DARWIN}
   327 	  SDL_MixerLibName = 'libSDL_mixer.a';
   331 	  SDL_MixerLibName = 'SDL_mixer';
   328 	{$ELSE}
   332 	{$ELSE}
   329           SDL_MixerLibName = 'libSDL_mixer.so';
   333           SDL_MixerLibName = 'libSDL_mixer.so';
   330 	{$ENDIF}
   334 	{$ENDIF}
   331       {$ENDIF}
   335       {$ENDIF}
   332 
   336 
   387 const {$IFDEF WIN32}
   391 const {$IFDEF WIN32}
   388       SDL_ImageLibName = 'SDL_image.dll';
   392       SDL_ImageLibName = 'SDL_image.dll';
   389       {$ENDIF}
   393       {$ENDIF}
   390       {$IFDEF UNIX}
   394       {$IFDEF UNIX}
   391 	{$IFDEF DARWIN}
   395 	{$IFDEF DARWIN}
   392 	  SDL_ImageLibName = 'libSDL_image.a';
   396 	  SDL_ImageLibName = 'SDL_image';
   393 	{$ELSE}
   397 	{$ELSE}
   394            SDL_ImageLibName = 'libSDL_image.so';
   398            SDL_ImageLibName = 'libSDL_image.so';
   395 	{$ENDIF}
   399 	{$ENDIF}
   396       {$ENDIF}
   400       {$ENDIF}
   397 
   401 
   402 const {$IFDEF WIN32}
   406 const {$IFDEF WIN32}
   403       SDL_NetLibName = 'SDL_net.dll';
   407       SDL_NetLibName = 'SDL_net.dll';
   404       {$ENDIF}
   408       {$ENDIF}
   405       {$IFDEF UNIX}
   409       {$IFDEF UNIX}
   406 	{$IFDEF DARWIN}
   410 	{$IFDEF DARWIN}
   407 	  SDL_NetLibName = 'libSDL_net.a';
   411 	  SDL_NetLibName = 'SDL_net';
   408 	{$ELSE}
   412 	{$ELSE}
   409           SDL_NetLibName = 'libSDL_net.so';
   413           SDL_NetLibName = 'libSDL_net.so';
   410 	{$ENDIF}
   414 	{$ENDIF}
   411       {$ENDIF}
   415       {$ENDIF}
   412 
   416