SDL.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL.h
  20. *
  21. * Main include header for the SDL library
  22. */
  23. /**
  24. * \mainpage Simple DirectMedia Layer (SDL)
  25. *
  26. * http://www.libsdl.org/
  27. *
  28. * \section intro_sec Introduction
  29. *
  30. * Simple DirectMedia Layer is a cross-platform development library designed
  31. * to provide low level access to audio, keyboard, mouse, joystick, and
  32. * graphics hardware via OpenGL and Direct3D. It is used by video playback
  33. * software, emulators, and popular games including Valve's award winning
  34. * catalog and many Humble Bundle games.
  35. *
  36. * SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
  37. * Support for other platforms may be found in the source code.
  38. *
  39. * SDL is written in C, works natively with C++, and there are bindings
  40. * available for several other languages, including C# and Python.
  41. *
  42. * This library is distributed under the zlib license, which can be found
  43. * in the file "COPYING.txt".
  44. *
  45. * The best way to learn how to use SDL is to check out the header files in
  46. * the "include" subdirectory and the programs in the "test" subdirectory.
  47. * The header files and test programs are well commented and always up to date.
  48. * More documentation and FAQs are available online at:
  49. * http://wiki.libsdl.org/
  50. *
  51. * If you need help with the library, or just want to discuss SDL related
  52. * issues, you can join the developers mailing list:
  53. * http://www.libsdl.org/mailing-list.php
  54. *
  55. * Enjoy!
  56. * Sam Lantinga (slouken@libsdl.org)
  57. */
  58. #ifndef _SDL_H
  59. #define _SDL_H
  60. #include "SDL_main.h"
  61. #include "SDL_stdinc.h"
  62. #include "SDL_assert.h"
  63. #include "SDL_atomic.h"
  64. #include "SDL_audio.h"
  65. #include "SDL_clipboard.h"
  66. #include "SDL_cpuinfo.h"
  67. #include "SDL_endian.h"
  68. #include "SDL_error.h"
  69. #include "SDL_events.h"
  70. #include "SDL_filesystem.h"
  71. #include "SDL_joystick.h"
  72. #include "SDL_gamecontroller.h"
  73. #include "SDL_haptic.h"
  74. #include "SDL_hints.h"
  75. #include "SDL_loadso.h"
  76. #include "SDL_log.h"
  77. #include "SDL_messagebox.h"
  78. #include "SDL_mutex.h"
  79. #include "SDL_power.h"
  80. #include "SDL_render.h"
  81. #include "SDL_rwops.h"
  82. #include "SDL_system.h"
  83. #include "SDL_thread.h"
  84. #include "SDL_timer.h"
  85. #include "SDL_version.h"
  86. #include "SDL_video.h"
  87. #include "begin_code.h"
  88. /* Set up for C function definitions, even when using C++ */
  89. #ifdef __cplusplus
  90. extern "C" {
  91. #endif
  92. /* As of version 0.5, SDL is loaded dynamically into the application */
  93. /**
  94. * \name SDL_INIT_*
  95. *
  96. * These are the flags which may be passed to SDL_Init(). You should
  97. * specify the subsystems which you will be using in your application.
  98. */
  99. /* @{ */
  100. #define SDL_INIT_TIMER 0x00000001
  101. #define SDL_INIT_AUDIO 0x00000010
  102. #define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
  103. #define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
  104. #define SDL_INIT_HAPTIC 0x00001000
  105. #define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
  106. #define SDL_INIT_EVENTS 0x00004000
  107. #define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
  108. #define SDL_INIT_EVERYTHING ( \
  109. SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
  110. SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
  111. )
  112. /* @} */
  113. /**
  114. * This function initializes the subsystems specified by \c flags
  115. * Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
  116. * signal handlers for some commonly ignored fatal signals (like SIGSEGV).
  117. */
  118. extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
  119. /**
  120. * This function initializes specific SDL subsystems
  121. */
  122. extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
  123. /**
  124. * This function cleans up specific SDL subsystems
  125. */
  126. extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
  127. /**
  128. * This function returns a mask of the specified subsystems which have
  129. * previously been initialized.
  130. *
  131. * If \c flags is 0, it returns a mask of all initialized subsystems.
  132. */
  133. extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
  134. /**
  135. * This function cleans up all initialized subsystems. You should
  136. * call it upon all exit conditions.
  137. */
  138. extern DECLSPEC void SDLCALL SDL_Quit(void);
  139. /* Ends C function definitions when using C++ */
  140. #ifdef __cplusplus
  141. }
  142. #endif
  143. #include "close_code.h"
  144. #endif /* _SDL_H */
  145. /* vi: set ts=4 sw=4 expandtab: */