sdl.inc 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // based on "sdl.h"
  2. type
  3. PPSDL_Init = ^PSDL_Init;
  4. PSDL_Init = ^TSDL_Init;
  5. TSDL_Init = type cuint32;
  6. const
  7. SDL_INIT_TIMER = TSDL_Init($00000001);
  8. {$EXTERNALSYM SDL_INIT_TIMER}
  9. SDL_INIT_AUDIO = TSDL_Init($00000010);
  10. {$EXTERNALSYM SDL_INIT_AUDIO}
  11. SDL_INIT_VIDEO = TSDL_Init($00000020); // SDL_INIT_VIDEO implies SDL_INIT_EVENTS
  12. {$EXTERNALSYM SDL_INIT_VIDEO}
  13. SDL_INIT_JOYSTICK = TSDL_Init($00000200); // SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS
  14. {$EXTERNALSYM SDL_INIT_JOYSTICK}
  15. SDL_INIT_HAPTIC = TSDL_Init($00001000);
  16. {$EXTERNALSYM SDL_INIT_HAPTIC}
  17. SDL_INIT_GAMECONTROLLER = TSDL_Init($00002000); //turn on game controller also implicitly does JOYSTICK
  18. {$EXTERNALSYM SDL_INIT_GAMECONTROLLER} // SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK
  19. SDL_INIT_EVENTS = TSDL_Init($00004000);
  20. {$EXTERNALSYM SDL_INIT_EVENTS}
  21. SDL_INIT_SENSOR = TSDL_Init($00008000);
  22. {$EXTERNALSYM SDL_INIT_SENSOR}
  23. SDL_INIT_NOPARACHUTE = TSDL_Init($00100000); //Don't catch fatal signals
  24. {$EXTERNALSYM SDL_INIT_NOPARACHUTE} // compatibility; this flag is ignored.
  25. SDL_INIT_EVERYTHING = TSDL_Init(
  26. SDL_INIT_TIMER or
  27. SDL_INIT_AUDIO or
  28. SDL_INIT_VIDEO or
  29. SDL_INIT_EVENTS or
  30. SDL_INIT_JOYSTICK or
  31. SDL_INIT_HAPTIC or
  32. SDL_INIT_GAMECONTROLLER or
  33. SDL_INIT_SENSOR
  34. );
  35. {$EXTERNALSYM SDL_INIT_EVERYTHING}
  36. {**
  37. * This function initializes the subsystems specified by flags
  38. * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
  39. * signal handlers for some commonly ignored fatal signals (like SIGSEGV).
  40. *}
  41. function SDL_Init(flags: TSDL_Init): cint; cdecl;
  42. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_Init' {$ENDIF} {$ENDIF};
  43. {**
  44. * This function initializes specific SDL subsystems
  45. *}
  46. function SDL_InitSubSystem(flags: TSDL_Init): cint; cdecl;
  47. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_InitSubSystem' {$ENDIF} {$ENDIF};
  48. {**
  49. * This function cleans up specific SDL subsystems
  50. *}
  51. procedure SDL_QuitSubSystem(flags: TSDL_Init); cdecl;
  52. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_QuitSubSystem' {$ENDIF} {$ENDIF};
  53. {**
  54. * This function returns a mask of the specified subsystems which have
  55. * previously been initialized.
  56. *
  57. * If flags is 0, it returns a mask of all initialized subsystems.
  58. *}
  59. function SDL_WasInit(flags: TSDL_Init): cuint32; cdecl;
  60. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_WasInit' {$ENDIF} {$ENDIF};
  61. {**
  62. * This function cleans up all initialized subsystems. You should
  63. * call it upon all exit conditions.
  64. *}
  65. procedure SDL_Quit(); cdecl;
  66. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_Quit' {$ENDIF} {$ENDIF};