hedgewars/SDLh.pas
changeset 2630 079ef82eac75
parent 2619 bc2786a00fb8
child 2633 9eb131794a6e
equal deleted inserted replaced
2629:be70fd3458c0 2630:079ef82eac75
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
    18 
    18 
       
    19 {$INCLUDE "options.inc"}
       
    20 
    19 unit SDLh;
    21 unit SDLh;
    20 interface
    22 interface
    21 
    23 
    22 {$INCLUDE "options.inc"}
       
    23 
    24 
    24 {$IFDEF LINUX}
    25 {$IFDEF LINUX}
    25 {$DEFINE UNIX}
    26   {$DEFINE UNIX}
    26 {$ENDIF}
    27 {$ENDIF}
    27 {$IFDEF FREEBSD}
    28 {$IFDEF FREEBSD}
    28 {$DEFINE UNIX}
    29   {$DEFINE UNIX}
    29 {$ENDIF}
    30 {$ENDIF}
    30 
    31 
    31 {$IFDEF UNIX}
    32 {$IFDEF UNIX}
    32   {$IFNDEF DARWIN}
    33   {$IFNDEF DARWIN}
    33     {$linklib c}
    34     {$linklib c}
    40 {$ELSE}
    41 {$ELSE}
    41   {$DEFINE cdecl attribute(cdecl)}
    42   {$DEFINE cdecl attribute(cdecl)}
    42 {$ENDIF}
    43 {$ENDIF}
    43 
    44 
    44 {$IFDEF DARWIN}
    45 {$IFDEF DARWIN}
    45 	{$PASCALMAINNAME SDL_main}
    46   {$PASCALMAINNAME SDL_main}
    46 {$IFNDEF IPHONEOS}
    47   {$IFNDEF IPHONEOS}
    47 	{$linkframework Cocoa}
    48     {$linkframework Cocoa}
    48 	{$linkframework SDL}
    49     {$linkframework SDL}
    49 	{$linkframework SDL_net}
    50     {$linkframework SDL_net}
    50 	{$linkframework SDL_image}
    51     {$linkframework SDL_image}
    51 	{$linkframework SDL_ttf}
    52     {$linkframework SDL_ttf}
    52 	{$linkframework SDL_mixer}
    53     {$linkframework SDL_mixer}
    53 	{$linklib SDLmain}
    54     {$linklib SDLmain}
    54 	{$linklib gcc}
    55     {$linklib gcc}
    55 {$ENDIF}
    56   {$ENDIF}
    56 {$ENDIF}
    57 {$ENDIF}
       
    58 
    57 
    59 
    58 (*  SDL  *)
    60 (*  SDL  *)
    59 const
    61 const
    60 {$IFDEF WIN32}
    62 {$IFDEF WIN32}
    61 	SDLLibName = 'SDL.dll';
    63 	SDLLibName = 'SDL.dll';
   480 		SDL_GL_CONTEXT_MAJOR_VERSION,
   482 		SDL_GL_CONTEXT_MAJOR_VERSION,
   481 		SDL_GL_CONTEXT_MINOR_VERSION
   483 		SDL_GL_CONTEXT_MINOR_VERSION
   482 {$ELSE}
   484 {$ELSE}
   483 		SDL_GL_SWAP_CONTROL
   485 		SDL_GL_SWAP_CONTROL
   484 {$ENDIF}
   486 {$ENDIF}
   485 );
   487 		);
   486 
   488 
   487 {$IFDEF SDL13}
   489 {$IFDEF SDL13}
   488 	TSDL_ArrayByteOrder = (  // array component order, low byte -> high byte 
   490 	TSDL_ArrayByteOrder = (  // array component order, low byte -> high byte 
   489 		SDL_ARRAYORDER_NONE,
   491 		SDL_ARRAYORDER_NONE,
   490 		SDL_ARRAYORDER_RGB,
   492 		SDL_ARRAYORDER_RGB,
   709 function  SDLNet_TCP_Recv(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName;
   711 function  SDLNet_TCP_Recv(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName;
   710 procedure SDLNet_TCP_Close(sock: PTCPsocket); cdecl; external SDL_NetLibName;
   712 procedure SDLNet_TCP_Close(sock: PTCPsocket); cdecl; external SDL_NetLibName;
   711 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName;
   713 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName;
   712 function  SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName;
   714 function  SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName;
   713 function  SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName;
   715 function  SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName;
       
   716 
       
   717 {$IFDEF IPHONEOS}
       
   718 function  get_documents_path: PChar; cdecl; external 'hwutils';
       
   719 {$ENDIF}
       
   720 
   714 {$ELSE}{$ENDIF}
   721 {$ELSE}{$ENDIF}
   715 
   722 
   716 procedure SDLNet_Write16(value: Word; buf: pointer);
   723 procedure SDLNet_Write16(value: Word; buf: pointer);
   717 procedure SDLNet_Write32(value: LongWord; buf: pointer);
   724 procedure SDLNet_Write32(value: LongWord; buf: pointer);
   718 function  SDLNet_Read16(buf: pointer): Word;
   725 function  SDLNet_Read16(buf: pointer): Word;