hedgewars/SDLh.pas
changeset 7049 35d762458d66
parent 7035 823caba67738
child 7167 0b3b306f129a
equal deleted inserted replaced
7048:0a4c88935902 7049:35d762458d66
   967 function SDL_putenv(const text: PChar): LongInt; cdecl; external SDLLibName;
   967 function SDL_putenv(const text: PChar): LongInt; cdecl; external SDLLibName;
   968 function SDL_getenv(const text: PChar): PChar; cdecl; external SDLLibName;
   968 function SDL_getenv(const text: PChar): PChar; cdecl; external SDLLibName;
   969 {$ENDIF}
   969 {$ENDIF}
   970 
   970 
   971 {* Compatibility between SDL-1.2 and SDL-1.3 *}
   971 {* Compatibility between SDL-1.2 and SDL-1.3 *}
   972 procedure SDL_WarpMouse(x, y: Word); {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   972 procedure SDL_WarpMouse(x, y: Word); {$IFDEF SDL13}inline{$ELSE}cdecl; external SDLLibName{$ENDIF};
   973 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF};
   973 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF};
   974 function  SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   974 function  SDL_AllocFormat(format: LongWord): PSDL_PixelFormat; {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   975 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   975 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); {$IFDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   976 function  SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   976 function  SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   977 function  SDL_EnableUNICODE(enable: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
   977 function  SDL_EnableUNICODE(enable: LongInt): LongInt; {$IFNDEF SDL13}cdecl; external SDLLibName;{$ENDIF}
  1053 function  SDLNet_Read16(buf: Pointer): Word;
  1053 function  SDLNet_Read16(buf: Pointer): Word;
  1054 function  SDLNet_Read32(buf: Pointer): LongWord;
  1054 function  SDLNet_Read32(buf: Pointer): LongWord;
  1055 
  1055 
  1056 implementation
  1056 implementation
  1057 {$IFDEF SDL13}
  1057 {$IFDEF SDL13}
  1058 uses strings, uVariables;
  1058 uses strings, uVariables, uStore;
  1059 
  1059 
  1060 // compatible functions
  1060 // compatible functions
  1061 procedure SDL_WarpMouse(x, y: Word);
  1061 procedure SDL_WarpMouse(x, y: Word); inline;
  1062 begin
  1062 begin
  1063     SDL_WarpMouseInWindow(SDLwindow, x, y);
  1063     WarpMouse(x, y);
  1064 end;
  1064 end;
  1065 
  1065 
  1066 function SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar;
  1066 function SDL_VideoDriverName(namebuf: PChar; maxlen: LongInt): PChar;
  1067 var name : PChar = nil;
  1067 var name : PChar = nil;
  1068 begin
  1068 begin
  1075     SDL_VideoDriverName:= name;
  1075     SDL_VideoDriverName:= name;
  1076 end;
  1076 end;
  1077 
  1077 
  1078 function SDL_EnableUNICODE(enable: LongInt): LongInt;
  1078 function SDL_EnableUNICODE(enable: LongInt): LongInt;
  1079 begin
  1079 begin
       
  1080     enable:= enable; // avoid hint
  1080     SDL_StartTextInput();
  1081     SDL_StartTextInput();
  1081     SDL_EnableUNICODE:= 0;
  1082     SDL_EnableUNICODE:= 0;
  1082 end;
  1083 end;
  1083 
  1084 
  1084 function SDL_EnableKeyRepeat(timedelay, interval: LongInt): LongInt;
  1085 function SDL_EnableKeyRepeat(timedelay, interval: LongInt): LongInt;