hedgewars/SDLh.pas
changeset 2254 bb68e5a5be56
parent 2253 ecd10eaa5daf
child 2376 ece7b87f1334
equal deleted inserted replaced
2253:ecd10eaa5daf 2254:bb68e5a5be56
   342 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV';
   342 function  SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV';
   343 
   343 
   344 function  SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName;
   344 function  SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName;
   345 procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName;
   345 procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName;
   346 
   346 
       
   347 {$IFDEF SDL13}
       
   348 {$IFDEF IPHONEOS}
       
   349 function  SDL_iPhoneKeyboardShow(windowID: LongInt): LongInt; cdecl; external SDLLibName;
       
   350 function  SDL_iPhoneKeyboardHide(windowID: LongInt): LongInt; cdecl; external SDLLibName;
       
   351 function  SDL_iPhoneKeyboardIsShown(windowID: LongInt): boolean; cdecl; external SDLLibName;
       
   352 function  SDL_iPhoneKeyboardToggle(windowID: LongInt): LongInt; cdecl; external SDLLibName;
       
   353 {$ENDIF}
       
   354 {$ENDIF}
       
   355 
   347 (*  TTF  *)
   356 (*  TTF  *)
   348 
   357 
   349 const {$IFDEF WIN32}
   358 const {$IFDEF WIN32}
   350       SDL_TTFLibName = 'SDL_ttf.dll';
   359       SDL_TTFLibName = 'SDL_ttf.dll';
   351       {$ENDIF}
   360       {$ENDIF}
   362 
   371 
   363 type PTTF_Font = ^TTTF_font;
   372 type PTTF_Font = ^TTTF_font;
   364      TTTF_Font = record
   373      TTTF_Font = record
   365                  end;
   374                  end;
   366 
   375 
   367 function TTF_Init: LongInt; cdecl; external SDL_TTFLibName;
   376 function  TTF_Init: LongInt; cdecl; external SDL_TTFLibName;
   368 procedure TTF_Quit; cdecl; external SDL_TTFLibName;
   377 procedure TTF_Quit; cdecl; external SDL_TTFLibName;
   369 
   378 
   370 
   379 
   371 function TTF_SizeUTF8(font: PTTF_Font; const text: PChar; var w, h: LongInt): LongInt; cdecl; external SDL_TTFLibName;
   380 function  TTF_SizeUTF8(font: PTTF_Font; const text: PChar; var w, h: LongInt): LongInt; cdecl; external SDL_TTFLibName;
   372 (* TSDL_Color -> Longword conversion is workaround over freepascal bug.
   381 (* TSDL_Color -> Longword conversion is workaround over freepascal bug.
   373    See http://www.freepascal.org/mantis/view.php?id=7613 for details *)
   382    See http://www.freepascal.org/mantis/view.php?id=7613 for details *)
   374 function TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
   383 function  TTF_RenderUTF8_Solid(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
   375 function TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
   384 function  TTF_RenderUTF8_Blended(font: PTTF_Font; const text: PChar; fg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
   376 function TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
   385 function  TTF_RenderUTF8_Shaded(font: PTTF_Font; const text: PChar; fg, bg: Longword): PSDL_Surface; cdecl; external SDL_TTFLibName;
   377 
   386 
   378 function TTF_OpenFont(const filename: PChar; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName;
   387 function  TTF_OpenFont(const filename: PChar; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName;
   379 procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName;
   388 procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName;
   380 
   389 
   381 
   390 
   382 (*  SDL_image  *)
   391 (*  SDL_image  *)
   383 
   392 
   425                          numsockets,
   434                          numsockets,
   426                          maxsockets: LongInt;
   435                          maxsockets: LongInt;
   427                          sockets: PTCPSocket;
   436                          sockets: PTCPSocket;
   428                          end;
   437                          end;
   429 
   438 
   430 function SDLNet_Init: LongInt; cdecl; external SDL_NetLibName;
   439 function  SDLNet_Init: LongInt; cdecl; external SDL_NetLibName;
   431 procedure SDLNet_Quit; cdecl; external SDL_NetLibName;
   440 procedure SDLNet_Quit; cdecl; external SDL_NetLibName;
   432 
   441 
   433 function SDLNet_AllocSocketSet(maxsockets: LongInt): PSDLNet_SocketSet; cdecl; external SDL_NetLibName;
   442 function  SDLNet_AllocSocketSet(maxsockets: LongInt): PSDLNet_SocketSet; cdecl; external SDL_NetLibName;
   434 function SDLNet_ResolveHost(var address: TIPaddress; host: PCHar; port: Word): LongInt; cdecl; external SDL_NetLibName;
   443 function  SDLNet_ResolveHost(var address: TIPaddress; host: PCHar; port: Word): LongInt; cdecl; external SDL_NetLibName;
   435 function SDLNet_TCP_Accept(server: PTCPsocket): PTCPSocket; cdecl; external SDL_NetLibName;
   444 function  SDLNet_TCP_Accept(server: PTCPsocket): PTCPSocket; cdecl; external SDL_NetLibName;
   436 function SDLNet_TCP_Open(var ip: TIPaddress): PTCPSocket; cdecl; external SDL_NetLibName;
   445 function  SDLNet_TCP_Open(var ip: TIPaddress): PTCPSocket; cdecl; external SDL_NetLibName;
   437 function SDLNet_TCP_Send(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName;
   446 function  SDLNet_TCP_Send(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName;
   438 function SDLNet_TCP_Recv(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName;
   447 function  SDLNet_TCP_Recv(sock: PTCPsocket; data: Pointer; len: LongInt): LongInt; cdecl; external SDL_NetLibName;
   439 procedure SDLNet_TCP_Close(sock: PTCPsocket); cdecl; external SDL_NetLibName;
   448 procedure SDLNet_TCP_Close(sock: PTCPsocket); cdecl; external SDL_NetLibName;
   440 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName;
   449 procedure SDLNet_FreeSocketSet(_set: PSDLNet_SocketSet); cdecl; external SDL_NetLibName;
   441 function SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName;
   450 function  SDLNet_AddSocket(_set: PSDLNet_SocketSet; sock: PTCPSocket): LongInt; cdecl; external SDL_NetLibName;
   442 function SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName;
   451 function  SDLNet_CheckSockets(_set: PSDLNet_SocketSet; timeout: LongInt): LongInt; cdecl; external SDL_NetLibName;
   443 
   452 
   444 procedure SDLNet_Write16(value: Word; buf: pointer);
   453 procedure SDLNet_Write16(value: Word; buf: pointer);
   445 procedure SDLNet_Write32(value: LongWord; buf: pointer);
   454 procedure SDLNet_Write32(value: LongWord; buf: pointer);
   446 function SDLNet_Read16(buf: pointer): Word;
   455 function  SDLNet_Read16(buf: pointer): Word;
   447 function SDLNet_Read32(buf: pointer): LongWord;
   456 function  SDLNet_Read32(buf: pointer): LongWord;
   448 
   457 
   449 implementation
   458 implementation
   450 
   459 
   451 function SDL_MustLock(Surface: PSDL_Surface): Boolean;
   460 function SDL_MustLock(Surface: PSDL_Surface): Boolean;
   452 begin
   461 begin