update linux SDL to latest
| | |
| | | * |
| | | * \section intro_sec Introduction |
| | | * |
| | | * This is the Simple DirectMedia Layer, a general API that provides low |
| | | * level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, |
| | | * and 2D framebuffer across multiple platforms. |
| | | * Simple DirectMedia Layer is a cross-platform development library designed |
| | | * to provide low level access to audio, keyboard, mouse, joystick, and |
| | | * graphics hardware via OpenGL and Direct3D. It is used by video playback |
| | | * software, emulators, and popular games including Valve's award winning |
| | | * catalog and many Humble Bundle games. |
| | | * |
| | | * SDL is written in C, but works with C++ natively, and has bindings to |
| | | * several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, |
| | | * Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, |
| | | * Pike, Pliant, Python, Ruby, and Smalltalk. |
| | | * SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. |
| | | * Support for other platforms may be found in the source code. |
| | | * |
| | | * This library is distributed under the zlib license, which can be |
| | | * found in the file "COPYING". This license allows you to use SDL |
| | | * freely for any purpose as long as you retain the copyright notice. |
| | | * SDL is written in C, works natively with C++, and there are bindings |
| | | * available for several other languages, including C# and Python. |
| | | * |
| | | * This library is distributed under the zlib license, which can be found |
| | | * in the file "COPYING.txt". |
| | | * |
| | | * The best way to learn how to use SDL is to check out the header files in |
| | | * the "include" subdirectory and the programs in the "test" subdirectory. |
| | |
| | | extern DECLSPEC void SDLCALL SDL_CloseAudio(void); |
| | | extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); |
| | | |
| | | /** |
| | | * \return 1 if audio device is still functioning, zero if not, -1 on error. |
| | | */ |
| | | extern DECLSPEC int SDLCALL SDL_AudioDeviceConnected(SDL_AudioDeviceID dev); |
| | | |
| | | |
| | | /* Ends C function definitions when using C++ */ |
| | | #ifdef __cplusplus |
| | | } |
| | |
| | | * with 0. This operation can also be stated as "count leading zeroes" and |
| | | * "log base 2". |
| | | * |
| | | * \return Index of the most significant bit. |
| | | * \return Index of the most significant bit, or -1 if the value is 0. |
| | | */ |
| | | SDL_FORCE_INLINE Sint8 |
| | | SDL_FORCE_INLINE int |
| | | SDL_MostSignificantBitIndex32(Uint32 x) |
| | | { |
| | | #if defined(__GNUC__) && __GNUC__ >= 4 |
| | | /* Count Leading Zeroes builtin in GCC. |
| | | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html |
| | | */ |
| | | if (x == 0) { |
| | | return -1; |
| | | } |
| | | return 31 - __builtin_clz(x); |
| | | #else |
| | | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson |
| | |
| | | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog |
| | | */ |
| | | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; |
| | | const Uint8 S[] = {1, 2, 4, 8, 16}; |
| | | const int S[] = {1, 2, 4, 8, 16}; |
| | | |
| | | Uint8 msbIndex = 0; |
| | | int msbIndex = 0; |
| | | int i; |
| | | |
| | | if (x == 0) { |
| | | return -1; |
| | | } |
| | | |
| | | for (i = 4; i >= 0; i--) |
| | | { |
| | | if (x & b[i]) |
| | |
| | | #define SDL_VIDEO_DRIVER_X11_XSHAPE 1 |
| | | #define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 |
| | | #define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 |
| | | /* #undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 */ |
| | | #define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1 |
| | | #define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 |
| | | #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 |
| | | |
| | |
| | | /* #undef SDL_VIDEO_OPENGL_ES */ |
| | | /* #undef SDL_VIDEO_OPENGL_BGL */ |
| | | /* #undef SDL_VIDEO_OPENGL_CGL */ |
| | | /* #undef SDL_VIDEO_OPENGL_EGL */ |
| | | #define SDL_VIDEO_OPENGL_GLX 1 |
| | | /* #undef SDL_VIDEO_OPENGL_WGL */ |
| | | /* #undef SDL_VIDEO_OPENGL_OSMESA */ |
| | |
| | | #define SDL_HAPTIC_SINE (1<<1) |
| | | |
| | | /** |
| | | * \brief Square wave effect supported. |
| | | * \brief Left/Right effect supported. |
| | | * |
| | | * Periodic haptic effect that simulates square waves. |
| | | * Haptic effect for direct control over high/low frequency motors. |
| | | * |
| | | * \sa SDL_HapticPeriodic |
| | | * \sa SDL_HapticLeftRight |
| | | * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, |
| | | * we ran out of bits, and this is important for XInput devices. |
| | | */ |
| | | #define SDL_HAPTIC_SQUARE (1<<2) |
| | | #define SDL_HAPTIC_LEFTRIGHT (1<<2) |
| | | |
| | | /* !!! FIXME: put this back when we have more bits in 2.1 */ |
| | | /*#define SDL_HAPTIC_SQUARE (1<<2)*/ |
| | | |
| | | /** |
| | | * \brief Triangle wave effect supported. |
| | |
| | | * |
| | | * The struct handles the following effects: |
| | | * - ::SDL_HAPTIC_SINE |
| | | * - ::SDL_HAPTIC_SQUARE |
| | | * - ::SDL_HAPTIC_LEFTRIGHT |
| | | * - ::SDL_HAPTIC_TRIANGLE |
| | | * - ::SDL_HAPTIC_SAWTOOTHUP |
| | | * - ::SDL_HAPTIC_SAWTOOTHDOWN |
| | |
| | | \endverbatim |
| | | * |
| | | * \sa SDL_HAPTIC_SINE |
| | | * \sa SDL_HAPTIC_SQUARE |
| | | * \sa SDL_HAPTIC_LEFTRIGHT |
| | | * \sa SDL_HAPTIC_TRIANGLE |
| | | * \sa SDL_HAPTIC_SAWTOOTHUP |
| | | * \sa SDL_HAPTIC_SAWTOOTHDOWN |
| | |
| | | typedef struct SDL_HapticPeriodic |
| | | { |
| | | /* Header */ |
| | | Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_SQUARE, |
| | | Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, |
| | | ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or |
| | | ::SDL_HAPTIC_SAWTOOTHDOWN */ |
| | | SDL_HapticDirection direction; /**< Direction of the effect. */ |
| | |
| | | } SDL_HapticRamp; |
| | | |
| | | /** |
| | | * \brief A structure containing a template for a Left/Right effect. |
| | | * |
| | | * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. |
| | | * |
| | | * The Left/Right effect is used to explicitly control the large and small |
| | | * motors, commonly found in modern game controllers. One motor is high |
| | | * frequency, the other is low frequency. |
| | | * |
| | | * \sa SDL_HAPTIC_LEFTRIGHT |
| | | * \sa SDL_HapticEffect |
| | | */ |
| | | typedef struct SDL_HapticLeftRight |
| | | { |
| | | /* Header */ |
| | | Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ |
| | | |
| | | /* Replay */ |
| | | Uint32 length; /**< Duration of the effect. */ |
| | | |
| | | /* Rumble */ |
| | | Uint16 large_magnitude; /**< Control of the large controller motor. */ |
| | | Uint16 small_magnitude; /**< Control of the small controller motor. */ |
| | | } SDL_HapticLeftRight; |
| | | |
| | | /** |
| | | * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. |
| | | * |
| | | * A custom force feedback effect is much like a periodic effect, where the |
| | |
| | | * \sa SDL_HapticPeriodic |
| | | * \sa SDL_HapticCondition |
| | | * \sa SDL_HapticRamp |
| | | * \sa SDL_HapticLeftRight |
| | | * \sa SDL_HapticCustom |
| | | */ |
| | | typedef union SDL_HapticEffect |
| | |
| | | SDL_HapticPeriodic periodic; /**< Periodic effect. */ |
| | | SDL_HapticCondition condition; /**< Condition effect. */ |
| | | SDL_HapticRamp ramp; /**< Ramp effect. */ |
| | | SDL_HapticLeftRight leftright; /**< Left/Right effect. */ |
| | | SDL_HapticCustom custom; /**< Custom effect. */ |
| | | } SDL_HapticEffect; |
| | | |
| | |
| | | * |
| | | * Example: |
| | | * \code |
| | | * if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) { |
| | | * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { |
| | | * printf("We have constant haptic effect!"); |
| | | * } |
| | | * \endcode |
| | |
| | | extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); |
| | | |
| | | /** |
| | | * \brief Checks to see if rumble is supported on a haptic device.. |
| | | * \brief Checks to see if rumble is supported on a haptic device. |
| | | * |
| | | * \param haptic Haptic device to check to see if it supports rumble. |
| | | * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. |
| | |
| | | * \sa SDL_HapticRumblePlay |
| | | */ |
| | | extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); |
| | | |
| | | |
| | | |
| | | /* Ends C function definitions when using C++ */ |
| | | #ifdef __cplusplus |
| | |
| | | * This variable can be set to the following values: |
| | | * "0" or "nearest" - Nearest pixel sampling |
| | | * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) |
| | | * "2" or "best" - Anisotropic filtering (supported by Direct3D) |
| | | * "2" or "best" - Currently this is the same as "linear" |
| | | * |
| | | * By default nearest pixel sampling is used |
| | | */ |
| | |
| | | extern "C" { |
| | | #endif |
| | | |
| | | /* |
| | | /** |
| | | * This is called by the real SDL main function to let the rest of the |
| | | * library know that initialization was done properly. |
| | | * |
| | |
| | | */ |
| | | /*@{*/ |
| | | |
| | | /* The SDL mutex structure, defined in SDL_mutex.c */ |
| | | /* The SDL mutex structure, defined in SDL_sysmutex.c */ |
| | | struct SDL_mutex; |
| | | typedef struct SDL_mutex SDL_mutex; |
| | | |
| | |
| | | */ |
| | | /*@{*/ |
| | | |
| | | /* The SDL semaphore structure, defined in SDL_sem.c */ |
| | | /* The SDL semaphore structure, defined in SDL_syssem.c */ |
| | | struct SDL_semaphore; |
| | | typedef struct SDL_semaphore SDL_sem; |
| | | |
| | |
| | | */ |
| | | /*@{*/ |
| | | |
| | | /* The SDL condition variable structure, defined in SDL_cond.c */ |
| | | /* The SDL condition variable structure, defined in SDL_syscond.c */ |
| | | struct SDL_cond; |
| | | typedef struct SDL_cond SDL_cond; |
| | | |
| | |
| | | #define SDL_REVISION "hg-7553:f0091f8eae33" |
| | | #define SDL_REVISION_NUMBER 7553 |
| | | #define SDL_REVISION "hg-7660:78204ab75b0f" |
| | | #define SDL_REVISION_NUMBER 7660 |
| | |
| | | /* Thread local storage ID, 0 is the invalid ID */ |
| | | typedef unsigned int SDL_TLSID; |
| | | |
| | | /* The SDL thread priority |
| | | /** |
| | | * The SDL thread priority. |
| | | * |
| | | * Note: On many systems you require special privileges to set high priority. |
| | | * \note On many systems you require special privileges to set high priority. |
| | | */ |
| | | typedef enum { |
| | | SDL_THREAD_PRIORITY_LOW, |
| | |
| | | SDL_THREAD_PRIORITY_HIGH |
| | | } SDL_ThreadPriority; |
| | | |
| | | /* The function passed to SDL_CreateThread() |
| | | It is passed a void* user context parameter and returns an int. |
| | | /** |
| | | * The function passed to SDL_CreateThread(). |
| | | * It is passed a void* user context parameter and returns an int. |
| | | */ |
| | | typedef int (SDLCALL * SDL_ThreadFunction) (void *data); |
| | | |
| | |
| | | { |
| | | SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, |
| | | SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, |
| | | SDL_GL_CONTEXT_PROFILE_ES = 0x0004 |
| | | SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /* GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ |
| | | } SDL_GLprofile; |
| | | |
| | | typedef enum |
| | |
| | | |
| | | /* Some compilers use a special export keyword */ |
| | | #ifndef DECLSPEC |
| | | # if defined(__BEOS__) || defined(__HAIKU__) |
| | | # if defined(__GNUC__) |
| | | # define DECLSPEC __declspec(dllexport) |
| | | # else |
| | | # define DECLSPEC __declspec(export) |
| | | # endif |
| | | # elif defined(__WIN32__) |
| | | # if defined(__WIN32__) |
| | | # ifdef __BORLANDC__ |
| | | # ifdef BUILD_SDL |
| | | # define DECLSPEC |
| | |
| | | # else |
| | | # if defined(__GNUC__) && __GNUC__ >= 4 |
| | | # define DECLSPEC __attribute__ ((visibility("default"))) |
| | | # elif defined(__GNUC__) && __GNUC__ >= 2 |
| | | # define DECLSPEC __declspec(dllexport) |
| | | # else |
| | | # define DECLSPEC |
| | | # endif |