SDL.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2013 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. * This is the Simple DirectMedia Layer, a general API that provides low
  31. * level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
  32. * and 2D framebuffer across multiple platforms.
  33. *
  34. * SDL is written in C, but works with C++ natively, and has bindings to
  35. * several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
  36. * Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
  37. * Pike, Pliant, Python, Ruby, and Smalltalk.
  38. *
  39. * This library is distributed under the zlib license, which can be
  40. * found in the file "COPYING". This license allows you to use SDL
  41. * freely for any purpose as long as you retain the copyright notice.
  42. *
  43. * The best way to learn how to use SDL is to check out the header files in
  44. * the "include" subdirectory and the programs in the "test" subdirectory.
  45. * The header files and test programs are well commented and always up to date.
  46. * More documentation and FAQs are available online at:
  47. * http://wiki.libsdl.org/
  48. *
  49. * If you need help with the library, or just want to discuss SDL related
  50. * issues, you can join the developers mailing list:
  51. * http://www.libsdl.org/mailing-list.php
  52. *
  53. * Enjoy!
  54. * Sam Lantinga (slouken@libsdl.org)
  55. */
  56. #ifndef _SDL_H
  57. #define _SDL_H
  58. #include "SDL_main.h"
  59. #include "SDL_stdinc.h"
  60. #include "SDL_assert.h"
  61. #include "SDL_atomic.h"
  62. #include "SDL_audio.h"
  63. #include "SDL_clipboard.h"
  64. #include "SDL_cpuinfo.h"
  65. #include "SDL_endian.h"
  66. #include "SDL_error.h"
  67. #include "SDL_events.h"
  68. #include "SDL_joystick.h"
  69. #include "SDL_gamecontroller.h"
  70. #include "SDL_haptic.h"
  71. #include "SDL_hints.h"
  72. #include "SDL_loadso.h"
  73. #include "SDL_log.h"
  74. #include "SDL_messagebox.h"
  75. #include "SDL_mutex.h"
  76. #include "SDL_power.h"
  77. #include "SDL_render.h"
  78. #include "SDL_rwops.h"
  79. #include "SDL_system.h"
  80. #include "SDL_thread.h"
  81. #include "SDL_timer.h"
  82. #include "SDL_version.h"
  83. #include "SDL_video.h"
  84. #include "begin_code.h"
  85. /* Set up for C function definitions, even when using C++ */
  86. #ifdef __cplusplus
  87. extern "C" {
  88. #endif
  89. /* As of version 0.5, SDL is loaded dynamically into the application */
  90. /**
  91. * \name SDL_INIT_*
  92. *
  93. * These are the flags which may be passed to SDL_Init(). You should
  94. * specify the subsystems which you will be using in your application.
  95. */
  96. /*@{*/
  97. #define SDL_INIT_TIMER 0x00000001
  98. #define SDL_INIT_AUDIO 0x00000010
  99. #define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
  100. #define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
  101. #define SDL_INIT_HAPTIC 0x00001000
  102. #define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
  103. #define SDL_INIT_EVENTS 0x00004000
  104. #define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
  105. #define SDL_INIT_EVERYTHING ( \
  106. SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
  107. SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
  108. )
  109. /*@}*/
  110. /**
  111. * This function initializes the subsystems specified by \c flags
  112. * Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
  113. * signal handlers for some commonly ignored fatal signals (like SIGSEGV).
  114. */
  115. extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
  116. /**
  117. * This function initializes specific SDL subsystems
  118. */
  119. extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
  120. /**
  121. * This function cleans up specific SDL subsystems
  122. */
  123. extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
  124. /**
  125. * This function returns a mask of the specified subsystems which have
  126. * previously been initialized.
  127. *
  128. * If \c flags is 0, it returns a mask of all initialized subsystems.
  129. */
  130. extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
  131. /**
  132. * This function cleans up all initialized subsystems. You should
  133. * call it upon all exit conditions.
  134. */
  135. extern DECLSPEC void SDLCALL SDL_Quit(void);
  136. /* Ends C function definitions when using C++ */
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140. #include "close_code.h"
  141. #endif /* _SDL_H */
  142. /* vi: set ts=4 sw=4 expandtab: */