hedgewars/SDLh.pas
changeset 2242 2e8251933b71
parent 2241 7992f7ba388d
child 2248 26e11cb27c61
equal deleted inserted replaced
2241:7992f7ba388d 2242:2e8251933b71
    94       SDL_KEYDOWN     = 2;
    94       SDL_KEYDOWN     = 2;
    95       SDL_KEYUP       = 3;
    95       SDL_KEYUP       = 3;
    96       SDL_QUITEV      = 12;
    96       SDL_QUITEV      = 12;
    97       SDL_VIDEORESIZE = 16;
    97       SDL_VIDEORESIZE = 16;
    98 
    98 
       
    99 {$IFDEF SDL13}
       
   100       SDL_MOUSEMOTION  = 5;
       
   101 {$ENDIF}
       
   102 
    99       SDL_APPINPUTFOCUS = 2;
   103       SDL_APPINPUTFOCUS = 2;
   100       SDL_GL_DOUBLEBUFFER = 5;
   104       SDL_GL_DOUBLEBUFFER = 5;
   101 
   105 
   102       RMask = $000000FF;
   106       RMask = $000000FF;
   103       GMask = $0000FF00;
   107       GMask = $0000FF00;
   208                           type_: Byte;
   212                           type_: Byte;
   209                           which: Byte;
   213                           which: Byte;
   210                           state: Byte;
   214                           state: Byte;
   211                           keysym: TSDL_KeySym;
   215                           keysym: TSDL_KeySym;
   212                           end;
   216                           end;
       
   217 						  
       
   218 	 {$IFDEF SDL13}
       
   219 	 TSDL_MouseMotionEvent = record
       
   220 							 type_: byte;
       
   221 							 which: byte;
       
   222 							 state: byte;
       
   223 							 x    : LongInt;
       
   224 							 y    : LongInt;
       
   225 							 xrel : LongInt;
       
   226 							 yrel : LongInt;
       
   227 							 end;
       
   228 	 {$ENDIF}
   213 
   229 
   214      TSDL_QuitEvent = record
   230      TSDL_QuitEvent = record
   215                       type_: Byte;
   231                       type_: Byte;
   216                       end;
   232                       end;
   217 	TSDL_ResizeEvent = record
   233 	 TSDL_ResizeEvent = record
   218 			type_: Byte;
   234 			type_: Byte;
   219 			w, h: LongInt;
   235 			w, h: LongInt;
   220 			end;
   236 			end;
   221 
   237 
   222      PSDL_Event = ^TSDL_Event;
   238      PSDL_Event = ^TSDL_Event;
   225                        SDL_NOEVENT: (type_: byte);
   241                        SDL_NOEVENT: (type_: byte);
   226                        SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent);
   242                        SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent);
   227                        SDL_KEYDOWN, SDL_KEYUP: (key: TSDL_KeyboardEvent);
   243                        SDL_KEYDOWN, SDL_KEYUP: (key: TSDL_KeyboardEvent);
   228                        SDL_QUITEV: (quit: TSDL_QuitEvent);
   244                        SDL_QUITEV: (quit: TSDL_QuitEvent);
   229                        SDL_VIDEORESIZE: (resize: TSDL_ResizeEvent);
   245                        SDL_VIDEORESIZE: (resize: TSDL_ResizeEvent);
   230                        end;
   246 	 {$IFDEF SDL13}
       
   247 					   SDL_MOUSEMOTION: (motion: TSDL_MouseMotionEvent);
       
   248      {$ENDIF}
       
   249 	                   end;
   231 
   250 
   232      PByteArray = ^TByteArray;
   251      PByteArray = ^TByteArray;
   233      TByteArray = array[0..65535] of Byte;
   252      TByteArray = array[0..65535] of Byte;
   234      PLongWordArray = ^TLongWordArray;
   253      PLongWordArray = ^TLongWordArray;
   235      TLongWordArray = array[0..16383] of LongWord;
   254      TLongWordArray = array[0..16383] of LongWord;
   272 function  SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName;
   291 function  SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName;
   273 function  SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName;
   292 function  SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName;
   274 
   293 
   275 {$IFDEF SDL13}
   294 {$IFDEF SDL13}
   276 function  SDL_GetKeyboardState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   295 function  SDL_GetKeyboardState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   277 function  SDL_GetMouseState(index: LongInt; x, y: PInteger): Byte; cdecl; external SDLLibName;
   296 function  SDL_GetMouseState(index: LongInt; x, y: PLongInt): Byte; cdecl; external SDLLibName;
       
   297 function  SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName;
       
   298 function  SDL_GetRelativeMouseState(index: LongInt; x, y: PLongInt): Byte; cdecl; external SDLLibName;
       
   299 function  SDL_GetNumMice : LongInt; cdecl; external SDLLibName;
   278 {$ELSE}
   300 {$ELSE}
   279 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   301 function  SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName;
   280 function  SDL_GetMouseState(x, y: PInteger): Byte; cdecl; external SDLLibName;
   302 function  SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName;
   281 {$ENDIF}
   303 {$ENDIF}
   282 function  SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName;
   304 function  SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName;
   283 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName;
   305 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName;
   284 
   306 
   285 function  SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName;
   307 function  SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName;