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