hedgewars/SDLh.pas
branchwebgl
changeset 9127 e350500c4edb
parent 8833 c13ebed437cb
parent 9115 36561f3c5345
child 9236 ddd675825672
equal deleted inserted replaced
8860:bde641cf53c8 9127:e350500c4edb
     1 (*
     1 (*
     2  * Hedgewars, a free turn based strategy game
     2  * Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation; version 2 of the License
     7  * the Free Software Foundation; version 2 of the License
     8  *
     8  *
    33 {$IFDEF HAIKU}
    33 {$IFDEF HAIKU}
    34     {$DEFINE UNIX}
    34     {$DEFINE UNIX}
    35 {$ENDIF}
    35 {$ENDIF}
    36 
    36 
    37 {$IFDEF UNIX}
    37 {$IFDEF UNIX}
    38     {$IFNDEF DARWIN}
       
    39         {necessary for statically linking physfs (divdi3 undefined on 32 bit)}
       
    40         {$IFDEF CPU32}
       
    41             {$linklib stdc++}
       
    42         {$ENDIF}
       
    43     {$ENDIF}
       
    44     {$IFDEF HAIKU}
    38     {$IFDEF HAIKU}
    45         {$linklib root}
    39         {$linklib root}
    46     {$ELSE}
    40     {$ELSE}
    47         {$IFNDEF ANDROID}
    41         {$IFNDEF ANDROID}
    48             {$linklib pthread}
    42             {$linklib pthread}
   960 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName;
   954 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName;
   961 function  SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName;
   955 function  SDL_SetHint(name, value: PChar): Boolean; cdecl; external SDLLibName;
   962 procedure SDL_StartTextInput; cdecl; external SDLLibName;
   956 procedure SDL_StartTextInput; cdecl; external SDLLibName;
   963 
   957 
   964 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
   958 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; minType, maxType: LongWord): LongInt; cdecl; external SDLLibName;
   965 function  SDL_CreateThread(fn: Pointer; name: PChar; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
   959 {$ELSE}
   966 {$ELSE}
       
   967 function  SDL_CreateThread(fn: Pointer; data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
       
   968 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName;
   960 function  SDL_PeepEvents(event: PSDL_Event; numevents: LongInt; action: TSDL_eventaction; mask: LongWord): LongInt; cdecl; external SDLLibName;
   969 {$ENDIF}
   961 {$ENDIF}
       
   962 
   970 
   963 
   971 function  SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
   964 function  SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
   972 function  SDL_GetKeyName(key: LongWord): PChar; cdecl; external SDLLibName;
   965 function  SDL_GetKeyName(key: LongWord): PChar; cdecl; external SDLLibName;
   973 function  SDL_GetScancodeName(key: LongWord): PChar; cdecl; external SDLLibName;
   966 function  SDL_GetScancodeName(key: LongWord): PChar; cdecl; external SDLLibName;
   974 function  SDL_GetKeyFromScancode(key: LongWord): LongInt; cdecl; external SDLLibName;
   967 function  SDL_GetKeyFromScancode(key: LongWord): LongInt; cdecl; external SDLLibName;
   983 
   976 
   984 procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : Byte); cdecl; external SDLLibName;
   977 procedure SDL_WM_SetIcon(icon: PSDL_Surface; mask : Byte); cdecl; external SDLLibName;
   985 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName;
   978 procedure SDL_WM_SetCaption(title: PChar; icon: PChar); cdecl; external SDLLibName;
   986 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
   979 function  SDL_WM_ToggleFullScreen(surface: PSDL_Surface): LongInt; cdecl; external SDLLibName;
   987 
   980 
       
   981 
       
   982 // remember to mark the threaded functions as 'cdecl; export;'
       
   983 // (or have fun debugging nil arguments)
       
   984 function  SDL_CreateThread(fn: Pointer; {$IFDEF SDL13}name: PChar;{$ENDIF} data: Pointer): PSDL_Thread; cdecl; external SDLLibName;
   988 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
   985 procedure SDL_WaitThread(thread: PSDL_Thread; status: PLongInt); cdecl; external SDLLibName;
       
   986 procedure SDL_KillThread(thread: PSDL_Thread); cdecl; external SDLLibName;
       
   987 
   989 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
   988 function  SDL_CreateMutex: PSDL_mutex; cdecl; external SDLLibName;
   990 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
   989 procedure SDL_DestroyMutex(mutex: PSDL_mutex); cdecl; external SDLLibName;
   991 function  SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP';
   990 function  SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP';
   992 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV';
   991 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV';
   993 
   992