325 |
325 |
326 |
326 |
327 {* SDL_Event type definition *} |
327 {* SDL_Event type definition *} |
328 |
328 |
329 {$IFDEF SDL13} |
329 {$IFDEF SDL13} |
330 TSDL_WindowID = LongInt; |
330 //UPDATE TSDL_Window AND TSDL_Texture before usage!!! |
331 TSDL_TextureID = LongInt; |
331 PSDL_Window = ^TSDL_Window; |
|
332 TSDL_Window = LongInt; //not true anymore |
|
333 |
|
334 PSDL_Texture = ^TSDL_Texture; |
|
335 TSDL_Texture = LongInt; //not true anymore |
332 |
336 |
333 TSDL_WindowEvent = record |
337 TSDL_WindowEvent = record |
334 type_: byte; |
338 type_: byte; |
335 gain: byte; |
339 gain: byte; |
336 state: byte; |
340 state: byte; |
337 windowID: TSDL_WindowID; |
341 windowID: LongInt; |
338 data1, data2: LongInt; |
342 data1, data2: LongInt; |
339 end; |
343 end; |
340 |
344 |
341 // implement SDL_TextEditingEvent + SDL_TextInputEvent for sdl13 |
345 // implement SDL_TextEditingEvent + SDL_TextInputEvent for sdl13 |
342 {$ELSE} |
346 {$ELSE} |
|
347 //these two are present in sdl1.3 but only for backward compatibility |
343 TSDL_ActiveEvent = record |
348 TSDL_ActiveEvent = record |
344 type_: byte; |
349 type_: byte; |
345 gain: byte; |
350 gain: byte; |
346 state: byte; |
351 state: byte; |
347 end; |
352 end; |
|
353 |
|
354 TSDL_ResizeEvent = record |
|
355 type_: Byte; |
|
356 w, h: LongInt; |
|
357 end; |
348 {$ENDIF} |
358 {$ENDIF} |
349 |
359 |
350 TSDL_MouseMotionEvent = record |
360 TSDL_MouseMotionEvent = record |
351 type_: byte; |
361 type_: byte; |
352 which: byte; |
362 which: byte; |
353 state: byte; |
363 state: byte; |
354 {$IFDEF SDL13} |
364 {$IFDEF SDL13} |
|
365 windowID: LongInt; |
355 x, y, xrel, yrel : LongInt; |
366 x, y, xrel, yrel : LongInt; |
356 pressure, pressure_max, pressure_min, |
367 pressure, pressure_max, pressure_min, |
357 rotation, tilt, cursor: LongInt; |
368 rotation, tilt, cursor: LongInt; |
358 {$ELSE} |
369 {$ELSE} |
359 x, y, xrel, yrel : word; |
370 x, y, xrel, yrel : word; |
624 |
629 |
625 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
630 function SDL_RWFromFile(filename, mode: PChar): PSDL_RWops; cdecl; external SDLLibName; |
626 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; |
631 function SDL_SaveBMP_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: LongInt): LongInt; cdecl; external SDLLibName; |
627 |
632 |
628 {$IFDEF SDL13} |
633 {$IFDEF SDL13} |
629 function SDL_CreateWindow(title: PChar; x,y,w,h, flags: LongInt): TSDL_WindowID; cdecl; external SDLLibName; |
|
630 function SDL_CreateRenderer(windowID: TSDL_WindowID; index, flags: LongInt): LongInt; cdecl; external SDLLibName; |
|
631 function SDL_SetRenderDrawColor(r,g,b,a: byte): LongInt; cdecl; external SDLLibName; |
|
632 function SDL_RenderFill(rect: PSDL_Rect): LongInt; |
634 function SDL_RenderFill(rect: PSDL_Rect): LongInt; |
633 function SDL_RenderFillRect(rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
635 function SDL_RenderFillRect(rect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
634 function SDL_RenderClear: LongInt; cdecl; external SDLLibName; |
636 function SDL_RenderClear: LongInt; cdecl; external SDLLibName; |
635 procedure SDL_RenderPresent; cdecl; external SDLLibName; |
637 procedure SDL_RenderPresent; cdecl; external SDLLibName; |
636 function SDL_RenderCopy(textureID: TSDL_TextureID; srcrect, dstrect: PSDL_Rect): LongInt; cdecl; external SDLLibName; |
|
637 procedure SDL_VideoQuit; cdecl; external SDLLibName; |
638 procedure SDL_VideoQuit; cdecl; external SDLLibName; |
638 |
639 |
639 function SDL_CreateTextureFromSurface(format: LongInt; surface: PSDL_Surface): TSDL_TextureID; cdecl; external SDLLibName; |
|
640 procedure SDL_DestroyTexture(textureID: TSDL_TextureID); cdecl; external SDLLibName; |
|
641 |
|
642 function SDL_GetKeyboardState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName; |
|
643 function SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName; |
640 function SDL_SelectMouse(index: LongInt): LongInt; cdecl; external SDLLibName; |
644 function SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
641 function SDL_GetRelativeMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
645 function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; |
642 function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; |
646 function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; |
643 function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; |
647 {$ELSE} |
644 {$ENDIF} |
648 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName; |
645 |
649 {$ENDIF} |
646 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF}; |
650 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
647 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
651 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
648 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
652 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
649 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
653 |
650 |
654 procedure SDL_PumpEvents; cdecl; external SDLLibName; |
651 procedure SDL_PumpEvents; cdecl; external SDLLibName; |
665 function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; |
662 function SDL_LockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexP'; |
666 function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; |
663 function SDL_UnlockMutex(mutex: PSDL_mutex): LongInt; cdecl; external SDLLibName name 'SDL_mutexV'; |
667 |
664 |
668 function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName; |
665 function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: LongInt): LongInt; cdecl; external SDLLibName; |
669 procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName; |
666 procedure SDL_GL_SwapBuffers(); cdecl; external SDLLibName; |
670 |
|
671 {$IFDEF IPHONEOS} |
|
672 function SDL_iPhoneKeyboardShow(windowID: LongInt): LongInt; cdecl; external SDLLibName; |
|
673 function SDL_iPhoneKeyboardHide(windowID: LongInt): LongInt; cdecl; external SDLLibName; |
|
674 function SDL_iPhoneKeyboardIsShown(windowID: LongInt): boolean; cdecl; external SDLLibName; |
|
675 function SDL_iPhoneKeyboardToggle(windowID: LongInt): LongInt; cdecl; external SDLLibName; |
|
676 {$ENDIF} |
|
677 |
667 |
678 function SDL_NumJoysticks: LongInt; cdecl; external SDLLibName; |
668 function SDL_NumJoysticks: LongInt; cdecl; external SDLLibName; |
679 function SDL_JoystickName(idx: LongInt): PChar; cdecl; external SDLLibName; |
669 function SDL_JoystickName(idx: LongInt): PChar; cdecl; external SDLLibName; |
680 function SDL_JoystickOpen(idx: LongInt): PSDL_Joystick; cdecl; external SDLLibName; |
670 function SDL_JoystickOpen(idx: LongInt): PSDL_Joystick; cdecl; external SDLLibName; |
681 function SDL_JoystickOpened(idx: LongInt): LongInt; cdecl; external SDLLibName; |
671 function SDL_JoystickOpened(idx: LongInt): LongInt; cdecl; external SDLLibName; |