diff --git a/Externals/SDL/Include/SDL.h b/Externals/SDL/Include/SDL.h index f1078304de..861e236979 100644 --- a/Externals/SDL/Include/SDL.h +++ b/Externals/SDL/Include/SDL.h @@ -1,151 +1,165 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL.h - * - * Main include header for the SDL library - */ -/** - * \mainpage Simple DirectMedia Layer (SDL) - -http://www.libsdl.org/ - -* \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. - -The current version supports Linux, Windows, Windows CE, BeOS, MacOS, -Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. -The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, -RISC OS, SymbianOS, and OS/2, but these are not officially supported. - -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. - -This library is distributed under GNU LGPL version 2, which can be -found in the file "COPYING". This license allows you to use SDL -freely in commercial programs as long as you link with the dynamic -library. - -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. -The header files and test programs are well commented and always up to date. -More documentation is available in HTML format in "docs/index.html", and -a documentation wiki is available online at: - http://www.libsdl.org/cgi/docwiki.cgi - -The test programs in the "test" subdirectory are in the public domain. - -Frequently asked questions are answered online: - http://www.libsdl.org/faq.php - -If you need help with the library, or just want to discuss SDL related -issues, you can join the developers mailing list: - http://www.libsdl.org/mailing-list.php - -Enjoy! - Sam Lantinga (slouken@libsdl.org) - */ - -#ifndef _SDL_H -#define _SDL_H - -#include "SDL_main.h" -#include "SDL_stdinc.h" -#include "SDL_audio.h" -#include "SDL_cdrom.h" -#include "SDL_cpuinfo.h" -#include "SDL_endian.h" -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_loadso.h" -#include "SDL_mutex.h" -#include "SDL_rwops.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_video.h" -#include "SDL_version.h" -#include "SDL_compat.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* As of version 0.5, SDL is loaded dynamically into the application */ - -/* These are the flags which may be passed to SDL_Init() -- you should - specify the subsystems which you will be using in your application. -*/ -#define SDL_INIT_TIMER 0x00000001 -#define SDL_INIT_AUDIO 0x00000010 -#define SDL_INIT_VIDEO 0x00000020 -#define SDL_INIT_CDROM 0x00000100 -#define SDL_INIT_JOYSTICK 0x00000200 -#define SDL_INIT_HAPTIC 0x00001000 -#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */ -#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */ -#define SDL_INIT_EVERYTHING 0x0000FFFF - -/* This function loads the SDL dynamically linked library and initializes - * the subsystems specified by 'flags' (and those satisfying dependencies) - * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup - * signal handlers for some commonly ignored fatal signals (like SIGSEGV) - */ -extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); - -/* This function initializes specific SDL subsystems */ -extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); - -/* This function cleans up specific SDL subsystems */ -extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); - -/* This function returns mask of the specified subsystems which have - been initialized. - If 'flags' is 0, it returns a mask of all initialized subsystems. -*/ -extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); - -/* This function cleans up all initialized subsystems and unloads the - * dynamically linked library. You should call it upon all exit conditions. - */ -extern DECLSPEC void SDLCALL SDL_Quit(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_H */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL.h + * + * Main include header for the SDL library + */ + +/** + * \mainpage Simple DirectMedia Layer (SDL) + * + * http://www.libsdl.org/ + * + * \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. + * + * The current version supports Linux, Windows, Windows CE, BeOS, MacOS, + * Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. + * The code contains support for AIX, OSF/Tru64, RISC OS, and SymbianOS, + * but these are not officially supported. + * + * 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. + * + * This library is distributed under GNU LGPL version 2, which can be + * found in the file "COPYING". This license allows you to use SDL + * freely in commercial programs as long as you link with the dynamic + * library. + * + * 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. + * The header files and test programs are well commented and always up to date. + * More documentation is available in HTML format in "docs/index.html", and + * a documentation wiki is available online at: + * http://www.libsdl.org/cgi/docwiki.cgi + * + * The test programs in the "test" subdirectory are in the public domain. + * + * Frequently asked questions are answered online: + * http://www.libsdl.org/faq.php + * + * If you need help with the library, or just want to discuss SDL related + * issues, you can join the developers mailing list: + * http://www.libsdl.org/mailing-list.php + * + * Enjoy! + * Sam Lantinga (slouken@libsdl.org) + */ + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_atomic.h" +#include "SDL_audio.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_loadso.h" +#include "SDL_mutex.h" +#include "SDL_power.h" +#include "SDL_rwops.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_video.h" +#include "SDL_version.h" +#include "SDL_compat.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/* As of version 0.5, SDL is loaded dynamically into the application */ + +/** + * \name SDL_INIT_* + * + * These are the flags which may be passed to SDL_Init(). You should + * specify the subsystems which you will be using in your application. + */ +/*@{*/ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 +#define SDL_INIT_JOYSTICK 0x00000200 +#define SDL_INIT_HAPTIC 0x00001000 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ +#define SDL_INIT_EVERYTHING 0x0000FFFF +/*@}*/ + +/** + * This function loads the SDL dynamically linked library and initializes + * the subsystems specified by \c flags (and those satisfying dependencies). + * Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV). + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** + * This function initializes specific SDL subsystems + */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** + * This function cleans up specific SDL subsystems + */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** + * This function returns mask of the specified subsystems which have + * been initialized. + * + * If \c flags is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** + * This function cleans up all initialized subsystems and unloads the + * dynamically linked library. You should call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_H */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_audio.h b/Externals/SDL/Include/SDL_audio.h index eeac3f5774..2043fbb2da 100644 --- a/Externals/SDL/Include/SDL_audio.h +++ b/Externals/SDL/Include/SDL_audio.h @@ -1,423 +1,505 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_audio.h - * - * Access to the raw audio mixing buffer for the SDL library - */ - -#ifndef _SDL_audio_h -#define _SDL_audio_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_endian.h" -#include "SDL_mutex.h" -#include "SDL_thread.h" -#include "SDL_rwops.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -typedef Uint16 SDL_AudioFormat; - -/* The calculated values in this structure are calculated by SDL_OpenAudio() */ -typedef struct SDL_AudioSpec -{ - int freq; /* DSP frequency -- samples per second */ - SDL_AudioFormat format; /* Audio data format */ - Uint8 channels; /* Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /* Audio buffer silence value (calculated) */ - Uint16 samples; /* Audio buffer size in samples (power of 2) */ - Uint16 padding; /* Necessary for some compile environments */ - Uint32 size; /* Audio buffer size in bytes (calculated) */ - /* This function is called when the audio device needs more data. - 'stream' is a pointer to the audio data buffer - 'len' is the length of that buffer in bytes. - Once the callback returns, the buffer will no longer be valid. - Stereo samples are stored in a LRLRLR ordering. - */ - void (SDLCALL * callback) (void *userdata, Uint8 * stream, int len); - void *userdata; -} SDL_AudioSpec; - - -/* - These are what the 16 bits in SDL_AudioFormat currently mean... - (Unspecified bits are always zero.) - - ++-----------------------sample is signed if set - || - || ++-----------sample is bigendian if set - || || - || || ++---sample is float if set - || || || - || || || +---sample bit size---+ - || || || | | - 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - - There are macros in SDL 1.3 and later to query these bits. -*/ - -#define SDL_AUDIO_MASK_BITSIZE (0xFF) -#define SDL_AUDIO_MASK_DATATYPE (1<<8) -#define SDL_AUDIO_MASK_ENDIAN (1<<12) -#define SDL_AUDIO_MASK_SIGNED (1<<15) -#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) -#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) -#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) -#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) -#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) -#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) -#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) - -/* Audio format flags (defaults to LSB byte order) */ -#define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /* Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB - -/* int32 support new to SDL 1.3 */ -#define AUDIO_S32LSB 0x8020 /* 32-bit integer samples */ -#define AUDIO_S32MSB 0x9020 /* As above, but big-endian byte order */ -#define AUDIO_S32 AUDIO_S32LSB - -/* float32 support new to SDL 1.3 */ -#define AUDIO_F32LSB 0x8120 /* 32-bit floating point samples */ -#define AUDIO_F32MSB 0x9120 /* As above, but big-endian byte order */ -#define AUDIO_F32 AUDIO_F32LSB - -/* Native audio byte ordering */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB -#define AUDIO_S32SYS AUDIO_S32LSB -#define AUDIO_F32SYS AUDIO_F32LSB -#else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB -#define AUDIO_S32SYS AUDIO_S32MSB -#define AUDIO_F32SYS AUDIO_F32MSB -#endif - -/* Which audio format changes are allowed when opening a device */ -#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 -#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 -#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 -#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) - -/* A structure to hold a set of audio conversion filters and buffers */ -struct SDL_AudioCVT; -typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, - SDL_AudioFormat format); - -typedef struct SDL_AudioCVT -{ - int needed; /* Set to 1 if conversion possible */ - SDL_AudioFormat src_format; /* Source audio format */ - SDL_AudioFormat dst_format; /* Target audio format */ - double rate_incr; /* Rate conversion increment */ - Uint8 *buf; /* Buffer to hold entire audio data */ - int len; /* Length of original audio buffer */ - int len_cvt; /* Length of converted audio buffer */ - int len_mult; /* buffer must be len*len_mult big */ - double len_ratio; /* Given len, final size is len*len_ratio */ - SDL_AudioFilter filters[10]; /* Filter list */ - int filter_index; /* Current audio conversion function */ -} SDL_AudioCVT; - - -/* Function prototypes */ - -/* These functions return the list of built in audio drivers, in the - * order that they are normally initialized by default. - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); -extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); - -/* These functions are used internally, and should not be used unless you - * have a specific need to specify the audio driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). - */ -extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); -extern DECLSPEC void SDLCALL SDL_AudioQuit(void); - -/* This function returns the name of the current audio driver, or NULL - * if no driver has been initialized. - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); - -/* - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. - * - * When filling in the desired audio spec structure, - * 'desired->freq' should be the desired audio frequency in samples-per-second. - * 'desired->format' should be the desired audio format. - * 'desired->samples' is the desired size of the audio buffer, in samples. - * This number should be a power of two, and may be adjusted by the audio - * driver to a value more suitable for the hardware. Good values seem to - * range between 512 and 8096 inclusive, depending on the application and - * CPU speed. Smaller values yield faster response time, but can lead - * to underflow if the application is doing heavy processing and cannot - * fill the audio buffer in time. A stereo sample consists of both right - * and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: ms = (samples*1000)/freq - * 'desired->size' is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * 'desired->silence' is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * 'desired->callback' should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. - * 'desired->userdata' is passed as the first parameter to your callback - * function. - * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. - */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, - SDL_AudioSpec * obtained); - -/* - * SDL Audio Device IDs. - * A successful call to SDL_OpenAudio() is always device id 1, and legacy - * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls - * always returns devices >= 2 on success. The legacy calls are good both - * for backwards compatibility and when you don't care about multiple, - * specific, or capture devices. - */ -typedef Uint32 SDL_AudioDeviceID; - -/* - * Get the number of available devices exposed by the current driver. - * Only valid after a successfully initializing the audio subsystem. - * Returns -1 if an explicit list of devices can't be determined; this is - * not an error. For example, if SDL is set up to talk to a remote audio - * server, it can't list every one available on the Internet, but it will - * still allow a specific host to be specified to SDL_OpenAudioDevice(). - * In many common cases, when this function returns a value <= 0, it can still - * successfully open the default device (NULL for first argument of - * SDL_OpenAudioDevice()). - */ -extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); - -/* - * Get the human-readable name of a specific audio device. - * Must be a value between 0 and (number of audio devices-1). - * Only valid after a successfully initializing the audio subsystem. - * The values returned by this function reflect the latest call to - * SDL_GetNumAudioDevices(); recall that function to redetect available - * hardware. - * - * The string returned by this function is UTF-8 encoded, read-only, and - * managed internally. You are not to free it. If you need to keep the - * string for any length of time, you should make your own copy of it, as it - * will be invalid next time any of several other SDL functions is called. - */ -extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, - int iscapture); - - -/* - * Open a specific audio device. Passing in a device name of NULL requests - * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). - * The device name is a UTF-8 string reported by SDL_GetAudioDevice(), but - * some drivers allow arbitrary and driver-specific strings, such as a - * hostname/IP address for a remote audio server, or a filename in the - * diskaudio driver. - * Returns 0 on error, a valid device ID that is >= 2 on success. - * SDL_OpenAudio(), unlike this function, always acts on device ID 1. - */ -extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char - *device, - int iscapture, - const - SDL_AudioSpec * - desired, - SDL_AudioSpec * - obtained, - int - allowed_changes); - - - -/* - * Get the current audio state: - */ -typedef enum -{ - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_audiostatus; -extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); - -extern DECLSPEC SDL_audiostatus SDLCALL -SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); - -/* - * This function pauses and unpauses the audio callback processing. - * It should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. - */ -extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); -extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, - int pause_on); - -/* - * This function loads a WAVE from the data source, automatically freeing - * that source if 'freesrc' is non-zero. For example, to load a WAVE file, - * you could do: - * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); - * - * If this function succeeds, it returns the given SDL_AudioSpec, - * filled with the audio data format of the wave data, and sets - * 'audio_buf' to a malloc()'d buffer containing the audio data, - * and sets 'audio_len' to the length of that audio buffer, in bytes. - * You need to free the audio buffer with SDL_FreeWAV() when you are - * done with it. - * - * This function returns NULL and sets the SDL error message if the - * wave file cannot be opened, uses an unknown data format, or is - * corrupt. Currently raw and MS-ADPCM WAVE files are supported. - */ -extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, - int freesrc, - SDL_AudioSpec * spec, - Uint8 ** audio_buf, - Uint32 * audio_len); - -/* Compatibility convenience function -- loads a WAV from a file */ -#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) - -/* - * This function frees data previously allocated with SDL_LoadWAV_RW() - */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); - -/* - * This function takes a source format and rate and a destination format - * and rate, and initializes the 'cvt' structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. - * Returns -1 if the format conversion is not supported, 0 if there's - * no conversion needed, or 1 if the audio filter is set up. - */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, - SDL_AudioFormat src_format, - Uint8 src_channels, - int src_rate, - SDL_AudioFormat dst_format, - Uint8 dst_channels, - int dst_rate); - -/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), - * created an audio buffer cvt->buf, and filled it with cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * The data conversion may expand the size of the audio data, so the buffer - * cvt->buf should be allocated after the cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. - */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); - -/* - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. - */ -#define SDL_MIX_MAXVOLUME 128 -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, - Uint32 len, int volume); - -/* - * This works like SDL_MixAudio, but you specify the audio format instead of - * using the format of audio device 1. Thus it can be used when no audio - * device is open at all. - */ -extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, - const Uint8 * src, - SDL_AudioFormat format, - Uint32 len, int volume); - -/* - * The lock manipulated by these functions protects the callback function. - * During a LockAudio/UnlockAudio pair, you can be guaranteed that the - * callback function is not running. Do not call these from the callback - * function or you will cause deadlock. - */ -extern DECLSPEC void SDLCALL SDL_LockAudio(void); -extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); -extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); - -/* - * This function shuts down audio processing and closes the audio device. - */ -extern DECLSPEC void SDLCALL SDL_CloseAudio(void); -extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); - -/* - * Returns 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 -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_audio_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_audio.h + * + * Access to the raw audio mixing buffer for the SDL library. + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). + * + * \verbatim + ++-----------------------sample is signed if set + || + || ++-----------sample is bigendian if set + || || + || || ++---sample is float if set + || || || + || || || +---sample bit size---+ + || || || | | + 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + \endverbatim + * + * There are macros in SDL 1.3 and later to query these bits. + */ +typedef Uint16 SDL_AudioFormat; + +/** + * \name Audio flags + */ +/*@{*/ + +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#define SDL_AUDIO_MASK_DATATYPE (1<<8) +#define SDL_AUDIO_MASK_ENDIAN (1<<12) +#define SDL_AUDIO_MASK_SIGNED (1<<15) +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) +#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) +#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) +#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) +#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) +#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) + +/** + * \name Audio format flags + * + * Defaults to LSB byte order. + */ +/*@{*/ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB +/*@}*/ + +/** + * \name int32 support + * + * New to SDL 1.3. + */ +/*@{*/ +#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ +#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ +#define AUDIO_S32 AUDIO_S32LSB +/*@}*/ + +/** + * \name float32 support + * + * New to SDL 1.3. + */ +/*@{*/ +#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ +#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ +#define AUDIO_F32 AUDIO_F32LSB +/*@}*/ + +/** + * \name Native audio byte ordering + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_S32SYS AUDIO_S32LSB +#define AUDIO_F32SYS AUDIO_F32LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_S32SYS AUDIO_S32MSB +#define AUDIO_F32SYS AUDIO_F32MSB +#endif +/*@}*/ + +/** + * \name Allow change flags + * + * Which audio format changes are allowed when opening a device. + */ +/*@{*/ +#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 +#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 +#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 +#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) +/*@}*/ + +/*@}*//*Audio flags*/ + +/** + * The calculated values in this structure are calculated by SDL_OpenAudio(). + */ +typedef struct SDL_AudioSpec +{ + int freq; /**< DSP frequency -- samples per second */ + SDL_AudioFormat format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + /** + * This function is called when the audio device needs more data. + * + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ + void (SDLCALL * callback) (void *userdata, Uint8 * stream, int len); + void *userdata; +} SDL_AudioSpec; + + +struct SDL_AudioCVT; +typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, + SDL_AudioFormat format); + +/** + * A structure to hold a set of audio conversion filters and buffers. + */ +typedef struct SDL_AudioCVT +{ + int needed; /**< Set to 1 if conversion possible */ + SDL_AudioFormat src_format; /**< Source audio format */ + SDL_AudioFormat dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + SDL_AudioFilter filters[10]; /**< Filter list */ + int filter_index; /**< Current audio conversion function */ +} SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * \name Driver discovery functions + * + * These functions return the list of built in audio drivers, in the + * order that they are normally initialized by default. + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); +extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +/*@}*/ + +/** + * \name Initialization and cleanup + * + * \internal These functions are used internally, and should not be used unless + * you have a specific need to specify the audio driver you want to + * use. You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/*@}*/ + +/** + * This function returns the name of the current audio driver, or NULL + * if no driver has been initialized. + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by \c obtained. If \c obtained is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * When filling in the desired audio spec structure, + * - \c desired->freq should be the desired audio frequency in samples-per- + * second. + * - \c desired->format should be the desired audio format. + * - \c desired->samples is the desired size of the audio buffer, in + * samples. This number should be a power of two, and may be adjusted by + * the audio driver to a value more suitable for the hardware. Good values + * seem to range between 512 and 8096 inclusive, depending on the + * application and CPU speed. Smaller values yield faster response time, + * but can lead to underflow if the application is doing heavy processing + * and cannot fill the audio buffer in time. A stereo sample consists of + * both right and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: \code ms = (samples*1000)/freq \endcode + * - \c desired->size is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - \c desired->silence is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - \c desired->callback should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - \c desired->userdata is passed as the first parameter to your callback + * function. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, + SDL_AudioSpec * obtained); + +/** + * SDL Audio Device IDs. + * + * A successful call to SDL_OpenAudio() is always device id 1, and legacy + * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both + * for backwards compatibility and when you don't care about multiple, + * specific, or capture devices. + */ +typedef Uint32 SDL_AudioDeviceID; + +/** + * Get the number of available devices exposed by the current driver. + * Only valid after a successfully initializing the audio subsystem. + * Returns -1 if an explicit list of devices can't be determined; this is + * not an error. For example, if SDL is set up to talk to a remote audio + * server, it can't list every one available on the Internet, but it will + * still allow a specific host to be specified to SDL_OpenAudioDevice(). + * + * In many common cases, when this function returns a value <= 0, it can still + * successfully open the default device (NULL for first argument of + * SDL_OpenAudioDevice()). + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); + +/** + * Get the human-readable name of a specific audio device. + * Must be a value between 0 and (number of audio devices-1). + * Only valid after a successfully initializing the audio subsystem. + * The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); recall that function to redetect available + * hardware. + * + * The string returned by this function is UTF-8 encoded, read-only, and + * managed internally. You are not to free it. If you need to keep the + * string for any length of time, you should make your own copy of it, as it + * will be invalid next time any of several other SDL functions is called. + */ +extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, + int iscapture); + + +/** + * Open a specific audio device. Passing in a device name of NULL requests + * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). + * + * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but + * some drivers allow arbitrary and driver-specific strings, such as a + * hostname/IP address for a remote audio server, or a filename in the + * diskaudio driver. + * + * \return 0 on error, a valid device ID that is >= 2 on success. + * + * SDL_OpenAudio(), unlike this function, always acts on device ID 1. + */ +extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char + *device, + int iscapture, + const + SDL_AudioSpec * + desired, + SDL_AudioSpec * + obtained, + int + allowed_changes); + + + +/** + * \name Audio state + * + * Get the current audio state. + */ +/*@{*/ +typedef enum +{ + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_audiostatus; +extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); + +extern DECLSPEC SDL_audiostatus SDLCALL +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); +/*@}*//*Audio State*/ + +/** + * \name Pause audio functions + * + * These functions pause and unpause the audio callback processing. + * They should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); +extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, + int pause_on); +/*@}*//*Pause audio functions*/ + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if \c freesrc is non-zero. For example, to load a WAVE file, + * you could do: + * \code + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + * \endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * \c *audio_buf to a malloc()'d buffer containing the audio data, + * and sets \c *audio_len to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, + int freesrc, + SDL_AudioSpec * spec, + Uint8 ** audio_buf, + Uint32 * audio_len); + +/** + * Loads a WAV from a file. + * Compatibility convenience function. + */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the \c cvt structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * \return -1 if the format conversion is not supported, 0 if there's + * no conversion needed, or 1 if the audio filter is set up. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_format, + Uint8 src_channels, + int src_rate, + SDL_AudioFormat dst_format, + Uint8 dst_channels, + int dst_rate); + +/** + * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), + * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * + * The data conversion may expand the size of the audio data, so the buffer + * \c cvt->buf should be allocated after the \c cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, + Uint32 len, int volume); + +/** + * This works like SDL_MixAudio(), but you specify the audio format instead of + * using the format of audio device 1. Thus it can be used when no audio + * device is open at all. + */ +extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, + const Uint8 * src, + SDL_AudioFormat format, + Uint32 len, int volume); + +/** + * \name Audio lock functions + * + * The lock manipulated by these functions protects the callback function. + * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that + * the callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); +/*@}*//*Audio lock functions*/ + +/** + * This function shuts down audio processing and closes the audio device. + */ +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 +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_compat.h b/Externals/SDL/Include/SDL_compat.h index 109dfb374e..a6d28a0030 100644 --- a/Externals/SDL/Include/SDL_compat.h +++ b/Externals/SDL/Include/SDL_compat.h @@ -20,7 +20,30 @@ slouken@libsdl.org */ -/* This file contains functions for backwards compatibility with SDL 1.2 */ + /** + * \defgroup Compatibility SDL 1.2 Compatibility API + */ +/*@{*/ + +/** + * \file SDL_compat.h + * + * This file contains functions for backwards compatibility with SDL 1.2. + */ + +/** + * \def SDL_NO_COMPAT + * + * #define SDL_NO_COMPAT to prevent SDL_compat.h from being included. + * SDL_NO_COMPAT is intended to make it easier to covert SDL 1.2 code to + * SDL 1.3/2.0. + */ + + /*@}*/ + +#ifdef SDL_NO_COMPAT +#define _SDL_compat_h +#endif #ifndef _SDL_compat_h #define _SDL_compat_h @@ -36,7 +59,16 @@ extern "C" { /* *INDENT-ON* */ #endif -#define SDL_SWSURFACE 0x00000000 /* Not used */ +/** + * \addtogroup Compatibility + */ +/*@{*/ + +/** + * \name Surface flags + */ +/*@{*/ +#define SDL_SWSURFACE 0x00000000 /**< \note Not used */ #define SDL_SRCALPHA 0x00010000 #define SDL_SRCCOLORKEY 0x00020000 #define SDL_ANYFORMAT 0x00100000 @@ -46,10 +78,11 @@ extern "C" { #define SDL_RESIZABLE 0x01000000 #define SDL_NOFRAME 0x02000000 #define SDL_OPENGL 0x04000000 -#define SDL_HWSURFACE 0x08000001 /* Not used */ -#define SDL_ASYNCBLIT 0x08000000 /* Not used */ -#define SDL_RLEACCELOK 0x08000000 /* Not used */ -#define SDL_HWACCEL 0x08000000 /* Not used */ +#define SDL_HWSURFACE 0x08000001 /**< \note Not used */ +#define SDL_ASYNCBLIT 0x08000000 /**< \note Not used */ +#define SDL_RLEACCELOK 0x08000000 /**< \note Not used */ +#define SDL_HWACCEL 0x08000000 /**< \note Not used */ +/*@}*//*Surface flags*/ #define SDL_APPMOUSEFOCUS 0x01 #define SDL_APPINPUTFOCUS 0x02 @@ -93,35 +126,51 @@ typedef struct SDL_VideoInfo int current_h; } SDL_VideoInfo; -/* The most common video overlay formats. - For an explanation of these pixel formats, see: - http://www.webartz.com/fourcc/indexyuv.htm - - For information on the relationship between color spaces, see: - http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html +/** + * \name Overlay formats + * + * The most common video overlay formats. + * + * For an explanation of these pixel formats, see: + * http://www.webartz.com/fourcc/indexyuv.htm + * + * For information on the relationship between color spaces, see: + * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html */ -#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */ -#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */ -#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ -#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ -#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ +/*@{*/ +#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ +#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ +#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ +#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ +#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ +/*@}*//*Overlay formats*/ -/* The YUV hardware video overlay */ +/** + * The YUV hardware video overlay. + */ typedef struct SDL_Overlay { - Uint32 format; /* Read-only */ - int w, h; /* Read-only */ - int planes; /* Read-only */ - Uint16 *pitches; /* Read-only */ - Uint8 **pixels; /* Read-write */ + Uint32 format; /**< Read-only */ + int w, h; /**< Read-only */ + int planes; /**< Read-only */ + Uint16 *pitches; /**< Read-only */ + Uint8 **pixels; /**< Read-write */ - /* Hardware-specific surface info */ + /** + * \name Hardware-specific surface info + */ + /*@{*/ struct private_yuvhwfuncs *hwfuncs; struct private_yuvhwdata *hwdata; + /*@}*//*Hardware-specific surface info*/ - /* Special flags */ - Uint32 hw_overlay:1; /* Flag: This overlay hardware accelerated? */ + /** + * \name Special flags + */ + /*@{*/ + Uint32 hw_overlay:1; /**< Flag: This overlay hardware accelerated? */ Uint32 UnusedBits:31; + /*@}*//*Special flags*/ } SDL_Overlay; typedef enum @@ -133,9 +182,17 @@ typedef enum struct SDL_SysWMinfo; -/* Obsolete or renamed key codes */ +/** + * \name Obsolete or renamed key codes + */ +/*@{*/ -/* These key constants were renamed for clarity or consistency. */ +/** + * \name Renamed keys + * + * These key constants were renamed for clarity or consistency. + */ +/*@{*/ #define SDLK_0 '0' #define SDLK_1 '1' #define SDLK_2 '2' @@ -204,19 +261,35 @@ struct SDL_SysWMinfo; #define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR #define SDLK_SCROLLOCK SDLK_SCROLLLOCK #define SDLK_PRINT SDLK_PRINTSCREEN +/*@}*//*Renamed keys*/ -/* The META modifier is equivalent to the GUI modifier from the USB standard */ +/** + * \name META modifier + * + * The META modifier is equivalent to the GUI modifier from the USB standard. + */ +/*@{*/ #define KMOD_LMETA KMOD_LGUI #define KMOD_RMETA KMOD_RGUI #define KMOD_META KMOD_GUI +/*@}*//*META modifier*/ -/* These keys don't appear in the USB specification (or at least not under those names). I'm unsure if the following assignments make sense or if these codes should be defined as actual additional SDLK_ constants. */ +/** + * \name Not in USB + * + * These keys don't appear in the USB specification (or at least not under + * those names). I'm unsure if the following assignments make sense or if these + * codes should be defined as actual additional SDLK_ constants. + */ +/*@{*/ #define SDLK_LSUPER SDLK_LMETA #define SDLK_RSUPER SDLK_RMETA #define SDLK_COMPOSE SDLK_APPLICATION #define SDLK_BREAK SDLK_STOP #define SDLK_EURO SDLK_2 +/*@}*//*Not in USB*/ +/*@}*//*Obsolete or renamed key codes*/ #define SDL_SetModuleHandle(x) #define SDL_AllocSurface SDL_CreateRGBSurface @@ -277,6 +350,8 @@ extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); +/*@}*//*Compatibility*/ + /* Ends C function definitions when using C++ */ #ifdef __cplusplus /* *INDENT-OFF* */ diff --git a/Externals/SDL/Include/SDL_config.h b/Externals/SDL/Include/SDL_config.h index d72d7e585e..327c49810a 100644 --- a/Externals/SDL/Include/SDL_config.h +++ b/Externals/SDL/Include/SDL_config.h @@ -1,45 +1,197 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/* Add any platform that doesn't build using the configure system */ -#if defined(__NINTENDODS__) -#include "SDL_config_nintendods.h" -#elif defined(__DREAMCAST__) -#include "SDL_config_dreamcast.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__WIN32__) -#include "SDL_config_win32.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#endif /* _SDL_config_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_win32_h +#define _SDL_config_win32_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif +#define SDL_HAS_64BIT_TYPE 1 + +/* Enabled for SDL 1.2 (binary compatibility) */ +//#define HAVE_LIBC 1 +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#ifndef _WIN32_WCE +#define HAVE_SIGNAL_H 1 +#endif + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#ifndef _WIN32_WCE +#define SDL_AUDIO_DRIVER_DSOUND 1 +#endif +#define SDL_AUDIO_DRIVER_WINWAVEOUT 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#ifdef _WIN32_WCE +#define SDL_JOYSTICK_DISABLED 1 +#define SDL_HAPTIC_DUMMY 1 +#else +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_HAPTIC_DINPUT 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WIN32 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WIN32 1 + +/* Enable various timer systems */ +#ifdef _WIN32_WCE +#define SDL_TIMER_WINCE 1 +#else +#define SDL_TIMER_WIN32 1 +#endif + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WIN32 1 + +#define SDL_VIDEO_RENDER_D3D 1 +#define SDL_VIDEO_RENDER_GDI 1 + +/* Enable OpenGL support */ +#ifndef _WIN32_WCE +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_win32_h */ diff --git a/Externals/SDL/Include/SDL_config.h.default b/Externals/SDL/Include/SDL_config.h.default index d72d7e585e..c0120728dc 100644 --- a/Externals/SDL/Include/SDL_config.h.default +++ b/Externals/SDL/Include/SDL_config.h.default @@ -1,45 +1,47 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/* Add any platform that doesn't build using the configure system */ -#if defined(__NINTENDODS__) -#include "SDL_config_nintendods.h" -#elif defined(__DREAMCAST__) -#include "SDL_config_dreamcast.h" -#elif defined(__IPHONEOS__) -#include "SDL_config_iphoneos.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__WIN32__) -#include "SDL_config_win32.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#endif /* _SDL_config_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/** + * \file SDL_config.h.default + * + * SDL_config.h for any platform that doesn't build using the configure system. + */ + +/* Add any platform that doesn't build using the configure system. */ +#if defined(__NINTENDODS__) +#include "SDL_config_nintendods.h" +#elif defined(__IPHONEOS__) +#include "SDL_config_iphoneos.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__WIN32__) +#include "SDL_config_win32.h" +#else +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#endif /* _SDL_config_h */ diff --git a/Externals/SDL/Include/SDL_config.h.in b/Externals/SDL/Include/SDL_config.h.in index 88a1f11c8c..b0f5c76f95 100644 --- a/Externals/SDL/Include/SDL_config.h.in +++ b/Externals/SDL/Include/SDL_config.h.in @@ -1,327 +1,308 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -/* Make sure that this isn't included by Visual C++ */ -#ifdef _MSC_VER -#error You should copy include/SDL_config.h.default to include/SDL_config.h -#endif - -/* C language features */ -#undef const -#undef inline -#undef volatile - -/* C datatypes */ -#undef size_t -#undef int8_t -#undef uint8_t -#undef int16_t -#undef uint16_t -#undef int32_t -#undef uint32_t -#undef int64_t -#undef uint64_t -#undef uintptr_t -#undef SDL_HAS_64BIT_TYPE - -/* Endianness */ -#undef SDL_BYTEORDER - -/* Comment this if you want to build without any C library requirements */ -#undef HAVE_LIBC -#if HAVE_LIBC - -/* Useful headers */ -#undef HAVE_ALLOCA_H -#undef HAVE_SYS_TYPES_H -#undef HAVE_STDIO_H -#undef STDC_HEADERS -#undef HAVE_STDLIB_H -#undef HAVE_STDARG_H -#undef HAVE_MALLOC_H -#undef HAVE_MEMORY_H -#undef HAVE_STRING_H -#undef HAVE_STRINGS_H -#undef HAVE_INTTYPES_H -#undef HAVE_STDINT_H -#undef HAVE_CTYPE_H -#undef HAVE_MATH_H -#undef HAVE_ICONV_H -#undef HAVE_SIGNAL_H -#undef HAVE_ALTIVEC_H - -/* C library functions */ -#undef HAVE_MALLOC -#undef HAVE_CALLOC -#undef HAVE_REALLOC -#undef HAVE_FREE -#undef HAVE_ALLOCA -#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ -#undef HAVE_GETENV -#undef HAVE_PUTENV -#undef HAVE_UNSETENV -#endif -#undef HAVE_QSORT -#undef HAVE_ABS -#undef HAVE_BCOPY -#undef HAVE_MEMSET -#undef HAVE_MEMCPY -#undef HAVE_MEMMOVE -#undef HAVE_MEMCMP -#undef HAVE_STRLEN -#undef HAVE_STRLCPY -#undef HAVE_STRLCAT -#undef HAVE_STRDUP -#undef HAVE__STRREV -#undef HAVE__STRUPR -#undef HAVE__STRLWR -#undef HAVE_INDEX -#undef HAVE_RINDEX -#undef HAVE_STRCHR -#undef HAVE_STRRCHR -#undef HAVE_STRSTR -#undef HAVE_ITOA -#undef HAVE__LTOA -#undef HAVE__UITOA -#undef HAVE__ULTOA -#undef HAVE_STRTOL -#undef HAVE_STRTOUL -#undef HAVE__I64TOA -#undef HAVE__UI64TOA -#undef HAVE_STRTOLL -#undef HAVE_STRTOULL -#undef HAVE_STRTOD -#undef HAVE_ATOI -#undef HAVE_ATOF -#undef HAVE_STRCMP -#undef HAVE_STRNCMP -#undef HAVE__STRICMP -#undef HAVE_STRCASECMP -#undef HAVE__STRNICMP -#undef HAVE_STRNCASECMP -#undef HAVE_SSCANF -#undef HAVE_SNPRINTF -#undef HAVE_VSNPRINTF -#undef HAVE_M_PI -#undef HAVE_CEIL -#undef HAVE_COPYSIGN -#undef HAVE_COS -#undef HAVE_COSF -#undef HAVE_FABS -#undef HAVE_FLOOR -#undef HAVE_LOG -#undef HAVE_POW -#undef HAVE_SCALBN -#undef HAVE_SIN -#undef HAVE_SINF -#undef HAVE_SQRT -#undef HAVE_SIGACTION -#undef HAVE_SETJMP -#undef HAVE_NANOSLEEP -#undef HAVE_CLOCK_GETTIME -#undef HAVE_DLVSYM -#undef HAVE_GETPAGESIZE - -#else -/* We may need some replacement for stdarg.h here */ -#include -#endif /* HAVE_LIBC */ - -/* Allow disabling of core subsystems */ -#undef SDL_AUDIO_DISABLED -#undef SDL_CDROM_DISABLED -#undef SDL_CPUINFO_DISABLED -#undef SDL_EVENTS_DISABLED -#undef SDL_FILE_DISABLED -#undef SDL_JOYSTICK_DISABLED -#undef SDL_HAPTIC_DISABLED -#undef SDL_LOADSO_DISABLED -#undef SDL_THREADS_DISABLED -#undef SDL_TIMERS_DISABLED -#undef SDL_VIDEO_DISABLED - -/* Enable various audio drivers */ -#undef SDL_AUDIO_DRIVER_ALSA -#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC -#undef SDL_AUDIO_DRIVER_ARTS -#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC -#undef SDL_AUDIO_DRIVER_PULSEAUDIO -#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC -#undef SDL_AUDIO_DRIVER_BEOSAUDIO -#undef SDL_AUDIO_DRIVER_BSD -#undef SDL_AUDIO_DRIVER_COREAUDIO -#undef SDL_AUDIO_DRIVER_DART -#undef SDL_AUDIO_DRIVER_DC -#undef SDL_AUDIO_DRIVER_DISK -#undef SDL_AUDIO_DRIVER_DUMMY -#undef SDL_AUDIO_DRIVER_DMEDIA -#undef SDL_AUDIO_DRIVER_DSOUND -#undef SDL_AUDIO_DRIVER_ESD -#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#undef SDL_AUDIO_DRIVER_MINT -#undef SDL_AUDIO_DRIVER_MMEAUDIO -#undef SDL_AUDIO_DRIVER_NAS -#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC -#undef SDL_AUDIO_DRIVER_NDS -#undef SDL_AUDIO_DRIVER_OSS -#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H -#undef SDL_AUDIO_DRIVER_PAUDIO -#undef SDL_AUDIO_DRIVER_QNXNTO -#undef SDL_AUDIO_DRIVER_SNDMGR -#undef SDL_AUDIO_DRIVER_SUNAUDIO -#undef SDL_AUDIO_DRIVER_WINWAVEOUT -#undef SDL_AUDIO_DRIVER_FUSIONSOUND -#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC - -/* Enable various cdrom drivers */ -#undef SDL_CDROM_AIX -#undef SDL_CDROM_BEOS -#undef SDL_CDROM_BSDI -#undef SDL_CDROM_DC -#undef SDL_CDROM_DUMMY -#undef SDL_CDROM_FREEBSD -#undef SDL_CDROM_LINUX -#undef SDL_CDROM_MACOSX -#undef SDL_CDROM_MINT -#undef SDL_CDROM_OPENBSD -#undef SDL_CDROM_OS2 -#undef SDL_CDROM_OSF -#undef SDL_CDROM_QNX -#undef SDL_CDROM_WIN32 - -/* Enable various input drivers */ -#undef SDL_INPUT_LINUXEV -#undef SDL_INPUT_TSLIB -#undef SDL_JOYSTICK_BEOS -#undef SDL_JOYSTICK_DC -#undef SDL_JOYSTICK_DINPUT -#undef SDL_JOYSTICK_DUMMY -#undef SDL_JOYSTICK_IOKIT -#undef SDL_JOYSTICK_LINUX -#undef SDL_JOYSTICK_MINT -#undef SDL_JOYSTICK_NDS -#undef SDL_JOYSTICK_OS2 -#undef SDL_JOYSTICK_RISCOS -#undef SDL_JOYSTICK_WINMM -#undef SDL_JOYSTICK_USBHID -#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H -#undef SDL_HAPTIC_DUMMY -#undef SDL_HAPTIC_LINUX -#undef SDL_HAPTIC_IOKIT -#undef SDL_HAPTIC_DINPUT - -/* Enable various shared object loading systems */ -#undef SDL_LOADSO_BEOS -#undef SDL_LOADSO_DLCOMPAT -#undef SDL_LOADSO_DLOPEN -#undef SDL_LOADSO_DUMMY -#undef SDL_LOADSO_LDG -#undef SDL_LOADSO_OS2 -#undef SDL_LOADSO_WIN32 - -/* Enable various threading systems */ -#undef SDL_THREAD_BEOS -#undef SDL_THREAD_DC -#undef SDL_THREAD_NDS -#undef SDL_THREAD_OS2 -#undef SDL_THREAD_PTH -#undef SDL_THREAD_PTHREAD -#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX -#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP -#undef SDL_THREAD_SPROC -#undef SDL_THREAD_WIN32 - -/* Enable various timer systems */ -#undef SDL_TIMER_BEOS -#undef SDL_TIMER_DC -#undef SDL_TIMER_DUMMY -#undef SDL_TIMER_MINT -#undef SDL_TIMER_NDS -#undef SDL_TIMER_OS2 -#undef SDL_TIMER_RISCOS -#undef SDL_TIMER_UNIX -#undef SDL_TIMER_WIN32 -#undef SDL_TIMER_WINCE - -/* Enable various video drivers */ -#undef SDL_VIDEO_DRIVER_BWINDOW -#undef SDL_VIDEO_DRIVER_COCOA -#undef SDL_VIDEO_DRIVER_DC -#undef SDL_VIDEO_DRIVER_DIRECTFB -#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC -#undef SDL_VIDEO_DRIVER_DUMMY -#undef SDL_VIDEO_DRIVER_FBCON -#undef SDL_VIDEO_DRIVER_GAPI -#undef SDL_VIDEO_DRIVER_GEM -#undef SDL_VIDEO_DRIVER_IPOD -#undef SDL_VIDEO_DRIVER_NANOX -#undef SDL_VIDEO_DRIVER_NDS -#undef SDL_VIDEO_DRIVER_OS2FS -#undef SDL_VIDEO_DRIVER_PHOTON -#undef SDL_VIDEO_DRIVER_PS2GS -#undef SDL_VIDEO_DRIVER_RISCOS -#undef SDL_VIDEO_DRIVER_SVGALIB -#undef SDL_VIDEO_DRIVER_VGL -#undef SDL_VIDEO_DRIVER_WIN32 -#undef SDL_VIDEO_DRIVER_WSCONS -#undef SDL_VIDEO_DRIVER_X11 -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS -#undef SDL_VIDEO_DRIVER_X11_VIDMODE -#undef SDL_VIDEO_DRIVER_X11_XINERAMA -#undef SDL_VIDEO_DRIVER_X11_XRANDR -#undef SDL_VIDEO_DRIVER_X11_XINPUT -#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER -#undef SDL_VIDEO_DRIVER_X11_XV -#undef SDL_VIDEO_DRIVER_XBIOS - -#undef SDL_VIDEO_RENDER_D3D -#undef SDL_VIDEO_RENDER_GDI -#undef SDL_VIDEO_RENDER_OGL -#undef SDL_VIDEO_RENDER_X11 - -/* Enable OpenGL support */ -#undef SDL_VIDEO_OPENGL -#undef SDL_VIDEO_OPENGL_BGL -#undef SDL_VIDEO_OPENGL_CGL -#undef SDL_VIDEO_OPENGL_GLX -#undef SDL_VIDEO_OPENGL_WGL -#undef SDL_VIDEO_OPENGL_OSMESA -#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC - -/* Enable assembly routines */ -#undef SDL_ASSEMBLY_ROUTINES -#undef SDL_ALTIVEC_BLITTERS - -#endif /* _SDL_config_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* Make sure that this isn't included by Visual C++ */ +#ifdef _MSC_VER +#error You should copy include/SDL_config.h.default to include/SDL_config.h +#endif + +/* C language features */ +#undef const +#undef inline +#undef volatile + +/* C datatypes */ +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#undef size_t +#undef int8_t +#undef uint8_t +#undef int16_t +#undef uint16_t +#undef int32_t +#undef uint32_t +#undef int64_t +#undef uint64_t +#undef uintptr_t +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#undef SIZEOF_VOIDP +#undef SDL_HAS_64BIT_TYPE + +/* Comment this if you want to build without any C library requirements */ +#undef HAVE_LIBC +#if HAVE_LIBC + +/* Useful headers */ +#undef HAVE_ALLOCA_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_STDIO_H +#undef STDC_HEADERS +#undef HAVE_STDLIB_H +#undef HAVE_STDARG_H +#undef HAVE_MALLOC_H +#undef HAVE_MEMORY_H +#undef HAVE_STRING_H +#undef HAVE_STRINGS_H +#undef HAVE_INTTYPES_H +#undef HAVE_STDINT_H +#undef HAVE_CTYPE_H +#undef HAVE_MATH_H +#undef HAVE_ICONV_H +#undef HAVE_SIGNAL_H +#undef HAVE_ALTIVEC_H + +/* C library functions */ +#undef HAVE_MALLOC +#undef HAVE_CALLOC +#undef HAVE_REALLOC +#undef HAVE_FREE +#undef HAVE_ALLOCA +#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ +#undef HAVE_GETENV +#undef HAVE_PUTENV +#undef HAVE_UNSETENV +#endif +#undef HAVE_QSORT +#undef HAVE_ABS +#undef HAVE_BCOPY +#undef HAVE_MEMSET +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMCMP +#undef HAVE_STRLEN +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#undef HAVE_STRDUP +#undef HAVE__STRREV +#undef HAVE__STRUPR +#undef HAVE__STRLWR +#undef HAVE_INDEX +#undef HAVE_RINDEX +#undef HAVE_STRCHR +#undef HAVE_STRRCHR +#undef HAVE_STRSTR +#undef HAVE_ITOA +#undef HAVE__LTOA +#undef HAVE__UITOA +#undef HAVE__ULTOA +#undef HAVE_STRTOL +#undef HAVE_STRTOUL +#undef HAVE__I64TOA +#undef HAVE__UI64TOA +#undef HAVE_STRTOLL +#undef HAVE_STRTOULL +#undef HAVE_STRTOD +#undef HAVE_ATOI +#undef HAVE_ATOF +#undef HAVE_STRCMP +#undef HAVE_STRNCMP +#undef HAVE__STRICMP +#undef HAVE_STRCASECMP +#undef HAVE__STRNICMP +#undef HAVE_STRNCASECMP +#undef HAVE_SSCANF +#undef HAVE_SNPRINTF +#undef HAVE_VSNPRINTF +#undef HAVE_M_PI +#undef HAVE_CEIL +#undef HAVE_COPYSIGN +#undef HAVE_COS +#undef HAVE_COSF +#undef HAVE_FABS +#undef HAVE_FLOOR +#undef HAVE_LOG +#undef HAVE_POW +#undef HAVE_SCALBN +#undef HAVE_SIN +#undef HAVE_SINF +#undef HAVE_SQRT +#undef HAVE_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_CLOCK_GETTIME +#undef HAVE_GETPAGESIZE +#undef HAVE_MPROTECT + +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* Allow disabling of core subsystems */ +#undef SDL_AUDIO_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_HAPTIC_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED +#undef SDL_POWER_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_PULSEAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_BEOSAUDIO +#undef SDL_AUDIO_DRIVER_BSD +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DUMMY +#undef SDL_AUDIO_DRIVER_DMEDIA +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_MMEAUDIO +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_NDS +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +#undef SDL_AUDIO_DRIVER_PAUDIO +#undef SDL_AUDIO_DRIVER_QSA +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WINWAVEOUT +#undef SDL_AUDIO_DRIVER_FUSIONSOUND +#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC + +/* Enable various input drivers */ +#undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_TSLIB +#undef SDL_JOYSTICK_BEOS +#undef SDL_JOYSTICK_DINPUT +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_NDS +#undef SDL_JOYSTICK_RISCOS +#undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_USBHID +#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_HAPTIC_DUMMY +#undef SDL_HAPTIC_LINUX +#undef SDL_HAPTIC_IOKIT +#undef SDL_HAPTIC_DINPUT + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_BEOS +#undef SDL_LOADSO_DLCOMPAT +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_DUMMY +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_WIN32 + +/* Enable various threading systems */ +#undef SDL_THREAD_BEOS +#undef SDL_THREAD_NDS +#undef SDL_THREAD_PTH +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_SPROC +#undef SDL_THREAD_WIN32 + +/* Enable various timer systems */ +#undef SDL_TIMER_BEOS +#undef SDL_TIMER_DUMMY +#undef SDL_TIMER_NDS +#undef SDL_TIMER_RISCOS +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WIN32 +#undef SDL_TIMER_WINCE + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_BWINDOW +#undef SDL_VIDEO_DRIVER_COCOA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_FBCON +#undef SDL_VIDEO_DRIVER_NDS +#undef SDL_VIDEO_DRIVER_PHOTON +#undef SDL_VIDEO_DRIVER_QNXGF +#undef SDL_VIDEO_DRIVER_PS2GS +#undef SDL_VIDEO_DRIVER_PS3 +#undef SDL_VIDEO_DRIVER_RISCOS +#undef SDL_VIDEO_DRIVER_SVGALIB +#undef SDL_VIDEO_DRIVER_WIN32 +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS +#undef SDL_VIDEO_DRIVER_X11_VIDMODE +#undef SDL_VIDEO_DRIVER_X11_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_XRANDR +#undef SDL_VIDEO_DRIVER_X11_XINPUT +#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER +#undef SDL_VIDEO_DRIVER_X11_XV + +#undef SDL_VIDEO_RENDER_D3D +#undef SDL_VIDEO_RENDER_GDI +#undef SDL_VIDEO_RENDER_OGL +#undef SDL_VIDEO_RENDER_OGL_ES +#undef SDL_VIDEO_RENDER_X11 +#undef SDL_VIDEO_RENDER_GAPI +#undef SDL_VIDEO_RENDER_DDRAW + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_ES +#undef SDL_VIDEO_OPENGL_BGL +#undef SDL_VIDEO_OPENGL_CGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Enable system power support */ +#undef SDL_POWER_LINUX +#undef SDL_POWER_WINDOWS +#undef SDL_POWER_MACOSX +#undef SDL_POWER_BEOS +#undef SDL_POWER_NINTENDODS +#undef SDL_POWER_HARDWIRED + +/* Enable assembly routines */ +#undef SDL_ASSEMBLY_ROUTINES +#undef SDL_ALTIVEC_BLITTERS + +#endif /* _SDL_config_h */ diff --git a/Externals/SDL/Include/SDL_config_iphoneos.h b/Externals/SDL/Include/SDL_config_iphoneos.h index 928976ac93..0c3c763d7c 100644 --- a/Externals/SDL/Include/SDL_config_iphoneos.h +++ b/Externals/SDL/Include/SDL_config_iphoneos.h @@ -25,6 +25,7 @@ #include "SDL_platform.h" +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -32,6 +33,14 @@ typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long uintptr_t; +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + #define SDL_HAS_64BIT_TYPE 1 #define HAVE_ALLOCA_H 1 @@ -82,6 +91,18 @@ typedef unsigned long uintptr_t; #define HAVE_SSCANF 1 #define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 #define HAVE_SIGACTION 1 #define HAVE_SETJMP 1 #define HAVE_NANOSLEEP 1 @@ -91,9 +112,6 @@ typedef unsigned long uintptr_t; /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ #define SDL_AUDIO_DRIVER_DUMMY 1 -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ #define SDL_HAPTIC_DISABLED 1 @@ -119,6 +137,9 @@ typedef unsigned long uintptr_t; #define SDL_VIDEO_OPENGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES 1 +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 + /* enable iPhone keyboard support */ #define SDL_IPHONE_KEYBOARD 1 diff --git a/Externals/SDL/Include/SDL_config_macosx.h b/Externals/SDL/Include/SDL_config_macosx.h index c23274e15e..8c57435dc7 100644 --- a/Externals/SDL/Include/SDL_config_macosx.h +++ b/Externals/SDL/Include/SDL_config_macosx.h @@ -1,134 +1,162 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_macosx_h -#define _SDL_config_macosx_h - -#include "SDL_platform.h" - -/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ -#include - -/* This is a set of defines to configure the SDL features */ - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ -#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) -#define HAVE_ALLOCA_H 1 -#endif -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_SNDMGR 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_MACOSX 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 -#define SDL_HAPTIC_IOKIT 1 - -/* Enable various shared object loading systems */ -#ifdef __ppc__ -/* For Mac OS X 10.2 compatibility */ -#define SDL_LOADSO_DLCOMPAT 1 -#else -#define SDL_LOADSO_DLOPEN 1 -#endif - -/* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 - -/* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_COCOA 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_CGL 1 -#define SDL_VIDEO_RENDER_OGL 1 - -/* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 -#ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 -#endif - -#endif /* _SDL_config_macosx_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macosx_h +#define _SDL_config_macosx_h + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ +#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) +#define HAVE_ALLOCA_H 1 +#endif +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_HAPTIC_IOKIT 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_COCOA 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.6.dylib" +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XINPUT 1 +#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1 +#define SDL_VIDEO_DRIVER_X11_XV 1 + +#define SDL_VIDEO_RENDER_OGL 1 +#define SDL_VIDEO_RENDER_X11 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_CGL 1 +#define SDL_VIDEO_OPENGL_GLX 1 + +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* _SDL_config_macosx_h */ diff --git a/Externals/SDL/Include/SDL_config_minimal.h b/Externals/SDL/Include/SDL_config_minimal.h index 1a85667484..382be2b3e6 100644 --- a/Externals/SDL/Include/SDL_config_minimal.h +++ b/Externals/SDL/Include/SDL_config_minimal.h @@ -1,65 +1,68 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_minimal_h -#define _SDL_config_minimal_h - -#include "SDL_platform.h" - -/* This is the minimal configuration that can be used to build SDL */ - -#include - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned int size_t; -typedef unsigned long uintptr_t; - -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ -#define SDL_HAPTIC_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 - -/* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_minimal_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/** + * \file SDL_config_minimal.h + * + * This is the minimal configuration that can be used to build SDL. + */ + +#include + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/Externals/SDL/Include/SDL_config_nintendods.h b/Externals/SDL/Include/SDL_config_nintendods.h index 043ad08efa..c45df85388 100644 --- a/Externals/SDL/Include/SDL_config_nintendods.h +++ b/Externals/SDL/Include/SDL_config_nintendods.h @@ -27,6 +27,7 @@ /* This is a set of defines to configure the SDL features */ +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -43,7 +44,7 @@ typedef unsigned long uintptr_t; #else typedef unsigned __PTRDIFF_TYPE__ uintptr_t; #endif - +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ #define SDL_HAS_64BIT_TYPE 1 @@ -95,9 +96,6 @@ typedef unsigned __PTRDIFF_TYPE__ uintptr_t; #define SDL_AUDIO_DRIVER_NDS 1 /*#define SDL_AUDIO_DRIVER_DUMMY 1 TODO: uncomment this later*/ -/* DS doesn't have optical media */ -#define SDL_CDROM_DISABLED 1 - /* Enable various input drivers */ #define SDL_JOYSTICK_NDS 1 /*#define SDL_JOYSTICK_DUMMY 1 TODO: uncomment this later*/ @@ -116,4 +114,7 @@ typedef unsigned __PTRDIFF_TYPE__ uintptr_t; #define SDL_VIDEO_DRIVER_NDS 1 /*#define SDL_VIDEO_DRIVER_DUMMY 1 TODO: uncomment this later*/ +/* Enable system power support */ +#define SDL_POWER_NINTENDODS 1 + #endif /* _SDL_config_nintendods_h */ diff --git a/Externals/SDL/Include/SDL_config_win32.h b/Externals/SDL/Include/SDL_config_win32.h index 9d0da4dcd8..327c49810a 100644 --- a/Externals/SDL/Include/SDL_config_win32.h +++ b/Externals/SDL/Include/SDL_config_win32.h @@ -1,193 +1,197 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_win32_h -#define _SDL_config_win32_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if defined(__GNUC__) || defined(__DMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Enabled for SDL 1.2 (binary compatibility) */ -//#define HAVE_LIBC 1 -#ifdef HAVE_LIBC -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#ifndef _WIN32_WCE -#define HAVE_SIGNAL_H 1 -#endif - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#define HAVE_M_PI 1 -#define HAVE_CEIL 1 -#define HAVE_COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_FABS 1 -#define HAVE_FLOOR 1 -#define HAVE_LOG 1 -#define HAVE_POW 1 -#define HAVE_SCALBN 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#ifndef _WIN32_WCE -#define SDL_AUDIO_DRIVER_DSOUND 1 -#endif -#define SDL_AUDIO_DRIVER_WINWAVEOUT 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#ifdef _WIN32_WCE -#define SDL_CDROM_DISABLED 1 -#else -#define SDL_CDROM_WIN32 1 -#endif - -/* Enable various input drivers */ -#ifdef _WIN32_WCE -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DUMMY 1 -#else -#define SDL_JOYSTICK_DINPUT 1 -#define SDL_HAPTIC_DINPUT 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WIN32 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WIN32 1 - -/* Enable various timer systems */ -#ifdef _WIN32_WCE -#define SDL_TIMER_WINCE 1 -#else -#define SDL_TIMER_WIN32 1 -#endif - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WIN32 1 - -#define SDL_VIDEO_RENDER_D3D 1 -#define SDL_VIDEO_RENDER_GDI 1 - -/* Enable OpenGL support */ -#ifndef _WIN32_WCE -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_WGL 1 -#define SDL_VIDEO_RENDER_OGL 1 -#endif - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* _SDL_config_win32_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_win32_h +#define _SDL_config_win32_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif +#define SDL_HAS_64BIT_TYPE 1 + +/* Enabled for SDL 1.2 (binary compatibility) */ +//#define HAVE_LIBC 1 +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#ifndef _WIN32_WCE +#define HAVE_SIGNAL_H 1 +#endif + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#ifndef _WIN32_WCE +#define SDL_AUDIO_DRIVER_DSOUND 1 +#endif +#define SDL_AUDIO_DRIVER_WINWAVEOUT 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#ifdef _WIN32_WCE +#define SDL_JOYSTICK_DISABLED 1 +#define SDL_HAPTIC_DUMMY 1 +#else +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_HAPTIC_DINPUT 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WIN32 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WIN32 1 + +/* Enable various timer systems */ +#ifdef _WIN32_WCE +#define SDL_TIMER_WINCE 1 +#else +#define SDL_TIMER_WIN32 1 +#endif + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WIN32 1 + +#define SDL_VIDEO_RENDER_D3D 1 +#define SDL_VIDEO_RENDER_GDI 1 + +/* Enable OpenGL support */ +#ifndef _WIN32_WCE +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_win32_h */ diff --git a/Externals/SDL/Include/SDL_copying.h b/Externals/SDL/Include/SDL_copying.h index 419598f7e3..a5623c89fa 100644 --- a/Externals/SDL/Include/SDL_copying.h +++ b/Externals/SDL/Include/SDL_copying.h @@ -1,21 +1,21 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ diff --git a/Externals/SDL/Include/SDL_cpuinfo.h b/Externals/SDL/Include/SDL_cpuinfo.h index fe4193eba9..ee28963623 100644 --- a/Externals/SDL/Include/SDL_cpuinfo.h +++ b/Externals/SDL/Include/SDL_cpuinfo.h @@ -1,84 +1,92 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_cpuinfo.h - * - * CPU feature detection for SDL - */ - -#ifndef _SDL_cpuinfo_h -#define _SDL_cpuinfo_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* This function returns true if the CPU has the RDTSC instruction - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); - -/* This function returns true if the CPU has MMX features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); - -/* This function returns true if the CPU has MMX Ext. features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); - -/* This function returns true if the CPU has 3DNow features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); - -/* This function returns true if the CPU has 3DNow! Ext. features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); - -/* This function returns true if the CPU has SSE features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); - -/* This function returns true if the CPU has SSE2 features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); - -/* This function returns true if the CPU has AltiVec features - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_cpuinfo_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_cpuinfo.h + * + * CPU feature detection for SDL. + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * This function returns true if the CPU has the RDTSC instruction. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** + * This function returns true if the CPU has MMX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** + * This function returns true if the CPU has MMX Ext.\ features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); + +/** + * This function returns true if the CPU has 3DNow!\ features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** + * This function returns true if the CPU has 3DNow!\ Ext.\ features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); + +/** + * This function returns true if the CPU has SSE features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** + * This function returns true if the CPU has SSE2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** + * This function returns true if the CPU has AltiVec features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_endian.h b/Externals/SDL/Include/SDL_endian.h index db06dafd8f..cd94fce3ab 100644 --- a/Externals/SDL/Include/SDL_endian.h +++ b/Externals/SDL/Include/SDL_endian.h @@ -1,240 +1,253 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_endian.h - * - * Functions for reading and writing endian-specific values - */ - -#ifndef _SDL_endian_h -#define _SDL_endian_h - -#include "SDL_stdinc.h" - -/* The two types of endianness */ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 - -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ - (defined(__MIPS__) && defined(__MISPEB__)) || \ - defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ - defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN -#else -#define SDL_BYTEORDER SDL_LIL_ENDIAN -#endif -#endif /* !SDL_BYTEORDER */ - - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* Use inline functions for compilers that support them, and static - functions for those that do not. Because these functions become - static for compilers that do not support inline functions, this - header should only be included in files that actually use them. -*/ -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) -static __inline__ Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint16 -SDL_Swap16(Uint16 x) -{ - Uint16 result; - - __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); - return result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) -static __inline__ Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#else -static __inline__ Uint16 -SDL_Swap16(Uint16 x) -{ - return ((x << 8) | (x >> 8)); -} -#endif - -#if defined(__GNUC__) && defined(__i386__) -static __inline__ Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswap %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("bswapl %0": "=r"(x):"0"(x)); - return x; -} -#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint32 -SDL_Swap32(Uint32 x) -{ - Uint32 result; - - __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); - __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); - __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); - return result; -} -#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) -static __inline__ Uint32 -SDL_Swap32(Uint32 x) -{ - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} -#else -static __inline__ Uint32 -SDL_Swap32(Uint32 x) -{ - return ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | - (x >> 24)); -} -#endif - -#ifdef SDL_HAS_64BIT_TYPE -#if defined(__GNUC__) && defined(__i386__) -static __inline__ Uint64 -SDL_Swap64(Uint64 x) -{ - union - { - struct - { - Uint32 a, b; - } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), - "1"(v.s. - b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint64 -SDL_Swap64(Uint64 x) -{ - __asm__("bswapq %0": "=r"(x):"0"(x)); - return x; -} -#else -static __inline__ Uint64 -SDL_Swap64(Uint64 x) -{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = (Uint32) (x & 0xFFFFFFFF); - x >>= 32; - hi = (Uint32) (x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -} -#endif -#else -/* This is mainly to keep compilers from complaining in SDL code. - If there is no real 64-bit datatype, then compilers will complain about - the fake 64-bit datatype that SDL provides when it compiles user code. -*/ -#define SDL_Swap64(X) (X) -#endif /* SDL_HAS_64BIT_TYPE */ - - -static __inline__ float -SDL_SwapFloat(float x) -{ - union - { - float f; - Uint32 ui32; - } swapper; - swapper.f = x; - swapper.ui32 = SDL_Swap32(swapper.ui32); - return swapper.f; -} - - -/* Byteswap item from the specified endianness to the native endianness */ -#if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapFloatLE(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) -#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) -#else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) -#define SDL_SwapFloatBE(X) (X) -#endif - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_endian_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_endian.h + * + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** + * \name The two types of endianness + */ +/*@{*/ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/*@}*/ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \file SDL_endian.h + * + * Uses inline functions for compilers that support them, and static + * functions for those that do not. Because these functions become + * static for compilers that do not support inline functions, this + * header should only be included in files that actually use them. + */ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) +static __inline__ Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint16 +SDL_Swap16(Uint16 x) +{ + Uint16 result; + + __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#else +static __inline__ Uint16 +SDL_Swap16(Uint16 x) +{ + return ((x << 8) | (x >> 8)); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +static __inline__ Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint32 +SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); + __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); + __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#else +static __inline__ Uint32 +SDL_Swap32(Uint32 x) +{ + return ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | + (x >> 24)); +} +#endif + +#ifdef SDL_HAS_64BIT_TYPE +#if defined(__GNUC__) && defined(__i386__) +static __inline__ Uint64 +SDL_Swap64(Uint64 x) +{ + union + { + struct + { + Uint32 a, b; + } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), + "1"(v.s. + b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint64 +SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0": "=r"(x):"0"(x)); + return x; +} +#else +static __inline__ Uint64 +SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return (x); +} +#endif +#else +/** + * This is mainly to keep compilers from complaining in SDL code. + * If there is no real 64-bit datatype, then compilers will complain about + * the fake 64-bit datatype that SDL provides when it compiles user code. + */ +#define SDL_Swap64(X) (X) +#endif /* SDL_HAS_64BIT_TYPE */ + + +static __inline__ float +SDL_SwapFloat(float x) +{ + union + { + float f; + Uint32 ui32; + } swapper; + swapper.f = x; + swapper.ui32 = SDL_Swap32(swapper.ui32); + return swapper.f; +} + + +/** + * \name Swap to native + * Byteswap item from the specified endianness to the native endianness. + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapFloatLE(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#define SDL_SwapFloatBE(X) (X) +#endif +/*@}*//*Swap to native*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_error.h b/Externals/SDL/Include/SDL_error.h index 5d54726e22..f1c8b43239 100644 --- a/Externals/SDL/Include/SDL_error.h +++ b/Externals/SDL/Include/SDL_error.h @@ -1,71 +1,78 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_error.h - * Simple error message routines for SDL - */ - -#ifndef _SDL_error_h -#define _SDL_error_h - -#include "SDL_stdinc.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* Public functions */ -extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); -extern DECLSPEC char *SDLCALL SDL_GetError(void); -extern DECLSPEC void SDLCALL SDL_ClearError(void); - -/* Private error message function - used internally */ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -typedef enum -{ - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR -} SDL_errorcode; -extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_error_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_error.h + * + * Simple error message routines for SDL. + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/* Public functions */ +extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC char *SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); + +/** + * \name Internal error functions + * + * \internal + * Private error message function - used internally. + */ +/*@{*/ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +typedef enum +{ + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); +/*@}*//*Internal error functions*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_events.h b/Externals/SDL/Include/SDL_events.h index 13672f2e4a..c45ff1cc7f 100644 --- a/Externals/SDL/Include/SDL_events.h +++ b/Externals/SDL/Include/SDL_events.h @@ -1,486 +1,535 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_events.h - * - * Include file for SDL event handling - */ - -#ifndef _SDL_events_h -#define _SDL_events_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_keyboard.h" -#include "SDL_mouse.h" -#include "SDL_joystick.h" -#include "SDL_quit.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* General keyboard/mouse state definitions */ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 - -/** - * \enum SDL_EventType - * - * \brief The types of events that can be delivered - */ -typedef enum -{ - SDL_NOEVENT = 0, /**< Unused (do not remove) */ - SDL_WINDOWEVENT, /**< Window state change */ - SDL_KEYDOWN, /**< Keys pressed */ - SDL_KEYUP, /**< Keys released */ - SDL_TEXTINPUT, /**< Keyboard text input */ - SDL_MOUSEMOTION, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_MOUSEWHEEL, /**< Mouse wheel motion */ - SDL_JOYAXISMOTION, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_QUIT, /**< User-requested quit */ - SDL_SYSWMEVENT, /**< System specific event */ - SDL_PROXIMITYIN, /**< Proximity In event */ - SDL_PROXIMITYOUT, /**< Proximity Out event */ - SDL_EVENT_RESERVED1, /**< Reserved for future use... */ - SDL_EVENT_RESERVED2, - SDL_EVENT_RESERVED3, - /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ - SDL_USEREVENT = 24, - /* This last event is only for bounding internal arrays - It is the number of bits in the event mask datatype -- Uint32 - */ - SDL_NUMEVENTS = 32 -} SDL_EventType; - -/** - * \enum SDL_EventMask - * - * \brief Predefined event masks - */ -#define SDL_EVENTMASK(X) (1<<(X)) -typedef enum -{ - SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT), - SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), - SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), - SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP), - SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT), - SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), - SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), - SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_MOUSEWHEELMASK = SDL_EVENTMASK(SDL_MOUSEWHEEL), - SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION) | - SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), - SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), - SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), - SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), - SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION) | - SDL_EVENTMASK(SDL_JOYBALLMOTION) | - SDL_EVENTMASK(SDL_JOYHATMOTION) | - SDL_EVENTMASK(SDL_JOYBUTTONDOWN) | SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), - SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT), - SDL_PROXIMITYINMASK = SDL_EVENTMASK(SDL_PROXIMITYIN), - SDL_PROXIMITYOUTMASK = SDL_EVENTMASK(SDL_PROXIMITYOUT) -} SDL_EventMask; -#define SDL_ALLEVENTS 0xFFFFFFFF - -/** - * \struct SDL_WindowEvent - * - * \brief Window state change event data (event.window.*) - */ -typedef struct SDL_WindowEvent -{ - Uint8 type; /**< SDL_WINDOWEVENT */ - Uint8 event; /**< SDL_WindowEventID */ - int data1; /**< event dependent data */ - int data2; /**< event dependent data */ - SDL_WindowID windowID; /**< The associated window */ -} SDL_WindowEvent; - -/** - * \struct SDL_KeyboardEvent - * - * \brief Keyboard button event structure (event.key.*) - */ -typedef struct SDL_KeyboardEvent -{ - Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ - Uint8 which; /**< The keyboard device index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - SDL_keysym keysym; /**< The key that was pressed or released */ - SDL_WindowID windowID; /**< The window with keyboard focus, if any */ -} SDL_KeyboardEvent; - -/** - * \struct SDL_TextInputEvent - * - * \brief Keyboard text input event structure (event.text.*) - */ -#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) -typedef struct SDL_TextInputEvent -{ - Uint8 type; /**< SDL_TEXTINPUT */ - Uint8 which; /**< The keyboard device index */ - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ - SDL_WindowID windowID; /**< The window with keyboard focus, if any */ -} SDL_TextInputEvent; - -/** - * \struct SDL_MouseMotionEvent - * - * \brief Mouse motion event structure (event.motion.*) - */ -typedef struct SDL_MouseMotionEvent -{ - Uint8 type; /**< SDL_MOUSEMOTION */ - Uint8 which; /**< The mouse device index */ - Uint8 state; /**< The current button state */ - int x; /**< X coordinate, relative to window */ - int y; /**< Y coordinate, relative to window */ - int z; /**< Z coordinate, for future use */ - int pressure; /**< Pressure reported by tablets */ - int pressure_max; /**< Maximum value of the pressure reported by the device */ - int pressure_min; /**< Minimum value of the pressure reported by the device */ - int rotation; /**< For future use */ - int tilt; /**< For future use */ - int cursor; /**< The cursor being used in the event */ - int xrel; /**< The relative motion in the X direction */ - int yrel; /**< The relative motion in the Y direction */ - SDL_WindowID windowID; /**< The window with mouse focus, if any */ -} SDL_MouseMotionEvent; - -/** - * \struct SDL_MouseButtonEvent - * - * \brief Mouse button event structure (event.button.*) - */ -typedef struct SDL_MouseButtonEvent -{ - Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ - Uint8 which; /**< The mouse device index */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - int x; /**< X coordinate, relative to window */ - int y; /**< Y coordinate, relative to window */ - SDL_WindowID windowID; /**< The window with mouse focus, if any */ -} SDL_MouseButtonEvent; - -/** - * \struct SDL_MouseWheelEvent - * - * \brief Mouse wheel event structure (event.wheel.*) - */ -typedef struct SDL_MouseWheelEvent -{ - Uint8 type; /**< SDL_MOUSEWHEEL */ - Uint8 which; /**< The mouse device index */ - int x; /**< The amount scrolled horizontally */ - int y; /**< The amount scrolled vertically */ - SDL_WindowID windowID; /**< The window with mouse focus, if any */ -} SDL_MouseWheelEvent; - -/** - * \struct SDL_JoyAxisEvent - * - * \brief Joystick axis motion event structure (event.jaxis.*) - */ -typedef struct SDL_JoyAxisEvent -{ - Uint8 type; /**< SDL_JOYAXISMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 axis; /**< The joystick axis index */ - int value; /**< The axis value (range: -32768 to 32767) */ -} SDL_JoyAxisEvent; - -/** - * \struct SDL_JoyBallEvent - * - * \brief Joystick trackball motion event structure (event.jball.*) - */ -typedef struct SDL_JoyBallEvent -{ - Uint8 type; /**< SDL_JOYBALLMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 ball; /**< The joystick trackball index */ - int xrel; /**< The relative motion in the X direction */ - int yrel; /**< The relative motion in the Y direction */ -} SDL_JoyBallEvent; - -/** - * \struct SDL_JoyHatEvent - * - * \brief Joystick hat position change event structure (event.jhat.*) - */ -typedef struct SDL_JoyHatEvent -{ - Uint8 type; /**< SDL_JOYHATMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value: - SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP - SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT - SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN - Note that zero means the POV is centered. - */ -} SDL_JoyHatEvent; - -/** - * \struct SDL_JoyButtonEvent - * - * \brief Joystick button event structure (event.jbutton.*) - */ -typedef struct SDL_JoyButtonEvent -{ - Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ - Uint8 which; /**< The joystick device index */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ -} SDL_JoyButtonEvent; - -/** - * \struct SDL_QuitEvent - * - * \brief The "quit requested" event - */ -typedef struct SDL_QuitEvent -{ - Uint8 type; /**< SDL_QUIT */ -} SDL_QuitEvent; - -/** - * \struct SDL_UserEvent - * - * \brief A user-defined event type (event.user.*) - */ -typedef struct SDL_UserEvent -{ - Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ - int code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ - SDL_WindowID windowID; /**< The associated window if any*/ -} SDL_UserEvent; - -/** - * \struct SDL_SysWMEvent - * - * \brief A video driver dependent system event (event.syswm.*) - * - * \note If you want to use this event, you should include SDL_syswm.h - */ -struct SDL_SysWMmsg; -typedef struct SDL_SysWMmsg SDL_SysWMmsg; -typedef struct SDL_SysWMEvent -{ - Uint8 type; /**< SDL_SYSWMEVENT */ - SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ -} SDL_SysWMEvent; - -/* Typedefs for backwards compatibility */ -typedef struct SDL_ActiveEvent -{ - Uint8 type; - Uint8 gain; - Uint8 state; -} SDL_ActiveEvent; -typedef struct SDL_ResizeEvent -{ - Uint8 type; - int w; - int h; -} SDL_ResizeEvent; - -typedef struct SDL_ProximityEvent -{ - Uint8 type; - Uint8 which; - int cursor; - int x; - int y; -} SDL_ProximityEvent; - -/** - * \union SDL_Event - * - * \brief General event structure - */ -typedef union SDL_Event -{ - Uint8 type; /**< Event type, shared with all events */ - SDL_WindowEvent window; /**< Window event data */ - SDL_KeyboardEvent key; /**< Keyboard event data */ - SDL_TextInputEvent text; /**< Text input event data */ - SDL_MouseMotionEvent motion; /**< Mouse motion event data */ - SDL_MouseButtonEvent button; /**< Mouse button event data */ - SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ - SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ - SDL_JoyBallEvent jball; /**< Joystick ball event data */ - SDL_JoyHatEvent jhat; /**< Joystick hat event data */ - SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ - SDL_QuitEvent quit; /**< Quit request event data */ - SDL_UserEvent user; /**< Custom event data */ - SDL_SysWMEvent syswm; /**< System dependent window event data */ - SDL_ProximityEvent proximity; /**< Proximity In or Out event */ - - /* Temporarily here for backwards compatibility */ - SDL_ActiveEvent active; - SDL_ResizeEvent resize; -} SDL_Event; - - -/* Function prototypes */ - -/* Pumps the event loop, gathering events from the input devices. - This function updates the event queue and internal input device state. - This should only be run in the thread that sets the video mode. -*/ -extern DECLSPEC void SDLCALL SDL_PumpEvents(void); - -/* Checks the event queue for messages and optionally returns them. - If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to - the back of the event queue. - If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front - of the event queue, matching 'mask', will be returned and will not - be removed from the queue. - If 'action' is SDL_GETEVENT, up to 'numevents' events at the front - of the event queue, matching 'mask', will be returned and will be - removed from the queue. - This function returns the number of events actually stored, or -1 - if there was an error. This function is thread-safe. -*/ -typedef enum -{ - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT -} SDL_eventaction; -/* */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, - SDL_eventaction action, - Uint32 mask); - -/* Checks to see if certain event types are in the event queue. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 mask); - -/* Polls for currently pending events, and returns 1 if there are any pending - events, or 0 if there are none available. If 'event' is not NULL, the next - event is removed from the queue and stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); - -/* Waits indefinitely for the next available event, returning 1, or 0 if there - was an error while waiting for events. If 'event' is not NULL, the next - event is removed from the queue and stored in that area. - */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); - -/* Add an event to the event queue. - This function returns 1 on success, 0 if the event was filtered, - or -1 if the event queue was full or there was some other error. - */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); - -/* - This function sets up a filter to process all events before they - change internal state and are posted to the internal event queue. - - The filter is protypted as: -*/ -typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); -/* - If the filter returns 1, then the event will be added to the internal queue. - If it returns 0, then the event will be dropped from the queue, but the - internal state will still be updated. This allows selective filtering of - dynamically arriving events. - - WARNING: Be very careful of what you do in the event filter function, as - it may run in a different thread! - - There is one caveat when dealing with the SDL_QUITEVENT event type. The - event filter is only called when the window manager desires to close the - application window. If the event filter returns 1, then the window will - be closed, otherwise the window will remain open if possible. - If the quit event is generated by an interrupt signal, it will bypass the - internal queue and be delivered to the application at the next event poll. -*/ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, - void *userdata); - -/* - Return the current event filter - can be used to "chain" filters. - If there is no event filter set, this function returns SDL_FALSE. -*/ -extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, - void **userdata); - -/* - Run the filter function on the current event queue, removing any - events for which the filter returns 0. -*/ -extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, - void *userdata); - -/* - This function allows you to set the state of processing certain events. - If 'state' is set to SDL_IGNORE, that event will be automatically dropped - from the event queue and will not event be filtered. - If 'state' is set to SDL_ENABLE, that event will be processed normally. - If 'state' is set to SDL_QUERY, SDL_EventState() will return the - current processing state of the specified event. -*/ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_events_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_events.h + * + * Include file for SDL event handling. + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_quit.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/* General keyboard/mouse state definitions */ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 + +/** + * \brief The types of events that can be delivered. + */ +typedef enum +{ + SDL_NOEVENT = 0, /**< Unused (do not remove) */ + SDL_WINDOWEVENT, /**< Window state change */ + SDL_KEYDOWN, /**< Keys pressed */ + SDL_KEYUP, /**< Keys released */ + SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ + SDL_TEXTINPUT, /**< Keyboard text input */ + SDL_MOUSEMOTION, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_MOUSEWHEEL, /**< Mouse wheel motion */ + SDL_JOYAXISMOTION, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_QUIT, /**< User-requested quit */ + SDL_SYSWMEVENT, /**< System specific event */ + SDL_PROXIMITYIN, /**< Proximity In event */ + SDL_PROXIMITYOUT, /**< Proximity Out event */ + SDL_EVENT_RESERVED1, /**< Reserved for future use... */ + SDL_EVENT_RESERVED2, /**< Reserved for future use... */ + SDL_EVENT_RESERVED3, /**< Reserved for future use... */ + /** Events ::SDL_USEREVENT through ::SDL_MAXEVENTS-1 are for your use */ + SDL_USEREVENT = 24, + /** + * This last event is only for bounding internal arrays + * It is the number of bits in the event mask datatype -- Uint32 + */ + SDL_NUMEVENTS = 32 +} SDL_EventType; + +/*@{*/ +#define SDL_EVENTMASK(X) (1<<(X)) +/** + * \brief Predefined event masks + */ +typedef enum +{ + SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT), + SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), + SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), + SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP), + SDL_TEXTEDITINGMASK = SDL_EVENTMASK(SDL_TEXTEDITING), + SDL_TEXTINPUTMASK = SDL_EVENTMASK(SDL_TEXTINPUT), + SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), + SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), + SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_MOUSEWHEELMASK = SDL_EVENTMASK(SDL_MOUSEWHEEL), + SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION) | + SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), + SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), + SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), + SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), + SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION) | + SDL_EVENTMASK(SDL_JOYBALLMOTION) | + SDL_EVENTMASK(SDL_JOYHATMOTION) | + SDL_EVENTMASK(SDL_JOYBUTTONDOWN) | SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), + SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT), + SDL_PROXIMITYINMASK = SDL_EVENTMASK(SDL_PROXIMITYIN), + SDL_PROXIMITYOUTMASK = SDL_EVENTMASK(SDL_PROXIMITYOUT) +} SDL_EventMask; +#define SDL_ALLEVENTS 0xFFFFFFFF +/*@}*/ + +/** + * \brief Window state change event data (event.window.*) + */ +typedef struct SDL_WindowEvent +{ + Uint8 type; /**< ::SDL_WINDOWEVENT */ + SDL_WindowID windowID; /**< The associated window */ + Uint8 event; /**< ::SDL_WindowEventID */ + int data1; /**< event dependent data */ + int data2; /**< event dependent data */ +} SDL_WindowEvent; + +/** + * \brief Keyboard button event structure (event.key.*) + */ +typedef struct SDL_KeyboardEvent +{ + Uint8 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + SDL_WindowID windowID; /**< The window with keyboard focus, if any */ + Uint8 which; /**< The keyboard device index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + SDL_keysym keysym; /**< The key that was pressed or released */ +} SDL_KeyboardEvent; + +#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text editing event structure (event.edit.*) + */ +typedef struct SDL_TextEditingEvent +{ + Uint8 type; /**< ::SDL_TEXTEDITING */ + char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ + int start; /**< The start cursor of selected editing text */ + int length; /**< The length of selected editing text */ +} SDL_TextEditingEvent; + + +#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text input event structure (event.text.*) + */ +typedef struct SDL_TextInputEvent +{ + Uint8 type; /**< ::SDL_TEXTINPUT */ + SDL_WindowID windowID; /**< The window with keyboard focus, if any */ + Uint8 which; /**< The keyboard device index */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ +} SDL_TextInputEvent; + +/** + * \brief Mouse motion event structure (event.motion.*) + */ +typedef struct SDL_MouseMotionEvent +{ + Uint8 type; /**< ::SDL_MOUSEMOTION */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + Uint8 which; /**< The mouse device index */ + Uint8 state; /**< The current button state */ + int x; /**< X coordinate, relative to window */ + int y; /**< Y coordinate, relative to window */ + int z; /**< Z coordinate, for future use */ + int pressure; /**< Pressure reported by tablets */ + int pressure_max; /**< Maximum value of the pressure reported by the device */ + int pressure_min; /**< Minimum value of the pressure reported by the device */ + int rotation; /**< For future use */ + int tilt; /**< For future use */ + int cursor; /**< The cursor being used in the event */ + int xrel; /**< The relative motion in the X direction */ + int yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** + * \brief Mouse button event structure (event.button.*) + */ +typedef struct SDL_MouseButtonEvent +{ + Uint8 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + Uint8 which; /**< The mouse device index */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + int x; /**< X coordinate, relative to window */ + int y; /**< Y coordinate, relative to window */ +} SDL_MouseButtonEvent; + +/** + * \brief Mouse wheel event structure (event.wheel.*) + */ +typedef struct SDL_MouseWheelEvent +{ + Uint8 type; /**< ::SDL_MOUSEWHEEL */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + Uint8 which; /**< The mouse device index */ + int x; /**< The amount scrolled horizontally */ + int y; /**< The amount scrolled vertically */ +} SDL_MouseWheelEvent; + +/** + * \brief Joystick axis motion event structure (event.jaxis.*) + */ +typedef struct SDL_JoyAxisEvent +{ + Uint8 type; /**< ::SDL_JOYAXISMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 axis; /**< The joystick axis index */ + int value; /**< The axis value (range: -32768 to 32767) */ +} SDL_JoyAxisEvent; + +/** + * \brief Joystick trackball motion event structure (event.jball.*) + */ +typedef struct SDL_JoyBallEvent +{ + Uint8 type; /**< ::SDL_JOYBALLMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 ball; /**< The joystick trackball index */ + int xrel; /**< The relative motion in the X direction */ + int yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** + * \brief Joystick hat position change event structure (event.jhat.*) + */ +typedef struct SDL_JoyHatEvent +{ + Uint8 type; /**< ::SDL_JOYHATMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value. + * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP + * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT + * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * + * Note that zero means the POV is centered. + */ +} SDL_JoyHatEvent; + +/** + * \brief Joystick button event structure (event.jbutton.*) + */ +typedef struct SDL_JoyButtonEvent +{ + Uint8 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint8 which; /**< The joystick device index */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ +} SDL_JoyButtonEvent; + +/** + * \brief The "quit requested" event + */ +typedef struct SDL_QuitEvent +{ + Uint8 type; /**< ::SDL_QUIT */ +} SDL_QuitEvent; + +/** + * \brief A user-defined event type (event.user.*) + */ +typedef struct SDL_UserEvent +{ + Uint8 type; /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */ + SDL_WindowID windowID; /**< The associated window if any*/ + int code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; + +/** + * \brief A video driver dependent system event (event.syswm.*) + * + * \note If you want to use this event, you should include SDL_syswm.h. + */ +typedef struct SDL_SysWMEvent +{ + Uint8 type; /**< ::SDL_SYSWMEVENT */ + SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ +} SDL_SysWMEvent; + +typedef struct SDL_ProximityEvent +{ + Uint8 type; + SDL_WindowID windowID; /**< The associated window */ + Uint8 which; + int cursor; + int x; + int y; +} SDL_ProximityEvent; + +#ifndef SDL_NO_COMPAT +/** + * \addtogroup Compatibility + */ +/*@{*/ + +/** + * \name Typedefs for backwards compatibility + */ +/*@{*/ +typedef struct SDL_ActiveEvent +{ + Uint8 type; + Uint8 gain; + Uint8 state; +} SDL_ActiveEvent; + +typedef struct SDL_ResizeEvent +{ + Uint8 type; + int w; + int h; +} SDL_ResizeEvent; +/*@}*/ + +/*@}*//*Compatibility*/ +#endif + +/** + * \brief General event structure + */ +typedef union SDL_Event +{ + Uint8 type; /**< Event type, shared with all events */ + SDL_WindowEvent window; /**< Window event data */ + SDL_KeyboardEvent key; /**< Keyboard event data */ + SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_ProximityEvent proximity; /**< Proximity In or Out event */ + + /** Temporarily here for backwards compatibility */ + /*@{*/ +#ifndef SDL_NO_COMPAT + SDL_ActiveEvent active; + SDL_ResizeEvent resize; +#endif + /*@}*/ +} SDL_Event; + + +/* Function prototypes */ + +/** + * Pumps the event loop, gathering events from the input devices. + * + * This function updates the event queue and internal input device state. + * + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +/*@{*/ +typedef enum +{ + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to + * the back of the event queue. + * + * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front + * of the event queue, matching \c mask, will be returned and will not + * be removed from the queue. + * + * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front + * of the event queue, matching \c mask, will be returned and will be + * removed from the queue. + * + * \return The number of events actually stored, or -1 if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, + SDL_eventaction action, + Uint32 mask); +/*@}*/ + +/** + * Checks to see if certain event types are in the event queue. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 mask); + +/** + * \brief Polls for currently pending events. + * + * \return 1 if there are any pending events, or 0 if there are none available. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); + +/** + * \brief Waits indefinitely for the next available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); + +/** + * \brief Waits until the specified timeout (in milliseconds) for the next + * available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, + int timeout); + +/** + * \brief Add an event to the event queue. + * + * \return 1 on success, 0 if the event was filtered, or -1 if the event queue + * was full or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); + +typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); + +/** + * Sets up a filter to process all events before they change internal state and + * are posted to the internal event queue. + * + * The filter is protypted as: + * \code + * int SDL_EventFilter(void *userdata, SDL_Event * event); + * \endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * \warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the ::SDL_QUITEVENT event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, + void *userdata); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns SDL_FALSE. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, + void **userdata); + +/** + * Run the filter function on the current event queue, removing any + * events for which the filter returns 0. + */ +extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, + void *userdata); + +/*@{*/ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 + +/** + * This function allows you to set the state of processing certain events. + * - If \c state is set to ::SDL_IGNORE, that event will be automatically + * dropped from the event queue and will not event be filtered. + * - If \c state is set to ::SDL_ENABLE, that event will be processed + * normally. + * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the + * current processing state of the specified event. + */ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_haptic.h b/Externals/SDL/Include/SDL_haptic.h index 6d748c2d0d..5ad165d45b 100644 --- a/Externals/SDL/Include/SDL_haptic.h +++ b/Externals/SDL/Include/SDL_haptic.h @@ -21,24 +21,23 @@ */ /** - * \file SDL_haptic.h - * - * \brief The SDL Haptic subsystem allows you to control haptic (force feedback) - * devices. - * - * The basic usage is as follows: - * - Initialize the Subsystem (SDL_INIT_HAPTIC). + * \file SDL_haptic.h + * + * \brief The SDL Haptic subsystem allows you to control haptic (force feedback) + * devices. + * + * The basic usage is as follows: + * - Initialize the Subsystem (::SDL_INIT_HAPTIC). * - Open a Haptic Device. - * - SDL_HapticOpen(...) to open from index. - * - SDL_HapticOpenFromJoystick(...) to open from an existing joystick. - * - Create an effect (SDL_HapticEffect). - * - Upload the effect with SDL_HapticNewEffect(...). - * - Run the effect with SDL_HapticRunEffect(...). - * - (optional) Free the effect with SDL_HapticDestroyEffect(...). - * - Close the haptic device with SDL_HapticClose(...). - * - * Example: + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (::SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). * + * \par Example: * \code * int test_haptic( SDL_Joystick * joystick ) { * SDL_Haptic *haptic; @@ -82,7 +81,6 @@ * return 0; // Success * } * \endcode - * * \author Edgar Simo Serra */ @@ -102,190 +100,215 @@ extern "C" { #endif /* __cplusplus */ /** - * \typedef SDL_Haptic - * - * \brief The haptic structure used to identify an SDL haptic. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose + * \typedef SDL_Haptic + * + * \brief The haptic structure used to identify an SDL haptic. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose */ struct _SDL_Haptic; typedef struct _SDL_Haptic SDL_Haptic; -/* - * Different haptic features a device can have. - */ /** - * \def SDL_HAPTIC_CONSTANT - * - * \brief Constant haptic effect. - * - * \sa SDL_HapticCondition + * \name Haptic features + * + * Different haptic features a device can have. */ -#define SDL_HAPTIC_CONSTANT (1<<0) /* Constant effect supported */ +/*@{*/ + /** - * \def SDL_HAPTIC_SINE - * - * \brief Periodic haptic effect that simulates sine waves. - * - * \sa SDL_HapticPeriodic + * \name Haptic effects */ -#define SDL_HAPTIC_SINE (1<<1) /* Sine wave effect supported */ +/*@{*/ + /** - * \def SDL_HAPTIC_SQUARE + * \brief Constant effect supported. * - * \brief Periodic haptic effect that simulates square waves. + * Constant haptic effect. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_CONSTANT (1<<0) + +/** + * \brief Sine wave effect supported. + * + * Periodic haptic effect that simulates sine waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SINE (1<<1) + +/** + * \brief Square wave effect supported. + * + * Periodic haptic effect that simulates square waves. * - * \sa SDL_HapticPeriodic + * \sa SDL_HapticPeriodic */ -#define SDL_HAPTIC_SQUARE (1<<2) /* Square wave effect supported */ +#define SDL_HAPTIC_SQUARE (1<<2) + /** - * \def SDL_HAPTIC_TRIANGLE - * - * \brief Periodic haptic effect that simulates triangular waves. - * - * \sa SDL_HapticPeriodic + * \brief Triangle wave effect supported. + * + * Periodic haptic effect that simulates triangular waves. + * + * \sa SDL_HapticPeriodic */ -#define SDL_HAPTIC_TRIANGLE (1<<3) /* Triangle wave effect supported */ +#define SDL_HAPTIC_TRIANGLE (1<<3) + /** - * \def SDL_HAPTIC_SAWTOOTHUP - * - * \brief Periodic haptic effect that simulates saw tooth up waves. - * - * \sa SDL_HapticPeriodic + * \brief Sawtoothup wave effect supported. + * + * Periodic haptic effect that simulates saw tooth up waves. + * + * \sa SDL_HapticPeriodic */ -#define SDL_HAPTIC_SAWTOOTHUP (1<<4) /* Sawtoothup wave effect supported */ +#define SDL_HAPTIC_SAWTOOTHUP (1<<4) + /** - * \def SDL_HAPTIC_SAWTOOTHDOWN - * - * \brief Periodic haptic effect that simulates saw tooth down waves. - * - * \sa SDL_HapticPeriodic + * \brief Sawtoothdown wave effect supported. + * + * Periodic haptic effect that simulates saw tooth down waves. + * + * \sa SDL_HapticPeriodic */ -#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) /* Sawtoothdown wave effect supported */ +#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) + /** - * \def SDL_HAPTIC_RAMP - * - * \brief Ramp haptic effect. - * - * \sa SDL_HapticRamp + * \brief Ramp effect supported. + * + * Ramp haptic effect. + * + * \sa SDL_HapticRamp */ -#define SDL_HAPTIC_RAMP (1<<6) /* Ramp effect supported */ +#define SDL_HAPTIC_RAMP (1<<6) + /** - * \def SDL_HAPTIC_SPRING + * \brief Spring effect supported - uses axes position. + * + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. * - * \brief Condition haptic effect that simulates a spring. Effect is based on the - * axes position. - * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ -#define SDL_HAPTIC_SPRING (1<<7) /* Spring effect supported - uses axes position */ +#define SDL_HAPTIC_SPRING (1<<7) + /** - * \def SDL_HAPTIC_DAMPER - * - * \brief Condition haptic effect that simulates dampening. Effect is based on the - * axes velocity. - * - * \sa SDL_HapticCondition + * \brief Damper effect supported - uses axes velocity. + * + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. + * + * \sa SDL_HapticCondition */ -#define SDL_HAPTIC_DAMPER (1<<8) /* Damper effect supported - uses axes velocity */ +#define SDL_HAPTIC_DAMPER (1<<8) + /** - * \def SDL_HAPTIC_INERTIA + * \brief Inertia effect supported - uses axes acceleration. + * + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. * - * \brief Condition haptic effect that simulates inertia. Effect is based on the axes - * acceleration. - * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ -#define SDL_HAPTIC_INERTIA (1<<9) /* Inertia effect supported - uses axes acceleration */ +#define SDL_HAPTIC_INERTIA (1<<9) + /** - * \def SDL_HAPTIC_FRICTION - * - * \brief Condition haptic effect that simulates friction. Effect is based on the axes - * movement. - * - * \sa SDL_HapticCondition + * \brief Friction effect supported - uses axes movement. + * + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. + * + * \sa SDL_HapticCondition */ -#define SDL_HAPTIC_FRICTION (1<<10) /* Friction effect supported - uses axes movement */ +#define SDL_HAPTIC_FRICTION (1<<10) + /** - * \def SDL_HAPTIC_CUSTOM - * - * \brief User defined custom haptic effect. + * \brief Custom effect is supported. + * + * User defined custom haptic effect. */ -#define SDL_HAPTIC_CUSTOM (1<<11) /* Custom effect is supported */ -/* These last two are features the device has, not effects */ +#define SDL_HAPTIC_CUSTOM (1<<11) + +/*@}*//*Haptic effects*/ + +/* These last few are features the device has, not effects */ + /** - * \def SDL_HAPTIC_GAIN - * - * \brief Device supports setting the global gain. - * - * \sa SDL_HapticSetGain + * \brief Device can set global gain. + * + * Device supports setting the global gain. + * + * \sa SDL_HapticSetGain */ -#define SDL_HAPTIC_GAIN (1<<12) /* Device can set global gain */ +#define SDL_HAPTIC_GAIN (1<<12) + /** - * \def SDL_HAPTIC_AUTOCENTER - * - * \brief Device supports setting autocenter. - * - * \sa SDL_HapticSetAutocenter + * \brief Device can set autocenter. + * + * Device supports setting autocenter. + * + * \sa SDL_HapticSetAutocenter */ -#define SDL_HAPTIC_AUTOCENTER (1<<13) /* Device can set autocenter */ +#define SDL_HAPTIC_AUTOCENTER (1<<13) + /** - * \def SDL_HAPTIC_STATUS - * - * \brief Device can be queried for effect status. - * - * \sa SDL_HapticGetEffectStatus + * \brief Device can be queried for effect status. + * + * Device can be queried for effect status. + * + * \sa SDL_HapticGetEffectStatus */ -#define SDL_HAPTIC_STATUS (1<<14) /* Device can be queried for effect status */ +#define SDL_HAPTIC_STATUS (1<<14) + /** - * \def SDL_HAPTIC_PAUSE - * - * \brief Device can be paused. - * - * \sa SDL_HapticPause - * \sa SDL_HapticUnpause + * \brief Device can be paused. + * + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause */ -#define SDL_HAPTIC_PAUSE (1<<15) /* Device can be paused. */ +#define SDL_HAPTIC_PAUSE (1<<15) -/* - * Direction encodings - */ /** - * \def SDL_HAPTIC_POLAR - * - * \brief Uses polar coordinates for the direction. - * - * \sa SDL_HapticDirection + * \name Direction encodings + */ +/*@{*/ + +/** + * \brief Uses polar coordinates for the direction. + * + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_POLAR 0 + /** - * \def SDL_HAPTIC_CARTESIAN - * - * \brief Uses cartesian coordinates for the direction. - * - * \sa SDL_HapticDirection + * \brief Uses cartesian coordinates for the direction. + * + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_CARTESIAN 1 + /** - * \def SDL_HAPTIC_SPHERICAL - * - * \brief Uses spherical coordinates for the direction. - * - * \sa SDL_HapticDirection + * \brief Uses spherical coordinates for the direction. + * + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_SPHERICAL 2 +/*@}*//*Direction encodings*/ + +/*@}*//*Haptic features*/ /* * Misc defines. */ + /** - * \def SDL_HAPTIC_INFINITY - * * \brief Used to play a device an infinite number of times. * * \sa SDL_HapticRunEffect @@ -294,97 +317,96 @@ typedef struct _SDL_Haptic SDL_Haptic; /** - * \struct SDL_HapticDirection + * \brief Structure that represents a haptic direction. + * + * Directions can be specified by: + * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. * - * \brief Structure that represents a haptic direction. - * - * Directions can be specified by: - * - SDL_HAPTIC_POLAR : Specified by polar coordinates. - * - SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. - * - SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. - * - * Cardinal directions of the haptic device are relative to the positioning + * Cardinal directions of the haptic device are relative to the positioning * of the device. North is considered to be away from the user. * - * The following diagram represents the cardinal directions: - * \code - * .--. - * |__| .-------. - * |=.| |.-----.| - * |--| || || - * | | |'-----'| - * |__|~')_____(' - * [ COMPUTER ] - * - * - * North (0,-1) - * ^ - * | - * | - * (1,0) West <----[ HAPTIC ]----> East (-1,0) - * | - * | - * v - * South (0,1) - * - * - * [ USER ] - * \|||/ - * (o o) - * ---ooO-(_)-Ooo--- - * \endcode - * - * If type is SDL_HAPTIC_POLAR, direction is encoded by hundredths of a - * degree starting north and turning clockwise. SDL_HAPTIC_POLAR only uses - * the first dir parameter. The cardinal directions would be: + * The following diagram represents the cardinal directions: + * \verbatim + .--. + |__| .-------. + |=.| |.-----.| + |--| || || + | | |'-----'| + |__|~')_____(' + [ COMPUTER ] + + + North (0,-1) + ^ + | + | + (1,0) West <----[ HAPTIC ]----> East (-1,0) + | + | + v + South (0,1) + + + [ USER ] + \|||/ + (o o) + ---ooO-(_)-Ooo--- + \endverbatim + * + * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses + * the first \c dir parameter. The cardinal directions would be: * - North: 0 (0 degrees) * - East: 9000 (90 degrees) * - South: 18000 (180 degrees) * - West: 27000 (270 degrees) - * - * If type is SDL_HAPTIC_CARTESIAN, direction is encoded by three positions - * (X axis, Y axis and Z axis (with 3 axes)). SDL_HAPTIC_CARTESIAN uses - * the first three dir parameters. The cardinal directions would be: + * + * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions + * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses + * the first three \c dir parameters. The cardinal directions would be: * - North: 0,-1, 0 * - East: -1, 0, 0 * - South: 0, 1, 0 * - West: 1, 0, 0 + * * The Z axis represents the height of the effect if supported, otherwise - * it's unused. In cartesian encoding (1,2) would be the same as (2,4), you + * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you * can use any multiple you want, only the direction matters. - * - * If type is SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. - * The first two dir parameters are used. The dir parameters are as follows - * (all values are in hundredths of degrees): - * 1) Degrees from (1, 0) rotated towards (0, 1). - * 2) Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. + * The first two \c dir parameters are used. The \c dir parameters are as + * follows (all values are in hundredths of degrees): + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). * * - * Example of force coming from the south with all encodings (force coming + * Example of force coming from the south with all encodings (force coming * from the south means the user will have to pull the stick to counteract): - * \code - * SDL_HapticDirection direction; + * \code + * SDL_HapticDirection direction; + * + * // Cartesian directions + * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. + * direction.dir[0] = 0; // X position + * direction.dir[1] = 1; // Y position + * // Assuming the device has 2 axes, we don't need to specify third parameter. + * + * // Polar directions + * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. + * direction.dir[0] = 18000; // Polar only uses first parameter + * + * // Spherical coordinates + * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding + * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. + * \endcode * - * // Cartesian directions - * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. - * direction.dir[0] = 0; // X position - * direction.dir[1] = 1; // Y position - * // Assuming the device has 2 axes, we don't need to specify third parameter. - * - * // Polar directions - * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. - * direction.dir[0] = 18000; // Polar only uses first parameter - * - * // Spherical coordinates - * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding - * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. - * \endcode - * - * \sa SDL_HAPTIC_POLAR - * \sa SDL_HAPTIC_CARTESIAN - * \sa SDL_HAPTIC_SPHERICAL - * \sa SDL_HapticEffect - * \sa SDL_HapticNumAxes + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes */ typedef struct SDL_HapticDirection { @@ -394,22 +416,20 @@ typedef struct SDL_HapticDirection /** - * \struct SDL_HapticConstant - * - * \brief A structure containing a template for a Constant effect. - * - * The struct is exclusive to the SDL_HAPTIC_CONSTANT effect. - * - * A constant effect applies a constant force in the specified direction + * \brief A structure containing a template for a Constant effect. + * + * The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect. + * + * A constant effect applies a constant force in the specified direction * to the joystick. - * - * \sa SDL_HAPTIC_CONSTANT - * \sa SDL_HapticEffect + * + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect */ typedef struct SDL_HapticConstant { /* Header */ - Uint16 type; /**< SDL_HAPTIC_CONSTANT */ + Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -429,71 +449,70 @@ typedef struct SDL_HapticConstant Uint16 fade_length; /**< Duration of the fade. */ Uint16 fade_level; /**< Level at the end of the fade. */ } SDL_HapticConstant; + /** - * \struct SDL_HapticPeriodic - * - * \brief A structure containing a template for a Periodic effect. - * - * The struct handles the following effects: - * - SDL_HAPTIC_SINE - * - SDL_HAPTIC_SQUARE - * - SDL_HAPTIC_TRIANGLE - * - SDL_HAPTIC_SAWTOOTHUP - * - SDL_HAPTIC_SAWTOOTHDOWN - * - * A periodic effect consists in a wave-shaped effect that repeats itself + * \brief A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SINE + * - ::SDL_HAPTIC_SQUARE + * - ::SDL_HAPTIC_TRIANGLE + * - ::SDL_HAPTIC_SAWTOOTHUP + * - ::SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself * over time. The type determines the shape of the wave and the parameters * determine the dimensions of the wave. - * - * Phase is given by hundredth of a cyle meaning that giving the phase a value + * + * Phase is given by hundredth of a cyle meaning that giving the phase a value * of 9000 will displace it 25% of it's period. Here are sample values: - * - 0: No phase displacement. - * - 9000: Displaced 25% of it's period. - * - 18000: Displaced 50% of it's period. - * - 27000: Displaced 75% of it's period. - * - 36000: Displaced 100% of it's period, same as 0, but 0 is preffered. + * - 0: No phase displacement. + * - 9000: Displaced 25% of it's period. + * - 18000: Displaced 50% of it's period. + * - 27000: Displaced 75% of it's period. + * - 36000: Displaced 100% of it's period, same as 0, but 0 is preffered. * - * Examples: - * \code - * SDL_HAPTIC_SINE - * __ __ __ __ - * / \ / \ / \ / - * / \__/ \__/ \__/ - * - * SDL_HAPTIC_SQUARE - * __ __ __ __ __ - * | | | | | | | | | | - * | |__| |__| |__| |__| | - * - * SDL_HAPTIC_TRIANGLE - * /\ /\ /\ /\ /\ - * / \ / \ / \ / \ / - * / \/ \/ \/ \/ - * - * SDL_HAPTIC_SAWTOOTHUP - * /| /| /| /| /| /| /| - * / | / | / | / | / | / | / | - * / |/ |/ |/ |/ |/ |/ | - * - * SDL_HAPTIC_SAWTOOTHDOWN - * \ |\ |\ |\ |\ |\ |\ | - * \ | \ | \ | \ | \ | \ | \ | - * \| \| \| \| \| \| \| - * \endcode - * - * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_SQUARE - * \sa SDL_HAPTIC_TRIANGLE - * \sa SDL_HAPTIC_SAWTOOTHUP - * \sa SDL_HAPTIC_SAWTOOTHDOWN - * \sa SDL_HapticEffect + * Examples: + * \verbatim + SDL_HAPTIC_SINE + __ __ __ __ + / \ / \ / \ / + / \__/ \__/ \__/ + + SDL_HAPTIC_SQUARE + __ __ __ __ __ + | | | | | | | | | | + | |__| |__| |__| |__| | + + SDL_HAPTIC_TRIANGLE + /\ /\ /\ /\ /\ + / \ / \ / \ / \ / + / \/ \/ \/ \/ + + SDL_HAPTIC_SAWTOOTHUP + /| /| /| /| /| /| /| + / | / | / | / | / | / | / | + / |/ |/ |/ |/ |/ |/ | + + SDL_HAPTIC_SAWTOOTHDOWN + \ |\ |\ |\ |\ |\ |\ | + \ | \ | \ | \ | \ | \ | \ | + \| \| \| \| \| \| \| + \endverbatim + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_SQUARE + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect */ typedef struct SDL_HapticPeriodic { /* Header */ - Uint16 type; /**< SDL_HAPTIC_SINE, SDL_HAPTIC_SQUARE, - SDL_HAPTIC_TRIANGLE, SDL_HAPTIC_SAWTOOTHUP or - SDL_HAPTIC_SAWTOOTHDOWN */ + Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_SQUARE, + ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or + ::SDL_HAPTIC_SAWTOOTHDOWN */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -516,37 +535,36 @@ typedef struct SDL_HapticPeriodic Uint16 fade_length; /**< Duration of the fade. */ Uint16 fade_level; /**< Level at the end of the fade. */ } SDL_HapticPeriodic; + /** - * \struct SDL_HapticCondition - * - * \brief A structure containing a template for a Condition effect. - * - * The struct handles the following effects: - * - SDL_HAPTIC_SPRING: Effect based on axes position. - * - SDL_HAPTIC_DAMPER: Effect based on axes velocity. - * - SDL_HAPTIC_INERTIA: Effect based on axes acceleration. - * - SDL_HAPTIC_FRICTION: Effect based on axes movement. - * - * Direction is handled by condition internals instead of a direction member. + * \brief A structure containing a template for a Condition effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SPRING: Effect based on axes position. + * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * + * Direction is handled by condition internals instead of a direction member. * The condition effect specific members have three parameters. The first * refers to the X axis, the second refers to the Y axis and the third * refers to the Z axis. The right terms refer to the positive side of the * axis and the left terms refer to the negative side of the axis. Please - * refer to the SDL_HapticDirection diagram for which side is positive and + * refer to the ::SDL_HapticDirection diagram for which side is positive and * which is negative. - * - * \sa SDL_HapticDirection - * \sa SDL_HAPTIC_SPRING - * \sa SDL_HAPTIC_DAMPER - * \sa SDL_HAPTIC_INERTIA - * \sa SDL_HAPTIC_FRICTION - * \sa SDL_HapticEffect + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect */ typedef struct SDL_HapticCondition { /* Header */ - Uint16 type; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER, - SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */ + Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, + ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ /* Replay */ @@ -565,25 +583,24 @@ typedef struct SDL_HapticCondition Uint16 deadband[3]; /**< Size of the dead zone. */ Sint16 center[3]; /**< Position of the dead zone. */ } SDL_HapticCondition; + /** - * \struct SDL_HapticRamp - * - * \brief A structure containing a template for a Ramp effect. - * - * This struct is exclusively for the SDL_HAPTIC_RAMP effect. - * - * The ramp effect starts at start strength and ends at end strength. + * \brief A structure containing a template for a Ramp effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * + * The ramp effect starts at start strength and ends at end strength. * It augments in linear fashion. If you use attack and fade with a ramp * they effects get added to the ramp effect making the effect become * quadratic instead of linear. - * - * \sa SDL_HAPTIC_RAMP - * \sa SDL_HapticEffect + * + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect */ typedef struct SDL_HapticRamp { /* Header */ - Uint16 type; /**< SDL_HAPTIC_RAMP */ + Uint16 type; /**< ::SDL_HAPTIC_RAMP */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -604,25 +621,24 @@ typedef struct SDL_HapticRamp Uint16 fade_length; /**< Duration of the fade. */ Uint16 fade_level; /**< Level at the end of the fade. */ } SDL_HapticRamp; + /** - * \struct SDL_HapticCustom - * - * \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 + * \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 * application can define it's exact shape. You will have to allocate the * data yourself. Data should consist of channels * samples Uint16 samples. - * - * If channels is one, the effect is rotated using the defined direction. + * + * If channels is one, the effect is rotated using the defined direction. * Otherwise it uses the samples in data for the different axes. - * - * \sa SDL_HAPTIC_CUSTOM - * \sa SDL_HapticEffect + * + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect */ typedef struct SDL_HapticCustom { /* Header */ - Uint16 type; /**< SDL_HAPTIC_CUSTOM */ + Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -645,76 +661,74 @@ typedef struct SDL_HapticCustom Uint16 fade_length; /**< Duration of the fade. */ Uint16 fade_level; /**< Level at the end of the fade. */ } SDL_HapticCustom; + /** - * \union SDL_HapticEffect - * - * \brief The generic template for any haptic effect. - * - * All values max at 32767 (0x7FFF). Signed values also can be negative. + * \brief The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. * Time values unless specified otherwise are in milliseconds. - * - * You can also pass SDL_HAPTIC_INFINITY to length instead of a 0-32767 value. - * Neither delay, interval, attack_length nor fade_length support - * SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. - * - * Additionally, the SDL_HAPTIC_RAMP effect does not support a duration of - * SDL_HAPTIC_INFINITY. - * - * Button triggers may not be supported on all devices, it is advised to not + * + * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 + * value. Neither delay, interval, attack_length nor fade_length support + * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * + * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of + * ::SDL_HAPTIC_INFINITY. + * + * Button triggers may not be supported on all devices, it is advised to not * use them if possible. Buttons start at index 1 instead of index 0 like * they joystick. - * - * If both attack_length and fade_level are 0, the envelope is not used, + * + * If both attack_length and fade_level are 0, the envelope is not used, * otherwise both values are used. - * - * Common parts: - * \code - * // Replay - All effects have this - * Uint32 length; // Duration of effect (ms). - * Uint16 delay; // Delay before starting effect. - * - * // Trigger - All effects have this - * Uint16 button; // Button that triggers effect. - * Uint16 interval; // How soon before effect can be triggered again. - * - * // Envelope - All effects except condition effects have this - * Uint16 attack_length; // Duration of the attack (ms). - * Uint16 attack_level; // Level at the start of the attack. - * Uint16 fade_length; // Duration of the fade out (ms). - * Uint16 fade_level; // Level at the end of the fade. - * \endcode + * + * Common parts: + * \code + * // Replay - All effects have this + * Uint32 length; // Duration of effect (ms). + * Uint16 delay; // Delay before starting effect. + * + * // Trigger - All effects have this + * Uint16 button; // Button that triggers effect. + * Uint16 interval; // How soon before effect can be triggered again. + * + * // Envelope - All effects except condition effects have this + * Uint16 attack_length; // Duration of the attack (ms). + * Uint16 attack_level; // Level at the start of the attack. + * Uint16 fade_length; // Duration of the fade out (ms). + * Uint16 fade_level; // Level at the end of the fade. + * \endcode * * - * Here we have an example of a constant effect evolution in time: - * - * \code - * Strength - * ^ - * | - * | effect level --> _________________ - * | / \ - * | / \ - * | / \ - * | / \ - * | attack_level --> | \ - * | | | <--- fade_level - * | - * +--------------------------------------------------> Time - * [--] [---] - * attack_length fade_length - * - * [------------------][-----------------------] - * delay length - * \endcode - * - * Note either the attack_level or the fade_level may be above the actual + * Here we have an example of a constant effect evolution in time: + * \verbatim + Strength + ^ + | + | effect level --> _________________ + | / \ + | / \ + | / \ + | / \ + | attack_level --> | \ + | | | <--- fade_level + | + +--------------------------------------------------> Time + [--] [---] + attack_length fade_length + + [------------------][-----------------------] + delay length + \endverbatim + * + * Note either the attack_level or the fade_level may be above the actual * effect level. * - * \sa SDL_HapticConstant - * \sa SDL_HapticPeriodic - * \sa SDL_HapticCondition - * \sa SDL_HapticRamp - * \sa SDL_HapticCustom + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticCustom */ typedef union SDL_HapticEffect { @@ -730,413 +744,368 @@ typedef union SDL_HapticEffect /* Function prototypes */ /** - * \fn int SDL_NumHaptics(void) - * - * \brief Count the number of joysticks attached to the system. - * - * \return Number of haptic devices detected on the system. + * \brief Count the number of joysticks attached to the system. + * + * \return Number of haptic devices detected on the system. */ extern DECLSPEC int SDLCALL SDL_NumHaptics(void); /** - * \fn const char * SDL_HapticName(int device_index) + * \brief Get the implementation dependent name of a Haptic device. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + * + * \param device_index Index of the device to get it's name. + * \return Name of the device or NULL on error. * - * \brief Get the implementation dependent name of a Haptic device. - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - * - * \param device_index Index of the device to get it's name. - * \return Name of the device or NULL on error. - * - * \sa SDL_NumHaptics + * \sa SDL_NumHaptics */ extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); /** - * \fn SDL_Haptic * SDL_HapticOpen(int device_index) + * \brief Opens a Haptic device for usage. + * + * The index passed as an argument refers to the N'th Haptic device on this + * system. * - * \brief Opens a Haptic device for usage - the index passed as an - * argument refers to the N'th Haptic device on this system. - * - * When opening a haptic device, it's gain will be set to maximum and + * When opening a haptic device, it's gain will be set to maximum and * autocenter will be disabled. To modify these values use - * SDL_HapticSetGain and SDL_HapticSetAutocenter + * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). * - * \param device_index Index of the device to open. - * \return Device identifier or NULL on error. + * \param device_index Index of the device to open. + * \return Device identifier or NULL on error. * - * \sa SDL_HapticIndex - * \sa SDL_HapticOpenFromMouse - * \sa SDL_HapticOpenFromJoystick - * \sa SDL_HapticClose - * \sa SDL_HapticSetGain - * \sa SDL_HapticSetAutocenter - * \sa SDL_HapticPause - * \sa SDL_HapticStopAll + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + * \sa SDL_HapticSetGain + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticPause + * \sa SDL_HapticStopAll */ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); /** - * \fn int SDL_HapticOpened(int device_index) - * - * \brief Checks if the haptic device at index has been opened. - * - * \param device_index Index to check to see if it has been opened. - * \return 1 if it has been opened or 0 if it hasn't. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticIndex + * \brief Checks if the haptic device at index has been opened. + * + * \param device_index Index to check to see if it has been opened. + * \return 1 if it has been opened or 0 if it hasn't. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticIndex */ extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); /** - * \fn int SDL_HapticIndex(SDL_Haptic * haptic) - * - * \brief Gets the index of a haptic device. - * - * \param haptic Haptic device to get the index of. - * \return The index of the haptic device or -1 on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticOpened + * \brief Gets the index of a haptic device. + * + * \param haptic Haptic device to get the index of. + * \return The index of the haptic device or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened */ extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); /** - * \fn int SDL_MouseIsHaptic(void) - * - * \brief Gets whether or not the current mouse has haptic capabilities. - * - * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. - * - * \sa SDL_HapticOpenFromMouse + * \brief Gets whether or not the current mouse has haptic capabilities. + * + * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. + * + * \sa SDL_HapticOpenFromMouse */ extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); /** - * \fn SDL_Haptic * SDL_HapticOpenFromMouse(void) - * - * \brief Tries to open a haptic device from the current mouse. - * - * \return The haptic device identifier or NULL on error. - * - * \sa SDL_MouseIsHaptic - * \sa SDL_HapticOpen + * \brief Tries to open a haptic device from the current mouse. + * + * \return The haptic device identifier or NULL on error. + * + * \sa SDL_MouseIsHaptic + * \sa SDL_HapticOpen */ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); /** - * \fn int SDL_JoystickIsHaptic(SDL_Joystick * joystick) - * - * \brief Checks to see if a joystick has haptic features. - * - * \param joystick Joystick to test for haptic capabilities. - * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't - * or -1 if an error ocurred. - * - * \sa SDL_HapticOpenFromJoystick + * \brief Checks to see if a joystick has haptic features. + * + * \param joystick Joystick to test for haptic capabilities. + * \return 1 if the joystick is haptic, 0 if it isn't + * or -1 if an error ocurred. + * + * \sa SDL_HapticOpenFromJoystick */ extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); /** - * \fn SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) - * - * \brief Opens a Haptic device for usage from a Joystick device. Still has - * to be closed seperately to the joystick. - * - * When opening from a joystick you should first close the haptic device before + * \brief Opens a Haptic device for usage from a Joystick device. + * + * You must still close the haptic device seperately. It will not be closed + * with the joystick. + * + * When opening from a joystick you should first close the haptic device before * closing the joystick device. If not, on some implementations the haptic * device will also get unallocated and you'll be unable to use force feedback * on that device. - * - * \param joystick Joystick to create a haptic device from. - * \return A valid haptic device identifier on success or NULL on error. - * - * \sa SDL_HapticOpen - * \sa SDL_HapticClose + * + * \param joystick Joystick to create a haptic device from. + * \return A valid haptic device identifier on success or NULL on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticClose */ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * joystick); /** - * \fn void SDL_HapticClose(SDL_Haptic * haptic) - * - * \brief Closes a Haptic device previously opened with SDL_HapticOpen. - * - * \param haptic Haptic device to close. + * \brief Closes a Haptic device previously opened with SDL_HapticOpen(). + * + * \param haptic Haptic device to close. */ extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); /** - * \fn int SDL_HapticNumEffects(SDL_Haptic * haptic) - * - * \brief Returns the number of effects a haptic device can store. - * - * On some platforms this isn't fully supported, and therefore is an + * \brief Returns the number of effects a haptic device can store. + * + * On some platforms this isn't fully supported, and therefore is an * aproximation. Always check to see if your created effect was actually - * created and do not rely solely on HapticNumEffects. - * - * \param haptic The haptic device to query effect max. - * \return The number of effects the haptic device can store or - * -1 on error. - * - * \sa SDL_HapticNumEffectsPlaying - * \sa SDL_HapticQuery + * created and do not rely solely on SDL_HapticNumEffects(). + * + * \param haptic The haptic device to query effect max. + * \return The number of effects the haptic device can store or + * -1 on error. + * + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); /** - * \fn int SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic) + * \brief Returns the number of effects a haptic device can play at the same + * time. + * + * This is not supported on all platforms, but will always return a value. + * Added here for the sake of completness. + * + * \param haptic The haptic device to query maximum playing effects. + * \return The number of effects the haptic device can play at the same time + * or -1 on error. * - * \brief Returns the number of effects a haptic device can play at the same time. - * - * This is not supported on all platforms, but will always return a value. Added - * here for the sake of completness. - * - * \param haptic The haptic device to query maximum playing effect.s - * \return The number of effects the haptic device can play at the same time - * or -1 on error. - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticQuery + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); /** - * \fn unsigned int SDL_HapticQuery(SDL_Haptic * haptic) - * - * \brief Gets the haptic devices supported features in bitwise matter. - * - * Example: - * \code - * if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) { - * printf("We have constant haptic effect!"); - * } - * \endcode - * - * - * \param haptic The haptic device to query. - * \return Haptic features in bitwise manner (OR'd). - * - * \sa SDL_HapticNumEffects - * \sa SDL_HapticEffectSupported + * \brief Gets the haptic devices supported features in bitwise matter. + * + * Example: + * \code + * if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) { + * printf("We have constant haptic effect!"); + * } + * \endcode + * + * \param haptic The haptic device to query. + * \return Haptic features in bitwise manner (OR'd). + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticEffectSupported */ extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); /** - * \fn int SDL_HapticNumAxes(SDL_Haptic * haptic) - * - * \brief Gets the number of haptic axes the device has. - * - * \sa SDL_HapticDirection + * \brief Gets the number of haptic axes the device has. + * + * \sa SDL_HapticDirection */ extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); /** - * \fn int SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect) - * - * \brief Checks to see if effect is supported by haptic. - * - * \param haptic Haptic device to check on. - * \param effect Effect to check to see if it is supported. - * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or - * -1 on error. - * - * \sa SDL_HapticQuery - * \sa SDL_HapticNewEffect + * \brief Checks to see if effect is supported by haptic. + * + * \param haptic Haptic device to check on. + * \param effect Effect to check to see if it is supported. + * \return 1 if effect is supported, 0 if it isn't or -1 on error. + * + * \sa SDL_HapticQuery + * \sa SDL_HapticNewEffect */ extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect); /** - * \fn int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect) - * - * \brief Creates a new haptic effect on the device. - * - * \param haptic Haptic device to create the effect on. - * \param effect Properties of the effect to create. - * \return The id of the effect on success or -1 on error. - * - * \sa SDL_HapticUpdateEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect + * \brief Creates a new haptic effect on the device. + * + * \param haptic Haptic device to create the effect on. + * \param effect Properties of the effect to create. + * \return The id of the effect on success or -1 on error. + * + * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect */ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect); /** - * \fn int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data) - * - * \brief Updates the properties of an effect. - * - * Can be used dynamically, although behaviour when dynamically changing - * direction may be strange. Specifically the effect may reupload itself - * and start playing from the start. You cannot change the type either when - * running UpdateEffect. - * - * \param haptic Haptic device that has the effect. - * \param effect Effect to update. - * \param data New effect properties to use. - * \return The id of the effect on success or -1 on error. - * - * \sa SDL_HapticNewEffect - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect + * \brief Updates the properties of an effect. + * + * Can be used dynamically, although behaviour when dynamically changing + * direction may be strange. Specifically the effect may reupload itself + * and start playing from the start. You cannot change the type either when + * running SDL_HapticUpdateEffect(). + * + * \param haptic Haptic device that has the effect. + * \param effect Effect to update. + * \param data New effect properties to use. + * \return The id of the effect on success or -1 on error. + * + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect */ extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data); /** - * \fn int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations) - * - * \brief Runs the haptic effect on it's assosciated haptic device. - * - * If iterations are SDL_HAPTIC_INFINITY, it'll run the effect over and over + * \brief Runs the haptic effect on it's assosciated haptic device. + * + * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over * repeating the envelope (attack and fade) every time. If you only want the - * effect to last forever, set SDL_HAPTIC_INFINITY in the effect's length + * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length * parameter. - * - * \param haptic Haptic device to run the effect on. - * \param effect Identifier of the haptic effect to run. - * \param iterations Number of iterations to run the effect. Use - * SDL_HAPTIC_INFINITY for infinity. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticStopEffect - * \sa SDL_HapticDestroyEffect - * \sa SDL_HapticGetEffectStatus + * + * \param haptic Haptic device to run the effect on. + * \param effect Identifier of the haptic effect to run. + * \param iterations Number of iterations to run the effect. Use + * ::SDL_HAPTIC_INFINITY for infinity. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticStopEffect + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus */ extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations); /** - * \fn int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect) - * - * \brief Stops the haptic effect on it's assosciated haptic device. - * - * \param haptic Haptic device to stop the effect on. - * \param effect Identifier of the effect to stop. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticDestroyEffect + * \brief Stops the haptic effect on it's assosciated haptic device. + * + * \param haptic Haptic device to stop the effect on. + * \param effect Identifier of the effect to stop. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect */ extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, int effect); /** - * \fn void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) - * - * \brief Destroys a haptic effect on the device. This will stop the effect - * if it's running. Effects are automatically destroyed when the device is - * closed. - * - * \param haptic Device to destroy the effect on. - * \param effect Identifier of the effect to destroy. - * - * \sa SDL_HapticNewEffect + * \brief Destroys a haptic effect on the device. + * + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. + * + * \param haptic Device to destroy the effect on. + * \param effect Identifier of the effect to destroy. + * + * \sa SDL_HapticNewEffect */ extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect); /** - * \fn int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect) - * - * \brief Gets the status of the current effect on the haptic device. - * - * Device must support the SDL_HAPTIC_STATUS feature. - * - * \param haptic Haptic device to query the effect status on. - * \param effect Identifier of the effect to query it's status. - * \return 0 if it isn't playing, SDL_HAPTIC_PLAYING if it is playing - * or -1 on error. - * - * \sa SDL_HapticRunEffect - * \sa SDL_HapticStopEffect + * \brief Gets the status of the current effect on the haptic device. + * + * Device must support the ::SDL_HAPTIC_STATUS feature. + * + * \param haptic Haptic device to query the effect status on. + * \param effect Identifier of the effect to query it's status. + * \return 0 if it isn't playing, ::SDL_HAPTIC_PLAYING if it is playing + * or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect */ extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, int effect); /** - * \fn int SDL_HapticSetGain(SDL_Haptic * haptic, int gain) - * - * \brief Sets the global gain of the device. Gain should be between 0 and 100. - * - * Device must support the SDL_HAPTIC_GAIN feature. - * - * The user may specify the maxmimum gain by setting the environment variable - * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to - * SDL_HapticSetGain will scale linearly using SDL_HAPTIC_GAIN_MAX as the + * \brief Sets the global gain of the device. + * + * Device must support the ::SDL_HAPTIC_GAIN feature. + * + * The user may specify the maxmimum gain by setting the environment variable + * ::SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using ::SDL_HAPTIC_GAIN_MAX as the * maximum. - * - * \param haptic Haptic device to set the gain on. - * \param gain Value to set the gain to, should be between 0 and 100. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery + * + * \param haptic Haptic device to set the gain on. + * \param gain Value to set the gain to, should be between 0 and 100. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); /** - * \fn int SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) + * \brief Sets the global autocenter of the device. + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. * - * \brief Sets the global autocenter of the device. Autocenter should be between - * 0 and 100. Setting it to 0 will disable autocentering. + * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. * - * Device must support the SDL_HAPTIC_AUTOCENTER feature. - * - * \param haptic Haptic device to set autocentering on. - * \param autocenter Value to set autocenter to, 0 disables autocentering. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticQuery + * \param haptic Haptic device to set autocentering on. + * \param autocenter Value to set autocenter to, 0 disables autocentering. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery */ extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); /** - * \fn extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic) - * - * \brief Pauses a haptic device. - * - * Device must support the SDL_HAPTIC_PAUSE feature. Call SDL_HapticUnpause - * to resume playback. - * - * Do not modify the effects nor add new ones while the device is paused. + * \brief Pauses a haptic device. + * + * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * SDL_HapticUnpause() to resume playback. + * + * Do not modify the effects nor add new ones while the device is paused. * That can cause all sorts of weird errors. - * - * \param haptic Haptic device to pause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticUnpause + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticUnpause */ extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); /** - * \fn extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic) - * - * \brief Unpauses a haptic device. - * - * Call to unpause after SDL_HapticPause. - * - * \param haptic Haptic device to pause. - * \return 0 on success or -1 on error. - * - * \sa SDL_HapticPause + * \brief Unpauses a haptic device. + * + * Call to unpause after SDL_HapticPause(). + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticPause */ extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); /** - * \fn extern DECSLPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic) - * - * \brief Stops all the currently playing effects on a haptic device. - * - * \param haptic Haptic device to stop. - * \return 0 on success or -1 on error. + * \brief Stops all the currently playing effects on a haptic device. + * + * \param haptic Haptic device to stop. + * \return 0 on success or -1 on error. */ extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); diff --git a/Externals/SDL/Include/SDL_joystick.h b/Externals/SDL/Include/SDL_joystick.h index 44aa3fbe23..4c57d264e8 100644 --- a/Externals/SDL/Include/SDL_joystick.h +++ b/Externals/SDL/Include/SDL_joystick.h @@ -1,181 +1,209 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_joystick.h - * - * Include file for SDL joystick event handling - */ - -#ifndef _SDL_joystick_h -#define _SDL_joystick_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* In order to use these functions, SDL_Init() must have been called - with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - for joysticks, and load appropriate drivers. -*/ - -/* The joystick structure used to identify an SDL joystick */ -struct _SDL_Joystick; -typedef struct _SDL_Joystick SDL_Joystick; - - -/* Function prototypes */ -/* - * Count the number of joysticks attached to the system - */ -extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); - -/* - * Get the implementation dependent name of a joystick. - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. - */ -extern DECLSPEC const char *SDLCALL SDL_JoystickName(int device_index); - -/* - * Open a joystick for use - the index passed as an argument refers to - * the N'th joystick on the system. This index is the value which will - * identify this joystick in future joystick events. - * - * This function returns a joystick identifier, or NULL if an error occurred. - */ -extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); - -/* - * Returns 1 if the joystick has been opened, or 0 if it has not. - */ -extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); - -/* - * Get the device index of an opened joystick. - */ -extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick * joystick); - -/* - * Get the number of general axis controls on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); - -/* - * Get the number of trackballs on a joystick - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); - -/* - * Get the number of POV hats on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); - -/* - * Get the number of buttons on a joystick - */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); - -/* - * Update the current state of the open joysticks. - * This is called automatically by the event loop if any joystick - * events are enabled. - */ -extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); - -/* - * Enable/disable joystick event polling. - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. - * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. - */ -extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); - -/* - * Get the current state of an axis control on a joystick - * The state is a value ranging from -32768 to 32767. - * The axis indices start at index 0. - */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, - int axis); - -/* - * Get the current state of a POV hat on a joystick - * The return value is one of the following positions: - */ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) -/* - * The hat indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, - int hat); - -/* - * Get the ball axis change since the last poll - * This returns 0, or -1 if you passed it invalid parameters. - * The ball indices start at index 0. - */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, - int ball, int *dx, int *dy); - -/* - * Get the current state of a button on a joystick - * The button indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, - int button); - -/* - * Close a joystick previously opened with SDL_JoystickOpen() - */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_joystick_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_joystick.h + * + * Include file for SDL joystick event handling + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \file SDL_joystick.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + */ + +/* The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickName(int device_index); + +/** + * Open a joystick for use. + * The index passed as an argument refers tothe N'th joystick on the system. + * This index is the value which will identify this joystick in future joystick + * events. + * + * \return A joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Returns 1 if the joystick has been opened, or 0 if it has not. + */ +extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); + +/** + * Get the device index of an opened joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick * joystick); + +/** + * Get the number of general axis controls on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); + +/** + * Get the number of trackballs on a joystick. + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); + +/** + * Get the number of POV hats on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); + +/** + * Get the number of buttons on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, + int axis); + +/** + * \name Hat positions + */ +/*@{*/ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/*@}*/ + +/** + * Get the current state of a POV hat on a joystick. + * + * The hat indices start at index 0. + * + * \return The return value is one of the following positions: + * - ::SDL_HAT_CENTERED + * - ::SDL_HAT_UP + * - ::SDL_HAT_RIGHT + * - ::SDL_HAT_DOWN + * - ::SDL_HAT_LEFT + * - ::SDL_HAT_RIGHTUP + * - ::SDL_HAT_RIGHTDOWN + * - ::SDL_HAT_LEFTUP + * - ::SDL_HAT_LEFTDOWN + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, + int hat); + +/** + * Get the ball axis change since the last poll. + * + * \return 0, or -1 if you passed it invalid parameters. + * + * The ball indices start at index 0. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, + int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, + int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen(). + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_keyboard.h b/Externals/SDL/Include/SDL_keyboard.h index 28737ee0e2..7922e95f42 100644 --- a/Externals/SDL/Include/SDL_keyboard.h +++ b/Externals/SDL/Include/SDL_keyboard.h @@ -1,168 +1,182 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_keyboard.h - * - * Include file for SDL keyboard event handling - */ - -#ifndef _SDL_keyboard_h -#define _SDL_keyboard_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_keysym.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/** - * \struct SDL_keysym - * - * \brief The SDL keysym structure, used in key events. - */ -typedef struct SDL_keysym -{ - SDL_scancode scancode; /**< SDL physical key code - see ::SDL_scancode for details */ - SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */ - Uint16 mod; /**< current key modifiers */ - Uint32 unicode; /**< OBSOLETE, use SDL_TextInputEvent instead */ -} SDL_keysym; - -/* Function prototypes */ - -/** - * \fn int SDL_GetNumKeyboards(void) - * - * \brief Get the number of keyboard input devices available. - * - * \sa SDL_SelectKeyboard() - */ -extern DECLSPEC int SDLCALL SDL_GetNumKeyboards(void); - -/** - * \fn int SDL_SelectKeyboard(int index) - * - * \brief Set the index of the currently selected keyboard. - * - * \return The index of the previously selected keyboard. - * - * \note You can query the currently selected keyboard by passing an index of -1. - * - * \sa SDL_GetNumKeyboards() - */ -extern DECLSPEC int SDLCALL SDL_SelectKeyboard(int index); - -/** - * \fn Uint8 *SDL_GetKeyboardState(int *numkeys) - * - * \brief Get a snapshot of the current state of the selected keyboard. - * - * \param numkeys if non-NULL, receives the length of the returned array. - * - * \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values. - * - * Example: - * Uint8 *state = SDL_GetKeyboardState(NULL); - * if ( state[SDL_SCANCODE_RETURN)] ) ... is pressed. - */ -extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); - -/** - * \fn SDLMod SDL_GetModState(void) - * - * \brief Get the current key modifier state for the selected keyboard. - */ -extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); - -/** - * \fn void SDL_SetModState(SDLMod modstate) - * - * \brief Set the current key modifier state for the selected keyboard. - * - * \note This does not change the keyboard state, only the key modifier flags. - */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); - -/** - * \fn SDLKey SDL_GetKeyFromScancode(SDL_scancode scancode) - * - * \brief Get the key code corresponding to the given scancode according to the current keyboard layout. - * - * See ::SDLKey for details. - * - * \sa SDL_GetKeyName() - */ -extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode); - -/** - * \fn SDL_scancode SDL_GetScancodeFromKey(SDLKey key) - * - * \brief Get the scancode corresponding to the given key code according to the current keyboard layout. - * - * See ::SDL_scancode for details. - * - * \sa SDL_GetScancodeName() - */ -extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key); - -/** - * \fn const char *SDL_GetScancodeName(SDL_scancode scancode) - * - * \brief Get a human-readable name for a scancode. - * - * \return A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. If the scancode doesn't have a name, this function returns "". - * - * \sa SDL_scancode - */ -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode - scancode); - -/** - * \fn const char *SDL_GetKeyName(SDLKey key) - * - * \brief Get a human-readable name for a key. - * - * \return A pointer to a UTF-8 string that stays valid at least until the next call to this function. If you need it around any longer, you must copy it. If the key doesn't have a name, this function returns "". - * - * \sa SDLKey - */ -extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_keyboard_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_keyboard.h + * + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keysym.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief The SDL keysym structure, used in key events. + */ +typedef struct SDL_keysym +{ + SDL_scancode scancode; /**< SDL physical key code - see ::SDL_scancode for details */ + SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */ + Uint16 mod; /**< current key modifiers */ + Uint32 unicode; /**< \deprecated use SDL_TextInputEvent instead */ +} SDL_keysym; + +/* Function prototypes */ + +/** + * \brief Get the number of keyboard input devices available. + * + * \sa SDL_SelectKeyboard() + */ +extern DECLSPEC int SDLCALL SDL_GetNumKeyboards(void); + +/** + * \brief Set the index of the currently selected keyboard. + * + * \return The index of the previously selected keyboard. + * + * \note You can query the currently selected keyboard by passing an index of -1. + * + * \sa SDL_GetNumKeyboards() + */ +extern DECLSPEC int SDLCALL SDL_SelectKeyboard(int index); + +/** + * \brief Get a snapshot of the current state of the selected keyboard. + * + * \param numkeys if non-NULL, receives the length of the returned array. + * + * \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values. + * + * \b Example: + * \code + * Uint8 *state = SDL_GetKeyboardState(NULL); + * if ( state[SDL_SCANCODE_RETURN] ) { + * printf(" is pressed.\n"); + * } + * \endcode + */ +extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); + +/** + * \brief Get the current key modifier state for the selected keyboard. + */ +extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); + +/** + * \brief Set the current key modifier state for the selected keyboard. + * + * \note This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); + +/** + * \brief Get the key code corresponding to the given scancode according to the + * current keyboard layout. + * + * See ::SDLKey for details. + * + * \sa SDL_GetKeyName() + */ +extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode); + +/** + * \brief Get the scancode corresponding to the given key code according to the + * current keyboard layout. + * + * See ::SDL_scancode for details. + * + * \sa SDL_GetScancodeName() + */ +extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key); + +/** + * \brief Get a human-readable name for a scancode. + * + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the scancode doesn't have a name, this function returns + * an empty string (""). + * + * \sa SDL_scancode + */ +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode + scancode); + +/** + * \brief Get a human-readable name for a key. + * + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the key doesn't have a name, this function returns an + * empty string (""). + * + * \sa SDLKey + */ +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key); + +/** + * \brief Start accepting Unicode text input events. + * + * \sa SDL_StopTextInput() + * \sa SDL_SetTextInputRect() + */ +extern DECLSPEC void SDLCALL SDL_StartTextInput(void); + +/** + * \brief Stop receiving any text input events. + * + * \sa SDL_StartTextInput() + */ +extern DECLSPEC void SDLCALL SDL_StopTextInput(void); + +/** + * \brief Set the rectangle used to type Unicode text inputs. + * + * \sa SDL_StartTextInput() + */ +extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_keysym.h b/Externals/SDL/Include/SDL_keysym.h index 72b2c35fb3..78afabf328 100644 --- a/Externals/SDL/Include/SDL_keysym.h +++ b/Externals/SDL/Include/SDL_keysym.h @@ -1,277 +1,275 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_keysym.h - */ - -#ifndef _SDL_keysym_h -#define _SDL_keysym_h - -#include "SDL_stdinc.h" -#include "SDL_scancode.h" - -/** - * \typedef SDLKey - * - * \brief The SDL virtual key representation. - * - * Values of this type are used to represent keyboard keys using the current - * layout of the keyboard. These values include Unicode values representing - * the unmodified character that would be generated by pressing the key, or - * an SDLK_* constant for those keys that do not generate characters. - */ -typedef Sint32 SDLKey; - -#define SDLK_SCANCODE_MASK (1<<30) -#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) - -enum -{ - SDLK_UNKNOWN = 0, - - SDLK_RETURN = '\r', - SDLK_ESCAPE = '\033', - SDLK_BACKSPACE = '\b', - SDLK_TAB = '\t', - SDLK_SPACE = ' ', - - SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), - - SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), - SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), - SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), - SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), - SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), - SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), - SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), - SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), - SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), - SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), - SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), - SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), - - SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), - SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), - SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), - SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), - SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), - SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), - SDLK_DELETE = '\177', - SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), - SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), - SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), - SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), - SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), - SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), - - SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), - SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), - SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), - SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), - SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), - SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), - SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), - SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), - SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), - SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), - SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), - SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), - SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), - SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), - SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), - SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), - SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), - - SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), - SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), - SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), - SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), - SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), - SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), - SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), - SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), - SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), - SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), - SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), - SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), - SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), - SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), - SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), - SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), - SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), - SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), - SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), - SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), - SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), - SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), - SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), - SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), - SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), - SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), - SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), - SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), - SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), - SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), - SDLK_KP_EQUALSAS400 = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), - - SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), - SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), - SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), - SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), - SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), - SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), - SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), - SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), - SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), - SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), - SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), - SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), - - SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), - SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), - SDLK_THOUSANDSSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), - SDLK_DECIMALSEPARATOR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), - SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), - SDLK_CURRENCYSUBUNIT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), - SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), - SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), - SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), - SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), - SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), - SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), - SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), - SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), - SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), - SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), - SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), - SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), - SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), - SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), - SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), - SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), - SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), - SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), - SDLK_KP_DBLAMPERSAND = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), - SDLK_KP_VERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), - SDLK_KP_DBLVERTICALBAR = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), - SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), - SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), - SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), - SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), - SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), - SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), - SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), - SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), - SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), - SDLK_KP_MEMSUBTRACT = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), - SDLK_KP_MEMMULTIPLY = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), - SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), - SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), - SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), - SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), - SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), - SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), - SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), - SDLK_KP_HEXADECIMAL = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), - - SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), - SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), - SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), - SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), - SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), - SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), - SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), - SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), - - SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), - - SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), - SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), - SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), - SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), - SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), - SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), - SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), - SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), - SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), - SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), - SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), - SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), - SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), - SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), - SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), - SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), - SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), - - SDLK_BRIGHTNESSDOWN = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), - SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), - SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), - SDLK_KBDILLUMTOGGLE = - SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), - SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), - SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), - SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), - SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) -}; - -/** - * \enum SDLMod - * - * \brief Enumeration of valid key mods (possibly OR'd together) - */ -typedef enum -{ - KMOD_NONE = 0x0000, - KMOD_LSHIFT = 0x0001, - KMOD_RSHIFT = 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LGUI = 0x0400, - KMOD_RGUI = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDLMod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) - -#endif /* _SDL_keysym_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_keysym.h + * + * Defines constants which identify keyboard keys and modifiers. + */ + +#ifndef _SDL_keysym_h +#define _SDL_keysym_h + +#include "SDL_stdinc.h" +#include "SDL_scancode.h" + +/** + * \brief The SDL virtual key representation. + * + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or + * an SDLK_* constant for those keys that do not generate characters. + */ +typedef Sint32 SDLKey; + +#define SDLK_SCANCODE_MASK (1<<30) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) + +enum +{ + SDLK_UNKNOWN = 0, + + SDLK_RETURN = '\r', + SDLK_ESCAPE = '\033', + SDLK_BACKSPACE = '\b', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), + + SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), + SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), + SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), + SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), + SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), + SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), + SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), + SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), + SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), + SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), + SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), + SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), + + SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), + SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), + SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), + SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), + SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), + SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), + SDLK_DELETE = '\177', + SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), + SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), + SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), + SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), + SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), + SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), + + SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), + SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), + SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), + SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), + SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), + SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), + SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), + SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), + SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), + SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), + SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), + SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), + SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), + SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), + SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), + SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), + SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), + + SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), + SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), + SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), + SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), + SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), + SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), + SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), + SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), + SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), + SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), + SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), + SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), + SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), + SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), + SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), + SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), + SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), + SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), + SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), + SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), + SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), + SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), + SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), + SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), + SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), + SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), + SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), + SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), + SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), + SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), + SDLK_KP_EQUALSAS400 = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), + + SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), + SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), + SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), + SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), + SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), + SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), + SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), + SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), + SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), + SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), + SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), + SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), + + SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), + SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), + SDLK_THOUSANDSSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), + SDLK_DECIMALSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), + SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), + SDLK_CURRENCYSUBUNIT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), + SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), + SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), + SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), + SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), + SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), + SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), + SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), + SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), + SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), + SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), + SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), + SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), + SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), + SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), + SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), + SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), + SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), + SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), + SDLK_KP_DBLAMPERSAND = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), + SDLK_KP_VERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), + SDLK_KP_DBLVERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), + SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), + SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), + SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), + SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), + SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), + SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), + SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), + SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), + SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), + SDLK_KP_MEMSUBTRACT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), + SDLK_KP_MEMMULTIPLY = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), + SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), + SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), + SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), + SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), + SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), + SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), + SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), + SDLK_KP_HEXADECIMAL = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), + + SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), + SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), + SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), + SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), + SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), + SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), + SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), + SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), + + SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), + + SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), + SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), + SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), + SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), + SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), + SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), + SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), + SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), + SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), + SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), + SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), + SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), + SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), + SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), + SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), + SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), + SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), + + SDLK_BRIGHTNESSDOWN = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), + SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), + SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), + SDLK_KBDILLUMTOGGLE = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), + SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), + SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), + SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), + SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) +}; + +/** + * \brief Enumeration of valid key mods (possibly OR'd together). + */ +typedef enum +{ + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDLMod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + +#endif /* _SDL_keysym_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_loadso.h b/Externals/SDL/Include/SDL_loadso.h index be3ea3228b..d01dfe2d53 100644 --- a/Externals/SDL/Include/SDL_loadso.h +++ b/Externals/SDL/Include/SDL_loadso.h @@ -1,82 +1,86 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_loadso.h - * - * System dependent library loading routines - * - * Some things to keep in mind: - * - These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * - Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * - Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - -#ifndef _SDL_loadso_h -#define _SDL_loadso_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. - */ -extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); - -/* Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). - */ -extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, - const char *name); - -/* Unload a shared object from memory */ -extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_loadso_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_loadso.h + * + * System dependent library loading routines + * + * Some things to keep in mind: + * \li These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * \li Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * \li Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, + const char *name); + +/** + * Unload a shared object from memory. + */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_main.h b/Externals/SDL/Include/SDL_main.h index d4d902de82..2de23fc095 100644 --- a/Externals/SDL/Include/SDL_main.h +++ b/Externals/SDL/Include/SDL_main.h @@ -1,82 +1,96 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_main_h -#define _SDL_main_h - -#include "SDL_stdinc.h" - -/* Redefine main() on some platforms so that it is called by SDL */ - -#if defined(__WIN32__) || \ - (defined(__MWERKS__) && !defined(__BEOS__)) || \ - defined(__SYMBIAN32__) || defined(__IPHONEOS__) - -#ifdef __cplusplus -#define C_LINKAGE "C" -#else -#define C_LINKAGE -#endif /* __cplusplus */ - -/* The application's main() function must be called with C linkage, - and should be declared like this: -#ifdef __cplusplus -extern "C" -#endif - int main(int argc, char *argv[]) - { - } - */ -#define main SDL_main - -/* The prototype for the application's main() function */ -extern C_LINKAGE int SDL_main(int argc, char *argv[]); - - -/* From the SDL library code -- needed for registering the app on Win32 */ -#ifdef __WIN32__ - -#include "begin_code.h" -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* This can be called to set the application class at startup */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, - void *hInst); -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); - -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" -#endif - -#endif /* Need to redefine main()? */ - -#endif /* _SDL_main_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** + * \file SDL_main.h + * + * Redefine main() on some platforms so that it is called by SDL. + */ + +#if defined(__WIN32__) || \ + (defined(__MWERKS__) && !defined(__BEOS__)) || \ + defined(__SYMBIAN32__) || defined(__IPHONEOS__) + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** + * \file SDL_main.h + * + * The application's main() function must be called with C linkage, + * and should be declared like this: + * \code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * \endcode + */ + +#define main SDL_main + +/** + * The prototype for the application's main() function + */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +/* From the SDL library code -- needed for registering the app on Win32 */ +#ifdef __WIN32__ + +#include "begin_code.h" +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * This can be called to set the application class at startup + */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, + void *hInst); +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); + +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" +#endif + +#endif /* Need to redefine main()? */ + +#endif /* _SDL_main_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_mouse.h b/Externals/SDL/Include/SDL_mouse.h index b57c371ca5..2a2be8a63a 100644 --- a/Externals/SDL/Include/SDL_mouse.h +++ b/Externals/SDL/Include/SDL_mouse.h @@ -1,274 +1,252 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_mouse.h - * - * Include file for SDL mouse event handling - */ - -#ifndef _SDL_mouse_h -#define _SDL_mouse_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ - -/* Function prototypes */ - -/** - * \fn int SDL_GetNumMice(void) - * - * \brief Get the number of mouse input devices available. - * - * \sa SDL_SelectMouse() - */ -extern DECLSPEC int SDLCALL SDL_GetNumMice(void); - -/** - * \fn char* SDL_GetMouseName(int index) - * - * \brief Gets the name of a mouse with the given index. - * - * \param index is the index of the mouse, which name is to be returned. - * - * \return the name of the mouse with the specified index - */ -extern DECLSPEC char *SDLCALL SDL_GetMouseName(int index); - -/** - * \fn int SDL_SelectMouse(int index) - * - * \brief Set the index of the currently selected mouse. - * - * \return The index of the previously selected mouse. - * - * \note You can query the currently selected mouse by passing an index of -1. - * - * \sa SDL_GetNumMice() - */ -extern DECLSPEC int SDLCALL SDL_SelectMouse(int index); - -/** - * \fn SDL_WindowID SDL_GetMouseFocusWindow(int index) - * - * \brief Get the window which currently has focus for the currently selected mouse. - */ -extern DECLSPEC SDL_WindowID SDLCALL SDL_GetMouseFocusWindow(int index); - -/** - * \fn int SDL_SetRelativeMouseMode(int index, SDL_bool enabled) - * - * \brief Set relative mouse mode for the currently selected mouse. - * - * \param enabled Whether or not to enable relative mode - * - * \return 0 on success, or -1 if relative mode is not supported. - * - * While the mouse is in relative mode, the cursor is hidden, and the - * driver will try to report continuous motion in the current window. - * Only relative motion events will be delivered, the mouse position - * will not change. - * - * \note This function will flush any pending mouse motion. - * - * \sa SDL_GetRelativeMouseMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(int index, - SDL_bool enabled); - -/** - * \fn SDL_bool SDL_GetRelativeMouseMode(int index) - * - * \brief Query whether relative mouse mode is enabled for the currently selected mouse. - * - * \sa SDL_SetRelativeMouseMode() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(int index); - -/** - * \fn Uint8 SDL_GetMouseState(int index, int *x, int *y) - * - * \brief Retrieve the current state of the currently selected mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse cursor position relative to the focus window for the currently - * selected mouse. You can pass NULL for either x or y. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int index, int *x, int *y); - -/** - * \fn Uint8 SDL_GetRelativeMouseState(int index, int *x, int *y) - * - * \brief Retrieve the state of the currently selected mouse. - * - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int index, int *x, - int *y); - -/** - * \fn void SDL_WarpMouseInWindow(SDL_WindowID windowID, int x, int y) - * - * \brief Moves the currently selected mouse to the given position within the window. - * - * \param windowID The window to move the mouse into, or 0 for the current mouse focus - * \param x The x coordinate within the window - * \param y The y coordinate within the window - * - * \note This function generates a mouse motion event - */ -extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID, - int x, int y); - -/** - * \fn SDL_Cursor *SDL_CreateCursor (const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y) - * - * \brief Create a cursor for the currently selected mouse, using the - * specified bitmap data and mask (in MSB format). - * - * The cursor width must be a multiple of 8 bits. - * - * The cursor is created in black and white according to the following: - * data mask resulting pixel on screen - * 0 1 White - * 1 1 Black - * 0 0 Transparent - * 1 0 Inverted color if possible, black if not. - * - * \sa SDL_FreeCursor() - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, - const Uint8 * mask, - int w, int h, int hot_x, - int hot_y); - -/** - * \fn void SDL_SetCursor(SDL_Cursor * cursor) - * - * \brief Set the active cursor for the currently selected mouse. - * - * \note The cursor must have been created for the selected mouse. - */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); - -/** - * \fn SDL_Cursor *SDL_GetCursor(void) - * - * \brief Return the active cursor for the currently selected mouse. - */ -extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); - -/** - * \fn void SDL_FreeCursor(SDL_Cursor * cursor) - * - * \brief Frees a cursor created with SDL_CreateCursor(). - * - * \sa SDL_CreateCursor() - */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); - -/** - * \fn int SDL_ShowCursor(int toggle) - * - * \brief Toggle whether or not the cursor is shown for the currently selected mouse. - * - * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current state. - * - * \return 1 if the cursor is shown, or 0 if the cursor is hidden. - */ -extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); - -/* Used as a mask when testing buttons in buttonstate - Button 1: Left mouse button - Button 2: Middle mouse button - Button 3: Right mouse button - */ - -/** - * \fn int SDL_GetCursorsNumber(int index) - * - * \brief Gets the number of cursors a pointing device supports. - * Useful for tablet users. Useful only under Windows. - * - * \param index is the index of the pointing device, which number of cursors we - * want to receive. - * - * \return the number of cursors supported by the pointing device. On Windows - * if a device is a tablet it returns a number >=1. Normal mice always return 1. - * On Linux every device reports one cursor. - */ -extern DECLSPEC int SDLCALL SDL_GetCursorsNumber(int index); - -/** - * \fn int SDL_GetCurrentCursor(int index) - * - * \brief Returns the index of the current cursor used by a specific pointing - * device. Useful only under Windows. - * - * \param index is the index of the pointing device, which cursor index we want - * to receive. - * - * \return the index of the cursor currently used by a specific pointing device. - * Always 0 under Linux. On Windows if the device isn't a tablet it returns 0. - * If the device is the tablet it returns the cursor index. - * 0 - stylus, 1 - eraser, 2 - cursor. - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentCursor(int index); - -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_X1 4 -#define SDL_BUTTON_X2 5 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_mouse_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_mouse.h + * + * Include file for SDL mouse event handling. + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ + +/* Function prototypes */ + +/** + * \brief Get the number of mouse input devices available. + * + * \sa SDL_SelectMouse() + */ +extern DECLSPEC int SDLCALL SDL_GetNumMice(void); + +/** + * \brief Gets the name of a mouse with the given index. + * + * \param index is the index of the mouse, which name is to be returned. + * + * \return the name of the mouse with the specified index + */ +extern DECLSPEC char *SDLCALL SDL_GetMouseName(int index); + +/** + * \brief Set the index of the currently selected mouse. + * + * \return The index of the previously selected mouse. + * + * \note You can query the currently selected mouse by passing an index of -1. + * + * \sa SDL_GetNumMice() + */ +extern DECLSPEC int SDLCALL SDL_SelectMouse(int index); + +/** + * \brief Get the window which currently has focus for the specified mouse. + */ +extern DECLSPEC SDL_WindowID SDLCALL SDL_GetMouseFocusWindow(int index); + +/** + * \brief Set relative mouse mode for the specified mouse. + * + * \param enabled Whether or not to enable relative mode + * + * \return 0 on success, or -1 if relative mode is not supported. + * + * While the mouse is in relative mode, the cursor is hidden, and the + * driver will try to report continuous motion in the current window. + * Only relative motion events will be delivered, the mouse position + * will not change. + * + * \note This function will flush any pending mouse motion. + * + * \sa SDL_GetRelativeMouseMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(int index, + SDL_bool enabled); + +/** + * \brief Query whether relative mouse mode is enabled for the specified mouse. + * + * \sa SDL_SetRelativeMouseMode() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(int index); + +/** + * \brief Retrieve the current state of the specified mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse cursor position relative to the focus window for the currently + * selected mouse. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int index, int *x, int *y); + +/** + * \brief Retrieve the state of the specified mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int index, int *x, + int *y); + +/** + * \brief Moves the currently selected mouse to the given position within the window. + * + * \param windowID The window to move the mouse into, or 0 for the current mouse focus + * \param x The x coordinate within the window + * \param y The y coordinate within the window + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID, + int x, int y); + +/** + * \brief Create a cursor for the currently selected mouse, using the + * specified bitmap data and mask (in MSB format). + * + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * + * + * + * + * + * + *
data mask resulting pixel on screen
0 1 White
1 1 Black
0 0 Transparent
1 0 Inverted color if possible, black + if not.
+ * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, + const Uint8 * mask, + int w, int h, int hot_x, + int hot_y); + +/** + * \brief Set the active cursor for the currently selected mouse. + * + * \note The cursor must have been created for the selected mouse. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); + +/** + * \brief Return the active cursor for the currently selected mouse. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); + +/** + * \brief Frees a cursor created with SDL_CreateCursor(). + * + * \sa SDL_CreateCursor() + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); + +/** + * \brief Toggle whether or not the cursor is shown for the currently selected + * mouse. + * + * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current + * state. + * + * \return 1 if the cursor is shown, or 0 if the cursor is hidden. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/** + * \brief Gets the number of cursors a pointing device supports. + * + * Useful for tablet users. Useful only under Windows. + * + * \param index is the index of the pointing device, which number of cursors we + * want to receive. + * + * \return the number of cursors supported by the pointing device. On Windows + * if a device is a tablet it returns a number >=1. Normal mice always + * return 1. + * + * On Linux every device reports one cursor. + */ +extern DECLSPEC int SDLCALL SDL_GetCursorsNumber(int index); + +/** + * \brief Returns the index of the current cursor used by a specific pointing + * device. + * + * Useful only under Windows. + * + * \param index is the index of the pointing device, which cursor index we want + * to receive. + * + * \return the index of the cursor currently used by a specific pointing + * device. Always 0 under Linux. On Windows if the device isn't a + * tablet it returns 0. If the device is the tablet it returns the + * cursor index. 0 - stylus, 1 - eraser, 2 - cursor. + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentCursor(int index); + +/** + * Used as a mask when testing buttons in buttonstate. + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_mutex.h b/Externals/SDL/Include/SDL_mutex.h index 98f98a098a..d7252b2b45 100644 --- a/Externals/SDL/Include/SDL_mutex.h +++ b/Externals/SDL/Include/SDL_mutex.h @@ -1,170 +1,223 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_mutex_h -#define _SDL_mutex_h - -/** - * \file SDL_mutex.h - * - * Functions to provide thread synchronization primitives - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* Synchronization functions which can time out return this value - if they time out. -*/ -#define SDL_MUTEX_TIMEDOUT 1 - -/* This is the timeout value which corresponds to never time out */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Mutex functions */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* The SDL mutex structure, defined in SDL_mutex.c */ -struct SDL_mutex; -typedef struct SDL_mutex SDL_mutex; - -/* Create a mutex, initialized unlocked */ -extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); - -/* Lock the mutex (Returns 0, or -1 on error) */ -#define SDL_LockMutex(m) SDL_mutexP(m) -extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex * mutex); - -/* Unlock the mutex (Returns 0, or -1 on error) - It is an error to unlock a mutex that has not been locked by - the current thread, and doing so results in undefined behavior. - */ -#define SDL_UnlockMutex(m) SDL_mutexV(m) -extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex * mutex); - -/* Destroy a mutex */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Semaphore functions */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* The SDL semaphore structure, defined in SDL_sem.c */ -struct SDL_semaphore; -typedef struct SDL_semaphore SDL_sem; - -/* Create a semaphore, initialized with value, returns NULL on failure. */ -extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); - -/* Destroy a semaphore */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); - -/* This function suspends the calling thread until the semaphore pointed - * to by sem has a positive count. It then atomically decreases the semaphore - * count. - */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); - -/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds, - SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. -*/ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); - -/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if - the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in - the allotted time, and -1 on error. - On some platforms this function is implemented by looping with a delay - of 1 ms, and so should be avoided if possible. -*/ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); - -/* Atomically increases the semaphore's count (not blocking), returns 0, - or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); - -/* Returns the current count of the semaphore */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Condition variable functions */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* The SDL condition variable structure, defined in SDL_cond.c */ -struct SDL_cond; -typedef struct SDL_cond SDL_cond; - -/* Create a condition variable */ -extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); - -/* Destroy a condition variable */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); - -/* Restart one of the threads that are waiting on the condition variable, - returns 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); - -/* Restart all threads that are waiting on the condition variable, - returns 0 or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); - -/* Wait on the condition variable, unlocking the provided mutex. - The mutex must be locked before entering this function! - The mutex is re-locked once the condition variable is signaled. - Returns 0 when it is signaled, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mut); - -/* Waits for at most 'ms' milliseconds, and returns 0 if the condition - variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not - signaled in the allotted time, and -1 on error. - On some platforms this function is implemented by looping with a delay - of 1 ms, and so should be avoided if possible. -*/ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, - SDL_mutex * mutex, Uint32 ms); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_mutex_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** + * \file SDL_mutex.h + * + * Functions to provide thread synchronization primitives. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** + * This is the timeout value which corresponds to never time out. + */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/** + * \name Mutex functions + */ +/*@{*/ + +/* The SDL mutex structure, defined in SDL_mutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** + * Create a mutex, initialized unlocked. + */ +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); + +/** + * Lock the mutex. + * + * \return 0, or -1 on error. + */ +#define SDL_LockMutex(m) SDL_mutexP(m) +extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex * mutex); + +/** + * Unlock the mutex. + * + * \return 0, or -1 on error. + * + * \warning It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +#define SDL_UnlockMutex(m) SDL_mutexV(m) +extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex * mutex); + +/** + * Destroy a mutex. + */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); + +/*@}*//*Mutex functions*/ + + +/** + * \name Semaphore functions + */ +/*@{*/ + +/* The SDL semaphore structure, defined in SDL_sem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** + * Create a semaphore, initialized with value, returns NULL on failure. + */ +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** + * Destroy a semaphore. + */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by \c sem has a positive count. It then atomically decreases the + * semaphore count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); + +/** + * Non-blocking variant of SDL_SemWait(). + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would + * block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); + +/** + * Variant of SDL_SemWait() with a timeout in milliseconds. + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not + * succeed in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); + +/** + * Atomically increases the semaphore's count (not blocking). + * + * \return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); + +/** + * Returns the current count of the semaphore. + */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); + +/*@}*//*Semaphore functions*/ + + +/** + * \name Condition variable functions + */ +/*@{*/ + +/* The SDL condition variable structure, defined in SDL_cond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; + +/** + * Create a condition variable. + */ +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); + +/** + * Destroy a condition variable. + */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); + +/** + * Restart one of the threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); + +/** + * Restart all threads that are waiting on the condition variable. + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); + +/** + * Wait on the condition variable, unlocking the provided mutex. + * + * \warning The mutex must be locked before entering this function! + * + * The mutex is re-locked once the condition variable is signaled. + * + * \return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mut); + +/** + * Waits for at most \c ms milliseconds, and returns 0 if the condition + * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, + SDL_mutex * mutex, Uint32 ms); + +/*@}*//*Condition variable functions*/ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_name.h b/Externals/SDL/Include/SDL_name.h index 511619af56..84d5e39a09 100644 --- a/Externals/SDL/Include/SDL_name.h +++ b/Externals/SDL/Include/SDL_name.h @@ -1,11 +1,11 @@ - -#ifndef _SDLname_h_ -#define _SDLname_h_ - -#if defined(__STDC__) || defined(__cplusplus) -#define NeedFunctionPrototypes 1 -#endif - -#define SDL_NAME(X) SDL_##X - -#endif /* _SDLname_h_ */ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ diff --git a/Externals/SDL/Include/SDL_opengl.h b/Externals/SDL/Include/SDL_opengl.h index 2a2ebb47ee..75f006428f 100644 --- a/Externals/SDL/Include/SDL_opengl.h +++ b/Externals/SDL/Include/SDL_opengl.h @@ -1,8515 +1,9333 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* This is a simple file to encapsulate the OpenGL API headers */ - -#include "SDL_config.h" - -#ifdef __WIN32__ -#define WIN32_LEAN_AND_MEAN -#ifndef NOMINMAX -#define NOMINMAX /* Don't defined min() and max() */ -#endif -#include -#endif -#ifndef NO_SDL_GLEXT -#define __glext_h_ /* Don't let gl.h include glext.h */ -#endif -#if defined(__MACOSX__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ -#else -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ -#endif -#ifndef NO_SDL_GLEXT -#undef __glext_h_ -#endif - -/* This file is included because glext.h is not available on some systems. - If you don't want this version included, simply define "NO_SDL_GLEXT" - The latest version is available from: - http://oss.sgi.com/projects/ogl-sample/registry/ - */ -#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) -/* *INDENT-OFF* */ -#ifndef __glext_h_ -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2008/11/14 */ -/* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 44 - -#ifndef GL_VERSION_1_2 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#endif - -#ifndef GL_ARB_imaging -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif - -#ifndef GL_VERSION_1_3 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#endif - -#ifndef GL_VERSION_1_4 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#endif - -#ifndef GL_VERSION_1_5 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#endif - -#ifndef GL_VERSION_2_0 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_VERSION_2_1 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -#endif - -#ifndef GL_VERSION_3_0 -#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB -#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 -#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 -#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 -#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 -#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 -#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 -#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_ALPHA_INTEGER 0x8D97 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -/* Reuse tokens from ARB_depth_buffer_float */ -/* reuse GL_DEPTH_COMPONENT32F */ -/* reuse GL_DEPTH32F_STENCIL8 */ -/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ -/* Reuse tokens from ARB_framebuffer_object */ -/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ -/* reuse GL_FRAMEBUFFER_DEFAULT */ -/* reuse GL_FRAMEBUFFER_UNDEFINED */ -/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ -/* reuse GL_INDEX */ -/* reuse GL_MAX_RENDERBUFFER_SIZE */ -/* reuse GL_DEPTH_STENCIL */ -/* reuse GL_UNSIGNED_INT_24_8 */ -/* reuse GL_DEPTH24_STENCIL8 */ -/* reuse GL_TEXTURE_STENCIL_SIZE */ -/* reuse GL_TEXTURE_RED_TYPE */ -/* reuse GL_TEXTURE_GREEN_TYPE */ -/* reuse GL_TEXTURE_BLUE_TYPE */ -/* reuse GL_TEXTURE_ALPHA_TYPE */ -/* reuse GL_TEXTURE_LUMINANCE_TYPE */ -/* reuse GL_TEXTURE_INTENSITY_TYPE */ -/* reuse GL_TEXTURE_DEPTH_TYPE */ -/* reuse GL_UNSIGNED_NORMALIZED */ -/* reuse GL_FRAMEBUFFER_BINDING */ -/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ -/* reuse GL_RENDERBUFFER_BINDING */ -/* reuse GL_READ_FRAMEBUFFER */ -/* reuse GL_DRAW_FRAMEBUFFER */ -/* reuse GL_READ_FRAMEBUFFER_BINDING */ -/* reuse GL_RENDERBUFFER_SAMPLES */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -/* reuse GL_FRAMEBUFFER_COMPLETE */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ -/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ -/* reuse GL_MAX_COLOR_ATTACHMENTS */ -/* reuse GL_COLOR_ATTACHMENT0 */ -/* reuse GL_COLOR_ATTACHMENT1 */ -/* reuse GL_COLOR_ATTACHMENT2 */ -/* reuse GL_COLOR_ATTACHMENT3 */ -/* reuse GL_COLOR_ATTACHMENT4 */ -/* reuse GL_COLOR_ATTACHMENT5 */ -/* reuse GL_COLOR_ATTACHMENT6 */ -/* reuse GL_COLOR_ATTACHMENT7 */ -/* reuse GL_COLOR_ATTACHMENT8 */ -/* reuse GL_COLOR_ATTACHMENT9 */ -/* reuse GL_COLOR_ATTACHMENT10 */ -/* reuse GL_COLOR_ATTACHMENT11 */ -/* reuse GL_COLOR_ATTACHMENT12 */ -/* reuse GL_COLOR_ATTACHMENT13 */ -/* reuse GL_COLOR_ATTACHMENT14 */ -/* reuse GL_COLOR_ATTACHMENT15 */ -/* reuse GL_DEPTH_ATTACHMENT */ -/* reuse GL_STENCIL_ATTACHMENT */ -/* reuse GL_FRAMEBUFFER */ -/* reuse GL_RENDERBUFFER */ -/* reuse GL_RENDERBUFFER_WIDTH */ -/* reuse GL_RENDERBUFFER_HEIGHT */ -/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ -/* reuse GL_STENCIL_INDEX1 */ -/* reuse GL_STENCIL_INDEX4 */ -/* reuse GL_STENCIL_INDEX8 */ -/* reuse GL_STENCIL_INDEX16 */ -/* reuse GL_RENDERBUFFER_RED_SIZE */ -/* reuse GL_RENDERBUFFER_GREEN_SIZE */ -/* reuse GL_RENDERBUFFER_BLUE_SIZE */ -/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ -/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ -/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ -/* reuse GL_MAX_SAMPLES */ -/* Reuse tokens from ARB_framebuffer_sRGB */ -/* reuse GL_FRAMEBUFFER_SRGB */ -/* Reuse tokens from ARB_half_float_vertex */ -/* reuse GL_HALF_FLOAT */ -/* Reuse tokens from ARB_map_buffer_range */ -/* reuse GL_MAP_READ_BIT */ -/* reuse GL_MAP_WRITE_BIT */ -/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ -/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ -/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ -/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ -/* Reuse tokens from ARB_texture_compression_rgtc */ -/* reuse GL_COMPRESSED_RED_RGTC1 */ -/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ -/* reuse GL_COMPRESSED_RG_RGTC2 */ -/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ -/* Reuse tokens from ARB_texture_rg */ -/* reuse GL_RG */ -/* reuse GL_RG_INTEGER */ -/* reuse GL_R8 */ -/* reuse GL_R16 */ -/* reuse GL_RG8 */ -/* reuse GL_RG16 */ -/* reuse GL_R16F */ -/* reuse GL_R32F */ -/* reuse GL_RG16F */ -/* reuse GL_RG32F */ -/* reuse GL_R8I */ -/* reuse GL_R8UI */ -/* reuse GL_R16I */ -/* reuse GL_R16UI */ -/* reuse GL_R32I */ -/* reuse GL_R32UI */ -/* reuse GL_RG8I */ -/* reuse GL_RG8UI */ -/* reuse GL_RG16I */ -/* reuse GL_RG16UI */ -/* reuse GL_RG32I */ -/* reuse GL_RG32UI */ -/* Reuse tokens from ARB_vertex_array_object */ -/* reuse GL_VERTEX_ARRAY_BINDING */ -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_env_add -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_ARB_point_parameters -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -#ifndef GL_ARB_shadow -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -#ifndef GL_ARB_window_pos -#endif - -#ifndef GL_ARB_vertex_program -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#endif - -#ifndef GL_ARB_fragment_program -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#endif - -#ifndef GL_ARB_shader_objects -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#endif - -#ifndef GL_ARB_point_sprite -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -#ifndef GL_ARB_texture_float -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -#ifndef GL_ARB_depth_buffer_float -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#endif - -#ifndef GL_ARB_draw_instanced -#endif - -#ifndef GL_ARB_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_INDEX 0x8222 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#endif - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#endif - -#ifndef GL_ARB_geometry_shader4 -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -/* reuse GL_MAX_VARYING_COMPONENTS */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ -#endif - -#ifndef GL_ARB_half_float_vertex -#define GL_HALF_FLOAT 0x140B -#endif - -#ifndef GL_ARB_instanced_arrays -#endif - -#ifndef GL_ARB_map_buffer_range -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#endif - -#ifndef GL_ARB_texture_buffer_object -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -#endif - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#endif - -#ifndef GL_ARB_texture_rg -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#endif - -#ifndef GL_ARB_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_EXT_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif - -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif - -#ifndef GL_NV_evaluators -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#endif - -#ifndef GL_NV_texture_compression_vtc -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif - -#ifndef GL_NV_texture_shader -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif - -#ifndef GL_NV_vertex_program -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif - -#ifndef GL_OML_interlace -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif - -#ifndef GL_OML_subsample -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif - -#ifndef GL_OML_resample -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#endif - -#ifndef GL_ATI_element_array -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#endif - -#ifndef GL_SUN_mesh_array -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_DEPTH_CLAMP_NV 0x864F -#endif - -#ifndef GL_NV_occlusion_query -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#endif - -#ifndef GL_NV_point_sprite -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif - -#ifndef GL_NV_vertex_program1_1 -#endif - -#ifndef GL_EXT_shadow_funcs -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -#ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A -#endif - -#ifndef GL_APPLE_fence -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -#ifndef GL_S3_s3tc -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -#ifndef GL_ATI_texture_float -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif - -#ifndef GL_NV_float_buffer -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif - -#ifndef GL_NV_fragment_program -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#endif - -#ifndef GL_NV_half_float -#define GL_HALF_FLOAT_NV 0x140B -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#endif - -#ifndef GL_NV_primitive_restart -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -#ifndef GL_NV_vertex_program2 -#endif - -#ifndef GL_ATI_map_object_buffer -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#endif - -#ifndef GL_OES_read_format -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#endif - -#ifndef GL_MESA_pack_invert -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -#ifndef GL_NV_fragment_program_option -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif - -#ifndef GL_NV_vertex_program2_option -/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ -/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ -#endif - -#ifndef GL_NV_vertex_program3 -/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#endif - -#ifndef GL_GREMEDY_string_marker -#endif - -#ifndef GL_EXT_packed_depth_stencil -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#endif - -#ifndef GL_EXT_stencil_clear_tag -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -#endif - -#ifndef GL_EXT_texture_sRGB -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#endif - -#ifndef GL_EXT_framebuffer_blit -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -#endif - -#ifndef GL_EXT_framebuffer_multisample -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#endif - -#ifndef GL_MESAX_texture_stack -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#endif - -#ifndef GL_EXT_timer_query -#define GL_TIME_ELAPSED_EXT 0x88BF -#endif - -#ifndef GL_EXT_gpu_program_parameters -#endif - -#ifndef GL_APPLE_flush_buffer_range -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -#endif - -#ifndef GL_NV_gpu_program4 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -#endif - -#ifndef GL_NV_geometry_program4 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#endif - -#ifndef GL_EXT_geometry_shader4 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ -/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ -/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ -/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -/* reuse GL_LINES_ADJACENCY_EXT */ -/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ -/* reuse GL_TRIANGLES_ADJACENCY_EXT */ -/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ -/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ -/* reuse GL_PROGRAM_POINT_SIZE_EXT */ -#endif - -#ifndef GL_NV_vertex_program4 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -#endif - -#ifndef GL_EXT_gpu_shader4 -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#endif - -#ifndef GL_EXT_draw_instanced -#endif - -#ifndef GL_EXT_packed_float -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#endif - -#ifndef GL_EXT_texture_array -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ -#endif - -#ifndef GL_EXT_texture_buffer_object -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -#endif - -#ifndef GL_EXT_texture_compression_latc -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#endif - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#endif - -#ifndef GL_EXT_texture_shared_exponent -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#endif - -#ifndef GL_NV_depth_buffer_float -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -#endif - -#ifndef GL_NV_fragment_program4 -#endif - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -#endif - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#endif - -#ifndef GL_NV_geometry_shader4 -#endif - -#ifndef GL_NV_parameter_buffer_object -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -#endif - -#ifndef GL_EXT_draw_buffers2 -#endif - -#ifndef GL_NV_transform_feedback -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#endif - -#ifndef GL_EXT_bindable_uniform -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -#endif - -#ifndef GL_EXT_texture_integer -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -#endif - -#ifndef GL_GREMEDY_frame_terminator -#endif - -#ifndef GL_NV_conditional_render -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -#endif - -#ifndef GL_NV_present_video -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -#endif - -#ifndef GL_EXT_transform_feedback -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#endif - -#ifndef GL_EXT_direct_state_access -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -#endif - -#ifndef GL_EXT_vertex_array_bgra -/* reuse GL_BGRA */ -#endif - -#ifndef GL_EXT_texture_swizzle -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#endif - -#ifndef GL_NV_explicit_multisample -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#endif - -#ifndef GL_NV_transform_feedback2 -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -#endif - - -/*************************************************************/ - -#include -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; /* native character */ -#endif - -#ifndef GL_VERSION_1_5 -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -#endif - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif - -#ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and program/shader text */ -typedef char GLcharARB; /* native character */ -typedef unsigned int GLhandleARB; /* shader object handle */ -#endif - -/* GL types for "half" precision (s10e5) float data in host memory */ -#ifndef GL_ARB_half_float_pixel -typedef unsigned short GLhalfARB; -#endif - -#ifndef GL_NV_half_float -typedef unsigned short GLhalfNV; -#endif - -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -#include /* Fallback option */ -#endif -#endif - -#ifndef GL_EXT_timer_query -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -#endif - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -#endif - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -#endif - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -/* OpenGL 3.0 also reuses entry points from these extensions: */ -/* ARB_framebuffer_object */ -/* ARB_map_buffer_range */ -/* ARB_vertex_array_object */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *); -GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glEnablei (GLenum, GLuint); -GLAPI void APIENTRY glDisablei (GLenum, GLuint); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum); -GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLint *, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLint *); -GLAPI void APIENTRY glClampColor (GLenum, GLenum); -GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); -GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint); -GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glUniform1ui (GLint, GLuint); -GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint); -GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *); -GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *); -GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *); -GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint); -GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint *location); -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#endif - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#endif - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#endif - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#endif - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#endif - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#endif - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -#endif - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint); -GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint); -GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmap (GLenum); -GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -#endif - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -#endif - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisor (GLuint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); -#endif - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -#endif - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#endif - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -#endif - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -#endif - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArray (GLuint); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); -#endif - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#endif - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#endif - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#endif - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#endif - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#endif - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#endif - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#endif - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#endif - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#endif - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#endif - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -/* This is really a WGL extension, but defines some associated GL enums. - * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. - */ -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#endif - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#endif - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#endif - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#endif - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#endif - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#endif - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#endif - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#endif - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); -#endif - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -#endif - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); -#endif - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -#endif - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -#endif - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); -#endif - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); -#endif - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); -#endif - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); -#endif - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -#endif - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); -#endif - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -#endif - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); -GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); -GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); -GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -#endif - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -#endif - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -#endif - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); -#endif - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -#endif - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -#endif - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -#endif - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); -GLAPI void APIENTRY glClearDepthdNV (GLdouble); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -#endif - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -#endif - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -#endif - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -#endif - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); -#endif - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); -#endif - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); -GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum); -GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -#endif - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -#endif - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -#endif - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); -#endif - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum); -GLAPI void APIENTRY glEndConditionalRenderNV (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); -#endif - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -#endif - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum); -GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLint *, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLint *location); -#endif - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield); -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixPopEXT (GLenum); -GLAPI void APIENTRY glMatrixPushEXT (GLenum); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *); -GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -#endif - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -#endif - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -#endif - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); -#endif - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint); -GLAPI void APIENTRY glPauseTransformFeedbackNV (void); -GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif -/* *INDENT-ON* */ -#endif /* NO_SDL_GLEXT */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_opengl.h + * + * This is a simple file to encapsulate the OpenGL API headers. + */ + +#ifndef _SDL_opengl_h +#define _SDL_opengl_h + +#include "SDL_config.h" + +#ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX /* Don't defined min() and max() */ +#endif +#include +#endif +#ifndef NO_SDL_GLEXT +#define __glext_h_ /* Don't let gl.h include glext.h */ +#endif +#if defined(__MACOSX__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#define __X_GL_H +#else +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#endif +#ifndef NO_SDL_GLEXT +#undef __glext_h_ +#endif + +/** + * \file SDL_opengl.h + * + * This file is included because glext.h is not available on some systems. + * If you don't want this version included, simply define ::NO_SDL_GLEXT. + * + * The latest version is available from: + * http://www.opengl.org/registry/ + */ + +/** + * \def NO_SDL_GLEXT + * + * Define this if you have your own version of glext.h and want to disable the + * version included in SDL_opengl.h. + */ + +#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) +/* *INDENT-OFF* */ +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated $Date: 2009-10-19 15:31:58 +0200 (må, 19 okt 2009) $ */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 54 + +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#endif + +#ifndef GL_ARB_imaging_DEPRECATED +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#endif + +#ifndef GL_VERSION_1_5_DEPRECATED +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_VERSION_2_0_DEPRECATED +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#endif + +#ifndef GL_VERSION_2_1 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#endif + +#ifndef GL_VERSION_2_1_DEPRECATED +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + +#ifndef GL_VERSION_3_0 +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +/* Reuse tokens from ARB_depth_buffer_float */ +/* reuse GL_DEPTH_COMPONENT32F */ +/* reuse GL_DEPTH32F_STENCIL8 */ +/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_DEFAULT */ +/* reuse GL_FRAMEBUFFER_UNDEFINED */ +/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ +/* reuse GL_INDEX */ +/* reuse GL_MAX_RENDERBUFFER_SIZE */ +/* reuse GL_DEPTH_STENCIL */ +/* reuse GL_UNSIGNED_INT_24_8 */ +/* reuse GL_DEPTH24_STENCIL8 */ +/* reuse GL_TEXTURE_STENCIL_SIZE */ +/* reuse GL_TEXTURE_RED_TYPE */ +/* reuse GL_TEXTURE_GREEN_TYPE */ +/* reuse GL_TEXTURE_BLUE_TYPE */ +/* reuse GL_TEXTURE_ALPHA_TYPE */ +/* reuse GL_TEXTURE_DEPTH_TYPE */ +/* reuse GL_UNSIGNED_NORMALIZED */ +/* reuse GL_FRAMEBUFFER_BINDING */ +/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_BINDING */ +/* reuse GL_READ_FRAMEBUFFER */ +/* reuse GL_DRAW_FRAMEBUFFER */ +/* reuse GL_READ_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_SAMPLES */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* reuse GL_FRAMEBUFFER_COMPLETE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ +/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ +/* reuse GL_MAX_COLOR_ATTACHMENTS */ +/* reuse GL_COLOR_ATTACHMENT0 */ +/* reuse GL_COLOR_ATTACHMENT1 */ +/* reuse GL_COLOR_ATTACHMENT2 */ +/* reuse GL_COLOR_ATTACHMENT3 */ +/* reuse GL_COLOR_ATTACHMENT4 */ +/* reuse GL_COLOR_ATTACHMENT5 */ +/* reuse GL_COLOR_ATTACHMENT6 */ +/* reuse GL_COLOR_ATTACHMENT7 */ +/* reuse GL_COLOR_ATTACHMENT8 */ +/* reuse GL_COLOR_ATTACHMENT9 */ +/* reuse GL_COLOR_ATTACHMENT10 */ +/* reuse GL_COLOR_ATTACHMENT11 */ +/* reuse GL_COLOR_ATTACHMENT12 */ +/* reuse GL_COLOR_ATTACHMENT13 */ +/* reuse GL_COLOR_ATTACHMENT14 */ +/* reuse GL_COLOR_ATTACHMENT15 */ +/* reuse GL_DEPTH_ATTACHMENT */ +/* reuse GL_STENCIL_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_RENDERBUFFER_WIDTH */ +/* reuse GL_RENDERBUFFER_HEIGHT */ +/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ +/* reuse GL_STENCIL_INDEX1 */ +/* reuse GL_STENCIL_INDEX4 */ +/* reuse GL_STENCIL_INDEX8 */ +/* reuse GL_STENCIL_INDEX16 */ +/* reuse GL_RENDERBUFFER_RED_SIZE */ +/* reuse GL_RENDERBUFFER_GREEN_SIZE */ +/* reuse GL_RENDERBUFFER_BLUE_SIZE */ +/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ +/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ +/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ +/* reuse GL_MAX_SAMPLES */ +/* Reuse tokens from ARB_framebuffer_sRGB */ +/* reuse GL_FRAMEBUFFER_SRGB */ +/* Reuse tokens from ARB_half_float_vertex */ +/* reuse GL_HALF_FLOAT */ +/* Reuse tokens from ARB_map_buffer_range */ +/* reuse GL_MAP_READ_BIT */ +/* reuse GL_MAP_WRITE_BIT */ +/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ +/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ +/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ +/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ +/* Reuse tokens from ARB_texture_compression_rgtc */ +/* reuse GL_COMPRESSED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_RG_RGTC2 */ +/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ +/* Reuse tokens from ARB_texture_rg */ +/* reuse GL_RG */ +/* reuse GL_RG_INTEGER */ +/* reuse GL_R8 */ +/* reuse GL_R16 */ +/* reuse GL_RG8 */ +/* reuse GL_RG16 */ +/* reuse GL_R16F */ +/* reuse GL_R32F */ +/* reuse GL_RG16F */ +/* reuse GL_RG32F */ +/* reuse GL_R8I */ +/* reuse GL_R8UI */ +/* reuse GL_R16I */ +/* reuse GL_R16UI */ +/* reuse GL_R32I */ +/* reuse GL_R32UI */ +/* reuse GL_RG8I */ +/* reuse GL_RG8UI */ +/* reuse GL_RG16I */ +/* reuse GL_RG16UI */ +/* reuse GL_RG32I */ +/* reuse GL_RG32UI */ +/* Reuse tokens from ARB_vertex_array_object */ +/* reuse GL_VERTEX_ARRAY_BINDING */ +#endif + +#ifndef GL_VERSION_3_0_DEPRECATED +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_TEXTURE_LUMINANCE_TYPE */ +/* reuse GL_TEXTURE_INTENSITY_TYPE */ +#endif + +#ifndef GL_VERSION_3_1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +/* Reuse tokens from ARB_copy_buffer */ +/* reuse GL_COPY_READ_BUFFER */ +/* reuse GL_COPY_WRITE_BUFFER */ +/* Would reuse tokens from ARB_draw_instanced, but it has none */ +/* Reuse tokens from ARB_uniform_buffer_object */ +/* reuse GL_UNIFORM_BUFFER */ +/* reuse GL_UNIFORM_BUFFER_BINDING */ +/* reuse GL_UNIFORM_BUFFER_START */ +/* reuse GL_UNIFORM_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ +/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ +/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ +/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ +/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ +/* reuse GL_UNIFORM_TYPE */ +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_INDEX */ +/* reuse GL_UNIFORM_OFFSET */ +/* reuse GL_UNIFORM_ARRAY_STRIDE */ +/* reuse GL_UNIFORM_MATRIX_STRIDE */ +/* reuse GL_UNIFORM_IS_ROW_MAJOR */ +/* reuse GL_UNIFORM_BLOCK_BINDING */ +/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ +/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_INVALID_INDEX */ +#endif + +#ifndef GL_VERSION_3_2 +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* Reuse tokens from ARB_depth_clamp */ +/* reuse GL_DEPTH_CLAMP */ +/* Would reuse tokens from ARB_draw_elements_base_vertex, but it has none */ +/* Would reuse tokens from ARB_fragment_coord_conventions, but it has none */ +/* Reuse tokens from ARB_provoking_vertex */ +/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +/* Reuse tokens from ARB_seamless_cube_map */ +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ +/* Reuse tokens from ARB_sync */ +/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */ +/* reuse GL_OBJECT_TYPE */ +/* reuse GL_SYNC_CONDITION */ +/* reuse GL_SYNC_STATUS */ +/* reuse GL_SYNC_FLAGS */ +/* reuse GL_SYNC_FENCE */ +/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */ +/* reuse GL_UNSIGNALED */ +/* reuse GL_SIGNALED */ +/* reuse GL_ALREADY_SIGNALED */ +/* reuse GL_TIMEOUT_EXPIRED */ +/* reuse GL_CONDITION_SATISFIED */ +/* reuse GL_WAIT_FAILED */ +/* reuse GL_TIMEOUT_IGNORED */ +/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */ +/* reuse GL_TIMEOUT_IGNORED */ +/* Reuse tokens from ARB_texture_multisample */ +/* reuse GL_SAMPLE_POSITION */ +/* reuse GL_SAMPLE_MASK */ +/* reuse GL_SAMPLE_MASK_VALUE */ +/* reuse GL_MAX_SAMPLE_MASK_WORDS */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_SAMPLES */ +/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */ +/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */ +/* reuse GL_MAX_INTEGER_SAMPLES */ +/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */ +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +#ifndef GL_ARB_draw_instanced +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#endif + +#ifndef GL_ARB_framebuffer_object_DEPRECATED +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_HALF_FLOAT 0x140B +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +#ifndef GL_ARB_texture_rg +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu +#endif + +#ifndef GL_ARB_compatibility +/* ARB_compatibility just defines tokens from core 3.0 */ +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#endif + +#ifndef GL_ARB_shader_texture_lod +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_DEPTH_CLAMP 0x864F +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#endif + +#ifndef GL_ARB_sync +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +#endif + +#ifndef GL_ARB_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_ARB_draw_buffers_blend +#endif + +#ifndef GL_ARB_sample_shading +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +#endif + +#ifndef GL_ARB_texture_gather +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#endif + +#ifndef GL_ARB_texture_query_lod +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + +#ifndef GL_NV_conditional_render +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#endif + +#ifndef GL_NV_present_video +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +#endif + +#ifndef GL_EXT_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#endif + +#ifndef GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +#ifndef GL_AMD_texture_texture4 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +/* reuse GL_R_SNORM */ +/* reuse GL_RG_SNORM */ +/* reuse GL_RGB_SNORM */ +/* reuse GL_RGBA_SNORM */ +/* reuse GL_R8_SNORM */ +/* reuse GL_RG8_SNORM */ +/* reuse GL_RGB8_SNORM */ +/* reuse GL_RGBA8_SNORM */ +/* reuse GL_R16_SNORM */ +/* reuse GL_RG16_SNORM */ +/* reuse GL_RGB16_SNORM */ +/* reuse GL_RGBA16_SNORM */ +/* reuse GL_SIGNED_NORMALIZED */ +#endif + +#ifndef GL_AMD_draw_buffers_blend +#endif + +#ifndef GL_APPLE_texture_range +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +/* reuse GL_STORAGE_CACHED_APPLE */ +/* reuse GL_STORAGE_SHARED_APPLE */ +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for program/shader text and shader object handles */ +typedef char GLcharARB; +typedef unsigned int GLhandleARB; +#endif + +/* GL type for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + +#ifndef ARB_sync +typedef int64_t GLint64; +typedef uint64_t GLuint64; +typedef struct __GLsync *GLsync; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_VERSION_1_2_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_VERSION_1_3_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_VERSION_1_4_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +/* OpenGL 3.0 also reuses entry points from these extensions: */ +/* ARB_framebuffer_object */ +/* ARB_map_buffer_range */ +/* ARB_vertex_array_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *); +GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glEnablei (GLenum, GLuint); +GLAPI void APIENTRY glDisablei (GLenum, GLuint); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glClampColor (GLenum, GLenum); +GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint); +GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glUniform1ui (GLint, GLuint); +GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint); +GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *); +GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *); +GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *); +GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint); +GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +#endif + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +/* OpenGL 3.1 also reuses entry points from these extensions: */ +/* ARB_copy_buffer */ +/* ARB_uniform_buffer_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +GLAPI void APIENTRY glTexBuffer (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +#endif + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +/* OpenGL 3.2 also reuses entry points from these extensions: */ +/* ARB_draw_elements_base_vertex */ +/* ARB_provoking_vertex */ +/* ARB_sync */ +/* ARB_texture_multisample */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInteger64i_v (GLenum, GLuint, GLint64 *); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum, GLenum, GLint64 *); +GLAPI void APIENTRY glProgramParameteri (GLuint, GLenum, GLint); +GLAPI void APIENTRY glFramebufferTexture (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureFace (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint); +GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint); +GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmap (GLenum); +GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArray (GLuint); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *); +GLAPI void APIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum, GLsizei, GLenum, const GLvoid *, GLint); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei, GLint); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertex (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glFenceSync (GLenum, GLbitfield); +GLAPI GLboolean APIENTRY glIsSync (GLsync); +GLAPI void APIENTRY glDeleteSync (GLsync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync, GLbitfield, GLuint64); +GLAPI void APIENTRY glWaitSync (GLsync, GLbitfield, GLuint64); +GLAPI void APIENTRY glGetInteger64v (GLenum, GLint64 *); +GLAPI void APIENTRY glGetSynciv (GLsync, GLenum, GLsizei, GLsizei *, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisample (GLenum, GLsizei, GLint, GLsizei, GLsizei, GLboolean); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum, GLsizei, GLint, GLsizei, GLsizei, GLsizei, GLboolean); +GLAPI void APIENTRY glGetMultisamplefv (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glSampleMaski (GLuint, GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +#endif + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationi (GLuint, GLenum); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint, GLenum, GLenum); +GLAPI void APIENTRY glBlendFunci (GLuint, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint, GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#endif + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#endif + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); +GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); +GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); +GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); +GLAPI void APIENTRY glClearDepthdNV (GLdouble); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLchar* *, GLenum); +GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#endif + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint); +GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield); +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMatrixPopEXT (GLenum); +GLAPI void APIENTRY glMatrixPushEXT (GLenum); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *); +GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_AMD_vertex_shader_tesselator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat); +GLAPI void APIENTRY glTessellationModeAMD (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#endif + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint, GLenum); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint, GLenum); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint, GLenum); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint, GLenum); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum, GLuint, GLenum); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum, GLuint, GLenum); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum, GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif +/* *INDENT-ON* */ +#endif /* NO_SDL_GLEXT */ + +#endif /* _SDL_opengl_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_opengles.h b/Externals/SDL/Include/SDL_opengles.h index 814eb07159..cd2c099d62 100644 --- a/Externals/SDL/Include/SDL_opengles.h +++ b/Externals/SDL/Include/SDL_opengles.h @@ -20,10 +20,13 @@ slouken@libsdl.org */ -/* - This is a simple file to encapsulate the OpenGL ES API headers. - Headers copied from The Kronos Group website. - http://www.khronos.org/opengles/ +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES API headers. + * + * Headers copied from The Kronos Group website. + * http://www.khronos.org/opengles/ */ #ifndef __gles_h_ @@ -48,6 +51,9 @@ extern "C" #define GL_APIENTRY #endif +#ifndef GL_API +#define GL_API +#endif /* GL_API */ /* ** License Applicability. Except to the extent portions of this file are @@ -341,6 +347,14 @@ extern "C" #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB +/* OpenGL ES 1.0 defines, they gone in 1.1 and 2.0 */ +#ifndef GL_MAX_ELEMENTS_VERTICES +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#endif /* GL_MAX_ELEMENTS_VERTICES */ +#ifndef GL_MAX_ELEMENTS_INDICES +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#endif /* GL_MAX_ELEMENTS_INDICES */ + /* GetTextureParameter */ /* GL_TEXTURE_MAG_FILTER */ /* GL_TEXTURE_MIN_FILTER */ @@ -655,6 +669,29 @@ extern "C" #define GL_COORD_REPLACE_OES 0x8862 #endif +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D +#endif /* GL_OES_draw_texture */ + +/* GL_OES_vertex_buffer_object */ +#ifndef GL_OES_vertex_buffer_object +#define GL_ARRAY_BUFFER_OES 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_OES 0x8893 +#define GL_ARRAY_BUFFER_BINDING_OES 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_OES 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_OES 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_OES 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_OES 0x8898 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_OES 0x889A +#define GL_STATIC_DRAW_OES 0x88E4 +#define GL_DYNAMIC_DRAW_OES 0x88E8 +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_SIZE_OES 0x8764 +#define GL_BUFFER_USAGE_OES 0x8765 +#define GL_BUFFER_ACCESS_OES 0x88BB +#endif /* GL_OES_vertex_buffer_object */ + /*************************************************************/ /* Available only in Common profile */ @@ -936,11 +973,65 @@ extern "C" const GLvoid * pointer); #endif +/* GL_OES_query_matrix */ +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 + GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES(GLfixed mantissa[16], + GLint exponent[16]); +#endif /* GL_OES_query_matrix */ + /* GL_OES_point_sprite */ #ifndef GL_OES_point_sprite #define GL_OES_point_sprite 1 #endif +/* GL_OES_draw_texture */ +#ifndef GL_OES_draw_texture +#define GL_OES_draw_texture 1 + GL_API void GL_APIENTRY glDrawTexsOES(GLshort x, GLshort y, GLshort z, + GLshort width, GLshort height); + GL_API void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z, + GLint width, GLint height); + GL_API void GL_APIENTRY glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, + GLfixed width, GLfixed height); + GL_API void GL_APIENTRY glDrawTexsvOES(const GLshort * coords); + GL_API void GL_APIENTRY glDrawTexivOES(const GLint * coords); + GL_API void GL_APIENTRY glDrawTexxvOES(const GLfixed * coords); + GL_API void GL_APIENTRY glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, + GLfloat width, GLfloat height); + GL_API void GL_APIENTRY glDrawTexfvOES(const GLfloat * coords); +#endif /* GL_OES_draw_texture */ + +/* GL_OES_single_precision */ +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + GL_API void GL_APIENTRY glDepthRangefOES(GLclampf zNear, GLclampf zFar); + GL_API void GL_APIENTRY glFrustumfOES(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, + GLfloat zNear, GLfloat zFar); + GL_API void GL_APIENTRY glOrthofOES(GLfloat left, GLfloat right, + GLfloat bottom, GLfloat top, + GLfloat zNear, GLfloat zFar); + GL_API void GL_APIENTRY glClipPlanefOES(GLenum plane, + const GLfloat * equation); + GL_API void GL_APIENTRY glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]); + GL_API void GL_APIENTRY glClearDepthfOES(GLclampf depth); +#endif /* GL_OES_single_precision */ + +/* GL_OES_vertex_buffer_object */ +#ifndef GL_OES_vertex_buffer_object +#define GL_OES_vertex_buffer_object 1 + GL_API void APIENTRY glBindBufferOES(GLenum, GLuint); + GL_API void APIENTRY glDeleteBuffersOES(GLsizei, const GLuint *); + GL_API void APIENTRY glGenBuffersOES(GLsizei, GLuint *); + GL_API GLboolean APIENTRY glIsBufferOES(GLuint); + GL_API void APIENTRY glBufferDataOES(GLenum, GLsizeiptr, const GLvoid *, + GLenum); + GL_API void APIENTRY glBufferSubDataOES(GLenum, GLintptr, GLsizeiptr, + const GLvoid *); + GL_API void APIENTRY glGetBufferParameterivOES(GLenum, GLenum, GLint *); +#endif /* GL_OES_vertex_buffer_object */ + #ifdef __cplusplus } #endif diff --git a/Externals/SDL/Include/SDL_pixels.h b/Externals/SDL/Include/SDL_pixels.h index f4523fa8e6..9aa4c1ee59 100644 --- a/Externals/SDL/Include/SDL_pixels.h +++ b/Externals/SDL/Include/SDL_pixels.h @@ -21,9 +21,9 @@ */ /** - * \file SDL_pixels.h - * - * Header for the enumerated pixel format definitions + * \file SDL_pixels.h + * + * Header for the enumerated pixel format definitions. */ #ifndef _SDL_pixels_h @@ -37,12 +37,19 @@ extern "C" { /* *INDENT-ON* */ #endif -/* Transparency definitions: These define alpha as the opacity of a surface */ +/** + * \name Transparency definitions + * + * These define alpha as the opacity of a surface. + */ +/*@{*/ #define SDL_ALPHA_OPAQUE 255 #define SDL_ALPHA_TRANSPARENT 0 +/*@}*/ +/** Pixel type. */ enum -{ /* Pixel type */ +{ SDL_PIXELTYPE_UNKNOWN, SDL_PIXELTYPE_INDEX1, SDL_PIXELTYPE_INDEX4, @@ -57,14 +64,17 @@ enum SDL_PIXELTYPE_ARRAYF32 }; +/** Bitmap pixel order, high bit -> low bit. */ enum -{ /* bitmap pixel order, high bit -> low bit */ +{ SDL_BITMAPORDER_NONE, SDL_BITMAPORDER_4321, SDL_BITMAPORDER_1234 }; + +/** Packed component order, high bit -> low bit. */ enum -{ /* packed component order, high bit -> low bit */ +{ SDL_PACKEDORDER_NONE, SDL_PACKEDORDER_XRGB, SDL_PACKEDORDER_RGBX, @@ -75,8 +85,10 @@ enum SDL_PACKEDORDER_ABGR, SDL_PACKEDORDER_BGRA }; + +/** Array component order, low byte -> high byte. */ enum -{ /* array component order, low byte -> high byte */ +{ SDL_ARRAYORDER_NONE, SDL_ARRAYORDER_RGB, SDL_ARRAYORDER_RGBA, @@ -86,8 +98,9 @@ enum SDL_ARRAYORDER_ABGR }; +/** Packed component layout. */ enum -{ /* Packed component layout */ +{ SDL_PACKEDLAYOUT_NONE, SDL_PACKEDLAYOUT_332, SDL_PACKEDLAYOUT_4444, @@ -117,6 +130,12 @@ enum (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)) +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)) + #define SDL_ISPIXELFORMAT_FOURCC(format) \ ((format) && !((format) & 0x80000000)) @@ -131,10 +150,10 @@ enum 1, 0), SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, - 2, 0), + 4, 0), SDL_PIXELFORMAT_INDEX4MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, - 2, 0), + 4, 0), SDL_PIXELFORMAT_INDEX8 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), SDL_PIXELFORMAT_RGB332 = @@ -152,6 +171,9 @@ enum SDL_PIXELFORMAT_ARGB4444 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ABGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_4444, 16, 2), SDL_PIXELFORMAT_ARGB1555 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_1555, 16, 2), @@ -161,6 +183,9 @@ enum SDL_PIXELFORMAT_RGB565 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_BGR565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_565, 16, 2), SDL_PIXELFORMAT_RGB24 = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, 24, 3), @@ -189,15 +214,15 @@ enum SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_2101010, 32, 4), - SDL_PIXELFORMAT_YV12 = /* Planar mode: Y + V + U (3 planes) */ + SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), - SDL_PIXELFORMAT_IYUV = /* Planar mode: Y + U + V (3 planes) */ + SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), - SDL_PIXELFORMAT_YUY2 = /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ + SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), - SDL_PIXELFORMAT_UYVY = /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ + SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), - SDL_PIXELFORMAT_YVYU = /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ + SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U') }; @@ -229,7 +254,9 @@ struct SDL_Palette SDL_PaletteWatch *watch; }; -/* Everything in the pixel format structure is read-only */ +/** + * \note Everything in the pixel format structure is read-only. + */ typedef struct SDL_PixelFormat { SDL_Palette *palette; @@ -250,13 +277,11 @@ typedef struct SDL_PixelFormat } SDL_PixelFormat; /** - * \fn SDL_bool SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask, Uint32 * Gmask, Uint32 * Bmask, Uint32 * Amask) - * - * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. - * - * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. - * - * \sa SDL_MasksToPixelFormatEnum() + * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. + * + * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. + * + * \sa SDL_MasksToPixelFormatEnum() */ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, @@ -266,13 +291,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, Uint32 * Amask); /** - * \fn Uint32 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) - * - * \brief Convert a bpp and RGBA masks to an enumerated pixel format. - * - * \return The pixel format, or SDL_PixelFormat_Unknown if the conversion wasn't possible. - * - * \sa SDL_PixelFormatEnumToMasks() + * \brief Convert a bpp and RGBA masks to an enumerated pixel format. + * + * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * wasn't possible. + * + * \sa SDL_PixelFormatEnumToMasks() */ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, @@ -281,107 +305,87 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Amask); /** - * \fn SDL_Palette *SDL_AllocPalette(int ncolors) - * - * \brief Create a palette structure with the specified number of color entries. - * - * \return A new palette, or NULL if there wasn't enough memory - * - * \note The palette entries are initialized to white. - * - * \sa SDL_FreePalette() + * \brief Create a palette structure with the specified number of color + * entries. + * + * \return A new palette, or NULL if there wasn't enough memory. + * + * \note The palette entries are initialized to white. + * + * \sa SDL_FreePalette() */ extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); /** - * \fn int SDL_AddPaletteWatch(SDL_Palette *palette, SDL_PaletteChangedFunc callback, void *userdata) - * - * \brief Add a callback function which is called when the palette changes. - * - * \sa SDL_DelPaletteWatch() + * \brief Add a callback function which is called when the palette changes. + * + * \sa SDL_DelPaletteWatch() */ extern DECLSPEC int SDLCALL SDL_AddPaletteWatch(SDL_Palette * palette, SDL_PaletteChangedFunc callback, void *userdata); /** - * \fn void SDL_DelPaletteWatch(SDL_Palette *palette, SDL_PaletteChangedFunc callback, void *userdata) - * - * \brief Remove a callback function previously added with SDL_AddPaletteWatch() - * - * \sa SDL_AddPaletteWatch() + * \brief Remove a callback function previously added with + * SDL_AddPaletteWatch(). + * + * \sa SDL_AddPaletteWatch() */ extern DECLSPEC void SDLCALL SDL_DelPaletteWatch(SDL_Palette * palette, SDL_PaletteChangedFunc callback, void *userdata); /** - * \fn int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Colors *colors, int firstcolor, int numcolors) - * - * \brief Set a range of colors in a palette. - * - * \param palette The palette to modify - * \param colors An array of colors to copy into the palette - * \param firstcolor The index of the first palette entry to modify - * \param ncolors The number of entries to modify - * - * \return 0 on success, or -1 if not all of the colors could be set + * \brief Set a range of colors in a palette. + * + * \param palette The palette to modify. + * \param colors An array of colors to copy into the palette. + * \param firstcolor The index of the first palette entry to modify. + * \param ncolors The number of entries to modify. + * + * \return 0 on success, or -1 if not all of the colors could be set. */ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, const SDL_Color * colors, int firstcolor, int ncolors); /** - * \fn void SDL_FreePalette(SDL_Palette *palette) - * - * \brief Free a palette created with SDL_AllocPalette() - * - * \sa SDL_AllocPalette() + * \brief Free a palette created with SDL_AllocPalette(). + * + * \sa SDL_AllocPalette() */ extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); /** - * \fn Uint32 SDL_MapRGB(const SDL_PixelFormat *format, - * Uint8 r, Uint8 g, Uint8 b) - * - * \brief Maps an RGB triple to an opaque pixel value for a given pixel format - * - * \sa SDL_MapRGBA + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. + * + * \sa SDL_MapRGBA */ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b); /** - * \fn Uint32 SDL_MapRGBA(const SDL_PixelFormat *fmt, - * Uint8 r, Uint8 g, Uint8 b, Uint8 a) - * - * \brief Maps an RGBA quadruple to a pixel value for a given pixel format - * - * \sa SDL_MapRGB + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. + * + * \sa SDL_MapRGB */ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** - * \fn void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, - * Uint8 * r, Uint8 * g, Uint8 * b) - * - * \brief Maps a pixel value into the RGB components for a given pixel format - * - * \sa SDL_GetRGBA + * \brief Maps a pixel value into the RGB components for a given pixel format. + * + * \sa SDL_GetRGBA */ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, Uint8 * r, Uint8 * g, Uint8 * b); /** - * \fn void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format, - * Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) - * - * \brief Maps a pixel value into the RGBA components for a given pixel format - * - * \sa SDL_GetRGB + * \brief Maps a pixel value into the RGBA components for a given pixel format. + * + * \sa SDL_GetRGB */ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format, diff --git a/Externals/SDL/Include/SDL_platform.h b/Externals/SDL/Include/SDL_platform.h index cc2e67fa49..ddf7a0cd51 100644 --- a/Externals/SDL/Include/SDL_platform.h +++ b/Externals/SDL/Include/SDL_platform.h @@ -1,122 +1,154 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* Try to get a standard set of platform defines */ - -#ifndef _SDL_platform_h -#define _SDL_platform_h - -#if defined(_AIX) -#undef __AIX__ -#define __AIX__ 1 -#endif -#if defined(__BEOS__) -#undef __BEOS__ -#define __BEOS__ 1 -#endif -#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) -#undef __BSDI__ -#define __BSDI__ 1 -#endif -#if defined(_arch_dreamcast) -#undef __DREAMCAST__ -#define __DREAMCAST__ 1 -#endif -#if defined(__FreeBSD__) || defined(__DragonFly__) -#undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(hpux) || defined(__hpux) || defined(__hpux__) -#undef __HPUX__ -#define __HPUX__ 1 -#endif -#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) -#undef __IRIX__ -#define __IRIX__ 1 -#endif -#if defined(linux) || defined(__linux) || defined(__linux__) -#undef __LINUX__ -#define __LINUX__ 1 -#endif - -#if defined(__APPLE__) -/* lets us know what version of Mac OS X we're compiling on */ -#include "AvailabilityMacros.h" -#ifdef MAC_OS_X_VERSION_10_3 -#include "TargetConditionals.h" /* this header is in 10.3 or later */ -#if TARGET_OS_IPHONE -/* if compiling for iPhone */ -#undef __IPHONEOS__ -#define __IPHONEOS__ 1 -#undef __MACOSX__ -#else -/* if not compiling for iPhone */ -#undef __MACOSX__ -#define __MACOSX__ 1 -#endif /* TARGET_OS_IPHONE */ -#else -/* if earlier verion of Mac OS X than version 10.3 */ -#undef __MACOSX__ -#define __MACOSX__ 1 -#endif - -#endif /* defined(__APPLE__) */ - -#if defined(__NetBSD__) -#undef __NETBSD__ -#define __NETBSD__ 1 -#endif -#if defined(__OpenBSD__) -#undef __OPENBSD__ -#define __OPENBSD__ 1 -#endif -#if defined(__OS2__) -#undef __OS2__ -#define __OS2__ 1 -#endif -#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) -#undef __OSF__ -#define __OSF__ 1 -#endif -#if defined(__QNXNTO__) -#undef __QNXNTO__ -#define __QNXNTO__ 1 -#endif -#if defined(riscos) || defined(__riscos) || defined(__riscos__) -#undef __RISCOS__ -#define __RISCOS__ 1 -#endif -#if defined(__SVR4) -#undef __SOLARIS__ -#define __SOLARIS__ 1 -#endif -#if defined(WIN32) || defined(_WIN32) -#undef __WIN32__ -#define __WIN32__ 1 -#endif - -#if defined(__NDS__) -#undef __NINTENDODS__ -#define __NINTENDODS__ 1 -#endif - -#endif /* _SDL_platform_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_platform.h + * + * Try to get a standard set of platform defines. + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__BEOS__) +#undef __BEOS__ +#define __BEOS__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +#undef __LINUX__ +#define __LINUX__ 1 +#endif + +#if defined(__APPLE__) +/* lets us know what version of Mac OS X we're compiling on */ +#include "AvailabilityMacros.h" +#ifdef MAC_OS_X_VERSION_10_3 +#include "TargetConditionals.h" /* this header is in 10.3 or later */ +#if TARGET_OS_IPHONE +/* if compiling for iPhone */ +#undef __IPHONEOS__ +#define __IPHONEOS__ 1 +#undef __MACOSX__ +#else +/* if not compiling for iPhone */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#endif /* TARGET_OS_IPHONE */ +#else +/* if earlier verion of Mac OS X than version 10.3 */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#endif + +#endif /* defined(__APPLE__) */ + +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif +#if defined(WIN32) || defined(_WIN32) +#undef __WIN32__ +#define __WIN32__ 1 +#endif + +#if defined(__NDS__) +#undef __NINTENDODS__ +#define __NINTENDODS__ 1 +#endif + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief Gets the name of the platform. + */ +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_platform_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_quit.h b/Externals/SDL/Include/SDL_quit.h index bcf6e3c457..ea6c8f8ddd 100644 --- a/Externals/SDL/Include/SDL_quit.h +++ b/Externals/SDL/Include/SDL_quit.h @@ -1,54 +1,59 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_quit.h - * - * Include file for SDL quit event handling - */ - -#ifndef _SDL_quit_h -#define _SDL_quit_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* - An SDL_QUITEVENT is generated when the user tries to close the application - window. If it is ignored or filtered out, the window will remain open. - If it is not ignored or filtered, it is queued normally and the window - is allowed to close. When the window is closed, screen updates will - complete, but have no effect. - - SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - and SIGTERM (system termination request), if handlers do not already - exist, that generate SDL_QUITEVENT events as well. There is no way - to determine the cause of an SDL_QUITEVENT, but setting a signal - handler in your application will override the default generation of - quit events for that signal. -*/ - -/* There are no functions directly affecting the quit event */ -#define SDL_QuitRequested() \ - (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) - -#endif /* _SDL_quit_h */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_quit.h + * + * Include file for SDL quit event handling. + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** + * \file SDL_quit.h + * + * An ::SDL_QUIT event is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate ::SDL_QUIT events as well. There is no way + * to determine the cause of an ::SDL_QUIT event, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + * + * \sa SDL_Quit() + */ + +/* There are no functions directly affecting the quit event */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) + +#endif /* _SDL_quit_h */ diff --git a/Externals/SDL/Include/SDL_rect.h b/Externals/SDL/Include/SDL_rect.h index c3394468e0..d6cb7942c3 100644 --- a/Externals/SDL/Include/SDL_rect.h +++ b/Externals/SDL/Include/SDL_rect.h @@ -21,9 +21,9 @@ */ /** - * \file SDL_rect.h - * - * Header file for SDL_rect definition and management functions + * \file SDL_rect.h + * + * Header file for SDL_rect definition and management functions. */ #ifndef _SDL_rect_h @@ -43,15 +43,13 @@ extern "C" { #endif /** - * \struct SDL_Rect - * - * \brief A rectangle, with the origin at the upper left. - * - * \sa SDL_RectEmpty - * \sa SDL_RectEquals - * \sa SDL_HasIntersection - * \sa SDL_IntersectRect - * \sa SDL_UnionRect + * \brief A rectangle, with the origin at the upper left. + * + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_UnionRect */ typedef struct SDL_Rect { @@ -60,56 +58,44 @@ typedef struct SDL_Rect } SDL_Rect; /** - * \def SDL_RectEmpty() - * - * \brief Returns true if the rectangle has no area. + * \brief Returns true if the rectangle has no area. */ #define SDL_RectEmpty(X) (((X)->w <= 0) || ((X)->h <= 0)) /** - * \def SDL_RectEquals() - * - * \brief Returns true if the two rectangles are equal. + * \brief Returns true if the two rectangles are equal. */ #define SDL_RectEquals(A, B) (((A)->x == (B)->x) && ((A)->y == (B)->y) && \ ((A)->w == (B)->w) && ((A)->h == (B)->h)) /** - * \fn SDL_bool SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B); - * - * \brief Determine whether two rectangles intersect. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \brief Determine whether two rectangles intersect. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. */ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B); /** - * \fn SDL_bool SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) - * - * \brief Calculate the intersection of two rectangles. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \brief Calculate the intersection of two rectangles. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. */ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result); /** - * \fn void SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) - * - * \brief Calculate the union of two rectangles + * \brief Calculate the union of two rectangles. */ extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result); /** - * \fn SDL_bool SDL_IntersectRectAndLine(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2) - * - * \brief Calculate the intersection of a rectangle and line segment. - * - * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * \brief Calculate the intersection of a rectangle and line segment. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. */ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, diff --git a/Externals/SDL/Include/SDL_revision.h b/Externals/SDL/Include/SDL_revision.h index a7851a2f4d..92dd93ac20 100644 --- a/Externals/SDL/Include/SDL_revision.h +++ b/Externals/SDL/Include/SDL_revision.h @@ -1 +1 @@ -#define SDL_REVISION 4404 +#define SDL_REVISION 0 diff --git a/Externals/SDL/Include/SDL_rwops.h b/Externals/SDL/Include/SDL_rwops.h index 957ce2edff..ab8e85de41 100644 --- a/Externals/SDL/Include/SDL_rwops.h +++ b/Externals/SDL/Include/SDL_rwops.h @@ -1,168 +1,203 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_rwops.h - * - * This file provides a general interface for SDL to read and write - * data sources. It can easily be extended to files, memory, etc. - */ - -#ifndef _SDL_rwops_h -#define _SDL_rwops_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* This is the read/write operation structure -- very basic */ - -typedef struct SDL_RWops -{ - /* Seek to 'offset' relative to whence, one of stdio's whence values: - RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END - Returns the final offset in the data source. - */ - long (SDLCALL * seek) (struct SDL_RWops * context, long offset, - int whence); - - /* Read up to 'num' objects each of size 'objsize' from the data - source to the area pointed at by 'ptr'. - Returns the number of objects read, or 0 at error or end of file. - */ - size_t(SDLCALL * read) (struct SDL_RWops * context, void *ptr, - size_t size, size_t maxnum); - - /* Write exactly 'num' objects each of size 'objsize' from the area - pointed at by 'ptr' to data source. - Returns the number of objects written, or 0 at error or end of file. - */ - size_t(SDLCALL * write) (struct SDL_RWops * context, const void *ptr, - size_t size, size_t num); - - /* Close and free an allocated SDL_RWops structure. - Returns 0 if successful or -1 on write error when flushing data. - */ - int (SDLCALL * close) (struct SDL_RWops * context); - - Uint32 type; - union - { -#ifdef __WIN32__ - struct - { - SDL_bool append; - void *h; - struct - { - void *data; - int size; - int left; - } buffer; - } win32io; -#endif -#ifdef HAVE_STDIO_H - struct - { - SDL_bool autoclose; - FILE *fp; - } stdio; -#endif - struct - { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct - { - void *data1; - } unknown; - } hidden; - -} SDL_RWops; - - -/* Functions to create SDL_RWops structures from various data sources */ - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, - const char *mode); - -#ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, - SDL_bool autoclose); -#endif - -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, - int size); - -extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); - -#define RW_SEEK_SET 0 /* Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /* Seek relative to current read point */ -#define RW_SEEK_END 2 /* Seek relative to the end of data */ - -/* Macros to easily read and write from an SDL_RWops structure */ -#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) -#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) -#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -#define SDL_RWclose(ctx) (ctx)->close(ctx) - - -/* Read an item of the specified endianness and return in native format */ -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); - -/* Write an item of native format to the specified endianness */ -extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); -extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_rwops_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_rwops.h + * + * This file provides a general interface for SDL to read and write + * data sources. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * This is the read/write operation structure -- very basic. + */ +typedef struct SDL_RWops +{ + /** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data source. + */ + long (SDLCALL * seek) (struct SDL_RWops * context, long offset, + int whence); + + /** + * Read up to \c num objects each of size \c objsize from the data + * source to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ + size_t(SDLCALL * read) (struct SDL_RWops * context, void *ptr, + size_t size, size_t maxnum); + + /** + * Write exactly \c num objects each of size \c objsize from the area + * pointed at by \c ptr to data source. + * + * \return the number of objects written, or 0 at error or end of file. + */ + size_t(SDLCALL * write) (struct SDL_RWops * context, const void *ptr, + size_t size, size_t num); + + /** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ + int (SDLCALL * close) (struct SDL_RWops * context); + + Uint32 type; + union + { +#ifdef __WIN32__ + struct + { + SDL_bool append; + void *h; + struct + { + void *data; + size_t size; + size_t left; + } buffer; + } win32io; +#endif +#ifdef HAVE_STDIO_H + struct + { + SDL_bool autoclose; + FILE *fp; + } stdio; +#endif + struct + { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct + { + void *data1; + } unknown; + } hidden; + +} SDL_RWops; + + +/** + * \name RWFrom functions + * + * Functions to create SDL_RWops structures from various data sources. + */ +/*@{*/ + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, + const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, + SDL_bool autoclose); +#endif + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, + int size); + +/*@}*//*RWFrom functions*/ + + +extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); + +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ + +/** + * \name Read/write macros + * + * Macros to easily read and write from an SDL_RWops structure. + */ +/*@{*/ +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/*@}*//*Read/write macros*/ + + +/** + * \name Read endian functions + * + * Read an item of the specified endianness and return in native format. + */ +/*@{*/ +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); +/*@}*//*Read endian functions*/ + +/** + * \name Write endian functions + * + * Write an item of native format to the specified endianness. + */ +/*@{*/ +extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); +/*@}*//*Write endian functions*/ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_scancode.h b/Externals/SDL/Include/SDL_scancode.h index 8cbfa08b93..8fe550913f 100644 --- a/Externals/SDL/Include/SDL_scancode.h +++ b/Externals/SDL/Include/SDL_scancode.h @@ -21,7 +21,9 @@ */ /** - * \file SDL_scancode.h + * \file SDL_scancode.h + * + * Defines keyboard scancodes. */ #ifndef _SDL_scancode_h @@ -30,22 +32,25 @@ #include "SDL_stdinc.h" /** - * \enum SDL_scancode - * - * \brief The SDL keyboard scancode representation. - * - * Values of this type are used to represent keyboard keys, among other places - * in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the - * SDL_Event structure. - * - * The values in this enumeration are based on the USB usage page standard: - * http://www.usb.org/developers/devclass_docs/Hut1_12.pdf + * \brief The SDL keyboard scancode representation. + * + * Values of this type are used to represent keyboard keys, among other places + * in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the + * SDL_Event structure. + * + * The values in this enumeration are based on the USB usage page standard: + * http://www.usb.org/developers/devclass_docs/Hut1_12.pdf */ typedef enum { SDL_SCANCODE_UNKNOWN = 0, - /* These values are from usage page 0x07 (USB keyboard page) */ + /** + * \name Usage page 0x07 + * + * These values are from usage page 0x07 (USB keyboard page). + */ + /*@{*/ SDL_SCANCODE_A = 4, SDL_SCANCODE_B = 5, @@ -95,11 +100,51 @@ typedef enum SDL_SCANCODE_EQUALS = 46, SDL_SCANCODE_LEFTBRACKET = 47, SDL_SCANCODE_RIGHTBRACKET = 48, - SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. */ - SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. */ + SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return + * key on ISO keyboards and at the right end + * of the QWERTY row on ANSI keyboards. + * Produces REVERSE SOLIDUS (backslash) and + * VERTICAL LINE in a US layout, REVERSE + * SOLIDUS and VERTICAL LINE in a UK Mac + * layout, NUMBER SIGN and TILDE in a UK + * Windows layout, DOLLAR SIGN and POUND SIGN + * in a Swiss German layout, NUMBER SIGN and + * APOSTROPHE in a German layout, GRAVE + * ACCENT and POUND SIGN in a French Mac + * layout, and ASTERISK and MICRO SIGN in a + * French Windows layout. + */ + SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code + * instead of 49 for the same key, but all + * OSes I've seen treat the two codes + * identically. So, as an implementor, unless + * your keyboard generates both of those + * codes and your OS treats them differently, + * you should generate SDL_SCANCODE_BACKSLASH + * instead of this code. As a user, you + * should not rely on this code because SDL + * will never generate it with most (all?) + * keyboards. + */ SDL_SCANCODE_SEMICOLON = 51, SDL_SCANCODE_APOSTROPHE = 52, - SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. */ + SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI + * and ISO keyboards). Produces GRAVE ACCENT and + * TILDE in a US Windows layout and in US and UK + * Mac layouts on ANSI keyboards, GRAVE ACCENT + * and NOT SIGN in a UK Windows layout, SECTION + * SIGN and PLUS-MINUS SIGN in US and UK Mac + * layouts on ISO keyboards, SECTION SIGN and + * DEGREE SIGN in a Swiss German layout (Mac: + * only on ISO keyboards), CIRCUMFLEX ACCENT and + * DEGREE SIGN in a German layout (Mac: only on + * ISO keyboards), SUPERSCRIPT TWO and TILDE in a + * French Windows layout, COMMERCIAL AT and + * NUMBER SIGN in a French Mac layout on ISO + * keyboards, and LESS-THAN SIGN and GREATER-THAN + * SIGN in a Swiss German, German, or French Mac + * layout on ANSI keyboards. + */ SDL_SCANCODE_COMMA = 54, SDL_SCANCODE_PERIOD = 55, SDL_SCANCODE_SLASH = 56, @@ -122,7 +167,8 @@ typedef enum SDL_SCANCODE_PRINTSCREEN = 70, SDL_SCANCODE_SCROLLLOCK = 71, SDL_SCANCODE_PAUSE = 72, - SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but does send code 73, not 117) */ + SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but + does send code 73, not 117) */ SDL_SCANCODE_HOME = 74, SDL_SCANCODE_PAGEUP = 75, SDL_SCANCODE_DELETE = 76, @@ -133,7 +179,8 @@ typedef enum SDL_SCANCODE_DOWN = 81, SDL_SCANCODE_UP = 82, - SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards */ + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + */ SDL_SCANCODE_KP_DIVIDE = 84, SDL_SCANCODE_KP_MULTIPLY = 85, SDL_SCANCODE_KP_MINUS = 86, @@ -151,9 +198,20 @@ typedef enum SDL_SCANCODE_KP_0 = 98, SDL_SCANCODE_KP_PERIOD = 99, - SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. */ + SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO + * keyboards have over ANSI ones, + * located between left shift and Y. + * Produces GRAVE ACCENT and TILDE in a + * US or UK Mac layout, REVERSE SOLIDUS + * (backslash) and VERTICAL LINE in a + * US or UK Windows layout, and + * LESS-THAN SIGN and GREATER-THAN SIGN + * in a Swiss German, German, or French + * layout. */ SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ - SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. */ + SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, + * not a physical key - but some Mac keyboards + * do have a power key. */ SDL_SCANCODE_KP_EQUALS = 103, SDL_SCANCODE_F13 = 104, SDL_SCANCODE_F14 = 105, @@ -172,7 +230,7 @@ typedef enum SDL_SCANCODE_MENU = 118, SDL_SCANCODE_SELECT = 119, SDL_SCANCODE_STOP = 120, - SDL_SCANCODE_AGAIN = 121, /*!< redo */ + SDL_SCANCODE_AGAIN = 121, /**< redo */ SDL_SCANCODE_UNDO = 122, SDL_SCANCODE_CUT = 123, SDL_SCANCODE_COPY = 124, @@ -188,7 +246,8 @@ typedef enum SDL_SCANCODE_KP_COMMA = 133, SDL_SCANCODE_KP_EQUALSAS400 = 134, - SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see footnotes in USB doc */ + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + footnotes in USB doc */ SDL_SCANCODE_INTERNATIONAL2 = 136, SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ SDL_SCANCODE_INTERNATIONAL4 = 138, @@ -276,9 +335,19 @@ typedef enum SDL_SCANCODE_RALT = 230, /**< alt gr, option */ SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ - SDL_SCANCODE_MODE = 257, /* I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here */ + SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered + * by any of the above, but since there's a + * special KMOD_MODE for it I'm adding it here + */ + + /*@}*//*Usage page 0x07*/ - /* These values are mapped from usage page 0x0C (USB consumer page) */ + /** + * \name Usage page 0x0C + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /*@{*/ SDL_SCANCODE_AUDIONEXT = 258, SDL_SCANCODE_AUDIOPREV = 259, @@ -297,21 +366,32 @@ typedef enum SDL_SCANCODE_AC_STOP = 272, SDL_SCANCODE_AC_REFRESH = 273, SDL_SCANCODE_AC_BOOKMARKS = 274, + + /*@}*//*Usage page 0x0C*/ - /* These are values that Christian Walther added (for mac keyboard?) */ + /** + * \name Walther keys + * + * These are values that Christian Walther added (for mac keyboard?). + */ + /*@{*/ SDL_SCANCODE_BRIGHTNESSDOWN = 275, SDL_SCANCODE_BRIGHTNESSUP = 276, - SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display switch, video mode switch */ + SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display + switch, video mode switch */ SDL_SCANCODE_KBDILLUMTOGGLE = 278, SDL_SCANCODE_KBDILLUMDOWN = 279, SDL_SCANCODE_KBDILLUMUP = 280, SDL_SCANCODE_EJECT = 281, SDL_SCANCODE_SLEEP = 282, + + /*@}*//*Walther keys*/ - /* Add any other keys here */ + /* Add any other keys here. */ - SDL_NUM_SCANCODES = 512 /**< (not a key, just marks the number of scancodes for array bounds) */ + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes + for array bounds */ } SDL_scancode; #endif /* _SDL_scancode_h */ diff --git a/Externals/SDL/Include/SDL_stdinc.h b/Externals/SDL/Include/SDL_stdinc.h index 1792759cc7..f7afdc30d2 100644 --- a/Externals/SDL/Include/SDL_stdinc.h +++ b/Externals/SDL/Include/SDL_stdinc.h @@ -1,761 +1,783 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_stdinc.h - * - * This is a general header that includes C language support - */ - -#ifndef _SDL_stdinc_h -#define _SDL_stdinc_h - -#include "SDL_config.h" - - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDIO_H -#include -#endif -#if defined(STDC_HEADERS) -# include -# include -# include -#else -# if defined(HAVE_STDLIB_H) -# include -# elif defined(HAVE_MALLOC_H) -# include -# endif -# if defined(HAVE_STDDEF_H) -# include -# endif -# if defined(HAVE_STDARG_H) -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#if defined(HAVE_INTTYPES_H) -# include -#elif defined(HAVE_STDINT_H) -# include -#endif -#ifdef HAVE_CTYPE_H -# include -#endif -#ifdef HAVE_MATH_H -# include -#endif -#ifdef HAVE_ICONV_H -# include -#endif - -/* The number of elements in an array */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/* Basic data types */ -typedef enum SDL_bool -{ - SDL_FALSE = 0, - SDL_TRUE = 1 -} SDL_bool; - -/** - * \typedef Sint8 - * \brief A signed 8-bit integer type. - */ -typedef int8_t Sint8; -/** - * \typedef Uint8 - * \brief An unsigned 8-bit integer type. - */ -typedef uint8_t Uint8; -/** - * \typedef Sint16 - * \brief A signed 16-bit integer type. - */ -typedef int16_t Sint16; -/** - * \typedef Uint16 - * \brief An unsigned 16-bit integer type. - */ -typedef uint16_t Uint16; -/** - * \typedef Sint32 - * \brief A signed 32-bit integer type. - */ -typedef int32_t Sint32; -/** - * \typedef Uint32 - * \brief An unsigned 32-bit integer type. - */ -typedef uint32_t Uint32; - -#ifdef SDL_HAS_64BIT_TYPE -/** - * \typedef Sint64 - * \brief A signed 64-bit integer type. - * \warning On platforms without any sort of 64-bit datatype, this is equivalent to Sint32! - */ -typedef int64_t Sint64; -/** - * \typedef Uint64 - * \brief An unsigned 64-bit integer type. - * \warning On platforms without any sort of 64-bit datatype, this is equivalent to Uint32! - */ -typedef uint64_t Uint64; -#else -/* This is really just a hack to prevent the compiler from complaining */ -typedef Sint32 Sint64; -typedef Uint32 Uint64; -#endif - -/* Make sure the types really have the right sizes */ -#define SDL_COMPILE_TIME_ASSERT(name, x) \ - typedef int SDL_dummy_ ## name[(x) * 2 - 1] -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); -SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); -SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); -SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); -SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); -SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); -#ifndef __NINTENDODS__ /* TODO: figure out why the following happens: - include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative - include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */ -SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); -SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -#endif -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - -/* Check to make sure enums are the size of ints, for structure packing. - For both Watcom C/C++ and Borland C/C++ the compiler option that makes - enums having the size of an int must be enabled. - This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). -*/ -/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ -#ifdef __MWERKS__ -#pragma enumsalwaysint on -#endif - -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -#ifndef __NINTENDODS__ /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ -typedef enum -{ - DUMMY_ENUM_VALUE -} SDL_DUMMY_ENUM; - -SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); -#endif -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -#ifdef HAVE_MALLOC -#define SDL_malloc malloc -#else -extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); -#endif - -#ifdef HAVE_CALLOC -#define SDL_calloc calloc -#else -extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -#endif - -#ifdef HAVE_REALLOC -#define SDL_realloc realloc -#else -extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); -#endif - -#ifdef HAVE_FREE -#define SDL_free free -#else -extern DECLSPEC void SDLCALL SDL_free(void *mem); -#endif - -#if defined(HAVE_ALLOCA) && !defined(alloca) -# if defined(HAVE_ALLOCA_H) -# include -# elif defined(__GNUC__) -# define alloca __builtin_alloca -# elif defined(_MSC_VER) -# include -# define alloca _alloca -# elif defined(__WATCOMC__) -# include -# elif defined(__BORLANDC__) -# include -# elif defined(__DMC__) -# include -# elif defined(__AIX__) -#pragma alloca -# elif defined(__MRC__) -void *alloca(unsigned); -# else -char *alloca(); -# endif -#endif -#ifdef HAVE_ALLOCA -#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) -#define SDL_stack_free(data) -#else -#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) -#define SDL_stack_free(data) SDL_free(data) -#endif - -#ifdef HAVE_GETENV -#define SDL_getenv getenv -#else -extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); -#endif - -#ifdef HAVE_PUTENV -#define SDL_putenv putenv -#else -extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); -#endif - -#ifdef HAVE_QSORT -#define SDL_qsort qsort -#else -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, - int (*compare) (const void *, - const void *)); -#endif - -#ifdef HAVE_ABS -#define SDL_abs abs -#else -#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) -#endif - -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) - -#ifdef HAVE_CTYPE_H -#define SDL_isdigit(X) isdigit(X) -#define SDL_isspace(X) isspace(X) -#define SDL_toupper(X) toupper(X) -#define SDL_tolower(X) tolower(X) -#else -#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) -#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) -#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) -#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) -#endif - -#ifdef HAVE_MEMSET -#define SDL_memset memset -#else -extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len); -#endif -#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) -#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) - -#if defined(__GNUC__) && defined(i386) -#define SDL_memset4(dst, val, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; stosl\n\t" \ - : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ - : "0" (dst), "1" (val), "2" ((Uint32)(len)) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memset4 -#define SDL_memset4(dst, val, len) \ -do { \ - unsigned _count = (len); \ - unsigned _n = (_count + 3) / 4; \ - Uint32 *_p = (Uint32 *)(dst); \ - Uint32 _val = (val); \ - switch (_count % 4) { \ - case 0: do { *_p++ = _val; \ - case 3: *_p++ = _val; \ - case 2: *_p++ = _val; \ - case 1: *_p++ = _val; \ - } while ( --_n ); \ - } \ -} while(0) -#endif - -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl\n\t" \ - "testb $2,%b4\n\t" \ - "je 1f\n\t" \ - "movsw\n" \ - "1:\ttestb $1,%b4\n\t" \ - "je 2f\n\t" \ - "movsb\n" \ - "2:" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy -#ifdef HAVE_MEMCPY -#define SDL_memcpy memcpy -#elif defined(HAVE_BCOPY) -#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) -#else -extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, - size_t len); -#endif -#endif - -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy4(dst, src, len) \ -do { \ - int ecx, edi, esi; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl" \ - : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ - : "0" ((unsigned)(len)), "1" (dst), "2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy4 -#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) -#endif - -#if defined(__GNUC__) && defined(i386) -#define SDL_revcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - char *dstp = (char *)(dst); \ - char *srcp = (char *)(src); \ - int n = (len); \ - if ( n >= 4 ) { \ - __asm__ __volatile__ ( \ - "std\n\t" \ - "rep ; movsl\n\t" \ - "cld\n\t" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (n >> 2), \ - "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ - : "memory" ); \ - } \ - switch (n & 3) { \ - case 3: dstp[2] = srcp[2]; \ - case 2: dstp[1] = srcp[1]; \ - case 1: dstp[0] = srcp[0]; \ - break; \ - default: \ - break; \ - } \ -} while(0) -#endif -#ifndef SDL_revcpy -extern DECLSPEC void *SDLCALL SDL_revcpy(void *dst, const void *src, - size_t len); -#endif - -#ifdef HAVE_MEMMOVE -#define SDL_memmove memmove -#elif defined(HAVE_BCOPY) -#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) -#else -#define SDL_memmove(dst, src, len) \ -do { \ - if ( dst < src ) { \ - SDL_memcpy(dst, src, len); \ - } else { \ - SDL_revcpy(dst, src, len); \ - } \ -} while(0) -#endif - -#ifdef HAVE_MEMCMP -#define SDL_memcmp memcmp -#else -extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, - size_t len); -#endif - -#ifdef HAVE_STRLEN -#define SDL_strlen strlen -#else -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); -#endif - -#ifdef HAVE_WCSLEN -#define SDL_wcslen wcslen -#else -#if !defined(wchar_t) && defined(__NINTENDODS__) -#define wchar_t short /* TODO: figure out why libnds doesn't have this */ -#endif -extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string); -#endif - -#ifdef HAVE_STRLCPY -#define SDL_strlcpy strlcpy -#else -extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, - size_t maxlen); -#endif - -#ifdef HAVE_STRLCAT -#define SDL_strlcat strlcat -#else -extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, - size_t maxlen); -#endif - -#ifdef HAVE_STRDUP -#define SDL_strdup strdup -#else -extern DECLSPEC char *SDLCALL SDL_strdup(const char *string); -#endif - -#ifdef HAVE__STRREV -#define SDL_strrev _strrev -#else -extern DECLSPEC char *SDLCALL SDL_strrev(char *string); -#endif - -#ifdef HAVE__STRUPR -#define SDL_strupr _strupr -#else -extern DECLSPEC char *SDLCALL SDL_strupr(char *string); -#endif - -#ifdef HAVE__STRLWR -#define SDL_strlwr _strlwr -#else -extern DECLSPEC char *SDLCALL SDL_strlwr(char *string); -#endif - -#ifdef HAVE_STRCHR -#define SDL_strchr strchr -#elif defined(HAVE_INDEX) -#define SDL_strchr index -#else -extern DECLSPEC char *SDLCALL SDL_strchr(const char *string, int c); -#endif - -#ifdef HAVE_STRRCHR -#define SDL_strrchr strrchr -#elif defined(HAVE_RINDEX) -#define SDL_strrchr rindex -#else -extern DECLSPEC char *SDLCALL SDL_strrchr(const char *string, int c); -#endif - -#ifdef HAVE_STRSTR -#define SDL_strstr strstr -#else -extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, - const char *needle); -#endif - -#ifdef HAVE_ITOA -#define SDL_itoa itoa -#else -#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) -#endif - -#ifdef HAVE__LTOA -#define SDL_ltoa _ltoa -#else -extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *string, int radix); -#endif - -#ifdef HAVE__UITOA -#define SDL_uitoa _uitoa -#else -#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) -#endif - -#ifdef HAVE__ULTOA -#define SDL_ultoa _ultoa -#else -extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *string, - int radix); -#endif - -#ifdef HAVE_STRTOL -#define SDL_strtol strtol -#else -extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, - int base); -#endif - -#ifdef HAVE_STRTOUL -#define SDL_strtoul strtoul -#else -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, - char **endp, int base); -#endif - -#ifdef SDL_HAS_64BIT_TYPE - -#ifdef HAVE__I64TOA -#define SDL_lltoa _i64toa -#else -extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *string, - int radix); -#endif - -#ifdef HAVE__UI64TOA -#define SDL_ulltoa _ui64toa -#else -extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *string, - int radix); -#endif - -#ifdef HAVE_STRTOLL -#define SDL_strtoll strtoll -#else -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, - int base); -#endif - -#ifdef HAVE_STRTOULL -#define SDL_strtoull strtoull -#else -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, - int base); -#endif - -#endif /* SDL_HAS_64BIT_TYPE */ - -#ifdef HAVE_STRTOD -#define SDL_strtod strtod -#else -extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); -#endif - -#ifdef HAVE_ATOI -#define SDL_atoi atoi -#else -#define SDL_atoi(X) SDL_strtol(X, NULL, 0) -#endif - -#ifdef HAVE_ATOF -#define SDL_atof atof -#else -#define SDL_atof(X) SDL_strtod(X, NULL) -#endif - -#ifdef HAVE_STRCMP -#define SDL_strcmp strcmp -#else -extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -#endif - -#ifdef HAVE_STRNCMP -#define SDL_strncmp strncmp -#else -extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, - size_t maxlen); -#endif - -#ifdef HAVE_STRCASECMP -#define SDL_strcasecmp strcasecmp -#elif defined(HAVE__STRICMP) -#define SDL_strcasecmp _stricmp -#else -extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, - const char *str2); -#endif - -#ifdef HAVE_STRNCASECMP -#define SDL_strncasecmp strncasecmp -#elif defined(HAVE__STRNICMP) -#define SDL_strncasecmp _strnicmp -#else -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, - const char *str2, size_t maxlen); -#endif - -#ifdef HAVE_SSCANF -#define SDL_sscanf sscanf -#else -extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, - ...); -#endif - -#ifdef HAVE_SNPRINTF -#define SDL_snprintf snprintf -#else -extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, - const char *fmt, ...); -#endif - -#ifdef HAVE_VSNPRINTF -#define SDL_vsnprintf vsnprintf -#else -extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, - const char *fmt, va_list ap); -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338327950288 /* pi */ -#endif - -#ifdef HAVE_CEIL -#define SDL_ceil ceil -#else -#define SDL_ceil(x) ((double)(int)((x)+0.5)) -#endif - -#ifdef HAVE_COPYSIGN -#define SDL_copysign copysign -#else -extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); -#endif - -#ifdef HAVE_COS -#define SDL_cos cos -#else -extern DECLSPEC double SDLCALL SDL_cos(double x); -#endif - -#ifdef HAVE_COSF -#define SDL_cosf cosf -#else -#define SDL_cosf(x) (float)SDL_cos((double)x) -#endif - -#ifdef HAVE_FABS -#define SDL_fabs fabs -#else -extern DECLSPEC double SDLCALL SDL_fabs(double x); -#endif - -#ifdef HAVE_FLOOR -#define SDL_floor floor -#else -extern DECLSPEC double SDLCALL SDL_floor(double x); -#endif - -#ifdef HAVE_LOG -#define SDL_log log -#else -extern DECLSPEC double SDLCALL SDL_log(double x); -#endif - -#ifdef HAVE_POW -#define SDL_pow pow -#else -extern DECLSPEC double SDLCALL SDL_pow(double x, double y); -#endif - -#ifdef HAVE_SCALBN -#define SDL_scalbn scalbn -#else -extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); -#endif - -#ifdef HAVE_SIN -#define SDL_sin sin -#else -extern DECLSPEC double SDLCALL SDL_sin(double x); -#endif - -#ifdef HAVE_SINF -#define SDL_sinf sinf -#else -#define SDL_sinf(x) (float)SDL_sin((double)x) -#endif - -#ifdef HAVE_SQRT -#define SDL_sqrt sqrt -#else -extern DECLSPEC double SDLCALL SDL_sqrt(double x); -#endif - -/* The SDL implementation of iconv() returns these error codes */ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 - -#ifdef HAVE_ICONV -#define SDL_iconv_t iconv_t -#define SDL_iconv_open iconv_open -#define SDL_iconv_close iconv_close -#else -typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, - const char *fromcode); -extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -#endif -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); -/* This function converts a string between encodings in one pass, returning a - string that must be freed with SDL_free() or NULL on error. -*/ -extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, - const char *fromcode, - const char *inbuf, - size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_stdinc_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_stdinc.h + * + * This is a general header that includes C language support. + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#ifdef HAVE_MATH_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** + * The number of elements in an array. + */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/** + * \name Cast operators + * + * Use proper C++ casts when compiled as C++ to be compatible with the option + * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). + */ +/*@{*/ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#endif +/*@}*//*Cast operators*/ + +/** + * \name Basic data types + */ +/*@{*/ + +typedef enum +{ + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +/** + * \brief A signed 8-bit integer type. + */ +typedef int8_t Sint8; +/** + * \brief An unsigned 8-bit integer type. + */ +typedef uint8_t Uint8; +/** + * \brief A signed 16-bit integer type. + */ +typedef int16_t Sint16; +/** + * \brief An unsigned 16-bit integer type. + */ +typedef uint16_t Uint16; +/** + * \brief A signed 32-bit integer type. + */ +typedef int32_t Sint32; +/** + * \brief An unsigned 32-bit integer type. + */ +typedef uint32_t Uint32; + +#ifdef SDL_HAS_64BIT_TYPE +/** + * \brief A signed 64-bit integer type. + * \warning On platforms without any sort of 64-bit datatype, this is equivalent to Sint32! + */ +typedef int64_t Sint64; +/** + * \brief An unsigned 64-bit integer type. + * \warning On platforms without any sort of 64-bit datatype, this is equivalent to Uint32! + */ +typedef uint64_t Uint64; +#else +/* This is really just a hack to prevent the compiler from complaining */ +typedef Sint32 Sint64; +typedef Uint32 Uint64; +#endif + +/*@}*//*Basic data types*/ + + +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +#ifndef __NINTENDODS__ /* TODO: figure out why the following happens: + include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative + include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */ +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +#endif +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +/* Check to make sure enums are the size of ints, for structure packing. + For both Watcom C/C++ and Borland C/C++ the compiler option that makes + enums having the size of an int must be enabled. + This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). +*/ +/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ +#ifdef __MWERKS__ +#pragma enumsalwaysint on +#endif + +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#ifndef __NINTENDODS__ /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +typedef enum +{ + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +#ifdef HAVE_MALLOC +#define SDL_malloc malloc +#else +extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); +#endif + +#ifdef HAVE_CALLOC +#define SDL_calloc calloc +#else +extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); +#endif + +#ifdef HAVE_REALLOC +#define SDL_realloc realloc +#else +extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); +#endif + +#ifdef HAVE_FREE +#define SDL_free free +#else +extern DECLSPEC void SDLCALL SDL_free(void *mem); +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) +#pragma alloca +# elif defined(__MRC__) +void *alloca(unsigned); +# else +char *alloca(); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +#ifdef HAVE_GETENV +#define SDL_getenv getenv +#else +extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); +#endif + +#ifdef HAVE_PUTENV +#define SDL_putenv putenv +#else +extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); +#endif + +#ifdef HAVE_QSORT +#define SDL_qsort qsort +#else +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, + int (*compare) (const void *, + const void *)); +#endif + +#ifdef HAVE_ABS +#define SDL_abs abs +#else +#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) +#endif + +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +#ifdef HAVE_CTYPE_H +#define SDL_isdigit(X) isdigit(X) +#define SDL_isspace(X) isspace(X) +#define SDL_toupper(X) toupper(X) +#define SDL_tolower(X) tolower(X) +#else +#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) +#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) +#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) +#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) +#endif + +#ifdef HAVE_MEMSET +#define SDL_memset memset +#else +extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len); +#endif +#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) +#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) + +#if defined(__GNUC__) && defined(i386) +#define SDL_memset4(dst, val, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; stosl\n\t" \ + : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memset4 +#define SDL_memset4(dst, val, len) \ +do { \ + unsigned _count = (len); \ + unsigned _n = (_count + 3) / 4; \ + Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ + Uint32 _val = (val); \ + if (len == 0) break; \ + switch (_count % 4) { \ + case 0: do { *_p++ = _val; \ + case 3: *_p++ = _val; \ + case 2: *_p++ = _val; \ + case 1: *_p++ = _val; \ + } while ( --_n ); \ + } \ +} while(0) +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl\n\t" \ + "testb $2,%b4\n\t" \ + "je 1f\n\t" \ + "movsw\n" \ + "1:\ttestb $1,%b4\n\t" \ + "je 2f\n\t" \ + "movsb\n" \ + "2:" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy +#ifdef HAVE_MEMCPY +#define SDL_memcpy memcpy +#elif defined(HAVE_BCOPY) +#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) +#else +extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, + size_t len); +#endif +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy4(dst, src, len) \ +do { \ + int ecx, edi, esi; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl" \ + : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ + : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy4 +#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_revcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + char *dstp = SDL_static_cast(char *, dst); \ + char *srcp = SDL_static_cast(char *, src); \ + int n = (len); \ + if ( n >= 4 ) { \ + __asm__ __volatile__ ( \ + "std\n\t" \ + "rep ; movsl\n\t" \ + "cld\n\t" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (n >> 2), \ + "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ + : "memory" ); \ + } \ + switch (n & 3) { \ + case 3: dstp[2] = srcp[2]; \ + case 2: dstp[1] = srcp[1]; \ + case 1: dstp[0] = srcp[0]; \ + break; \ + default: \ + break; \ + } \ +} while(0) +#endif +#ifndef SDL_revcpy +extern DECLSPEC void *SDLCALL SDL_revcpy(void *dst, const void *src, + size_t len); +#endif + +#ifdef HAVE_MEMMOVE +#define SDL_memmove memmove +#elif defined(HAVE_BCOPY) +#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) +#else +#define SDL_memmove(dst, src, len) \ +do { \ + if ( dst < src ) { \ + SDL_memcpy(dst, src, len); \ + } else { \ + SDL_revcpy(dst, src, len); \ + } \ +} while(0) +#endif + +#ifdef HAVE_MEMCMP +#define SDL_memcmp memcmp +#else +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, + size_t len); +#endif + +#ifdef HAVE_STRLEN +#define SDL_strlen strlen +#else +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); +#endif + +#ifdef HAVE_WCSLEN +#define SDL_wcslen wcslen +#else +#if !defined(wchar_t) && defined(__NINTENDODS__) +#define wchar_t short /* TODO: figure out why libnds doesn't have this */ +#endif +extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string); +#endif + +#ifdef HAVE_STRLCPY +#define SDL_strlcpy strlcpy +#else +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, + size_t maxlen); +#endif + +#ifdef HAVE_STRLCAT +#define SDL_strlcat strlcat +#else +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, + size_t maxlen); +#endif + +#ifdef HAVE_STRDUP +#define SDL_strdup strdup +#else +extern DECLSPEC char *SDLCALL SDL_strdup(const char *string); +#endif + +#ifdef HAVE__STRREV +#define SDL_strrev _strrev +#else +extern DECLSPEC char *SDLCALL SDL_strrev(char *string); +#endif + +#ifdef HAVE__STRUPR +#define SDL_strupr _strupr +#else +extern DECLSPEC char *SDLCALL SDL_strupr(char *string); +#endif + +#ifdef HAVE__STRLWR +#define SDL_strlwr _strlwr +#else +extern DECLSPEC char *SDLCALL SDL_strlwr(char *string); +#endif + +#ifdef HAVE_STRCHR +#define SDL_strchr strchr +#elif defined(HAVE_INDEX) +#define SDL_strchr index +#else +extern DECLSPEC char *SDLCALL SDL_strchr(const char *string, int c); +#endif + +#ifdef HAVE_STRRCHR +#define SDL_strrchr strrchr +#elif defined(HAVE_RINDEX) +#define SDL_strrchr rindex +#else +extern DECLSPEC char *SDLCALL SDL_strrchr(const char *string, int c); +#endif + +#ifdef HAVE_STRSTR +#define SDL_strstr strstr +#else +extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, + const char *needle); +#endif + +#ifdef HAVE_ITOA +#define SDL_itoa itoa +#else +#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) +#endif + +#ifdef HAVE__LTOA +#define SDL_ltoa _ltoa +#else +extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *string, int radix); +#endif + +#ifdef HAVE__UITOA +#define SDL_uitoa _uitoa +#else +#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) +#endif + +#ifdef HAVE__ULTOA +#define SDL_ultoa _ultoa +#else +extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *string, + int radix); +#endif + +#ifdef HAVE_STRTOL +#define SDL_strtol strtol +#else +extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, + int base); +#endif + +#ifdef HAVE_STRTOUL +#define SDL_strtoul strtoul +#else +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, + char **endp, int base); +#endif + +#ifdef SDL_HAS_64BIT_TYPE + +#ifdef HAVE__I64TOA +#define SDL_lltoa _i64toa +#else +extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *string, + int radix); +#endif + +#ifdef HAVE__UI64TOA +#define SDL_ulltoa _ui64toa +#else +extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *string, + int radix); +#endif + +#ifdef HAVE_STRTOLL +#define SDL_strtoll strtoll +#else +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, + int base); +#endif + +#ifdef HAVE_STRTOULL +#define SDL_strtoull strtoull +#else +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, + int base); +#endif + +#endif /* SDL_HAS_64BIT_TYPE */ + +#ifdef HAVE_STRTOD +#define SDL_strtod strtod +#else +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); +#endif + +#ifdef HAVE_ATOI +#define SDL_atoi atoi +#else +#define SDL_atoi(X) SDL_strtol(X, NULL, 0) +#endif + +#ifdef HAVE_ATOF +#define SDL_atof atof +#else +#define SDL_atof(X) SDL_strtod(X, NULL) +#endif + +#ifdef HAVE_STRCMP +#define SDL_strcmp strcmp +#else +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCMP +#define SDL_strncmp strncmp +#else +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, + size_t maxlen); +#endif + +#ifdef HAVE_STRCASECMP +#define SDL_strcasecmp strcasecmp +#elif defined(HAVE__STRICMP) +#define SDL_strcasecmp _stricmp +#else +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, + const char *str2); +#endif + +#ifdef HAVE_STRNCASECMP +#define SDL_strncasecmp strncasecmp +#elif defined(HAVE__STRNICMP) +#define SDL_strncasecmp _strnicmp +#else +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, + const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_SSCANF +#define SDL_sscanf sscanf +#else +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, + ...); +#endif + +#ifdef HAVE_SNPRINTF +#define SDL_snprintf snprintf +#else +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, + const char *fmt, ...); +#endif + +#ifdef HAVE_VSNPRINTF +#define SDL_vsnprintf vsnprintf +#else +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, + const char *fmt, va_list ap); +#endif + +#ifndef HAVE_M_PI +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#endif + +#ifdef HAVE_CEIL +#define SDL_ceil ceil +#else +#define SDL_ceil(x) ((double)(int)((x)+0.5)) +#endif + +#ifdef HAVE_COPYSIGN +#define SDL_copysign copysign +#else +extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); +#endif + +#ifdef HAVE_COS +#define SDL_cos cos +#else +extern DECLSPEC double SDLCALL SDL_cos(double x); +#endif + +#ifdef HAVE_COSF +#define SDL_cosf cosf +#else +#define SDL_cosf(x) (float)SDL_cos((double)x) +#endif + +#ifdef HAVE_FABS +#define SDL_fabs fabs +#else +extern DECLSPEC double SDLCALL SDL_fabs(double x); +#endif + +#ifdef HAVE_FLOOR +#define SDL_floor floor +#else +extern DECLSPEC double SDLCALL SDL_floor(double x); +#endif + +#ifdef HAVE_LOG +#define SDL_log log +#else +extern DECLSPEC double SDLCALL SDL_log(double x); +#endif + +#ifdef HAVE_POW +#define SDL_pow pow +#else +extern DECLSPEC double SDLCALL SDL_pow(double x, double y); +#endif + +#ifdef HAVE_SCALBN +#define SDL_scalbn scalbn +#else +extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); +#endif + +#ifdef HAVE_SIN +#define SDL_sin sin +#else +extern DECLSPEC double SDLCALL SDL_sin(double x); +#endif + +#ifdef HAVE_SINF +#define SDL_sinf sinf +#else +#define SDL_sinf(x) (float)SDL_sin((double)x) +#endif + +#ifdef HAVE_SQRT +#define SDL_sqrt sqrt +#else +extern DECLSPEC double SDLCALL SDL_sqrt(double x); +#endif + +/* The SDL implementation of iconv() returns these error codes */ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 + +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +#define SDL_iconv_t iconv_t +#define SDL_iconv_open iconv_open +#define SDL_iconv_close iconv_close +#else +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, + const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +#endif +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, + size_t * inbytesleft, char **outbuf, + size_t * outbytesleft); +/** + * This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, + const char *fromcode, + const char *inbuf, + size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_surface.h b/Externals/SDL/Include/SDL_surface.h index 3a4abba939..de84d942c5 100644 --- a/Externals/SDL/Include/SDL_surface.h +++ b/Externals/SDL/Include/SDL_surface.h @@ -21,9 +21,9 @@ */ /** - * \file SDL_surface.h - * - * Header file for SDL_surface definition and management functions + * \file SDL_surface.h + * + * Header file for ::SDL_surface definition and management functions. */ #ifndef _SDL_surface_h @@ -42,20 +42,28 @@ extern "C" { /* *INDENT-ON* */ #endif -/* These are the currently supported flags for the SDL_surface */ -/* Used internally (read-only) */ -#define SDL_PREALLOC 0x00000001 /* Surface uses preallocated memory */ -#define SDL_RLEACCEL 0x00000002 /* Surface is RLE encoded */ +/** + * \name Surface flags + * + * These are the currently supported flags for the ::SDL_surface. + * + * \internal + * Used internally (read-only). + */ +/*@{*/ +#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ +#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ +/*@}*//*Surface flags*/ -/* Evaluates to true if the surface needs to be locked before access */ +/** + * Evaluates to true if the surface needs to be locked before access. + */ #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) /** - * \struct SDL_Surface + * \brief A collection of pixels used in software blitting. * - * \brief A collection of pixels used in software blitting - * - * \note This structure should be treated as read-only, except for 'pixels', + * \note This structure should be treated as read-only, except for \c pixels, * which, if not NULL, contains the raw pixel data for the surface. */ typedef struct SDL_Surface @@ -66,42 +74,42 @@ typedef struct SDL_Surface int pitch; /**< Read-only */ void *pixels; /**< Read-write */ - /* Application data associated with the surfade */ + /** Application data associated with the surfade */ void *userdata; /**< Read-write */ - /* information needed for surfaces requiring locks */ + /** information needed for surfaces requiring locks */ int locked; /**< Read-only */ void *lock_data; /**< Read-only */ - /* clipping information */ + /** clipping information */ SDL_Rect clip_rect; /**< Read-only */ - /* info for fast blit mapping to other surfaces */ + /** info for fast blit mapping to other surfaces */ struct SDL_BlitMap *map; /**< Private */ - /* format version, bumped at every change to invalidate blit maps */ + /** format version, bumped at every change to invalidate blit maps */ unsigned int format_version; /**< Private */ - /* Reference count -- used when freeing surface */ + /** Reference count -- used when freeing surface */ int refcount; /**< Read-mostly */ } SDL_Surface; /** - * \typedef SDL_blit - * - * \brief The type of function used for surface blitting functions + * \brief The type of function used for surface blitting functions. */ typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, struct SDL_Surface * dst, SDL_Rect * dstrect); -/* - * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * If the function runs out of memory, it will return NULL. - * - * The 'flags' are obsolete and should be set to 0. +/** + * Allocate and free an RGB surface (must be called after SDL_SetVideoMode). + * + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * + * If the function runs out of memory, it will return NULL. + * + * \param flags The \c flags are obsolete and should be set to 0. */ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface (Uint32 flags, int width, int height, int depth, @@ -118,402 +126,437 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); /** - * \fn int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) - * - * \brief Set the palette used by a surface. - * - * \return 0, or -1 if the surface format doesn't use a palette. - * - * \note A single palette can be shared with many surfaces. + * \brief Set the palette used by a surface. + * + * \return 0, or -1 if the surface format doesn't use a palette. + * + * \note A single palette can be shared with many surfaces. */ extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette); -/* - * SDL_LockSurface() sets up a surface for directly accessing the pixels. - * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write - * to and read from 'surface->pixels', using the pixel format stored in - * 'surface->format'. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. - * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. - * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. +/** + * \brief Sets up a surface for directly accessing the pixels. + * + * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write + * to and read from \c surface->pixels, using the pixel format stored in + * \c surface->format. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + * + * \sa SDL_UnlockSurface() */ extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); +/** \sa SDL_LockSurface() */ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); -/* - * Load a surface from a seekable SDL data source (memory or file.) - * If 'freesrc' is non-zero, the source will be closed after being read. - * Returns the new surface, or NULL if there was an error. - * The new surface should be freed with SDL_FreeSurface(). +/** + * Load a surface from a seekable SDL data source (memory or file). + * + * If \c freesrc is non-zero, the source will be closed after being read. + * + * The new surface should be freed with SDL_FreeSurface(). + * + * \return the new surface, or NULL if there was an error. */ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, int freesrc); -/* Convenience macro -- load a surface from a file */ +/** + * Load a surface from a file. + * + * Convenience macro. + */ #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) -/* - * Save a surface to a seekable SDL data source (memory or file.) - * If 'freedst' is non-zero, the source will be closed after being written. - * Returns 0 if successful or -1 if there was an error. +/** + * Save a surface to a seekable SDL data source (memory or file). + * + * If \c freedst is non-zero, the source will be closed after being written. + * + * \return 0 if successful or -1 if there was an error. */ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW (SDL_Surface * surface, SDL_RWops * dst, int freedst); -/* Convenience macro -- save a surface to a file */ +/** + * Save a surface to a file. + * + * Convenience macro. + */ #define SDL_SaveBMP(surface, file) \ SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) -/* - * \fn int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag) - * - * \brief Sets the RLE acceleration hint for a surface. - * - * \return 0 on success, or -1 if the surface is not valid - * - * \note If RLE is enabled, colorkey and alpha blending blits are much faster, - * but the surface must be locked before directly accessing the pixels. +/** + * \brief Sets the RLE acceleration hint for a surface. + * + * \return 0 on success, or -1 if the surface is not valid + * + * \note If RLE is enabled, colorkey and alpha blending blits are much faster, + * but the surface must be locked before directly accessing the pixels. */ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, int flag); -/* - * \fn int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key) - * - * \brief Sets the color key (transparent pixel) in a blittable surface. - * - * \param surface The surface to update - * \param flag Non-zero to enable colorkey and 0 to disable colorkey - * \param key The transparent pixel in the native surface format - * - * \return 0 on success, or -1 if the surface is not valid +/** + * \brief Sets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param flag Non-zero to enable colorkey and 0 to disable colorkey + * \param key The transparent pixel in the native surface format + * + * \return 0 on success, or -1 if the surface is not valid */ extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, Uint32 flag, Uint32 key); /** - * \fn int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) - * - * \brief Set an additional color value used in blit operations - * - * \param surface The surface to update - * \param r The red source color value multiplied into blit operations - * \param g The green source color value multiplied into blit operations - * \param b The blue source color value multiplied into blit operations - * - * \return 0 on success, or -1 if the surface is not valid - * - * \sa SDL_GetSurfaceColorMod() + * \brief Sets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param key A pointer filled in with the transparent pixel in the native + * surface format + * + * \return 0 on success, or -1 if the surface is not valid or colorkey is not + * enabled. + */ +extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, + Uint32 * key); + +/** + * \brief Set an additional color value used in blit operations. + * + * \param surface The surface to update. + * \param r The red source color value multiplied into blit operations. + * \param g The green source color value multiplied into blit operations. + * \param b The blue source color value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceColorMod() */ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, Uint8 r, Uint8 g, Uint8 b); /** - * \fn int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) - * - * \brief Get the additional color value used in blit operations - * - * \param surface The surface to query - * \param r A pointer filled in with the source red color value - * \param g A pointer filled in with the source green color value - * \param b A pointer filled in with the source blue color value - * - * \return 0 on success, or -1 if the surface is not valid - * - * \sa SDL_SetSurfaceColorMod() + * \brief Get the additional color value used in blit operations. + * + * \param surface The surface to query. + * \param r A pointer filled in with the source red color value. + * \param g A pointer filled in with the source green color value. + * \param b A pointer filled in with the source blue color value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceColorMod() */ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, Uint8 * r, Uint8 * g, Uint8 * b); /** - * \fn int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) - * - * \brief Set an additional alpha value used in blit operations - * - * \param surface The surface to update - * \param alpha The source alpha value multiplied into blit operations. - * - * \return 0 on success, or -1 if the surface is not valid - * - * \sa SDL_GetSurfaceAlphaMod() + * \brief Set an additional alpha value used in blit operations. + * + * \param surface The surface to update. + * \param alpha The source alpha value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceAlphaMod() */ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, Uint8 alpha); /** - * \fn int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) - * - * \brief Get the additional alpha value used in blit operations - * - * \param surface The surface to query - * \param alpha A pointer filled in with the source alpha value - * - * \return 0 on success, or -1 if the surface is not valid - * - * \sa SDL_SetSurfaceAlphaMod() + * \brief Get the additional alpha value used in blit operations. + * + * \param surface The surface to query. + * \param alpha A pointer filled in with the source alpha value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceAlphaMod() */ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha); /** - * \fn int SDL_SetSurfaceBlendMode(SDL_Surface *surface, int blendMode) - * - * \brief Set the blend mode used for blit operations - * - * \param surface The surface to update - * \param blendMode SDL_TextureBlendMode to use for blit blending - * - * \return 0 on success, or -1 if the parameters are not valid - * - * \sa SDL_GetSurfaceBlendMode() + * \brief Set the blend mode used for blit operations. + * + * \param surface The surface to update. + * \param blendMode ::SDL_BlendMode to use for blit blending. + * + * \return 0 on success, or -1 if the parameters are not valid. + * + * \sa SDL_GetSurfaceBlendMode() */ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode); /** - * \fn int SDL_GetSurfaceBlendMode(SDL_Surface *surface, int *blendMode) - * - * \brief Get the blend mode used for blit operations - * - * \param surface The surface to query - * \param blendMode A pointer filled in with the current blend mode - * - * \return 0 on success, or -1 if the surface is not valid - * - * \sa SDL_SetSurfaceBlendMode() + * \brief Get the blend mode used for blit operations. + * + * \param surface The surface to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceBlendMode() */ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode); /** - * \fn int SDL_SetSurfaceScaleMode(SDL_Surface *surface, int scaleMode) - * - * \brief Set the scale mode used for blit operations - * - * \param surface The surface to update - * \param scaleMode SDL_TextureScaleMode to use for blit scaling - * - * \return 0 on success, or -1 if the surface is not valid or the scale mode is not supported - * - * \note If the scale mode is not supported, the closest supported mode is chosen. Currently only SDL_TEXTURESCALEMODE_FAST is supported on surfaces. - * - * \sa SDL_GetSurfaceScaleMode() + * \brief Set the scale mode used for blit operations. + * + * \param surface The surface to update. + * \param scaleMode ::SDL_TextureScaleMode to use for blit scaling. + * + * \return 0 on success, or -1 if the surface is not valid or the scale mode is + * not supported. + * + * \note If the scale mode is not supported, the closest supported mode is + * chosen. Currently only ::SDL_TEXTURESCALEMODE_FAST is supported on + * surfaces. + * + * \sa SDL_GetSurfaceScaleMode() */ extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode); /** - * \fn int SDL_GetSurfaceScaleMode(SDL_Surface *surface, int *scaleMode) - * - * \brief Get the scale mode used for blit operations - * - * \param surface The surface to query - * \param scaleMode A pointer filled in with the current scale mode - * - * \return 0 on success, or -1 if the surface is not valid - * - * \sa SDL_SetSurfaceScaleMode() + * \brief Get the scale mode used for blit operations. + * + * \param surface The surface to query. + * \param scaleMode A pointer filled in with the current scale mode. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceScaleMode() */ extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode); -/* - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. */ extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, const SDL_Rect * rect); -/* - * Gets the clipping rectangle for the destination surface in a blit. - * 'rect' must be a pointer to a valid rectangle which will be filled - * with the correct values. +/** + * Gets the clipping rectangle for the destination surface in a blit. + * + * \c rect must be a pointer to a valid rectangle which will be filled + * with the correct values. */ extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, SDL_Rect * rect); -/* - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - * - * This function is used internally by SDL_DisplayFormat(). +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + * + * This function is used internally by SDL_DisplayFormat(). */ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface (SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags); -/* - * This function draws a point with 'color' - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. +/** + * Draws a point with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_DrawPoint (SDL_Surface * dst, int x, int y, Uint32 color); -/* - * This function blends a point with an RGBA value - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. +/** + * Blends a point with an RGBA value. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_BlendPoint (SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -/* - * This function draws a line with 'color' - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. +/** + * Draws a line with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_DrawLine (SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color); -/* - * This function blends an RGBA value along a line - * This function returns 0 on success, or -1 on error. +/** + * Blends an RGBA value along a line. + * + * \return 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_BlendLine (SDL_Surface * dst, int x1, int y1, int x2, int y2, int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -/* - * This function performs a fast fill of the given rectangle with 'color' - * The given rectangle is clipped to the destination surface clip area - * and the final fill rectangle is saved in the passed in pointer. - * If 'dstrect' is NULL, the whole surface will be filled with 'color' - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. +/** + * Performs a fast fill of the given rectangle with \c color. + * + * The given rectangle is clipped to the destination surface clip area + * and the final fill rectangle is saved in the passed in pointer. + * + * If \c dstrect is NULL, the whole surface will be filled with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_FillRect (SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color); -/* - * This function blends an RGBA value into the given rectangle. - * The given rectangle is clipped to the destination surface clip area - * and the final fill rectangle is saved in the passed in pointer. - * If 'dstrect' is NULL, the whole surface will be filled with 'color' - * This function returns 0 on success, or -1 on error. +/** + * Blends an RGBA value into the given rectangle. + * + * The given rectangle is clipped to the destination surface clip area + * and the final fill rectangle is saved in the passed in pointer. + * + * If \c dstrect is NULL, the whole surface will be filled with \c color. + * + * \return This function returns 0 on success, or -1 on error. */ extern DECLSPEC int SDLCALL SDL_BlendRect (SDL_Surface * dst, SDL_Rect * dstrect, int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -/* - * This performs a fast blit from the source surface to the destination - * surface. It assumes that the source and destination rectangles are - * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire - * surface (src or dst) is copied. The final blit rectangles are saved - * in 'srcrect' and 'dstrect' after all clipping is performed. - * If the blit is successful, it returns 0, otherwise it returns -1. +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are + * the same size. If either \c srcrect or \c dstrect are NULL, the entire + * surface (\c src or \c dst) is copied. The final blit rectangles are saved + * in \c srcrect and \c dstrect after all clipping is performed. + * + * \return If the blit is successful, it returns 0, otherwise it returns -1. * - * The blit function should not be called on a locked surface. + * The blit function should not be called on a locked surface. * - * The blit semantics for surfaces with and without alpha and colorkey - * are defined as follows: - * - * RGBA->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using alpha-channel). - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy RGB. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value); - * set destination alpha to opaque. - * SDL_SRCALPHA not set: - * copy RGB, set destination alpha to source per-surface alpha value. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * RGBA->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source alpha channel) the RGB values; - * leave destination alpha untouched. [Note: is this correct?] - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy all of RGBA to the destination. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value). - * SDL_SRCALPHA not set: - * copy RGB. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * If either of the surfaces were in video memory, and the blit returns -2, - * the video memory was lost, so it should be reloaded with artwork and - * re-blitted: - while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { - while ( SDL_LockSurface(image) < 0 ) - Sleep(10); - -- Write image pixels to image->pixels -- - SDL_UnlockSurface(image); - } - * This happens under DirectX 5.0 when the system switches away from your - * fullscreen application. The lock will also fail until you have access - * to the video memory again. + * The blit semantics for surfaces with and without alpha and colorkey + * are defined as follows: + * \verbatim + RGBA->RGB: + SDL_SRCALPHA set: + alpha-blend (using alpha-channel). + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value); + set destination alpha to opaque. + SDL_SRCALPHA not set: + copy RGB, set destination alpha to source per-surface alpha value. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + RGBA->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source alpha channel) the RGB values; + leave destination alpha untouched. [Note: is this correct?] + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGB: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value). + SDL_SRCALPHA not set: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + \endverbatim + * + * If either of the surfaces were in video memory, and the blit returns -2, + * the video memory was lost, so it should be reloaded with artwork and + * re-blitted: + * @code + * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { + * while ( SDL_LockSurface(image) < 0 ) + * Sleep(10); + * -- Write image pixels to image->pixels -- + * SDL_UnlockSurface(image); + * } + * @endcode + * + * This happens under DirectX 5.0 when the system switches away from your + * fullscreen application. The lock will also fail until you have access + * to the video memory again. + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. */ -/* You should call SDL_BlitSurface() unless you know exactly how SDL - blitting works internally and how to use the other blit functions. -*/ #define SDL_BlitSurface SDL_UpperBlit -/* This is the public blit function, SDL_BlitSurface(), and it performs - rectangle validation and clipping before passing it to SDL_LowerBlit() -*/ +/** + * This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ extern DECLSPEC int SDLCALL SDL_UpperBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect); -/* This is a semi-private blit function and it performs low-level surface - blitting only. -*/ + +/** + * This is a semi-private blit function and it performs low-level surface + * blitting only. + */ extern DECLSPEC int SDLCALL SDL_LowerBlit (SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect); /** - * \fn int SDL_SoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, const SDL_Rect * dstrect) - * - * \brief Perform a fast, low quality, stretch blit between two surfaces of the same pixel format. - * - * \note This function uses a static buffer, and is not thread-safe. + * \brief Perform a fast, low quality, stretch blit between two surfaces of the + * same pixel format. + * + * \note This function uses a static buffer, and is not thread-safe. */ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, diff --git a/Externals/SDL/Include/SDL_syswm.h b/Externals/SDL/Include/SDL_syswm.h index 483118cf86..fdd4f0521b 100644 --- a/Externals/SDL/Include/SDL_syswm.h +++ b/Externals/SDL/Include/SDL_syswm.h @@ -1,244 +1,262 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_syswm.h - * - * Include file for SDL custom system window manager hooks - */ - -#ifndef _SDL_syswm_h -#define _SDL_syswm_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_video.h" -#include "SDL_version.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* Your application has access to a special type of event 'SDL_SYSWMEVENT', - which contains window-manager specific information and arrives whenever - an unhandled window event occurs. This event is ignored by default, but - you can enable it with SDL_EventState() -*/ -#ifdef SDL_PROTOTYPES_ONLY -struct SDL_SysWMinfo; -#else - -/* This is the structure for custom window manager events */ -#if defined(SDL_VIDEO_DRIVER_X11) -#if defined(__APPLE__) && defined(__MACH__) -/* conflicts with Quickdraw.h */ -#define Cursor X11Cursor -#endif - -#include -#include - -#if defined(__APPLE__) && defined(__MACH__) -/* matches the re-define above */ -#undef Cursor -#endif - -/* These are the various supported subsystems under UNIX */ -typedef enum -{ - SDL_SYSWM_X11 -} SDL_SYSWM_TYPE; - -/* The UNIX custom event structure */ -struct SDL_SysWMmsg -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { - XEvent xevent; - } event; -}; - -/* The UNIX custom window manager information structure. - When this structure is returned, it holds information about which - low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -struct SDL_SysWMinfo -{ - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union - { - struct - { - Display *display; /* The X11 display */ - Window window; /* The X11 display window */ - /* These locking functions should be called around - any X11 functions using the display variable. - They lock the event thread, so should not be - called around event functions or from event filters. - */ - void (*lock_func) (void); - void (*unlock_func) (void); - - /* Introduced in SDL 1.0.2 */ - Window fswindow; /* The X11 fullscreen window */ - Window wmwindow; /* The X11 managed input window */ - } x11; - } info; -}; - -#elif defined(SDL_VIDEO_DRIVER_NANOX) -#include - -/* The generic custom event structure */ -struct SDL_SysWMmsg -{ - SDL_version version; - int data; -}; - -/* The windows custom window manager information structure */ -struct SDL_SysWMinfo -{ - SDL_version version; - GR_WINDOW_ID window; /* The display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_WIN32) -#define WIN32_LEAN_AND_MEAN -#include - -/* The windows custom event structure */ -struct SDL_SysWMmsg -{ - SDL_version version; - HWND hwnd; /* The window for the message */ - UINT msg; /* The type of message */ - WPARAM wParam; /* WORD message parameter */ - LPARAM lParam; /* LONG message parameter */ -}; - -/* The windows custom window manager information structure */ -struct SDL_SysWMinfo -{ - SDL_version version; - HWND window; /* The Win32 display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_RISCOS) - -/* RISC OS custom event structure */ -struct SDL_SysWMmsg -{ - SDL_version version; - int eventCode; /* The window for the message */ - int pollBlock[64]; -}; - -/* The RISC OS custom window manager information structure */ -struct SDL_SysWMinfo -{ - SDL_version version; - int wimpVersion; /* Wimp version running under */ - int taskHandle; /* The RISC OS task handle */ - int window; /* The RISC OS display window */ -}; - -#elif defined(SDL_VIDEO_DRIVER_PHOTON) -#include -#include - -/* The QNX custom event structure */ -struct SDL_SysWMmsg -{ - SDL_version version; - int data; -}; - -/* The QNX custom window manager information structure */ -struct SDL_SysWMinfo -{ - SDL_version version; - int data; -}; - -#else - -/* The generic custom event structure */ -struct SDL_SysWMmsg -{ - SDL_version version; - int data; -}; - -/* The generic custom window manager information structure */ -struct SDL_SysWMinfo -{ - SDL_version version; - int data; -}; - -#endif /* video driver type */ - -#endif /* SDL_PROTOTYPES_ONLY */ - -typedef struct SDL_SysWMinfo SDL_SysWMinfo; - -/* Function prototypes */ -/** - * \fn SDL_bool SDL_GetWindowWMInfo (SDL_WindowID windowID, SDL_SysWMinfo * info) - * - * \brief This function allows access to driver-dependent window information. - * - * \param windowID The window about which information is being requested - * \param info This structure must be initialized with the SDL version, and is then filled in with information about the given window. - * - * \return SDL_TRUE if the function is implemented and the version member of the 'info' struct is valid, SDL_FALSE otherwise. - * - * You typically use this function like this: - * \code - * SDL_SysWMInfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWindowWMInfo(&info) ) { ... } - * \endcode - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID, - SDL_SysWMinfo * info); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_syswm_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_syswm.h + * + * Include file for SDL custom system window manager hooks. + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \file SDL_syswm.h + * + * Your application has access to a special type of event ::SDL_SYSWMEVENT, + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState(). + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +#else + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +/** + * These are the various supported subsystems under UNIX. + */ +typedef enum +{ + SDL_SYSWM_X11 +} SDL_SYSWM_TYPE; + +/** + * The UNIX custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { + XEvent xevent; + } event; +}; + +/** + * The UNIX custom window manager information structure. + * + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { + struct + { + Display *display; /**< The X11 display */ + Window window; /**< The X11 display window */ + /** + * These locking functions should be called around + * any X11 functions using the display variable. + * They lock the event thread, so should not be + * called around event functions or from event filters. + */ + /*@{*/ + void (*lock_func) (void); + void (*unlock_func) (void); + /*@}*/ + + /** + * Introduced in SDL 1.0.2. + */ + /*@{*/ + Window fswindow; /**< The X11 fullscreen window */ + Window wmwindow; /**< The X11 managed input window */ + /*@}*/ + } x11; + } info; +}; + +#elif defined(SDL_VIDEO_DRIVER_WIN32) +#define WIN32_LEAN_AND_MEAN +#include + +/** + * The windows custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ +}; + +/** + * The windows custom window manager information structure. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + HWND window; /**< The Win32 display window */ +}; + +#elif defined(SDL_VIDEO_DRIVER_RISCOS) + +/** + * RISC OS custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + int eventCode; /**< The window for the message */ + int pollBlock[64]; +}; + +/** + * The RISC OS custom window manager information structure. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + int wimpVersion; /**< Wimp version running under */ + int taskHandle; /**< The RISC OS task handle */ + int window; /**< The RISC OS display window */ +}; + +#elif defined(SDL_VIDEO_DRIVER_PHOTON) || defined(SDL_VIDEO_DRIVER_QNXGF) +#include +#if defined(SDL_VIDEO_OPENGL_ES) +#include +#endif /* SDL_VIDEO_OPENGL_ES */ +#include + +/** + * The QNX custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + int data; +}; + +/** + * The QNX Photon custom window manager information structure. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + int data; +}; + +#else + +/** + * The generic custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + int data; +}; + +/** + * The generic custom window manager information structure. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + int data; +}; + +#endif /* video driver type */ + +#endif /* SDL_PROTOTYPES_ONLY */ + +typedef struct SDL_SysWMinfo SDL_SysWMinfo; + +/* Function prototypes */ +/** + * \brief This function allows access to driver-dependent window information. + * + * \param windowID The window about which information is being requested + * \param info This structure must be initialized with the SDL version, and is + * then filled in with information about the given window. + * + * \return SDL_TRUE if the function is implemented and the version member of + * the \c info struct is valid, SDL_FALSE otherwise. + * + * You typically use this function like this: + * \code + * SDL_SysWMInfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWindowWMInfo(&info) ) { ... } + * \endcode + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID, + SDL_SysWMinfo * info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_thread.h b/Externals/SDL/Include/SDL_thread.h index 1a8b13f2e8..1033ac1148 100644 --- a/Externals/SDL/Include/SDL_thread.h +++ b/Externals/SDL/Include/SDL_thread.h @@ -1,144 +1,170 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_thread_h -#define _SDL_thread_h - -/** - * \file SDL_thread.h - * - * Header for the SDL thread management routines - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -/* Thread synchronization primitives */ -#include "SDL_mutex.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* The SDL thread structure, defined in SDL_thread.c */ -struct SDL_Thread; -typedef struct SDL_Thread SDL_Thread; - -/* Create a thread */ -#if (defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__) -/* - We compile SDL into a DLL on OS/2. This means, that it's the DLL which - creates a new thread for the calling process with the SDL_CreateThread() - API. There is a problem with this, that only the RTL of the SDL.DLL will - be initialized for those threads, and not the RTL of the calling application! - To solve this, we make a little hack here. - We'll always use the caller's _beginthread() and _endthread() APIs to - start a new thread. This way, if it's the SDL.DLL which uses this API, - then the RTL of SDL.DLL will be used to create the new thread, and if it's - the application, then the RTL of the application will be used. - So, in short: - Always use the _beginthread() and _endthread() of the calling runtime library! -*/ -#define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef _WIN32_WCE -#include /* This has _beginthread() and _endthread() defined! */ -#endif - -#ifdef __OS2__ -typedef int (*pfnSDL_CurrentBeginThread) (void (*func) (void *), void *, - unsigned, void *arg); -typedef void (*pfnSDL_CurrentEndThread) (void); -#elif __GNUC__ -typedef unsigned long (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned - (__stdcall * - func) (void *), - void *arg, - unsigned, - unsigned - *threadID); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); -#else -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall * - func) (void - *), - void *arg, unsigned, - unsigned *threadID); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); -#endif - -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(int (SDLCALL * f) (void *), void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread); - -#ifdef __OS2__ -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) -#elif defined(_WIN32_WCE) -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) -#else -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) -#endif -#else -extern DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(int (SDLCALL * fn) (void *), void *data); -#endif - -/* Get the 32-bit thread identifier for the current thread */ -extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); - -/* Get the 32-bit thread identifier for the specified thread, - equivalent to SDL_ThreadID() if the specified thread is NULL. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread * thread); - -/* Wait for a thread to finish. - The return code for the thread function is placed in the area - pointed to by 'status', if 'status' is not NULL. - */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); - -/* This function is here for binary compatibility with legacy apps, but - in SDL 1.3 and later, it's a no-op. You cannot forcibly kill a thread - in a safe manner on many platforms. You should instead find a way to - alert your thread that it is time to terminate, and then have it gracefully - exit on its own. Do not ever call this function! - */ -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_thread_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** + * \file SDL_thread.h + * + * Header for the SDL thread management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/* The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +#if defined(__WIN32__) && !defined(HAVE_LIBC) +/** + * \file SDL_thread.h + * + * We compile SDL into a DLL. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling + * application! + * + * To solve this, we make a little hack here. + * + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime + * library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef _WIN32_WCE +#include /* This has _beginthread() and _endthread() defined! */ +#endif + +#ifdef __GNUC__ +typedef unsigned long (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned + (__stdcall * + func) (void *), + void *arg, + unsigned, + unsigned + *threadID); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); +#else +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall * + func) (void + *), + void *arg, unsigned, + unsigned *threadID); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); +#endif + +/** + * Create a thread. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(int (SDLCALL * f) (void *), void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +#if defined(_WIN32_WCE) + +/** + * Create a thread. + */ +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) + +#else + +/** + * Create a thread. + */ +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) + +#endif +#else + +/** + * Create a thread. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(int (SDLCALL * fn) (void *), void *data); + +#endif + +/** + * Get the 32-bit thread identifier for the current thread. + */ +extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); + +/** + * Get the 32-bit thread identifier for the specified thread. + * + * Equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread * thread); + +/** + * Wait for a thread to finish. + * + * The return code for the thread function is placed in the area + * pointed to by \c status, if \c status is not NULL. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); + +/** + * \deprecated This function is here for binary compatibility with legacy apps, + * but in SDL 1.3 and later, it's a no-op. + * + * You cannot forcibly kill a thread in a safe manner on many platforms. You + * should instead find a way to alert your thread that it is time to terminate, + * and then have it gracefully exit on its own. Do not ever call this function! + */ +extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_timer.h b/Externals/SDL/Include/SDL_timer.h index 75901d7311..dc9726d997 100644 --- a/Externals/SDL/Include/SDL_timer.h +++ b/Externals/SDL/Include/SDL_timer.h @@ -1,128 +1,153 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_timer_h -#define _SDL_timer_h - -/** - * \file SDL_timer.h - * - * Header for the SDL time management routines - */ - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/* This is the OS scheduler timeslice, in milliseconds */ -#define SDL_TIMESLICE 10 - -/* This is the maximum resolution of the SDL timer on all platforms */ -#define TIMER_RESOLUTION 10 /* Experimentally determined */ - -/* Get the number of milliseconds since the SDL library initialization. - * Note that this value wraps if the program runs for more than ~49 days. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); - -/* Wait a specified number of milliseconds before returning */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/* Function prototype for the timer callback function */ -typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval); - -/* Set a callback to run after the specified number of milliseconds has - * elapsed. The callback function is passed the current timer interval - * and returns the next timer interval. If the returned value is the - * same as the one passed in, the periodic alarm continues, otherwise a - * new alarm is scheduled. If the callback returns 0, the periodic alarm - * is cancelled. - * - * To cancel a currently running timer, call SDL_SetTimer(0, NULL); - * - * The timer callback function may run in a different thread than your - * main code, and so shouldn't call any functions from within itself. - * - * The maximum resolution of this timer is 10 ms, which means that if - * you request a 16 ms timer, your callback will run approximately 20 ms - * later on an unloaded system. If you wanted to set a flag signaling - * a frame update at 30 frames per second (every 33 ms), you might set a - * timer for 30 ms: - * SDL_SetTimer((33/10)*10, flag_update); - * - * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). - * - * Under UNIX, you should not use raise or use SIGALRM and this function - * in the same program, as it is implemented using setitimer(). You also - * should not use this function in multi-threaded applications as signals - * to multi-threaded apps have undefined behavior in some implementations. - * - * This function returns 0 if successful, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, - SDL_TimerCallback callback); - -/* New timer API, supports multiple timers - * Written by Stephane Peter - */ - -/* Function prototype for the new timer callback function. - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. - */ -typedef Uint32(SDLCALL * SDL_NewTimerCallback) (Uint32 interval, void *param); - -/* Definition of the timer ID type */ -typedef struct _SDL_TimerID *SDL_TimerID; - -/* Add a new timer to the pool of timers already running. - Returns a timer ID, or NULL when an error occurs. - */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, - SDL_NewTimerCallback - callback, void *param); - -/* Remove one of the multiple timers knowing its ID. - * Returns a boolean value indicating success. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_timer_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** + * \file SDL_timer.h + * + * Header for the SDL time management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * This is the OS scheduler timeslice, in milliseconds. + */ +#define SDL_TIMESLICE 10 + +/** + * This is the maximum resolution of the SDL timer on all platforms. + */ +#define TIMER_RESOLUTION 10 /**< Experimentally determined */ + +/** + * Get the number of milliseconds since the SDL library initialization. + * + * Note that this value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** + * Wait a specified number of milliseconds before returning. + */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** + * Function prototype for the timer callback function. + */ +typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval); + +/** + * Set a callback to run after the specified number of milliseconds has + * elapsed. The callback function is passed the current timer interval + * and returns the next timer interval. If the returned value is the + * same as the one passed in, the periodic alarm continues, otherwise a + * new alarm is scheduled. If the callback returns 0, the periodic alarm + * is cancelled. + * + * To cancel a currently running timer, call + * \code SDL_SetTimer(0, NULL); \endcode + * + * The timer callback function may run in a different thread than your + * main code, and so shouldn't call any functions from within itself. + * + * The maximum resolution of this timer is 10 ms, which means that if + * you request a 16 ms timer, your callback will run approximately 20 ms + * later on an unloaded system. If you wanted to set a flag signaling + * a frame update at 30 frames per second (every 33 ms), you might set a + * timer for 30 ms: + * \code + * SDL_SetTimer((33/10)*10, flag_update); + * \endcode + * + * If you use this function, you need to pass ::SDL_INIT_TIMER to SDL_Init(). + * + * Under UNIX, you should not use raise or use SIGALRM and this function + * in the same program, as it is implemented using setitimer(). You also + * should not use this function in multi-threaded applications as signals + * to multi-threaded apps have undefined behavior in some implementations. + * + * \return 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, + SDL_TimerCallback callback); + +/** + * \name Peter timers + * New timer API, supports multiple timers + * Written by Stephane Peter + */ +/*@{*/ + +/** + * Function prototype for the new timer callback function. + * + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32(SDLCALL * SDL_NewTimerCallback) (Uint32 interval, void *param); + +/** + * Definition of the timer ID type. + */ +typedef struct _SDL_TimerID *SDL_TimerID; + +/** + * Add a new timer to the pool of timers already running. + * \return A timer ID, or NULL when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, + SDL_NewTimerCallback + callback, void *param); + +/** + * Remove one of the multiple timers knowing its ID. + * \return A boolean value indicating success or failure. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); + +/*@}*//*Peter timers*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_types.h b/Externals/SDL/Include/SDL_types.h index 942732d0a0..f2bc8e1f87 100644 --- a/Externals/SDL/Include/SDL_types.h +++ b/Externals/SDL/Include/SDL_types.h @@ -1,24 +1,30 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* DEPRECATED */ -#include "SDL_stdinc.h" +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_types.h + * + * \deprecated + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/Externals/SDL/Include/SDL_version.h b/Externals/SDL/Include/SDL_version.h index 702386ba4a..e485ee4efc 100644 --- a/Externals/SDL/Include/SDL_version.h +++ b/Externals/SDL/Include/SDL_version.h @@ -1,151 +1,155 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_version.h - * - * This header defines the current SDL version - */ - -#ifndef _SDL_version_h -#define _SDL_version_h - -#include "SDL_stdinc.h" -#include "SDL_revision.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/** - * \struct SDL_version - * \brief Information the version of SDL in use. - * - * Represents the library's version as three levels: major revision - * (increments with massive changes, additions, and enhancements), - * minor revision (increments with backwards-compatible changes to the - * major revision), and patchlevel (increments with fixes to the minor - * revision). - * - * \sa SDL_VERSION - * \sa SDL_GetVersion - */ -typedef struct SDL_version -{ - Uint8 major; /**< major version */ - Uint8 minor; /**< minor version */ - Uint8 patch; /**< update version */ -} SDL_version; - -/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL -*/ -#define SDL_MAJOR_VERSION 1 -#define SDL_MINOR_VERSION 3 -#define SDL_PATCHLEVEL 0 - -/** - * \def SDL_VERSION(x) - * \brief Macro to determine SDL version program was compiled against. - * - * This macro fills in a SDL_version structure with the version of the - * library you compiled against. This is determined by what header the - * compiler uses. Note that if you dynamically linked the library, you might - * have a slightly newer or older version at runtime. That version can be - * determined with SDL_GetVersion(), which, unlike SDL_VERSION, - * is not a macro. - * - * \param x A pointer to a SDL_version struct to initialize. - * - * \sa SDL_version - * \sa SDL_GetVersion - */ -#define SDL_VERSION(x) \ -{ \ - (x)->major = SDL_MAJOR_VERSION; \ - (x)->minor = SDL_MINOR_VERSION; \ - (x)->patch = SDL_PATCHLEVEL; \ -} - -/* This macro turns the version numbers into a numeric value: - (1,2,3) -> (1203) - This assumes that there will never be more than 100 patchlevels -*/ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) - -/* This is the version number macro for the current SDL version */ -#define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) - -/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ -#define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) - -/** - * \fn void SDL_GetVersion(SDL_version *ver) - * \brief Get the version of SDL that is linked against your program. - * - * If you are using a shared library (DLL) version of SDL, then it is - * possible that it will be different than the version you compiled against. - * - * This is a real function; the macro SDL_VERSION tells you what version - * of SDL you compiled against: - * - * \code - * SDL_version compiled; - * SDL_version linked; - * - * SDL_VERSION(&compiled); - * SDL_GetVersion(&linked); - * printf("We compiled against SDL version %d.%d.%d ...\n", - * compiled.major, compiled.minor, compiled.patch); - * printf("But we linked against SDL version %d.%d.%d.\n", - * linked.major, linked.minor, linked.patch); - * \endcode - * - * This function may be called safely at any time, even before SDL_Init(). - * - * \sa SDL_VERSION - */ -extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); - -/** - * \fn int SDL_GetRevision(void) - * \brief Get the code revision of SDL that is linked against your program. - */ -extern DECLSPEC int SDLCALL SDL_GetRevision(void); - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_version_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_version.h + * + * This header defines the current SDL version. + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" +#include "SDL_revision.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief Information the version of SDL in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa SDL_VERSION + * \sa SDL_GetVersion + */ +typedef struct SDL_version +{ + Uint8 major; /**< major version */ + Uint8 minor; /**< minor version */ + Uint8 patch; /**< update version */ +} SDL_version; + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MAJOR_VERSION 1 +#define SDL_MINOR_VERSION 3 +#define SDL_PATCHLEVEL 0 + +/** + * \brief Macro to determine SDL version program was compiled against. + * + * This macro fills in a SDL_version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), + * is not a macro. + * + * \param x A pointer to a SDL_version struct to initialize. + * + * \sa SDL_version + * \sa SDL_GetVersion + */ +#define SDL_VERSION(x) \ +{ \ + (x)->major = SDL_MAJOR_VERSION; \ + (x)->minor = SDL_MINOR_VERSION; \ + (x)->patch = SDL_PATCHLEVEL; \ +} + +/** + * This macro turns the version numbers into a numeric value: + * \verbatim + (1,2,3) -> (1203) + \endverbatim + * + * This assumes that there will never be more than 100 patchlevels. + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** + * This is the version number macro for the current SDL version. + */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** + * \brief Get the version of SDL that is linked against your program. + * + * If you are using a shared library (DLL) version of SDL, then it is + * possible that it will be different than the version you compiled against. + * + * This is a real function; the macro SDL_VERSION() tells you what version + * of SDL you compiled against: + * + * \code + * SDL_version compiled; + * SDL_version linked; + * + * SDL_VERSION(&compiled); + * SDL_GetVersion(&linked); + * printf("We compiled against SDL version %d.%d.%d ...\n", + * compiled.major, compiled.minor, compiled.patch); + * printf("But we linked against SDL version %d.%d.%d.\n", + * linked.major, linked.minor, linked.patch); + * \endcode + * + * This function may be called safely at any time, even before SDL_Init(). + * + * \sa SDL_VERSION + */ +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); + +/** + * \brief Get the code revision of SDL that is linked against your program. + */ +extern DECLSPEC int SDLCALL SDL_GetRevision(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/SDL_video.h b/Externals/SDL/Include/SDL_video.h index 02aec68642..b13ee8c2e6 100644 --- a/Externals/SDL/Include/SDL_video.h +++ b/Externals/SDL/Include/SDL_video.h @@ -1,1469 +1,1369 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * \file SDL_video.h - * - * Header file for SDL video functions. - */ - -#ifndef _SDL_video_h -#define _SDL_video_h - -#include "SDL_stdinc.h" -#include "SDL_pixels.h" -#include "SDL_rect.h" -#include "SDL_surface.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -extern "C" { -/* *INDENT-ON* */ -#endif - -/** - * \struct SDL_DisplayMode - * - * \brief The structure that defines a display mode - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - * \sa SDL_GetDesktopDisplayMode() - * \sa SDL_GetCurrentDisplayMode() - * \sa SDL_GetClosestDisplayMode() - * \sa SDL_SetDisplayMode() - */ -typedef struct -{ - Uint32 format; /**< pixel format */ - int w; /**< width */ - int h; /**< height */ - int refresh_rate; /**< refresh rate (or zero for unspecified) */ - void *driverdata; /**< driver-specific data, initialize to 0 */ -} SDL_DisplayMode; - -/** - * \typedef SDL_WindowID - * - * \brief The type used to identify a window - * - * \sa SDL_CreateWindow() - * \sa SDL_CreateWindowFrom() - * \sa SDL_DestroyWindow() - * \sa SDL_GetWindowData() - * \sa SDL_GetWindowFlags() - * \sa SDL_GetWindowGrab() - * \sa SDL_GetWindowPosition() - * \sa SDL_GetWindowSize() - * \sa SDL_GetWindowTitle() - * \sa SDL_HideWindow() - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - * \sa SDL_RaiseWindow() - * \sa SDL_RestoreWindow() - * \sa SDL_SetWindowData() - * \sa SDL_SetWindowFullscreen() - * \sa SDL_SetWindowGrab() - * \sa SDL_SetWindowIcon() - * \sa SDL_SetWindowPosition() - * \sa SDL_SetWindowSize() - * \sa SDL_SetWindowTitle() - * \sa SDL_ShowWindow() - */ -typedef Uint32 SDL_WindowID; - -/** - * \enum SDL_WindowFlags - * - * \brief The flags on a window - * - * \sa SDL_GetWindowFlags() - */ -typedef enum -{ - SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window, implies borderless */ - SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ - SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ - SDL_WINDOW_BORDERLESS = 0x00000008, /**< no window decoration */ - SDL_WINDOW_RESIZABLE = 0x00000010, /**< window can be resized */ - SDL_WINDOW_MINIMIZED = 0x00000020, /**< minimized */ - SDL_WINDOW_MAXIMIZED = 0x00000040, /**< maximized */ - SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ - SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ - SDL_WINDOW_MOUSE_FOCUS = 0x00000400 /**< window has mouse focus */ -} SDL_WindowFlags; - -/** - * \def SDL_WINDOWPOS_UNDEFINED - * \brief Used to indicate that you don't care what the window position is. - */ -#define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF -/** - * \def SDL_WINDOWPOS_CENTERED - * \brief Used to indicate that the window position should be centered. - */ -#define SDL_WINDOWPOS_CENTERED 0x7FFFFFE - -/** - * \enum SDL_WindowEventID - * - * \brief Event subtype for window events - */ -typedef enum -{ - SDL_WINDOWEVENT_NONE, /**< Never used */ - SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ - SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ - SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be redrawn */ - SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1,data2 */ - SDL_WINDOWEVENT_RESIZED, /**< Window size changed to data1xdata2 */ - SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ - SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ - SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size and position */ - SDL_WINDOWEVENT_ENTER, /**< The window has gained mouse focus */ - SDL_WINDOWEVENT_LEAVE, /**< The window has lost mouse focus */ - SDL_WINDOWEVENT_FOCUS_GAINED, /**< The window has gained keyboard focus */ - SDL_WINDOWEVENT_FOCUS_LOST, /**< The window has lost keyboard focus */ - SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the window be closed */ -} SDL_WindowEventID; - -/** - * \enum SDL_RendererFlags - * - * \brief Flags used when creating a rendering context - */ -typedef enum -{ - SDL_RENDERER_SINGLEBUFFER = 0x00000001, /**< Render directly to the window, if possible */ - SDL_RENDERER_PRESENTCOPY = 0x00000002, /**< Present uses a copy from back buffer to the front buffer */ - SDL_RENDERER_PRESENTFLIP2 = 0x00000004, /**< Present uses a flip, swapping back buffer and front buffer */ - SDL_RENDERER_PRESENTFLIP3 = 0x00000008, /**< Present uses a flip, rotating between two back buffers and a front buffer */ - SDL_RENDERER_PRESENTDISCARD = 0x00000010, /**< Present leaves the contents of the backbuffer undefined */ - SDL_RENDERER_PRESENTVSYNC = 0x00000020, /**< Present is synchronized with the refresh rate */ - SDL_RENDERER_ACCELERATED = 0x00000040 /**< The renderer uses hardware acceleration */ -} SDL_RendererFlags; - -/** - * \struct SDL_RendererInfo - * - * \brief Information on the capabilities of a render driver or context - */ -typedef struct SDL_RendererInfo -{ - const char *name; /**< The name of the renderer */ - Uint32 flags; /**< Supported SDL_RendererFlags */ - Uint32 mod_modes; /**< A mask of supported channel modulation */ - Uint32 blend_modes; /**< A mask of supported blend modes */ - Uint32 scale_modes; /**< A mask of supported scale modes */ - Uint32 num_texture_formats; /**< The number of available texture formats */ - Uint32 texture_formats[20]; /**< The available texture formats */ - int max_texture_width; /**< The maximimum texture width */ - int max_texture_height; /**< The maximimum texture height */ -} SDL_RendererInfo; - -/** - * \enum SDL_TextureAccess - * - * \brief The access pattern allowed for a texture - */ -typedef enum -{ - SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ - SDL_TEXTUREACCESS_STREAMING /**< Changes frequently, lockable */ -} SDL_TextureAccess; - -/** - * \enum SDL_TextureModulate - * - * \brief The texture channel modulation used in SDL_RenderCopy() - */ -typedef enum -{ - SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ - SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ - SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ -} SDL_TextureModulate; - -/** - * \enum SDL_BlendMode - * - * \brief The blend mode used in SDL_RenderCopy() and drawing operations - */ -typedef enum -{ - SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */ - SDL_BLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst (alpha is mask) */ - SDL_BLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */ - SDL_BLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */ - SDL_BLENDMODE_MOD = 0x00000008 /**< dst = src * dst */ -} SDL_BlendMode; - -/** - * \enum SDL_TextureScaleMode - * - * \brief The texture scale mode used in SDL_RenderCopy() - */ -typedef enum -{ - SDL_TEXTURESCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must match dimensions */ - SDL_TEXTURESCALEMODE_FAST = 0x00000001, /**< Point sampling or equivalent algorithm */ - SDL_TEXTURESCALEMODE_SLOW = 0x00000002, /**< Linear filtering or equivalent algorithm */ - SDL_TEXTURESCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or equivalent algorithm */ -} SDL_TextureScaleMode; - -/** - * \typedef SDL_TextureID - * - * \brief An efficient driver-specific representation of pixel data - */ -typedef Uint32 SDL_TextureID; - -/** - * \typedef SDL_GLContext - * - * \brief An opaque handle to an OpenGL context. - */ -typedef void *SDL_GLContext; - -/** - * \enum SDL_GLattr - * - * \brief OpenGL configuration attributes - */ -typedef enum -{ - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING -} SDL_GLattr; - - -/* Function prototypes */ - -/** - * \fn int SDL_GetNumVideoDrivers(void) - * - * \brief Get the number of video drivers compiled into SDL - * - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); - -/** - * \fn const char *SDL_GetVideoDriver(int index) - * - * \brief Get the name of a built in video driver. - * - * \note The video drivers are presented in the order in which they are - * normally checked during initialization. - * - * \sa SDL_GetNumVideoDrivers() - */ -extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); - -/** - * \fn int SDL_VideoInit(const char *driver_name, Uint32 flags) - * - * \brief Initialize the video subsystem, optionally specifying a video driver. - * - * \param driver_name Initialize a specific driver by name, or NULL for the default video driver. - * \param flags FIXME: Still needed? - * - * \return 0 on success, -1 on error - * - * This function initializes the video subsystem; setting up a connection - * to the window manager, etc, and determines the available display modes - * and pixel formats, but does not initialize a window or graphics mode. - * - * \sa SDL_VideoQuit() - */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, - Uint32 flags); - -/** - * \fn void SDL_VideoQuit(void) - * - * \brief Shuts down the video subsystem. - * - * This function closes all windows, and restores the original video mode. - * - * \sa SDL_VideoInit() - */ -extern DECLSPEC void SDLCALL SDL_VideoQuit(void); - -/** - * \fn const char *SDL_GetCurrentVideoDriver(void) - * - * \brief Returns the name of the currently initialized video driver. - * - * \return The name of the current video driver or NULL if no driver - * has been initialized - * - * \sa SDL_GetNumVideoDrivers() - * \sa SDL_GetVideoDriver() - */ -extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); - -/** - * \fn int SDL_GetNumVideoDisplays(void) - * - * \brief Returns the number of available video displays. - * - * \sa SDL_SelectVideoDisplay() - */ -extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); - -/** - * \fn int SDL_SelectVideoDisplay(int index) - * - * \brief Set the index of the currently selected display. - * - * \return 0 on success, or -1 if the index is out of range. - * - * \sa SDL_GetNumVideoDisplays() - * \sa SDL_GetCurrentVideoDisplay() - */ -extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index); - -/** - * \fn int SDL_GetCurrentVideoDisplay(void) - * - * \brief Get the index of the currently selected display. - * - * \return The index of the currently selected display. - * - * \sa SDL_GetNumVideoDisplays() - * \sa SDL_SelectVideoDisplay() - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void); - -/** - * \fn int SDL_GetNumDisplayModes(void) - * - * \brief Returns the number of available display modes for the current display. - * - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void); - -/** - * \fn int SDL_GetDisplayMode(int index, SDL_DisplayMode *mode) - * - * \brief Fill in information about a specific display mode. - * - * \note The display modes are sorted in this priority: - * \li bits per pixel -> more colors to fewer colors - * \li width -> largest to smallest - * \li height -> largest to smallest - * \li refresh rate -> highest to lowest - * - * \sa SDL_GetNumDisplayModes() - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index, - SDL_DisplayMode * mode); - -/** - * \fn int SDL_GetDesktopDisplayMode(SDL_DisplayMode *mode) - * - * \brief Fill in information about the desktop display mode for the current display. - */ -extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode); - -/** - * \fn int SDL_GetCurrentDisplayMode(SDL_DisplayMode *mode) - * - * \brief Fill in information about the current display mode. - */ -extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode); - -/** - * \fn SDL_DisplayMode *SDL_GetClosestDisplayMode(const SDL_DisplayMode *mode, SDL_DisplayMode *closest) - * - * \brief Get the closest match to the requested display mode. - * - * \param mode The desired display mode - * \param closest A pointer to a display mode to be filled in with the closest match of the available display modes. - * - * \return The passed in value 'closest', or NULL if no matching video mode was available. - * - * The available display modes are scanned, and 'closest' is filled in with the closest mode matching the requested mode and returned. The mode format and refresh_rate default to the desktop mode if they are 0. The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate. If all the available modes are too small, then NULL is returned. - * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - */ -extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const - SDL_DisplayMode - * mode, - SDL_DisplayMode - * closest); - -/** - * \fn int SDL_SetFullscreenDisplayMode(const SDL_DisplayMode *mode) - * - * \brief Set the display mode used when a fullscreen window is visible - * on the currently selected display. - * - * \param mode The mode to use, or NULL for the desktop mode. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_SetWindowFullscreen() - */ -extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode - * mode); - -/** - * \fn int SDL_GetFullscreenDisplayMode(SDL_DisplayMode *mode) - * - * \brief Fill in information about the display mode used when a fullscreen - * window is visible on the currently selected display. - */ -extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode * - mode); - -/** - * \fn int SDL_SetDisplayPalette(const SDL_Color *colors, int firstcolor, int ncolors) - * - * \brief Set the palette entries for indexed display modes. - * - * \return 0 on success, or -1 if the display mode isn't palettized or the colors couldn't be set. - */ -extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors, - int firstcolor, - int ncolors); - -/** - * \fn int SDL_GetDisplayPalette(SDL_Color *colors, int firstcolor, int ncolors) - * - * \brief Gets the palette entries for indexed display modes. - * - * \return 0 on success, or -1 if the display mode isn't palettized - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors, - int firstcolor, - int ncolors); - -/** - * \fn int SDL_SetGamma(float red, float green, float blue) - * - * \brief Set the gamma correction for each of the color channels on the currently selected display. - * - * \return 0 on success, or -1 if setting the gamma isn't supported. - * - * \sa SDL_SetGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); - -/** - * \fn int SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue) - * - * \brief Set the gamma ramp for the currently selected display. - * - * \param red The translation table for the red channel, or NULL - * \param green The translation table for the green channel, or NULL - * \param blue The translation table for the blue channel, or NULL - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * \sa SDL_GetGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red, - const Uint16 * green, - const Uint16 * blue); - -/** - * \fn int SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue) - * - * \brief Get the gamma ramp for the currently selected display. - * - * \param red A pointer to a 256 element array of 16-bit quantities to hold the translation table for the red channel, or NULL. - * \param green A pointer to a 256 element array of 16-bit quantities to hold the translation table for the green channel, or NULL. - * \param blue A pointer to a 256 element array of 16-bit quantities to hold the translation table for the blue channel, or NULL. - * - * \return 0 on success, or -1 if gamma ramps are unsupported. - * - * \sa SDL_SetGammaRamp() - */ -extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green, - Uint16 * blue); - - -/** - * \fn SDL_WindowID SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) - * - * \brief Create a window with the specified position, dimensions, and flags. - * - * \param title The title of the window, in UTF-8 encoding - * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED - * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED - * \param w The width of the window - * \param h The height of the window - * \param flags The flags for the window, a mask of any of the following: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WINDOW_SHOWN, SDL_WINDOW_BORDERLESS, SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED, SDL_WINDOW_INPUT_GRABBED - * - * \return The id of the window created, or zero if window creation failed. - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title, - int x, int y, int w, - int h, Uint32 flags); - -/** - * \fn SDL_WindowID SDL_CreateWindowFrom(void *data) - * - * \brief Create an SDL window struct from an existing native window. - * - * \param data A pointer to driver-dependent window creation data - * - * \return The id of the window created, or zero if window creation failed. - * - * \warning This function is NOT SUPPORTED, use at your own risk! - * - * \sa SDL_DestroyWindow() - */ -extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data); - -/** - * \fn Uint32 SDL_GetWindowFlags(SDL_WindowID windowID) - * - * \brief Get the window flags. - */ -extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID); - -/** - * \fn void SDL_SetWindowTitle(SDL_WindowID windowID, const char *title) - * - * \brief Set the title of the window, in UTF-8 format. - * - * \sa SDL_GetWindowTitle() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID, - const char *title); - -/** - * \fn const char *SDL_GetWindowTitle(SDL_WindowID windowID) - * - * \brief Get the title of the window, in UTF-8 format. - * - * \sa SDL_SetWindowTitle() - */ -extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID); - -/** - * \fn void SDL_SetWindowIcon(SDL_WindowID windowID, SDL_Surface *icon) - * - * \brief Set the icon of the window. - * - * \param icon The icon for the window - */ -extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_WindowID windowID, - SDL_Surface * icon); - -/** - * \fn void SDL_SetWindowData(SDL_WindowID windowID, void *userdata) - * - * \brief Associate an arbitrary pointer with the window. - * - * \sa SDL_GetWindowData() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID, - void *userdata); - -/** - * \fn void *SDL_GetWindowData(SDL_WindowID windowID) - * - * \brief Retrieve the data pointer associated with the window. - * - * \sa SDL_SetWindowData() - */ -extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID); - -/** - * \fn void SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y) - * - * \brief Set the position of the window. - * - * \param windowID The window to reposition - * \param x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED - * \param y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED - * - * \note The window coordinate origin is the upper left of the display. - * - * \sa SDL_GetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID, - int x, int y); - -/** - * \fn void SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y) - * - * \brief Get the position of the window. - * - * \sa SDL_SetWindowPosition() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID, - int *x, int *y); - -/** - * \fn void SDL_SetWindowSize(SDL_WindowID windowID, int w, int w) - * - * \brief Set the size of the window's client area. - * - * \note You can't change the size of a fullscreen window, it automatically - * matches the size of the display mode. - * - * \sa SDL_GetWindowSize() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w, - int h); - -/** - * \fn void SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *h) - * - * \brief Get the size of the window's client area. - * - * \sa SDL_SetWindowSize() - */ -extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w, - int *h); - -/** - * \fn void SDL_ShowWindow(SDL_WindowID windowID) - * - * \brief Show the window - * - * \sa SDL_HideWindow() - */ -extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID); - -/** - * \fn void SDL_HideWindow(SDL_WindowID windowID) - * - * \brief Hide the window - * - * \sa SDL_ShowWindow() - */ -extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID); - -/** - * \fn void SDL_RaiseWindow(SDL_WindowID windowID) - * - * \brief Raise the window above other windows and set the input focus. - */ -extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID); - -/** - * \fn void SDL_MaximizeWindow(SDL_WindowID windowID) - * - * \brief Make the window as large as possible. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID); - -/** - * \fn void SDL_MinimizeWindow(SDL_WindowID windowID) - * - * \brief Minimize the window to an iconic representation. - * - * \sa SDL_RestoreWindow() - */ -extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID); - -/** - * \fn void SDL_RestoreWindow(SDL_WindowID windowID) - * - * \brief Restore the size and position of a minimized or maximized window. - * - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - */ -extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID); - -/** - * \fn int SDL_SetWindowFullscreen(SDL_WindowID windowID, int fullscreen) - * - * \brief Set the window's fullscreen state. - * - * \return 0 on success, or -1 if setting the display mode failed. - * - * \sa SDL_SetFullscreenDisplayMode() - */ -extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID, - int fullscreen); - -/** - * \fn void SDL_SetWindowGrab(SDL_WindowID windowID, int mode) - * - * \brief Set the window's input grab mode. - * - * \param mode This is 1 to grab input, and 0 to release input. - * - * \sa SDL_GetWindowGrab() - */ -extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID, - int mode); - -/** - * \fn int SDL_GetWindowGrab(SDL_WindowID windowID) - * - * \brief Get the window's input grab mode. - * - * \return This returns 1 if input is grabbed, and 0 otherwise. - * - * \sa SDL_SetWindowGrab() - */ -extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID); - -/** - * \fn SDL_bool SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo * info) - * - * \brief Get driver specific information about a window. - * - * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo. - */ -struct SDL_SysWMinfo; -extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID, - struct SDL_SysWMinfo - *info); - -/** - * \fn void SDL_DestroyWindow(SDL_WindowID windowID) - * - * \brief Destroy a window. - */ -extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID); - -/** - * \fn int SDL_GetNumRenderDrivers(void) - * - * \brief Get the number of 2D rendering drivers available for the current display. - * - * A render driver is a set of code that handles rendering and texture - * management on a particular display. Normally there is only one, but - * some drivers may have several available with different capabilities. - * - * \sa SDL_GetRenderDriverInfo() - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); - -/** - * \fn int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info) - * - * \brief Get information about a specific 2D rendering driver for the current display. - * - * \param index The index of the driver to query information about. - * \param info A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver. - * - * \return 0 on success, -1 if the index was out of range - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, - SDL_RendererInfo * info); - -/** - * \fn int SDL_CreateRenderer(SDL_WindowID window, int index, Uint32 flags) - * - * \brief Create and make active a 2D rendering context for a window. - * - * \param windowID The window used for rendering - * \param index The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags. - * \param flags SDL_RendererFlags - * - * \return 0 on success, -1 if the flags were not supported, or -2 if - * there isn't enough memory to support the requested flags - * - * \sa SDL_SelectRenderer() - * \sa SDL_GetRendererInfo() - * \sa SDL_DestroyRenderer() - */ -extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID, - int index, Uint32 flags); - -/** - * \fn int SDL_SelectRenderer(SDL_WindowID windowID) - * - * \brief Select the rendering context for a particular window. - * - * \return 0 on success, -1 if the selected window doesn't have a - * rendering context. - */ -extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID); - -/** - * \fn int SDL_GetRendererInfo(SDL_RendererInfo *info) - * - * \brief Get information about the current rendering context. - */ -extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info); - -/** - * \fn SDL_TextureID SDL_CreateTexture(Uint32 format, int access, int w, int h) - * - * \brief Create a texture for the current rendering context. - * - * \param format The format of the texture - * \param access One of the enumerated values in SDL_TextureAccess - * \param w The width of the texture in pixels - * \param h The height of the texture in pixels - * - * \return The created texture is returned, or 0 if no rendering context was active, the format was unsupported, or the width or height were out of range. - * - * \sa SDL_QueryTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format, - int access, int w, - int h); - -/** - * \fn SDL_TextureID SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface *surface) - * - * \brief Create a texture from an existing surface. - * - * \param format The format of the texture, or 0 to pick an appropriate format - * \param surface The surface containing pixel data used to fill the texture - * - * \return The created texture is returned, or 0 if no rendering context was active, the format was unsupported, or the surface width or height were out of range. - * - * \note The surface is not modified or freed by this function. - * - * \sa SDL_QueryTexture() - * \sa SDL_DestroyTexture() - */ -extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32 - format, - SDL_Surface - * surface); - -/** - * \fn int SDL_QueryTexture(SDL_TextureID textureID, Uint32 *format, int *access, int *w, int *h) - * - * \brief Query the attributes of a texture - * - * \param texture A texture to be queried - * \param format A pointer filled in with the raw format of the texture. The actual format may differ, but pixel transfers will use this format. - * \param access A pointer filled in with the actual access to the texture. - * \param w A pointer filled in with the width of the texture in pixels - * \param h A pointer filled in with the height of the texture in pixels - * - * \return 0 on success, or -1 if the texture is not valid - */ -extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID, - Uint32 * format, int *access, - int *w, int *h); - -/** - * \fn int SDL_QueryTexturePixels(SDL_TextureID textureID, void **pixels, int pitch) - * - * \brief Query the pixels of a texture, if the texture does not need to be locked for pixel access. - * - * \param texture A texture to be queried, which was created with SDL_TEXTUREACCESS_STREAMING - * \param pixels A pointer filled with a pointer to the pixels for the texture - * \param pitch A pointer filled in with the pitch of the pixel data - * - * \return 0 on success, or -1 if the texture is not valid, or must be locked for pixel access. - */ -extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID, - void **pixels, int *pitch); - -/** - * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors, int firstcolor, int ncolors) - * - * \brief Update an indexed texture with a color palette - * - * \param texture The texture to update - * \param colors The array of RGB color data - * \param firstcolor The first index to update - * \param ncolors The number of palette entries to fill with the color data - * - * \return 0 on success, or -1 if the texture is not valid or not an indexed texture - */ -extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID, - const SDL_Color * colors, - int firstcolor, - int ncolors); - -/** - * \fn int SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors) - * - * \brief Update an indexed texture with a color palette - * - * \param texture The texture to update - * \param colors The array to fill with RGB color data - * \param firstcolor The first index to retrieve - * \param ncolors The number of palette entries to retrieve - * - * \return 0 on success, or -1 if the texture is not valid or not an indexed texture - */ -extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID, - SDL_Color * colors, - int firstcolor, - int ncolors); - -/** - * \fn int SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b) - * - * \brief Set an additional color value used in render copy operations - * - * \param texture The texture to update - * \param r The red source color value multiplied into copy operations - * \param g The green source color value multiplied into copy operations - * \param b The blue source color value multiplied into copy operations - * - * \return 0 on success, or -1 if the texture is not valid or color modulation is not supported - * - * \sa SDL_GetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID, - Uint8 r, Uint8 g, Uint8 b); - - -/** - * \fn int SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b) - * - * \brief Get the additional color value used in render copy operations - * - * \param texture The texture to query - * \param r A pointer filled in with the source red color value - * \param g A pointer filled in with the source green color value - * \param b A pointer filled in with the source blue color value - * - * \return 0 on success, or -1 if the texture is not valid - * - * \sa SDL_SetTextureColorMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID, - Uint8 * r, Uint8 * g, - Uint8 * b); - -/** - * \fn int SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha) - * - * \brief Set an additional alpha value used in render copy operations - * - * \param texture The texture to update - * \param alpha The source alpha value multiplied into copy operations. - * - * \return 0 on success, or -1 if the texture is not valid or alpha modulation is not supported - * - * \sa SDL_GetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID, - Uint8 alpha); - -/** - * \fn int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 *alpha) - * - * \brief Get the additional alpha value used in render copy operations - * - * \param texture The texture to query - * \param alpha A pointer filled in with the source alpha value - * - * \return 0 on success, or -1 if the texture is not valid - * - * \sa SDL_SetTextureAlphaMod() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID, - Uint8 * alpha); - -/** - * \fn int SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode) - * - * \brief Set the blend mode used for texture copy operations - * - * \param texture The texture to update - * \param blendMode SDL_TextureBlendMode to use for texture blending - * - * \return 0 on success, or -1 if the texture is not valid or the blend mode is not supported - * - * \note If the blend mode is not supported, the closest supported mode is chosen. - * - * \sa SDL_GetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID, - int blendMode); - -/** - * \fn int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode) - * - * \brief Get the blend mode used for texture copy operations - * - * \param texture The texture to query - * \param blendMode A pointer filled in with the current blend mode - * - * \return 0 on success, or -1 if the texture is not valid - * - * \sa SDL_SetTextureBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID, - int *blendMode); - -/** - * \fn int SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode) - * - * \brief Set the scale mode used for texture copy operations - * - * \param texture The texture to update - * \param scaleMode SDL_TextureScaleMode to use for texture scaling - * - * \return 0 on success, or -1 if the texture is not valid or the scale mode is not supported - * - * \note If the scale mode is not supported, the closest supported mode is chosen. - * - * \sa SDL_GetTextureScaleMode() - */ -extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID, - int scaleMode); - -/** - * \fn int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode) - * - * \brief Get the scale mode used for texture copy operations - * - * \param texture The texture to query - * \param scaleMode A pointer filled in with the current scale mode - * - * \return 0 on success, or -1 if the texture is not valid - * - * \sa SDL_SetTextureScaleMode() - */ -extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID, - int *scaleMode); - -/** - * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch) - * - * \brief Update the given texture rectangle with new pixel data. - * - * \param texture The texture to update - * \param rect A pointer to the rectangle of pixels to update, or NULL to update the entire texture. - * \param pixels The raw pixel data - * \param pitch The number of bytes between rows of pixel data - * - * \return 0 on success, or -1 if the texture is not valid - * - * \note This is a fairly slow function. - */ -extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID, - const SDL_Rect * rect, - const void *pixels, int pitch); - -/** - * \fn void SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch) - * - * \brief Lock a portion of the texture for pixel access. - * - * \param textureID The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING. - * \param rect A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked. - * \param markDirty If this is nonzero, the locked area will be marked dirty when the texture is unlocked. - * \param pixels This is filled in with a pointer to the locked pixels, appropriately offset by the locked area. - * \param pitch This is filled in with the pitch of the locked pixels. - * - * \return 0 on success, or -1 if the texture is not valid or was created with SDL_TEXTUREACCESS_STATIC - * - * \sa SDL_DirtyTexture() - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID, - const SDL_Rect * rect, - int markDirty, void **pixels, - int *pitch); - -/** - * \fn void SDL_UnlockTexture(SDL_TextureID textureID) - * - * \brief Unlock a texture, uploading the changes to video memory, if needed. - * - * \sa SDL_LockTexture() - * \sa SDL_DirtyTexture() - */ -extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID); - -/** - * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, const SDL_Rect * rects) - * - * \brief Mark the specified rectangles of the texture as dirty. - * - * \param textureID The texture to mark dirty, which was created with SDL_TEXTUREACCESS_STREAMING. - * \param numrects The number of rectangles pointed to by rects. - * \param rects The pointer to an array of dirty rectangles. - * - * \sa SDL_LockTexture() - * \sa SDL_UnlockTexture() - */ -extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID, - int numrects, - const SDL_Rect * rects); - -/** - * \fn void SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) - * - * \brief Set the color used for drawing operations (Fill and Line). - * - * \param r The red value used to draw on the rendering target - * \param g The green value used to draw on the rendering target - * \param b The blue value used to draw on the rendering target - * \param a The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255) - * \return 0 on success, or -1 if there is no rendering context current - */ -extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, - Uint8 a); - -/** - * \fn void SDL_GetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) - * - * \brief Get the color used for drawing operations (Fill and Line). - * - * \param r A pointer to the red value used to draw on the rendering target - * \param g A pointer to the green value used to draw on the rendering target - * \param b A pointer to the blue value used to draw on the rendering target - * \param a A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255) - * \return 0 on success, or -1 if there is no rendering context current - */ -extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); - -/** - * \fn int SDL_SetRenderDrawBlendMode(int blendMode) - * - * \brief Set the blend mode used for drawing operations (Fill and Line). - * - * \param blendMode SDL_BlendMode to use for blending - * - * \return 0 on success, or -1 if there is no rendering context current - * - * \note If the blend mode is not supported, the closest supported mode is chosen. - * - * \sa SDL_SetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode); - -/** - * \fn int SDL_GetRenderDrawBlendMode(int *blendMode) - * - * \brief Get the blend mode used for drawing operations - * - * \param blendMode A pointer filled in with the current blend mode - * - * \return 0 on success, or -1 if there is no rendering context current - * - * \sa SDL_SetRenderDrawBlendMode() - */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode); - -/** - * \fn int SDL_RenderPoint(int x, int y) - * - * \brief Draw a point on the current rendering target. - * - * \param x The x coordinate of the point - * \param y The y coordinate of the point - * - * \return 0 on success, or -1 if there is no rendering context current - */ -extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y); - -/** - * \fn int SDL_RenderLine(int x1, int y1, int x2, int y2) - * - * \brief Draw a line on the current rendering target. - * - * \param x1 The x coordinate of the start point - * \param y1 The y coordinate of the start point - * \param x2 The x coordinate of the end point - * \param y2 The y coordinate of the end point - * - * \return 0 on success, or -1 if there is no rendering context current - */ -extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2); - -/** - * \fn void SDL_RenderFill(const SDL_Rect *rect) - * - * \brief Fill the current rendering target with the drawing color. - * - * \param r The red value used to fill the rendering target - * \param g The green value used to fill the rendering target - * \param b The blue value used to fill the rendering target - * \param a The alpha value used to fill the rendering target, usually SDL_ALPHA_OPAQUE (255) - * \param rect A pointer to the destination rectangle, or NULL for the entire rendering target. - * - * \return 0 on success, or -1 if there is no rendering context current - */ -extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect); - -/** - * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect) - * - * \brief Copy a portion of the texture to the current rendering target. - * - * \param texture The source texture. - * \param srcrect A pointer to the source rectangle, or NULL for the entire texture. - * \param dstrect A pointer to the destination rectangle, or NULL for the entire rendering target. - * - * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation. - */ -extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); - -/** - * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch) - * - * \brief Read pixels from the current rendering target. - * - * \param rect A pointer to the rectangle to read, or NULL for the entire render target - * \param pixels A pointer to be filled in with the pixel data - * \param pitch The pitch of the pixels parameter - * - * \return 0 on success, or -1 if pixel reading is not supported. - * - * \warning This is a very slow operation, and should not be used frequently. - */ -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect, - void *pixels, int pitch); - -/** - * \fn int SDL_RenderWritePixels(const SDL_Rect *rect, const void *pixels, int pitch) - * - * \brief Write pixels to the current rendering target. - * - * \param rect A pointer to the rectangle to write, or NULL for the entire render target - * \param pixels A pointer to the pixel data to write - * \param pitch The pitch of the pixels parameter - * - * \return 0 on success, or -1 if pixel writing is not supported. - * - * \warning This is a very slow operation, and should not be used frequently. - */ -extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect, - const void *pixels, - int pitch); - -/** - * \fn void SDL_RenderPresent(void) - * - * \brief Update the screen with rendering performed. - */ -extern DECLSPEC void SDLCALL SDL_RenderPresent(void); - -/** - * \fn void SDL_DestroyTexture(SDL_TextureID textureID); - * - * \brief Destroy the specified texture. - * - * \sa SDL_CreateTexture() - * \sa SDL_CreateTextureFromSurface() - */ -extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID); - -/** - * \fn void SDL_DestroyRenderer(SDL_WindowID windowID); - * - * \brief Destroy the rendering context for a window and free associated - * textures. - * - * \sa SDL_CreateRenderer() - */ -extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID); - -/** - * \fn SDL_bool SDL_IsScreenSaverEnabled(); - * - * \brief Returns whether the screensaver is currently enabled (default off). - * - * \sa SDL_EnableScreenSaver() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); - -/** - * \fn void SDL_EnableScreenSaver(); - * - * \brief Allow the screen to be blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_DisableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); - -/** - * \fn void SDL_DisableScreenSaver(); - * - * \brief Prevent the screen from being blanked by a screensaver - * - * \sa SDL_IsScreenSaverEnabled() - * \sa SDL_EnableScreenSaver() - */ -extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* OpenGL support functions. */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** - * \fn int SDL_GL_LoadLibrary(const char *path) - * - * \brief Dynamically load an OpenGL library. - * - * \param path The platform dependent OpenGL library name, or NULL to open the default OpenGL library - * - * \return 0 on success, or -1 if the library couldn't be loaded - * - * This should be done after initializing the video driver, but before - * creating any OpenGL windows. If no OpenGL library is loaded, the default - * library will be loaded upon creation of the first OpenGL window. - * - * \note If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). - * - * \sa SDL_GL_GetProcAddress() - */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); - -/** - * \fn void *SDL_GL_GetProcAddress(const char *proc) - * - * \brief Get the address of an OpenGL function. - */ -extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); - -/** - * \fn SDL_bool SDL_GL_ExtensionSupported(const char *extension) - * - * \brief Return true if an OpenGL extension is supported for the current context. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char - *extension); - -/** - * \fn int SDL_GL_SetAttribute(SDL_GLattr attr, int value) - * - * \brief Set an OpenGL window attribute before window creation. - */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); - -/** - * \fn int SDL_GL_GetWindowAttribute(SDL_WindowID windowID, SDL_GLattr attr, int *value) - * - * \brief Get the actual value for an attribute from the current context. - */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); - -/** - * \fn SDL_GLContext SDL_GL_CreateContext(SDL_WindowID windowID) - * - * \brief Create an OpenGL context for use with an OpenGL window, and make it current. - * - * \sa SDL_GL_DeleteContext() - */ -extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID - windowID); - -/** - * \fn int SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context) - * - * \brief Set up an OpenGL context for rendering into an OpenGL window. - * - * \note The context must have been created with a compatible window. - */ -extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID, - SDL_GLContext context); - -/** - * \fn int SDL_GL_SetSwapInterval(int interval) - * - * \brief Set the swap interval for the current OpenGL context. - * - * \param interval 0 for immediate updates, 1 for updates synchronized with the vertical retrace - * - * \return 0 on success, or -1 if setting the swap interval is not supported. - * - * \sa SDL_GL_GetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); - -/** - * \fn int SDL_GL_GetSwapInterval(void) - * - * \brief Get the swap interval for the current OpenGL context. - * - * \return 0 if there is no vertical retrace synchronization, 1 if the buffer swap is synchronized with the vertical retrace, and -1 if getting the swap interval is not supported. - * - * \sa SDL_GL_SetSwapInterval() - */ -extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); - -/** - * \fn void SDL_GL_SwapWindow(SDL_WindowID windowID) - * - * \brief Swap the OpenGL buffers for the window, if double-buffering is supported. - */ -extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID); - -/** - * \fn void SDL_GL_DeleteContext(SDL_GLContext context) - * - * \brief Delete an OpenGL context. - * - * \sa SDL_GL_CreateContext() - */ -extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -/* *INDENT-OFF* */ -} -/* *INDENT-ON* */ -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ - -/* vi: set ts=4 sw=4 expandtab: */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_video.h + * + * Header file for SDL video functions. + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief The structure that defines a display mode + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + * \sa SDL_GetDesktopDisplayMode() + * \sa SDL_GetCurrentDisplayMode() + * \sa SDL_GetClosestDisplayMode() + * \sa SDL_SetDisplayMode() + */ +typedef struct +{ + Uint32 format; /**< pixel format */ + int w; /**< width */ + int h; /**< height */ + int refresh_rate; /**< refresh rate (or zero for unspecified) */ + void *driverdata; /**< driver-specific data, initialize to 0 */ +} SDL_DisplayMode; + +/** + * \brief The type used to identify a window + * + * \sa SDL_CreateWindow() + * \sa SDL_CreateWindowFrom() + * \sa SDL_DestroyWindow() + * \sa SDL_GetWindowData() + * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowGrab() + * \sa SDL_GetWindowPosition() + * \sa SDL_GetWindowSize() + * \sa SDL_GetWindowTitle() + * \sa SDL_HideWindow() + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + * \sa SDL_RaiseWindow() + * \sa SDL_RestoreWindow() + * \sa SDL_SetWindowData() + * \sa SDL_SetWindowFullscreen() + * \sa SDL_SetWindowGrab() + * \sa SDL_SetWindowIcon() + * \sa SDL_SetWindowPosition() + * \sa SDL_SetWindowSize() + * \sa SDL_SetWindowTitle() + * \sa SDL_ShowWindow() + */ +typedef Uint32 SDL_WindowID; + +/** + * \brief The flags on a window + * + * \sa SDL_GetWindowFlags() + */ +typedef enum +{ + SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window, implies borderless */ + SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ + SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ + SDL_WINDOW_BORDERLESS = 0x00000008, /**< no window decoration */ + SDL_WINDOW_RESIZABLE = 0x00000010, /**< window can be resized */ + SDL_WINDOW_MINIMIZED = 0x00000020, /**< minimized */ + SDL_WINDOW_MAXIMIZED = 0x00000040, /**< maximized */ + SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ + SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ + SDL_WINDOW_FOREIGN = 0x00000800 /**< window not created by SDL */ +} SDL_WindowFlags; + +/** + * \brief Used to indicate that you don't care what the window position is. + */ +#define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF + +/** + * \brief Used to indicate that the window position should be centered. + */ +#define SDL_WINDOWPOS_CENTERED 0x7FFFFFE + +/** + * \brief Event subtype for window events + */ +typedef enum +{ + SDL_WINDOWEVENT_NONE, /**< Never used */ + SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ + SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be + redrawn */ + SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + */ + SDL_WINDOWEVENT_RESIZED, /**< Window size changed to data1xdata2 */ + SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ + SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ + SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size + and position */ + SDL_WINDOWEVENT_ENTER, /**< The window has gained mouse focus */ + SDL_WINDOWEVENT_LEAVE, /**< The window has lost mouse focus */ + SDL_WINDOWEVENT_FOCUS_GAINED, /**< The window has gained keyboard focus */ + SDL_WINDOWEVENT_FOCUS_LOST, /**< The window has lost keyboard focus */ + SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the + window be closed */ +} SDL_WindowEventID; + +/** + * \brief Flags used when creating a rendering context + */ +typedef enum +{ + SDL_RENDERER_SINGLEBUFFER = 0x00000001, /**< Render directly to the + window, if possible */ + + SDL_RENDERER_PRESENTCOPY = 0x00000002, /**< Present uses a copy from + back buffer to the front + buffer */ + + SDL_RENDERER_PRESENTFLIP2 = 0x00000004, /**< Present uses a flip, + swapping back buffer and + front buffer */ + + SDL_RENDERER_PRESENTFLIP3 = 0x00000008, /**< Present uses a flip, + rotating between two back + buffers and a front buffer + */ + + SDL_RENDERER_PRESENTDISCARD = 0x00000010, /**< Present leaves the contents + of the backbuffer undefined + */ + + SDL_RENDERER_PRESENTVSYNC = 0x00000020, /**< Present is synchronized + with the refresh rate */ + + SDL_RENDERER_ACCELERATED = 0x00000040 /**< The renderer uses hardware + acceleration */ + + } SDL_RendererFlags; + +/** + * \brief Information on the capabilities of a render driver or context. + */ +typedef struct SDL_RendererInfo +{ + const char *name; /**< The name of the renderer */ + Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 mod_modes; /**< A mask of supported channel modulation */ + Uint32 blend_modes; /**< A mask of supported blend modes */ + Uint32 scale_modes; /**< A mask of supported scale modes */ + Uint32 num_texture_formats; /**< The number of available texture formats */ + Uint32 texture_formats[20]; /**< The available texture formats */ + int max_texture_width; /**< The maximimum texture width */ + int max_texture_height; /**< The maximimum texture height */ +} SDL_RendererInfo; + +/** + * \brief The access pattern allowed for a texture. + */ +typedef enum +{ + SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ + SDL_TEXTUREACCESS_STREAMING /**< Changes frequently, lockable */ +} SDL_TextureAccess; + +/** + * \brief The texture channel modulation used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ + SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ + SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ +} SDL_TextureModulate; + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */ + SDL_BLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst + (alpha is mask) */ + + SDL_BLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */ + SDL_BLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */ + SDL_BLENDMODE_MOD = 0x00000008 /**< dst = src * dst */ +} SDL_BlendMode; + +/** + * \brief The texture scale mode used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTURESCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must + match dimensions */ + + SDL_TEXTURESCALEMODE_FAST = 0x00000001, /**< Point sampling or + equivalent algorithm */ + + SDL_TEXTURESCALEMODE_SLOW = 0x00000002, /**< Linear filtering or + equivalent algorithm */ + + SDL_TEXTURESCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or + equivalent algorithm */ +} SDL_TextureScaleMode; + +/** + * \brief An efficient driver-specific representation of pixel data + */ +typedef Uint32 SDL_TextureID; + +/** + * \brief An opaque handle to an OpenGL context. + */ +typedef void *SDL_GLContext; + +/** + * \brief OpenGL configuration attributes + */ +typedef enum +{ + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION +} SDL_GLattr; + + +/* Function prototypes */ + +/** + * \brief Get the number of video drivers compiled into SDL + * + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); + +/** + * \brief Get the name of a built in video driver. + * + * \note The video drivers are presented in the order in which they are + * normally checked during initialization. + * + * \sa SDL_GetNumVideoDrivers() + */ +extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); + +/** + * \brief Initialize the video subsystem, optionally specifying a video driver. + * + * \param driver_name Initialize a specific driver by name, or NULL for the + * default video driver. + * + * \param flags FIXME: Still needed? + * + * \return 0 on success, -1 on error + * + * This function initializes the video subsystem; setting up a connection + * to the window manager, etc, and determines the available display modes + * and pixel formats, but does not initialize a window or graphics mode. + * + * \sa SDL_VideoQuit() + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, + Uint32 flags); + +/** + * \brief Shuts down the video subsystem. + * + * This function closes all windows, and restores the original video mode. + * + * \sa SDL_VideoInit() + */ +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); + +/** + * \brief Returns the name of the currently initialized video driver. + * + * \return The name of the current video driver or NULL if no driver + * has been initialized + * + * \sa SDL_GetNumVideoDrivers() + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); + +/** + * \brief Returns the number of available video displays. + * + * \sa SDL_SelectVideoDisplay() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); + +/** + * \brief Set the index of the currently selected display. + * + * \return 0 on success, or -1 if the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + * \sa SDL_GetCurrentVideoDisplay() + */ +extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index); + +/** + * \brief Get the index of the currently selected display. + * + * \return The index of the currently selected display. + * + * \sa SDL_GetNumVideoDisplays() + * \sa SDL_SelectVideoDisplay() + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void); + +/** + * \brief Returns the number of available display modes for the current display. + * + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void); + +/** + * \brief Fill in information about a specific display mode. + * + * \note The display modes are sorted in this priority: + * \li bits per pixel -> more colors to fewer colors + * \li width -> largest to smallest + * \li height -> largest to smallest + * \li refresh rate -> highest to lowest + * + * \sa SDL_GetNumDisplayModes() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index, + SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the desktop display mode for the current + * display. + */ +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the current display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode); + + +/** + * \brief Get the closest match to the requested display mode. + * + * \param mode The desired display mode + * \param closest A pointer to a display mode to be filled in with the closest + * match of the available display modes. + * + * \return The passed in value \c closest, or NULL if no matching video mode + * was available. + * + * The available display modes are scanned, and \c closest is filled in with the + * closest mode matching the requested mode and returned. The mode format and + * refresh_rate default to the desktop mode if they are 0. The modes are + * scanned with size being first priority, format being second priority, and + * finally checking the refresh_rate. If all the available modes are too + * small, then NULL is returned. + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const + SDL_DisplayMode + * mode, + SDL_DisplayMode + * closest); + +/** + * \brief Set the display mode used when a fullscreen window is visible + * on the currently selected display. + * + * \param mode The mode to use, or NULL for the desktop mode. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode + * mode); + +/** + * \brief Fill in information about the display mode used when a fullscreen + * window is visible on the currently selected display. + */ +extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode * + mode); + +/** + * \brief Set the palette entries for indexed display modes. + * + * \return 0 on success, or -1 if the display mode isn't palettized or the + * colors couldn't be set. + */ +extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors, + int firstcolor, + int ncolors); + +/** + * \brief Gets the palette entries for indexed display modes. + * + * \return 0 on success, or -1 if the display mode isn't palettized + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors, + int firstcolor, + int ncolors); + +/** + * \brief Set the gamma correction for each of the color channels on the + * currently selected display. + * + * \return 0 on success, or -1 if setting the gamma isn't supported. + * + * \sa SDL_SetGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); + +/** + * \brief Set the gamma ramp for the currently selected display. + * + * \param red The translation table for the red channel, or NULL. + * \param green The translation table for the green channel, or NULL. + * \param blue The translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * \sa SDL_GetGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red, + const Uint16 * green, + const Uint16 * blue); + +/** + * \brief Get the gamma ramp for the currently selected display. + * + * \param red A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the red channel, or NULL. + * \param green A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the green channel, or NULL. + * \param blue A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * \sa SDL_SetGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green, + Uint16 * blue); + + +/** + * \brief Create a window with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of any of the following: + * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, + * ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_BORDERLESS, + * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED. + * + * \return The id of the window created, or zero if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title, + int x, int y, int w, + int h, Uint32 flags); + +/** + * \brief Create an SDL window struct from an existing native window. + * + * \param data A pointer to driver-dependent window creation data + * + * \return The id of the window created, or zero if window creation failed. + * + * \warning This function is NOT SUPPORTED, use at your own risk! + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data); + +/** + * \brief Get the window flags. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID); + +/** + * \brief Set the title of the window, in UTF-8 format. + * + * \sa SDL_GetWindowTitle() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID, + const char *title); + +/** + * \brief Get the title of the window, in UTF-8 format. + * + * \sa SDL_SetWindowTitle() + */ +extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID); + +/** + * \brief Set the icon of the window. + * + * \param icon The icon for the window. + */ +extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_WindowID windowID, + SDL_Surface * icon); + +/** + * \brief Associate an arbitrary pointer with the window. + * + * \sa SDL_GetWindowData() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID, + void *userdata); + +/** + * \brief Retrieve the data pointer associated with the window. + * + * \sa SDL_SetWindowData() + */ +extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID); + +/** + * \brief Set the position of the window. + * + * \param windowID The window to reposition. + * \param x The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or + ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or + ::SDL_WINDOWPOS_UNDEFINED. + * + * \note The window coordinate origin is the upper left of the display. + * + * \sa SDL_GetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID, + int x, int y); + +/** + * \brief Get the position of the window. + * + * \sa SDL_SetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID, + int *x, int *y); + +/** + * \brief Set the size of the window's client area. + * + * \note You can't change the size of a fullscreen window, it automatically + * matches the size of the display mode. + * + * \sa SDL_GetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w, + int h); + +/** + * \brief Get the size of the window's client area. + * + * \sa SDL_SetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w, + int *h); + +/** + * \brief Show the window. + * + * \sa SDL_HideWindow() + */ +extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID); + +/** + * \brief Hide the window. + * + * \sa SDL_ShowWindow() + */ +extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID); + +/** + * \brief Raise the window above other windows and set the input focus. + */ +extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID); + +/** + * \brief Make the window as large as possible. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID); + +/** + * \brief Minimize the window to an iconic representation. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID); + +/** + * \brief Restore the size and position of a minimized or maximized window. + * + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + */ +extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID); + +/** + * \brief Set the window's fullscreen state. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_SetFullscreenDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID, + int fullscreen); + +/** + * \brief Set the window's input grab mode. + * + * \param mode This is 1 to grab input, and 0 to release input. + * + * \sa SDL_GetWindowGrab() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID, + int mode); + +/** + * \brief Get the window's input grab mode. + * + * \return This returns 1 if input is grabbed, and 0 otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID); + +/** + * \brief Get driver specific information about a window. + * + * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo. + */ +struct SDL_SysWMinfo; +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID, + struct SDL_SysWMinfo + *info); + +/** + * \brief Destroy a window. + */ +extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID); + +/** + * \brief Get the number of 2D rendering drivers available for the current + * display. + * + * A render driver is a set of code that handles rendering and texture + * management on a particular display. Normally there is only one, but + * some drivers may have several available with different capabilities. + * + * \sa SDL_GetRenderDriverInfo() + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); + +/** + * \brief Get information about a specific 2D rendering driver for the current + * display. + * + * \param index The index of the driver to query information about. + * \param info A pointer to an SDL_RendererInfo struct to be filled with + * information on the rendering driver. + * + * \return 0 on success, -1 if the index was out of range. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, + SDL_RendererInfo * info); + +/** + * \brief Create and make active a 2D rendering context for a window. + * + * \param windowID The window used for rendering. + * \param index The index of the rendering driver to initialize, or -1 to + * initialize the first one supporting the requested flags. + * \param flags ::SDL_RendererFlags. + * + * \return 0 on success, -1 if there was an error creating the renderer. + * + * \sa SDL_SelectRenderer() + * \sa SDL_GetRendererInfo() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID, + int index, Uint32 flags); + +/** + * \brief Select the rendering context for a particular window. + * + * \return 0 on success, -1 if the selected window doesn't have a + * rendering context. + */ +extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID); + +/** + * \brief Get information about the current rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info); + +/** + * \brief Create a texture for the current rendering context. + * + * \param format The format of the texture. + * \param access One of the enumerated values in ::SDL_TextureAccess. + * \param w The width of the texture in pixels. + * \param h The height of the texture in pixels. + * + * \return The created texture is returned, or 0 if no rendering context was + * active, the format was unsupported, or the width or height were out + * of range. + * + * \sa SDL_QueryTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format, + int access, int w, + int h); + +/** + * \brief Create a texture from an existing surface. + * + * \param format The format of the texture, or 0 to pick an appropriate format. + * \param surface The surface containing pixel data used to fill the texture. + * + * \return The created texture is returned, or 0 if no rendering context was + * active, the format was unsupported, or the surface width or height + * were out of range. + * + * \note The surface is not modified or freed by this function. + * + * \sa SDL_QueryTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32 + format, + SDL_Surface + * surface); + +/** + * \brief Query the attributes of a texture + * + * \param textureID A texture to be queried. + * \param format A pointer filled in with the raw format of the texture. The + * actual format may differ, but pixel transfers will use this + * format. + * \param access A pointer filled in with the actual access to the texture. + * \param w A pointer filled in with the width of the texture in pixels. + * \param h A pointer filled in with the height of the texture in pixels. + * + * \return 0 on success, or -1 if the texture is not valid. + */ +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID, + Uint32 * format, int *access, + int *w, int *h); + +/** + * \brief Query the pixels of a texture, if the texture does not need to be + * locked for pixel access. + * + * \param textureID A texture to be queried, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param pixels A pointer filled with a pointer to the pixels for the + * texture. + * \param pitch A pointer filled in with the pitch of the pixel data. + * + * \return 0 on success, or -1 if the texture is not valid, or must be locked + * for pixel access. + */ +extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID, + void **pixels, int *pitch); + +/** + * \brief Set the color palette of an indexed texture. + * + * \param textureID The texture to update. + * \param colors The array of RGB color data. + * \param firstcolor The first index to update. + * \param ncolors The number of palette entries to fill with the color data. + * + * \return 0 on success, or -1 if the texture is not valid or not an indexed + * texture. + */ +extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID, + const SDL_Color * colors, + int firstcolor, + int ncolors); + +/** + * \brief Get the color palette from an indexed texture if it has one. + * + * \param textureID The texture to update. + * \param colors The array to fill with RGB color data. + * \param firstcolor The first index to retrieve. + * \param ncolors The number of palette entries to retrieve. + * + * \return 0 on success, or -1 if the texture is not valid or not an indexed + * texture. + */ +extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID, + SDL_Color * colors, + int firstcolor, + int ncolors); + +/** + * \brief Set an additional color value used in render copy operations. + * + * \param textureID The texture to update. + * \param r The red source color value multiplied into copy operations. + * \param g The green source color value multiplied into copy operations. + * \param b The blue source color value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or color modulation + * is not supported. + * + * \sa SDL_GetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in render copy operations. + * + * \param textureID The texture to query. + * \param r A pointer filled in with the source red color value. + * \param g A pointer filled in with the source green color value. + * \param b A pointer filled in with the source blue color value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in render copy operations. + * + * \param textureID The texture to update. + * \param alpha The source alpha value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or alpha modulation + * is not supported. + * + * \sa SDL_GetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in render copy operations. + * + * \param textureID The texture to query. + * \param alpha A pointer filled in with the source alpha value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for texture copy operations. + * + * \param textureID The texture to update. + * \param blendMode ::SDL_BlendMode to use for texture blending. + * + * \return 0 on success, or -1 if the texture is not valid or the blend mode is + * not supported. + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID, + int blendMode); + +/** + * \brief Get the blend mode used for texture copy operations. + * + * \param textureID The texture to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID, + int *blendMode); + +/** + * \brief Set the scale mode used for texture copy operations. + * + * \param textureID The texture to update. + * \param scaleMode ::SDL_TextureScaleMode to use for texture scaling. + * + * \return 0 on success, or -1 if the texture is not valid or the scale mode is + * not supported. + * + * \note If the scale mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID, + int scaleMode); + +/** + * \brief Get the scale mode used for texture copy operations. + * + * \param textureID The texture to query. + * \param scaleMode A pointer filled in with the current scale mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureScaleMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID, + int *scaleMode); + +/** + * \brief Update the given texture rectangle with new pixel data. + * + * \param textureID The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param pixels The raw pixel data. + * \param pitch The number of bytes between rows of pixel data. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note This is a fairly slow function. + */ +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID, + const SDL_Rect * rect, + const void *pixels, int pitch); + +/** + * \brief Lock a portion of the texture for pixel access. + * + * \param textureID The texture to lock for access, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param rect A pointer to the rectangle to lock for access. If the rect + * is NULL, the entire texture will be locked. + * \param markDirty If this is nonzero, the locked area will be marked dirty + * when the texture is unlocked. + * \param pixels This is filled in with a pointer to the locked pixels, + * appropriately offset by the locked area. + * \param pitch This is filled in with the pitch of the locked pixels. + * + * \return 0 on success, or -1 if the texture is not valid or was created with + * ::SDL_TEXTUREACCESS_STATIC. + * + * \sa SDL_DirtyTexture() + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID, + const SDL_Rect * rect, + int markDirty, void **pixels, + int *pitch); + +/** + * \brief Unlock a texture, uploading the changes to video memory, if needed. + * + * \sa SDL_LockTexture() + * \sa SDL_DirtyTexture() + */ +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID); + +/** + * \brief Mark the specified rectangles of the texture as dirty. + * + * \param textureID The texture to mark dirty, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param numrects The number of rectangles pointed to by rects. + * \param rects The pointer to an array of dirty rectangles. + * + * \sa SDL_LockTexture() + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID, + int numrects, + const SDL_Rect * rects); + +/** + * \brief Set the color used for drawing operations (Fill and Line). + * + * \param r The red value used to draw on the rendering target. + * \param g The green value used to draw on the rendering target. + * \param b The blue value used to draw on the rendering target. + * \param a The alpha value used to draw on the rendering target, usually + * ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 if there is no rendering context current. + */ +extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the color used for drawing operations (Fill and Line). + * + * \param r A pointer to the red value used to draw on the rendering target. + * \param g A pointer to the green value used to draw on the rendering target. + * \param b A pointer to the blue value used to draw on the rendering target. + * \param a A pointer to the alpha value used to draw on the rendering target, + * usually ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 if there is no rendering context current. + */ +extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Set the blend mode used for drawing operations (Fill and Line). + * + * \param blendMode ::SDL_BlendMode to use for blending. + * + * \return 0 on success, or -1 if there is no rendering context current. + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode); + +/** + * \brief Get the blend mode used for drawing operations. + * + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if there is no rendering context current. + * + * \sa SDL_SetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode); + +/** + * \brief Draw a point on the current rendering target. + * + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * + * \return 0 on success, or -1 if there is no rendering context current. + */ +extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y); + +/** + * \brief Draw a line on the current rendering target. + * + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * + * \return 0 on success, or -1 if there is no rendering context current. + */ +extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2); + +/** + * \brief Fill the current rendering target with the drawing color. + * + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * + * \return 0 on success, or -1 if there is no rendering context current. + */ +extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect); + +/** + * \brief Copy a portion of the texture to the current rendering target. + * + * \param textureID The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * + * \return 0 on success, or -1 if there is no rendering context current, or the + * driver doesn't support the requested operation. + */ +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect); + +/** + * \brief Read pixels from the current rendering target. + * + * \param rect A pointer to the rectangle to read, or NULL for the entire + * render target. + * \param pixels A pointer to be filled in with the pixel data in the rendering + * target format. + * \param pitch The pitch of the pixels parameter. + * + * \return 0 on success, or -1 if pixel reading is not supported. + * + * \warning This is a very slow operation, and should not be used frequently. + */ +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect, + void *pixels, int pitch); + +/** + * \brief Write pixels to the current rendering target. + * + * \param rect A pointer to the rectangle to write, or NULL for the entire + * render target. + * \param pixels A pointer to the pixel data to write. + * \param pitch The pitch of the pixels parameter. + * + * \return 0 on success, or -1 if pixel writing is not supported. + * + * \warning This is a very slow operation, and should not be used frequently. + */ +extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect, + const void *pixels, + int pitch); + +/** + * \brief Update the screen with rendering performed. + */ +extern DECLSPEC void SDLCALL SDL_RenderPresent(void); + +/** + * \brief Destroy the specified texture. + * + * \sa SDL_CreateTexture() + * \sa SDL_CreateTextureFromSurface() + */ +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID); + +/** + * \brief Destroy the rendering context for a window and free associated + * textures. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID); + +/** + * \brief Returns whether the screensaver is currently enabled (default off). + * + * \sa SDL_EnableScreenSaver() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); + +/** + * \brief Allow the screen to be blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); + +/** + * \brief Prevent the screen from being blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_EnableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); + + +/** + * \name OpenGL support functions + */ +/*@{*/ + +/** + * \brief Dynamically load an OpenGL library. + * + * \param path The platform dependent OpenGL library name, or NULL to open the + * default OpenGL library. + * + * \return 0 on success, or -1 if the library couldn't be loaded. + * + * This should be done after initializing the video driver, but before + * creating any OpenGL windows. If no OpenGL library is loaded, the default + * library will be loaded upon creation of the first OpenGL window. + * + * \note If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + * + * \sa SDL_GL_GetProcAddress() + * \sa SDL_GL_UnloadLibrary() + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * \brief Get the address of an OpenGL function. + */ +extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); + +/** + * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). + * + * \sa SDL_GL_LoadLibrary() + */ +extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); + +/** + * \brief Return true if an OpenGL extension is supported for the current + * context. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char + *extension); + +/** + * \brief Set an OpenGL window attribute before window creation. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * \brief Get the actual value for an attribute from the current context. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); + +/** + * \brief Create an OpenGL context for use with an OpenGL window, and make it + * current. + * + * \sa SDL_GL_DeleteContext() + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID + windowID); + +/** + * \brief Set up an OpenGL context for rendering into an OpenGL window. + * + * \note The context must have been created with a compatible window. + */ +extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID, + SDL_GLContext context); + +/** + * \brief Set the swap interval for the current OpenGL context. + * + * \param interval 0 for immediate updates, 1 for updates synchronized with the + * vertical retrace. + * + * \return 0 on success, or -1 if setting the swap interval is not supported. + * + * \sa SDL_GL_GetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); + +/** + * \brief Get the swap interval for the current OpenGL context. + * + * \return 0 if there is no vertical retrace synchronization, 1 if the buffer + * swap is synchronized with the vertical retrace, and -1 if getting + * the swap interval is not supported. + * + * \sa SDL_GL_SetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); + +/** + * \brief Swap the OpenGL buffers for the window, if double-buffering is + * supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID); + +/** + * \brief Delete an OpenGL context. + * + * \sa SDL_GL_CreateContext() + */ +extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); + +/*@}*//*OpenGL support functions*/ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/Include/begin_code.h b/Externals/SDL/Include/begin_code.h index 33e8e53484..ba8cabe2b6 100644 --- a/Externals/SDL/Include/begin_code.h +++ b/Externals/SDL/Include/begin_code.h @@ -1,149 +1,136 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* This file sets things up for C dynamic library function definitions, - static inlined functions, and structures aligned at 4-byte alignment. - If you don't like ugly C preprocessor code, don't look at this file. :) -*/ - -/* This shouldn't be nested -- included it around code only. */ -#ifdef _begin_code_h -#error Nested inclusion of begin_code.h -#endif -#define _begin_code_h - -/* Some compilers use a special export keyword */ -#ifndef DECLSPEC -# if defined(__BEOS__) -# if defined(__GNUC__) -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC __declspec(export) -# endif -# elif defined(__WIN32__) -# ifdef __BORLANDC__ -# ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# elif defined(__OS2__) -# ifdef __WATCOMC__ -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else -# define DECLSPEC -# endif -# else -# define DECLSPEC -# endif -# else -# if defined(__GNUC__) && __GNUC__ >= 4 -# define DECLSPEC __attribute__ ((visibility("default"))) -# else -# define DECLSPEC -# endif -# endif -#endif - -/* By default SDL uses the C calling convention */ -#ifndef SDLCALL -#if defined(__WIN32__) && !defined(__GNUC__) -#define SDLCALL __cdecl -#else -#ifdef __OS2__ -/* But on OS/2, we use the _System calling convention */ -/* to be compatible with every compiler */ -#define SDLCALL _System -#else -#define SDLCALL -#endif -#endif -#endif /* SDLCALL */ - -/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ -#ifdef __SYMBIAN32__ -#undef DECLSPEC -#define DECLSPEC -#endif /* __SYMBIAN32__ */ - -/* Force structure packing at 4 byte alignment. - This is necessary if the header is included in code which has structure - packing set to an alternate value, say for loading structures from disk. - The packing is reset to the previous value in close_code.h - */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) -#ifdef _MSC_VER -#pragma warning(disable: 4103) -#endif -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#pragma pack(push,4) -#endif /* Compiler needs structure packing set */ - -/* Set up compiler-specific options for inlining functions */ -#ifndef SDL_INLINE_OKAY -#ifdef __GNUC__ -#define SDL_INLINE_OKAY -#else -/* Add any special compiler-specific cases here */ -#if defined(_MSC_VER) || defined(__BORLANDC__) || \ - defined(__DMC__) || defined(__SC__) || \ - defined(__WATCOMC__) || defined(__LCC__) || \ - defined(__DECC) -#ifndef __inline__ -#define __inline__ __inline -#endif -#define SDL_INLINE_OKAY -#else -#if !defined(__MRC__) && !defined(_SGI_SOURCE) -#ifndef __inline__ -#define __inline__ inline -#endif -#define SDL_INLINE_OKAY -#endif /* Not a funky compiler */ -#endif /* Visual C++ */ -#endif /* GNU C */ -#endif /* SDL_INLINE_OKAY */ - -/* If inlining isn't supported, remove "__inline__", turning static - inlined functions into static functions (resulting in code bloat - in all files which include the offending header files) -*/ -#ifndef SDL_INLINE_OKAY -#define __inline__ -#endif - -/* Apparently this is needed by several Windows compilers */ -#if !defined(__MACH__) -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif /* NULL */ -#endif /* ! Mac OS X - breaks precompiled headers */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file begin_code.h + * + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/* This shouldn't be nested -- included it around code only. */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +/* 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__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && __GNUC__ >= 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/* By default SDL uses the C calling convention */ +#ifndef SDLCALL +#if defined(__WIN32__) && !defined(__GNUC__) +#define SDLCALL __cdecl +#else +#define SDLCALL +#endif +#endif /* SDLCALL */ + +/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ +#ifdef __SYMBIAN32__ +#undef DECLSPEC +#define DECLSPEC +#endif /* __SYMBIAN32__ */ + +/* Force structure packing at 4 byte alignment. + This is necessary if the header is included in code which has structure + packing set to an alternate value, say for loading structures from disk. + The packing is reset to the previous value in close_code.h + */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef _MSC_VER +#pragma warning(disable: 4103) +#endif +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#pragma pack(push,4) +#endif /* Compiler needs structure packing set */ + +/* Set up compiler-specific options for inlining functions */ +#ifndef SDL_INLINE_OKAY +#ifdef __GNUC__ +#define SDL_INLINE_OKAY +#else +/* Add any special compiler-specific cases here */ +#if defined(_MSC_VER) || defined(__BORLANDC__) || \ + defined(__DMC__) || defined(__SC__) || \ + defined(__WATCOMC__) || defined(__LCC__) || \ + defined(__DECC) +#ifndef __inline__ +#define __inline__ __inline +#endif +#define SDL_INLINE_OKAY +#else +#if !defined(__MRC__) && !defined(_SGI_SOURCE) +#ifndef __inline__ +#define __inline__ inline +#endif +#define SDL_INLINE_OKAY +#endif /* Not a funky compiler */ +#endif /* Visual C++ */ +#endif /* GNU C */ +#endif /* SDL_INLINE_OKAY */ + +/* If inlining isn't supported, remove "__inline__", turning static + inlined functions into static functions (resulting in code bloat + in all files which include the offending header files) +*/ +#ifndef SDL_INLINE_OKAY +#define __inline__ +#endif + +/* Apparently this is needed by several Windows compilers */ +#if !defined(__MACH__) +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif /* NULL */ +#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/Externals/SDL/Include/close_code.h b/Externals/SDL/Include/close_code.h index 660933d5f5..980b2d7544 100644 --- a/Externals/SDL/Include/close_code.h +++ b/Externals/SDL/Include/close_code.h @@ -1,35 +1,38 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2009 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* This file reverses the effects of begin_code.h and should be included - after you finish any function and structure declarations in your headers -*/ - -#undef _begin_code_h - -/* Reset structure packing at previous byte alignment */ -#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) -#ifdef __BORLANDC__ -#pragma nopackwarning -#endif -#pragma pack(pop) -#endif /* Compiler needs structure packing set */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file close_code.h + * + * This file reverses the effects of begin_code.h and should be included + * after you finish any function and structure declarations in your headers + */ + +#undef _begin_code_h + +/* Reset structure packing at previous byte alignment */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#pragma pack(pop) +#endif /* Compiler needs structure packing set */ diff --git a/Externals/SDL/VisualC/SDL/SDL_VS2008.vcproj b/Externals/SDL/VisualC/SDL/SDL_VS2008.vcproj new file mode 100644 index 0000000000..6498e263e1 --- /dev/null +++ b/Externals/SDL/VisualC/SDL/SDL_VS2008.vcproj @@ -0,0 +1,1137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Externals/SDL/src/SDL.c b/Externals/SDL/src/SDL.c new file mode 100644 index 0000000000..6f5800459a --- /dev/null +++ b/Externals/SDL/src/SDL.c @@ -0,0 +1,360 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Initialization code for SDL */ + +#include "SDL.h" +#include "SDL_fatal.h" +#if !SDL_VIDEO_DISABLED +#include "video/SDL_leaks.h" +#endif + +#if SDL_THREAD_PTH +#include +#endif + +/* Initialization/Cleanup routines */ +#if !SDL_JOYSTICK_DISABLED +extern int SDL_JoystickInit(void); +extern void SDL_JoystickQuit(void); +#endif +#if !SDL_HAPTIC_DISABLED +extern int SDL_HapticInit(void); +extern int SDL_HapticQuit(void); +#endif +#if !SDL_TIMERS_DISABLED +extern void SDL_StartTicks(void); +extern int SDL_TimerInit(void); +extern void SDL_TimerQuit(void); +#endif +#if defined(__WIN32__) +extern int SDL_HelperWindowCreate(void); +extern int SDL_HelperWindowDestroy(void); +#endif + +/* The initialized subsystems */ +static Uint32 SDL_initialized = 0; +static Uint32 ticks_started = 0; + +#ifdef CHECK_LEAKS +int surfaces_allocated = 0; +#endif + +int +SDL_InitSubSystem(Uint32 flags) +{ +#if !SDL_VIDEO_DISABLED + /* Initialize the video/event subsystem */ + if ((flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO)) { + if (SDL_VideoInit(NULL, (flags & SDL_INIT_EVENTTHREAD)) < 0) { + return (-1); + } + SDL_initialized |= SDL_INIT_VIDEO; + } +#else + if (flags & SDL_INIT_VIDEO) { + SDL_SetError("SDL not built with video support"); + return (-1); + } +#endif + +#if !SDL_AUDIO_DISABLED + /* Initialize the audio subsystem */ + if ((flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO)) { + if (SDL_AudioInit(NULL) < 0) { + return (-1); + } + SDL_initialized |= SDL_INIT_AUDIO; + } +#else + if (flags & SDL_INIT_AUDIO) { + SDL_SetError("SDL not built with audio support"); + return (-1); + } +#endif + +#if !SDL_TIMERS_DISABLED + /* Initialize the timer subsystem */ + if (!ticks_started) { + SDL_StartTicks(); + ticks_started = 1; + } + if ((flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER)) { + if (SDL_TimerInit() < 0) { + return (-1); + } + SDL_initialized |= SDL_INIT_TIMER; + } +#else + if (flags & SDL_INIT_TIMER) { + SDL_SetError("SDL not built with timer support"); + return (-1); + } +#endif + +#if !SDL_JOYSTICK_DISABLED + /* Initialize the joystick subsystem */ + if ((flags & SDL_INIT_JOYSTICK) && !(SDL_initialized & SDL_INIT_JOYSTICK)) { + if (SDL_JoystickInit() < 0) { + return (-1); + } + SDL_initialized |= SDL_INIT_JOYSTICK; + } +#else + if (flags & SDL_INIT_JOYSTICK) { + SDL_SetError("SDL not built with joystick support"); + return (-1); + } +#endif + +#if !SDL_HAPTIC_DISABLED + /* Initialize the haptic subsystem */ + if ((flags & SDL_INIT_HAPTIC) && !(SDL_initialized & SDL_INIT_HAPTIC)) { + if (SDL_HapticInit() < 0) { + return (-1); + } + SDL_initialized |= SDL_INIT_HAPTIC; + } +#else + if (flags & SDL_INIT_HAPTIC) { + SDL_SetError("SDL not built with haptic (force feedback) support"); + return (-1); + } +#endif + return (0); +} + +int +SDL_Init(Uint32 flags) +{ +#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH + if (!pth_init()) { + return -1; + } +#endif + + /* Clear the error message */ + SDL_ClearError(); + +#if defined(__WIN32__) + if (SDL_HelperWindowCreate() < 0) { + return -1; + } +#endif + + /* Initialize the desired subsystems */ + if (SDL_InitSubSystem(flags) < 0) { + return (-1); + } + + /* Everything is initialized */ + if (!(flags & SDL_INIT_NOPARACHUTE)) { + SDL_InstallParachute(); + } + return (0); +} + +void +SDL_QuitSubSystem(Uint32 flags) +{ + /* Shut down requested initialized subsystems */ +#if !SDL_JOYSTICK_DISABLED + if ((flags & SDL_initialized & SDL_INIT_JOYSTICK)) { + SDL_JoystickQuit(); + SDL_initialized &= ~SDL_INIT_JOYSTICK; + } +#endif +#if !SDL_HAPTIC_DISABLED + if ((flags & SDL_initialized & SDL_INIT_HAPTIC)) { + SDL_HapticQuit(); + SDL_initialized &= ~SDL_INIT_HAPTIC; + } +#endif +#if !SDL_TIMERS_DISABLED + if ((flags & SDL_initialized & SDL_INIT_TIMER)) { + SDL_TimerQuit(); + SDL_initialized &= ~SDL_INIT_TIMER; + } +#endif +#if !SDL_AUDIO_DISABLED + if ((flags & SDL_initialized & SDL_INIT_AUDIO)) { + SDL_AudioQuit(); + SDL_initialized &= ~SDL_INIT_AUDIO; + } +#endif +#if !SDL_VIDEO_DISABLED + if ((flags & SDL_initialized & SDL_INIT_VIDEO)) { + SDL_VideoQuit(); + SDL_initialized &= ~SDL_INIT_VIDEO; + } +#endif +} + +Uint32 +SDL_WasInit(Uint32 flags) +{ + if (!flags) { + flags = SDL_INIT_EVERYTHING; + } + return (SDL_initialized & flags); +} + +void +SDL_Quit(void) +{ + /* Quit all subsystems */ +#ifdef DEBUG_BUILD + printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); + fflush(stdout); +#endif + +#if defined(__WIN32__) + SDL_HelperWindowDestroy(); +#endif + SDL_QuitSubSystem(SDL_INIT_EVERYTHING); + +#ifdef CHECK_LEAKS +#ifdef DEBUG_BUILD + printf("[SDL_Quit] : CHECK_LEAKS\n"); + fflush(stdout); +#endif + + /* Print the number of surfaces not freed */ + if (surfaces_allocated != 0) { + fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n", + surfaces_allocated); + } +#endif +#ifdef DEBUG_BUILD + printf("[SDL_Quit] : SDL_UninstallParachute()\n"); + fflush(stdout); +#endif + + /* Uninstall any parachute signal handlers */ + SDL_UninstallParachute(); + +#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH + pth_kill(); +#endif +#ifdef DEBUG_BUILD + printf("[SDL_Quit] : Returning!\n"); + fflush(stdout); +#endif + +} + +/* Get the library version number */ +void +SDL_GetVersion(SDL_version * ver) +{ + SDL_VERSION(ver); +} + +/* Get the library source revision */ +int +SDL_GetRevision(void) +{ + return SDL_REVISION; +} + +/* Get the name of the platform */ +const char * +SDL_GetPlatform() +{ +#if __AIX__ + return "AIX"; +#elif __HAIKU__ +/* Haiku must appear here before BeOS, since it also defines __BEOS__ */ + return "Haiku"; +#elif __BEOS__ + return "BeOS"; +#elif __BSDI__ + return "BSDI"; +#elif __DREAMCAST__ + return "Dreamcast"; +#elif __FREEBSD__ + return "FreeBSD"; +#elif __HPUX__ + return "HP-UX"; +#elif __IRIX__ + return "Irix"; +#elif __LINUX__ + return "Linux"; +#elif __MINT__ + return "Atari MiNT"; +#elif __MACOS__ + return "MacOS Classic"; +#elif __MACOSX__ + return "Mac OS X"; +#elif __NETBSD__ + return "NetBSD"; +#elif __OPENBSD__ + return "OpenBSD"; +#elif __OS2__ + return "OS/2"; +#elif __OSF__ + return "OSF/1"; +#elif __QNXNTO__ + return "QNX Neutrino"; +#elif __RISCOS__ + return "RISC OS"; +#elif __SOLARIS__ + return "Solaris"; +#elif __WIN32__ +#ifdef _WIN32_WCE + return "Windows CE"; +#else + return "Windows"; +#endif +#elif __IPHONEOS__ + return "iPhone OS"; +#else + return "Unknown (see SDL_platform.h)"; +#endif +} + +#if defined(__WIN32__) + +#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) +/* Need to include DllMain() on Watcom C for some reason.. */ +#define WIN32_LEAN_AND_MEAN +#include + +BOOL APIENTRY +_DllMainCRTStartup(HANDLE hModule, + DWORD ul_reason_for_call, LPVOID lpReserved) +{ + switch (ul_reason_for_call) { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} +#endif /* building DLL with Watcom C */ + +#endif /* __WIN32__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/SDL_compat.c b/Externals/SDL/src/SDL_compat.c new file mode 100644 index 0000000000..6b485ef90b --- /dev/null +++ b/Externals/SDL/src/SDL_compat.c @@ -0,0 +1,1739 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* This file contains functions for backwards compatibility with SDL 1.2 */ + +#include "SDL.h" +#include "SDL_syswm.h" + +#include "video/SDL_sysvideo.h" +#include "video/SDL_pixels_c.h" +#include "video/SDL_yuv_sw_c.h" + +static SDL_WindowID SDL_VideoWindow = 0; +static SDL_RendererInfo SDL_VideoRendererInfo; +static SDL_TextureID SDL_VideoTexture = 0; +static SDL_Surface *SDL_VideoSurface = NULL; +static SDL_Surface *SDL_ShadowSurface = NULL; +static SDL_Surface *SDL_PublicSurface = NULL; +static SDL_GLContext *SDL_VideoContext = NULL; +static Uint32 SDL_VideoFlags = 0; +static char *wm_title = NULL; +static SDL_Surface *SDL_VideoIcon; +static int SDL_enabled_UNICODE = 0; + +char * +SDL_AudioDriverName(char *namebuf, int maxlen) +{ + const char *name = SDL_GetCurrentAudioDriver(); + if (name) { + SDL_strlcpy(namebuf, name, maxlen); + return namebuf; + } + return NULL; +} + +char * +SDL_VideoDriverName(char *namebuf, int maxlen) +{ + const char *name = SDL_GetCurrentVideoDriver(); + if (name) { + SDL_strlcpy(namebuf, name, maxlen); + return namebuf; + } + return NULL; +} + +const SDL_VideoInfo * +SDL_GetVideoInfo(void) +{ + static SDL_VideoInfo info; + SDL_DisplayMode mode; + + /* Memory leak, compatibility code, who cares? */ + if (!info.vfmt && SDL_GetDesktopDisplayMode(&mode) == 0) { + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, &Bmask, + &Amask); + info.vfmt = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask); + info.current_w = mode.w; + info.current_h = mode.h; + } + return &info; +} + +int +SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags) +{ + int i, actual_bpp = 0; + + if (!SDL_GetVideoDevice()) { + return 0; + } + + if (!(flags & SDL_FULLSCREEN)) { + SDL_DisplayMode mode; + SDL_GetDesktopDisplayMode(&mode); + return SDL_BITSPERPIXEL(mode.format); + } + + for (i = 0; i < SDL_GetNumDisplayModes(); ++i) { + SDL_DisplayMode mode; + SDL_GetDisplayMode(i, &mode); + if (!mode.w || !mode.h || (width == mode.w && height == mode.h)) { + if (!mode.format) { + return bpp; + } + if (SDL_BITSPERPIXEL(mode.format) >= (Uint32) bpp) { + actual_bpp = SDL_BITSPERPIXEL(mode.format); + } + } + } + return actual_bpp; +} + +SDL_Rect ** +SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags) +{ + int i, nmodes; + SDL_Rect **modes; + + if (!SDL_GetVideoDevice()) { + return NULL; + } + + if (!(flags & SDL_FULLSCREEN)) { + return (SDL_Rect **) (-1); + } + + if (!format) { + format = SDL_GetVideoInfo()->vfmt; + } + + /* Memory leak, but this is a compatibility function, who cares? */ + nmodes = 0; + modes = NULL; + for (i = 0; i < SDL_GetNumDisplayModes(); ++i) { + SDL_DisplayMode mode; + SDL_GetDisplayMode(i, &mode); + if (!mode.w || !mode.h) { + return (SDL_Rect **) (-1); + } + if (SDL_BITSPERPIXEL(mode.format) != format->BitsPerPixel) { + continue; + } + if (nmodes > 0 && modes[nmodes - 1]->w == mode.w + && modes[nmodes - 1]->h == mode.h) { + continue; + } + + modes = SDL_realloc(modes, (nmodes + 2) * sizeof(*modes)); + if (!modes) { + return NULL; + } + modes[nmodes] = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect)); + if (!modes[nmodes]) { + return NULL; + } + modes[nmodes]->x = 0; + modes[nmodes]->y = 0; + modes[nmodes]->w = mode.w; + modes[nmodes]->h = mode.h; + ++nmodes; + } + if (modes) { + modes[nmodes] = NULL; + } + return modes; +} + +static int +SDL_CompatEventFilter(void *userdata, SDL_Event * event) +{ + SDL_Event fake; + + switch (event->type) { + case SDL_WINDOWEVENT: + switch (event->window.event) { + case SDL_WINDOWEVENT_EXPOSED: + if (!SDL_HasEvent(SDL_VIDEOEXPOSEMASK)) { + fake.type = SDL_VIDEOEXPOSE; + SDL_PushEvent(&fake); + } + break; + case SDL_WINDOWEVENT_RESIZED: + SDL_PeepEvents(&fake, 1, SDL_GETEVENT, SDL_VIDEORESIZEMASK); + fake.type = SDL_VIDEORESIZE; + fake.resize.w = event->window.data1; + fake.resize.h = event->window.data2; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_MINIMIZED: + fake.type = SDL_ACTIVEEVENT; + fake.active.gain = 0; + fake.active.state = SDL_APPACTIVE; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_RESTORED: + fake.type = SDL_ACTIVEEVENT; + fake.active.gain = 1; + fake.active.state = SDL_APPACTIVE; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_ENTER: + fake.type = SDL_ACTIVEEVENT; + fake.active.gain = 1; + fake.active.state = SDL_APPMOUSEFOCUS; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_LEAVE: + fake.type = SDL_ACTIVEEVENT; + fake.active.gain = 0; + fake.active.state = SDL_APPMOUSEFOCUS; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_FOCUS_GAINED: + fake.type = SDL_ACTIVEEVENT; + fake.active.gain = 1; + fake.active.state = SDL_APPINPUTFOCUS; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + fake.type = SDL_ACTIVEEVENT; + fake.active.gain = 0; + fake.active.state = SDL_APPINPUTFOCUS; + SDL_PushEvent(&fake); + break; + case SDL_WINDOWEVENT_CLOSE: + fake.type = SDL_QUIT; + SDL_PushEvent(&fake); + break; + } + case SDL_KEYDOWN: + case SDL_KEYUP: + { + Uint32 unicode = 0; + if (event->key.type == SDL_KEYDOWN && event->key.keysym.sym < 256) { + unicode = event->key.keysym.sym; + if (unicode >= 'a' && unicode <= 'z') { + int shifted = !!(event->key.keysym.mod & KMOD_SHIFT); + int capslock = !!(event->key.keysym.mod & KMOD_CAPS); + if ((shifted ^ capslock) != 0) { + unicode = SDL_toupper(unicode); + } + } + } + if (unicode) { + event->key.keysym.unicode = unicode; + } + break; + } + case SDL_TEXTINPUT: + { + /* FIXME: Generate an old style key repeat event if needed */ + //printf("TEXTINPUT: '%s'\n", event->text.text); + break; + } + case SDL_MOUSEWHEEL: + { + Uint8 button; + int selected; + int x, y; + + if (event->wheel.y == 0) { + break; + } + + selected = SDL_SelectMouse(event->wheel.which); + SDL_GetMouseState(selected, &x, &y); + SDL_SelectMouse(selected); + + if (event->wheel.y > 0) { + button = SDL_BUTTON_WHEELUP; + } else { + button = SDL_BUTTON_WHEELDOWN; + } + + fake.button.which = event->wheel.windowID; + fake.button.button = button; + fake.button.x = x; + fake.button.y = y; + fake.button.windowID = event->wheel.windowID; + + fake.type = SDL_MOUSEBUTTONDOWN; + fake.button.state = SDL_PRESSED; + SDL_PushEvent(&fake); + + fake.type = SDL_MOUSEBUTTONUP; + fake.button.state = SDL_RELEASED; + SDL_PushEvent(&fake); + break; + } + + } + return 1; +} + +static int +SDL_VideoPaletteChanged(void *userdata, SDL_Palette * palette) +{ + if (userdata == SDL_ShadowSurface) { + /* If the shadow palette changed, make the changes visible */ + if (!SDL_VideoSurface->format->palette) { + SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0); + } + } + if (userdata == SDL_VideoSurface) { + if (SDL_SetDisplayPalette(palette->colors, 0, palette->ncolors) < 0) { + return -1; + } + if (SDL_SetTexturePalette + (SDL_VideoTexture, palette->colors, 0, palette->ncolors) < 0) { + return -1; + } + } + return 0; +} + +static void +GetEnvironmentWindowPosition(int w, int h, int *x, int *y) +{ + const char *window = SDL_getenv("SDL_VIDEO_WINDOW_POS"); + const char *center = SDL_getenv("SDL_VIDEO_CENTERED"); + if (window) { + if (SDL_sscanf(window, "%d,%d", x, y) == 2) { + return; + } + if (SDL_strcmp(window, "center") == 0) { + center = window; + } + } + if (center) { + SDL_DisplayMode mode; + SDL_GetDesktopDisplayMode(&mode); + *x = (mode.w - w) / 2; + *y = (mode.h - h) / 2; + } +} + +static SDL_Surface * +CreateVideoSurface(SDL_TextureID textureID) +{ + SDL_Surface *surface; + Uint32 format; + int w, h; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + void *pixels; + int pitch; + + if (SDL_QueryTexture(textureID, &format, NULL, &w, &h) < 0) { + return NULL; + } + + if (!SDL_PixelFormatEnumToMasks + (format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + SDL_SetError("Unknown texture format"); + return NULL; + } + + if (SDL_QueryTexturePixels(textureID, &pixels, &pitch) == 0) { + surface = + SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch, Rmask, Gmask, + Bmask, Amask); + } else { + surface = + SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask); + } + return surface; +} + +static void +ClearVideoSurface() +{ + Uint32 black; + + /* Clear the surface for display */ + black = SDL_MapRGB(SDL_PublicSurface->format, 0, 0, 0); + SDL_FillRect(SDL_PublicSurface, NULL, black); + SDL_UpdateRect(SDL_PublicSurface, 0, 0, 0, 0); +} + +static void +SetupScreenSaver(int flags) +{ + const char *env; + SDL_bool allow_screensaver; + + /* Allow environment override of screensaver disable */ + env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); + if (env) { + allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE; + } else if (flags & SDL_FULLSCREEN) { + allow_screensaver = SDL_FALSE; + } else { + allow_screensaver = SDL_TRUE; + } + if (allow_screensaver) { + SDL_EnableScreenSaver(); + } else { + SDL_DisableScreenSaver(); + } +} + +int +SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags) +{ + int w, h; + Uint32 format; + int access; + void *pixels; + int pitch; + + /* We can't resize something we don't have... */ + if (!SDL_VideoWindow) { + return -1; + } + + /* We probably have to recreate the window in fullscreen mode */ + if (flags & SDL_FULLSCREEN) { + return -1; + } + + /* I don't think there's any change we can gracefully make in flags */ + if (flags != SDL_VideoFlags) { + return -1; + } + + /* Resize the window */ + SDL_GetWindowSize(SDL_VideoWindow, &w, &h); + if (w != width || h != height) { + SDL_SetWindowSize(SDL_VideoWindow, width, height); + } + + /* If we're in OpenGL mode, just resize the stub surface and we're done! */ + if (flags & SDL_OPENGL) { + SDL_VideoSurface->w = width; + SDL_VideoSurface->h = height; + return 0; + } + + /* Destroy the screen texture and recreate it */ + SDL_QueryTexture(SDL_VideoTexture, &format, &access, &w, &h); + SDL_DestroyTexture(SDL_VideoTexture); + SDL_VideoTexture = SDL_CreateTexture(format, access, width, height); + if (!SDL_VideoTexture) { + return -1; + } + + SDL_VideoSurface->w = width; + SDL_VideoSurface->h = height; + if (SDL_QueryTexturePixels(SDL_VideoTexture, &pixels, &pitch) == 0) { + SDL_VideoSurface->pixels = pixels; + SDL_VideoSurface->pitch = pitch; + } else { + SDL_CalculatePitch(SDL_VideoSurface); + SDL_VideoSurface->pixels = + SDL_realloc(SDL_VideoSurface->pixels, + SDL_VideoSurface->h * SDL_VideoSurface->pitch); + } + SDL_SetClipRect(SDL_VideoSurface, NULL); + SDL_InvalidateMap(SDL_VideoSurface->map); + + if (SDL_ShadowSurface) { + SDL_ShadowSurface->w = width; + SDL_ShadowSurface->h = height; + SDL_ShadowSurface->pitch = SDL_CalculatePitch(SDL_ShadowSurface); + SDL_ShadowSurface->pixels = + SDL_realloc(SDL_ShadowSurface->pixels, + SDL_ShadowSurface->h * SDL_ShadowSurface->pitch); + SDL_SetClipRect(SDL_ShadowSurface, NULL); + SDL_InvalidateMap(SDL_ShadowSurface->map); + } + + ClearVideoSurface(); + + return 0; +} + +SDL_Surface * +SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) +{ + SDL_DisplayMode desktop_mode; + SDL_DisplayMode mode; + int window_x = SDL_WINDOWPOS_UNDEFINED; + int window_y = SDL_WINDOWPOS_UNDEFINED; + Uint32 window_flags; + Uint32 desktop_format; + Uint32 desired_format; + Uint32 surface_flags; + + if (!SDL_GetVideoDevice()) { + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { + return NULL; + } + } + + SDL_GetDesktopDisplayMode(&desktop_mode); + + if (width == 0) { + width = desktop_mode.w; + } + if (height == 0) { + height = desktop_mode.h; + } + + /* See if we can simply resize the existing window and surface */ + if (SDL_ResizeVideoMode(width, height, bpp, flags) == 0) { + return SDL_PublicSurface; + } + + /* Destroy existing window */ + SDL_PublicSurface = NULL; + if (SDL_ShadowSurface) { + SDL_FreeSurface(SDL_ShadowSurface); + SDL_ShadowSurface = NULL; + } + if (SDL_VideoSurface) { + SDL_DelPaletteWatch(SDL_VideoSurface->format->palette, + SDL_VideoPaletteChanged, NULL); + SDL_FreeSurface(SDL_VideoSurface); + SDL_VideoSurface = NULL; + } + if (SDL_VideoContext) { + /* SDL_GL_MakeCurrent(0, NULL); *//* Doesn't do anything */ + SDL_GL_DeleteContext(SDL_VideoContext); + SDL_VideoContext = NULL; + } + if (SDL_VideoWindow) { + SDL_GetWindowPosition(SDL_VideoWindow, &window_x, &window_y); + SDL_DestroyWindow(SDL_VideoWindow); + } + + /* Set up the event filter */ + if (!SDL_GetEventFilter(NULL, NULL)) { + SDL_SetEventFilter(SDL_CompatEventFilter, NULL); + } + + /* Create a new window */ + window_flags = SDL_WINDOW_SHOWN; + if (flags & SDL_FULLSCREEN) { + window_flags |= SDL_WINDOW_FULLSCREEN; + } + if (flags & SDL_OPENGL) { + window_flags |= SDL_WINDOW_OPENGL; + } + if (flags & SDL_RESIZABLE) { + window_flags |= SDL_WINDOW_RESIZABLE; + } + if (flags & SDL_NOFRAME) { + window_flags |= SDL_WINDOW_BORDERLESS; + } + GetEnvironmentWindowPosition(width, height, &window_x, &window_y); + SDL_SetFullscreenDisplayMode(NULL); + SDL_VideoWindow = + SDL_CreateWindow(wm_title, window_x, window_y, width, height, + window_flags); + if (!SDL_VideoWindow) { + return NULL; + } + SDL_SetWindowIcon(SDL_VideoWindow, SDL_VideoIcon); + + window_flags = SDL_GetWindowFlags(SDL_VideoWindow); + surface_flags = 0; + if (window_flags & SDL_WINDOW_FULLSCREEN) { + surface_flags |= SDL_FULLSCREEN; + } + if (window_flags & SDL_WINDOW_OPENGL) { + surface_flags |= SDL_OPENGL; + } + if (window_flags & SDL_WINDOW_RESIZABLE) { + surface_flags |= SDL_RESIZABLE; + } + if (window_flags & SDL_WINDOW_BORDERLESS) { + surface_flags |= SDL_NOFRAME; + } + + /* Set up the desired display mode */ + desktop_format = desktop_mode.format; + if (desktop_format && ((flags & SDL_ANYFORMAT) + || (bpp == SDL_BITSPERPIXEL(desktop_format)))) { + desired_format = desktop_format; + } else { + switch (bpp) { + case 0: + if (desktop_format) { + desired_format = desktop_format; + } else { + desired_format = SDL_PIXELFORMAT_RGB888; + } + bpp = SDL_BITSPERPIXEL(desired_format); + break; + case 8: + desired_format = SDL_PIXELFORMAT_INDEX8; + break; + case 15: + desired_format = SDL_PIXELFORMAT_RGB555; + break; + case 16: + desired_format = SDL_PIXELFORMAT_RGB565; + break; + case 24: + desired_format = SDL_PIXELFORMAT_RGB24; + break; + case 32: + desired_format = SDL_PIXELFORMAT_RGB888; + break; + default: + SDL_SetError("Unsupported bpp in SDL_SetVideoMode()"); + return NULL; + } + } + mode.format = desired_format; + mode.w = width; + mode.h = height; + mode.refresh_rate = 0; + + /* Set the desired display mode */ + if (flags & SDL_FULLSCREEN) { + if (SDL_SetFullscreenDisplayMode(&mode) < 0) { + return NULL; + } + } + + /* If we're in OpenGL mode, just create a stub surface and we're done! */ + if (flags & SDL_OPENGL) { + SDL_VideoContext = SDL_GL_CreateContext(SDL_VideoWindow); + if (!SDL_VideoContext) { + return NULL; + } + if (SDL_GL_MakeCurrent(SDL_VideoWindow, SDL_VideoContext) < 0) { + return NULL; + } + SDL_VideoSurface = + SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, 0, 0, 0, 0, 0); + if (!SDL_VideoSurface) { + return NULL; + } + SDL_VideoSurface->flags |= surface_flags; + SDL_PublicSurface = SDL_VideoSurface; + return SDL_PublicSurface; + } + + /* Create a renderer for the window */ + if (SDL_CreateRenderer + (SDL_VideoWindow, -1, + SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD) < 0) { + return NULL; + } + SDL_GetRendererInfo(&SDL_VideoRendererInfo); + + /* Create a texture for the screen surface */ + SDL_VideoTexture = + SDL_CreateTexture(desired_format, SDL_TEXTUREACCESS_STREAMING, width, + height); + + if (!SDL_VideoTexture) { + SDL_VideoTexture = + SDL_CreateTexture(desktop_format, + SDL_TEXTUREACCESS_STREAMING, width, height); + } + if (!SDL_VideoTexture) { + return NULL; + } + + /* Create the screen surface */ + SDL_VideoSurface = CreateVideoSurface(SDL_VideoTexture); + if (!SDL_VideoSurface) { + return NULL; + } + SDL_VideoSurface->flags |= surface_flags; + + /* Set a default screen palette */ + if (SDL_VideoSurface->format->palette) { + SDL_VideoSurface->flags |= SDL_HWPALETTE; + SDL_DitherColors(SDL_VideoSurface->format->palette->colors, + SDL_VideoSurface->format->BitsPerPixel); + SDL_AddPaletteWatch(SDL_VideoSurface->format->palette, + SDL_VideoPaletteChanged, SDL_VideoSurface); + SDL_SetPaletteColors(SDL_VideoSurface->format->palette, + SDL_VideoSurface->format->palette->colors, 0, + SDL_VideoSurface->format->palette->ncolors); + } + + /* Create a shadow surface if necessary */ + if ((bpp != SDL_VideoSurface->format->BitsPerPixel) + && !(flags & SDL_ANYFORMAT)) { + SDL_ShadowSurface = + SDL_CreateRGBSurface(0, width, height, bpp, 0, 0, 0, 0); + if (!SDL_ShadowSurface) { + return NULL; + } + SDL_ShadowSurface->flags |= surface_flags; + + /* 8-bit SDL_ShadowSurface surfaces report that they have exclusive palette */ + if (SDL_ShadowSurface->format->palette) { + SDL_ShadowSurface->flags |= SDL_HWPALETTE; + if (SDL_VideoSurface->format->palette) { + SDL_SetSurfacePalette(SDL_ShadowSurface, + SDL_VideoSurface->format->palette); + } else { + SDL_DitherColors(SDL_ShadowSurface->format->palette->colors, + SDL_ShadowSurface->format->BitsPerPixel); + } + SDL_AddPaletteWatch(SDL_ShadowSurface->format->palette, + SDL_VideoPaletteChanged, SDL_ShadowSurface); + } + } + SDL_PublicSurface = + (SDL_ShadowSurface ? SDL_ShadowSurface : SDL_VideoSurface); + + SDL_VideoFlags = flags; + + ClearVideoSurface(); + + SetupScreenSaver(flags); + + /* We're finally done! */ + return SDL_PublicSurface; +} + +SDL_Surface * +SDL_GetVideoSurface(void) +{ + return SDL_PublicSurface; +} + +int +SDL_SetAlpha(SDL_Surface * surface, Uint32 flag, Uint8 value) +{ + if (flag & SDL_SRCALPHA) { + /* According to the docs, value is ignored for alpha surfaces */ + if (surface->format->Amask) { + value = 0xFF; + } + SDL_SetSurfaceAlphaMod(surface, value); + SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); + } else { + SDL_SetSurfaceAlphaMod(surface, 0xFF); + SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE); + } + SDL_SetSurfaceRLE(surface, (flag & SDL_RLEACCEL)); + + return 0; +} + +SDL_Surface * +SDL_DisplayFormat(SDL_Surface * surface) +{ + SDL_PixelFormat *format; + + if (!SDL_PublicSurface) { + SDL_SetError("No video mode has been set"); + return NULL; + } + format = SDL_PublicSurface->format; + + /* Set the flags appropriate for copying to display surface */ + return SDL_ConvertSurface(surface, format, SDL_RLEACCEL); +} + +SDL_Surface * +SDL_DisplayFormatAlpha(SDL_Surface * surface) +{ + SDL_PixelFormat *vf; + SDL_PixelFormat *format; + SDL_Surface *converted; + /* default to ARGB8888 */ + Uint32 amask = 0xff000000; + Uint32 rmask = 0x00ff0000; + Uint32 gmask = 0x0000ff00; + Uint32 bmask = 0x000000ff; + + if (!SDL_PublicSurface) { + SDL_SetError("No video mode has been set"); + return NULL; + } + vf = SDL_PublicSurface->format; + + switch (vf->BytesPerPixel) { + case 2: + /* For XGY5[56]5, use, AXGY8888, where {X, Y} = {R, B}. + For anything else (like ARGB4444) it doesn't matter + since we have no special code for it anyway */ + if ((vf->Rmask == 0x1f) && + (vf->Bmask == 0xf800 || vf->Bmask == 0x7c00)) { + rmask = 0xff; + bmask = 0xff0000; + } + break; + + case 3: + case 4: + /* Keep the video format, as long as the high 8 bits are + unused or alpha */ + if ((vf->Rmask == 0xff) && (vf->Bmask == 0xff0000)) { + rmask = 0xff; + bmask = 0xff0000; + } + break; + + default: + /* We have no other optimised formats right now. When/if a new + optimised alpha format is written, add the converter here */ + break; + } + format = SDL_AllocFormat(32, rmask, gmask, bmask, amask); + converted = SDL_ConvertSurface(surface, format, SDL_RLEACCEL); + SDL_FreeFormat(format); + return converted; +} + +int +SDL_Flip(SDL_Surface * screen) +{ + SDL_UpdateRect(screen, 0, 0, 0, 0); + return 0; +} + +void +SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h) +{ + if (screen) { + SDL_Rect rect; + + /* Fill the rectangle */ + rect.x = (int) x; + rect.y = (int) y; + rect.w = (int) (w ? w : screen->w); + rect.h = (int) (h ? h : screen->h); + SDL_UpdateRects(screen, 1, &rect); + } +} + +void +SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects) +{ + int i; + + if (screen == SDL_ShadowSurface) { + for (i = 0; i < numrects; ++i) { + SDL_LowerBlit(SDL_ShadowSurface, &rects[i], SDL_VideoSurface, + &rects[i]); + } + + /* Fall through to video surface update */ + screen = SDL_VideoSurface; + } + if (screen == SDL_VideoSurface) { + if (screen->flags & SDL_PREALLOC) { + /* The surface memory is maintained by the renderer */ + SDL_DirtyTexture(SDL_VideoTexture, numrects, rects); + } else { + /* The surface memory needs to be copied to texture */ + int pitch = screen->pitch; + int psize = screen->format->BytesPerPixel; + for (i = 0; i < numrects; ++i) { + const SDL_Rect *rect = &rects[i]; + void *pixels = + (Uint8 *) screen->pixels + rect->y * pitch + + rect->x * psize; + SDL_UpdateTexture(SDL_VideoTexture, rect, pixels, pitch); + } + } + if (SDL_VideoRendererInfo.flags & SDL_RENDERER_PRESENTCOPY) { + for (i = 0; i < numrects; ++i) { + SDL_RenderCopy(SDL_VideoTexture, &rects[i], &rects[i]); + } + } else { + SDL_Rect rect; + rect.x = 0; + rect.y = 0; + rect.w = screen->w; + rect.h = screen->h; + SDL_RenderCopy(SDL_VideoTexture, &rect, &rect); + } + SDL_RenderPresent(); + } +} + +void +SDL_WM_SetCaption(const char *title, const char *icon) +{ + if (wm_title) { + SDL_free(wm_title); + } + if (title) { + wm_title = SDL_strdup(title); + } else { + wm_title = NULL; + } + SDL_SetWindowTitle(SDL_VideoWindow, wm_title); +} + +void +SDL_WM_GetCaption(const char **title, const char **icon) +{ + if (title) { + *title = wm_title; + } + if (icon) { + *icon = ""; + } +} + +void +SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask) +{ + SDL_VideoIcon = icon; +} + +int +SDL_WM_IconifyWindow(void) +{ + SDL_MinimizeWindow(SDL_VideoWindow); + return 0; +} + +int +SDL_WM_ToggleFullScreen(SDL_Surface * surface) +{ + if (SDL_GetWindowFlags(SDL_VideoWindow) & SDL_WINDOW_FULLSCREEN) { + if (SDL_SetWindowFullscreen(SDL_VideoWindow, 0) < 0) { + return 0; + } + SDL_PublicSurface->flags &= ~SDL_FULLSCREEN; + } else { + if (SDL_SetWindowFullscreen(SDL_VideoWindow, 1) < 0) { + return 0; + } + SDL_PublicSurface->flags |= SDL_FULLSCREEN; + } + return 1; +} + +SDL_GrabMode +SDL_WM_GrabInput(SDL_GrabMode mode) +{ + if (mode != SDL_GRAB_QUERY) { + SDL_SetWindowGrab(SDL_VideoWindow, mode); + } + return (SDL_GrabMode) SDL_GetWindowGrab(SDL_VideoWindow); +} + +void +SDL_WarpMouse(Uint16 x, Uint16 y) +{ + SDL_WarpMouseInWindow(SDL_VideoWindow, x, y); +} + +Uint8 +SDL_GetAppState(void) +{ + Uint8 state = 0; + Uint32 flags = 0; + + flags = SDL_GetWindowFlags(SDL_VideoWindow); + if ((flags & SDL_WINDOW_SHOWN) && !(flags & SDL_WINDOW_MINIMIZED)) { + state |= SDL_APPACTIVE; + } + if (flags & SDL_WINDOW_INPUT_FOCUS) { + state |= SDL_APPINPUTFOCUS; + } + if (flags & SDL_WINDOW_MOUSE_FOCUS) { + state |= SDL_APPMOUSEFOCUS; + } + return state; +} + +const SDL_version * +SDL_Linked_Version(void) +{ + static SDL_version version; + SDL_VERSION(&version); + return &version; +} + +int +SDL_SetPalette(SDL_Surface * surface, int flags, const SDL_Color * colors, + int firstcolor, int ncolors) +{ + return SDL_SetColors(surface, colors, firstcolor, ncolors); +} + +int +SDL_SetColors(SDL_Surface * surface, const SDL_Color * colors, int firstcolor, + int ncolors) +{ + if (SDL_SetPaletteColors + (surface->format->palette, colors, firstcolor, ncolors) == 0) { + return 1; + } else { + return 0; + } +} + +int +SDL_GetWMInfo(SDL_SysWMinfo * info) +{ + return SDL_GetWindowWMInfo(SDL_VideoWindow, info); +} + +#if 0 +void +SDL_MoveCursor(int x, int y) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + + /* Erase and update the current mouse position */ + if (SHOULD_DRAWCURSOR(SDL_cursorstate)) { + /* Erase and redraw mouse cursor in new position */ + SDL_LockCursor(); + SDL_EraseCursor(SDL_VideoSurface); + SDL_cursor->area.x = (x - SDL_cursor->hot_x); + SDL_cursor->area.y = (y - SDL_cursor->hot_y); + SDL_DrawCursor(SDL_VideoSurface); + SDL_UnlockCursor(); + } else if (_this->MoveWMCursor) { + _this->MoveWMCursor(_this, x, y); + } +} + +/* Keep track of the current cursor colors */ +static int palette_changed = 1; +static Uint8 pixels8[2]; + +void +SDL_CursorPaletteChanged(void) +{ + palette_changed = 1; +} + +void +SDL_MouseRect(SDL_Rect * area) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + int clip_diff; + + *area = SDL_cursor->area; + if (area->x < 0) { + area->w += area->x; + area->x = 0; + } + if (area->y < 0) { + area->h += area->y; + area->y = 0; + } + clip_diff = (area->x + area->w) - SDL_VideoSurface->w; + if (clip_diff > 0) { + area->w = area->w < clip_diff ? 0 : area->w - clip_diff; + } + clip_diff = (area->y + area->h) - SDL_VideoSurface->h; + if (clip_diff > 0) { + area->h = area->h < clip_diff ? 0 : area->h - clip_diff; + } +} + +static void +SDL_DrawCursorFast(SDL_Surface * screen, SDL_Rect * area) +{ + const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 }; + int i, w, h; + Uint8 *data, datab; + Uint8 *mask, maskb; + + data = SDL_cursor->data + area->y * SDL_cursor->area.w / 8; + mask = SDL_cursor->mask + area->y * SDL_cursor->area.w / 8; + switch (screen->format->BytesPerPixel) { + + case 1: + { + Uint8 *dst; + int dstskip; + + if (palette_changed) { + pixels8[0] = + (Uint8) SDL_MapRGB(screen->format, 255, 255, 255); + pixels8[1] = (Uint8) SDL_MapRGB(screen->format, 0, 0, 0); + palette_changed = 0; + } + dst = (Uint8 *) screen->pixels + + (SDL_cursor->area.y + area->y) * screen->pitch + + SDL_cursor->area.x; + dstskip = screen->pitch - area->w; + + for (h = area->h; h; h--) { + for (w = area->w / 8; w; w--) { + maskb = *mask++; + datab = *data++; + for (i = 0; i < 8; ++i) { + if (maskb & 0x80) { + *dst = pixels8[datab >> 7]; + } + maskb <<= 1; + datab <<= 1; + dst++; + } + } + dst += dstskip; + } + } + break; + + case 2: + { + Uint16 *dst; + int dstskip; + + dst = (Uint16 *) screen->pixels + + (SDL_cursor->area.y + area->y) * screen->pitch / 2 + + SDL_cursor->area.x; + dstskip = (screen->pitch / 2) - area->w; + + for (h = area->h; h; h--) { + for (w = area->w / 8; w; w--) { + maskb = *mask++; + datab = *data++; + for (i = 0; i < 8; ++i) { + if (maskb & 0x80) { + *dst = (Uint16) pixels[datab >> 7]; + } + maskb <<= 1; + datab <<= 1; + dst++; + } + } + dst += dstskip; + } + } + break; + + case 3: + { + Uint8 *dst; + int dstskip; + + dst = (Uint8 *) screen->pixels + + (SDL_cursor->area.y + area->y) * screen->pitch + + SDL_cursor->area.x * 3; + dstskip = screen->pitch - area->w * 3; + + for (h = area->h; h; h--) { + for (w = area->w / 8; w; w--) { + maskb = *mask++; + datab = *data++; + for (i = 0; i < 8; ++i) { + if (maskb & 0x80) { + SDL_memset(dst, pixels[datab >> 7], 3); + } + maskb <<= 1; + datab <<= 1; + dst += 3; + } + } + dst += dstskip; + } + } + break; + + case 4: + { + Uint32 *dst; + int dstskip; + + dst = (Uint32 *) screen->pixels + + (SDL_cursor->area.y + area->y) * screen->pitch / 4 + + SDL_cursor->area.x; + dstskip = (screen->pitch / 4) - area->w; + + for (h = area->h; h; h--) { + for (w = area->w / 8; w; w--) { + maskb = *mask++; + datab = *data++; + for (i = 0; i < 8; ++i) { + if (maskb & 0x80) { + *dst = pixels[datab >> 7]; + } + maskb <<= 1; + datab <<= 1; + dst++; + } + } + dst += dstskip; + } + } + break; + } +} + +static void +SDL_DrawCursorSlow(SDL_Surface * screen, SDL_Rect * area) +{ + const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 }; + int h; + int x, minx, maxx; + Uint8 *data, datab = 0; + Uint8 *mask, maskb = 0; + Uint8 *dst; + int dstbpp, dstskip; + + data = SDL_cursor->data + area->y * SDL_cursor->area.w / 8; + mask = SDL_cursor->mask + area->y * SDL_cursor->area.w / 8; + dstbpp = screen->format->BytesPerPixel; + dst = (Uint8 *) screen->pixels + + (SDL_cursor->area.y + area->y) * screen->pitch + + SDL_cursor->area.x * dstbpp; + dstskip = screen->pitch - SDL_cursor->area.w * dstbpp; + + minx = area->x; + maxx = area->x + area->w; + if (screen->format->BytesPerPixel == 1) { + if (palette_changed) { + pixels8[0] = (Uint8) SDL_MapRGB(screen->format, 255, 255, 255); + pixels8[1] = (Uint8) SDL_MapRGB(screen->format, 0, 0, 0); + palette_changed = 0; + } + for (h = area->h; h; h--) { + for (x = 0; x < SDL_cursor->area.w; ++x) { + if ((x % 8) == 0) { + maskb = *mask++; + datab = *data++; + } + if ((x >= minx) && (x < maxx)) { + if (maskb & 0x80) { + SDL_memset(dst, pixels8[datab >> 7], dstbpp); + } + } + maskb <<= 1; + datab <<= 1; + dst += dstbpp; + } + dst += dstskip; + } + } else { + for (h = area->h; h; h--) { + for (x = 0; x < SDL_cursor->area.w; ++x) { + if ((x % 8) == 0) { + maskb = *mask++; + datab = *data++; + } + if ((x >= minx) && (x < maxx)) { + if (maskb & 0x80) { + SDL_memset(dst, pixels[datab >> 7], dstbpp); + } + } + maskb <<= 1; + datab <<= 1; + dst += dstbpp; + } + dst += dstskip; + } + } +} + +/* This handles the ugly work of converting the saved cursor background from + the pixel format of the shadow surface to that of the video surface. + This is only necessary when blitting from a shadow surface of a different + pixel format than the video surface, and using a software rendered cursor. +*/ +static void +SDL_ConvertCursorSave(SDL_Surface * screen, int w, int h) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + SDL_BlitInfo info; + SDL_loblit RunBlit; + + /* Make sure we can steal the blit mapping */ + if (screen->map->dst != SDL_VideoSurface) { + return; + } + + /* Set up the blit information */ + info.s_pixels = SDL_cursor->save[1]; + info.s_width = w; + info.s_height = h; + info.s_skip = 0; + info.d_pixels = SDL_cursor->save[0]; + info.d_width = w; + info.d_height = h; + info.d_skip = 0; + info.aux_data = screen->map->sw_data->aux_data; + info.src = screen->format; + info.table = screen->map->table; + info.dst = SDL_VideoSurface->format; + RunBlit = screen->map->sw_data->blit; + + /* Run the actual software blit */ + RunBlit(&info); +} + +void +SDL_DrawCursorNoLock(SDL_Surface * screen) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + SDL_Rect area; + + /* Get the mouse rectangle, clipped to the screen */ + SDL_MouseRect(&area); + if ((area.w == 0) || (area.h == 0)) { + return; + } + + /* Copy mouse background */ + { + int w, h, screenbpp; + Uint8 *src, *dst; + + /* Set up the copy pointers */ + screenbpp = screen->format->BytesPerPixel; + if ((screen == SDL_VideoSurface) || + FORMAT_EQUAL(screen->format, SDL_VideoSurface->format)) { + dst = SDL_cursor->save[0]; + } else { + dst = SDL_cursor->save[1]; + } + src = (Uint8 *) screen->pixels + area.y * screen->pitch + + area.x * screenbpp; + + /* Perform the copy */ + w = area.w * screenbpp; + h = area.h; + while (h--) { + SDL_memcpy(dst, src, w); + dst += w; + src += screen->pitch; + } + } + + /* Draw the mouse cursor */ + area.x -= SDL_cursor->area.x; + area.y -= SDL_cursor->area.y; + if ((area.x == 0) && (area.w == SDL_cursor->area.w)) { + SDL_DrawCursorFast(screen, &area); + } else { + SDL_DrawCursorSlow(screen, &area); + } +} + +void +SDL_DrawCursor(SDL_Surface * screen) +{ + /* Lock the screen if necessary */ + if (screen == NULL) { + return; + } + if (SDL_MUSTLOCK(screen)) { + if (SDL_LockSurface(screen) < 0) { + return; + } + } + + SDL_DrawCursorNoLock(screen); + + /* Unlock the screen and update if necessary */ + if (SDL_MUSTLOCK(screen)) { + SDL_UnlockSurface(screen); + } + if (screen->flags & SDL_SCREEN_SURFACE) { + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + SDL_Window *window; + SDL_Rect area; + + window = SDL_GetWindowFromSurface(screen); + if (!window) { + return; + } + + SDL_MouseRect(&area); + + if (_this->UpdateWindowSurface) { + _this->UpdateWindowSurface(_this, window, 1, &area); + } + } +} + +void +SDL_EraseCursorNoLock(SDL_Surface * screen) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + SDL_Window *window; + SDL_Rect area; + + /* Get the window associated with the surface */ + window = SDL_GetWindowFromSurface(screen); + if (!window || !window->surface) { + return; + } + + /* Get the mouse rectangle, clipped to the screen */ + SDL_MouseRect(&area); + if ((area.w == 0) || (area.h == 0)) { + return; + } + + /* Copy mouse background */ + { + int w, h, screenbpp; + Uint8 *src, *dst; + + /* Set up the copy pointers */ + screenbpp = screen->format->BytesPerPixel; + if ((screen->flags & SDL_SCREEN_SURFACE) || + FORMAT_EQUAL(screen->format, window->surface->format)) { + src = SDL_cursor->save[0]; + } else { + src = SDL_cursor->save[1]; + } + dst = (Uint8 *) screen->pixels + area.y * screen->pitch + + area.x * screenbpp; + + /* Perform the copy */ + w = area.w * screenbpp; + h = area.h; + while (h--) { + SDL_memcpy(dst, src, w); + src += w; + dst += screen->pitch; + } + + /* Perform pixel conversion on cursor background */ + if (src > SDL_cursor->save[1]) { + SDL_ConvertCursorSave(screen, area.w, area.h); + } + } +} + +void +SDL_EraseCursor(SDL_Surface * screen) +{ + /* Lock the screen if necessary */ + if (screen == NULL) { + return; + } + if (SDL_MUSTLOCK(screen)) { + if (SDL_LockSurface(screen) < 0) { + return; + } + } + + SDL_EraseCursorNoLock(screen); + + /* Unlock the screen and update if necessary */ + if (SDL_MUSTLOCK(screen)) { + SDL_UnlockSurface(screen); + } + if (screen->flags & SDL_SCREEN_SURFACE) { + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + SDL_Window *window; + SDL_Rect area; + + window = SDL_GetWindowFromSurface(screen); + if (!window) { + return; + } + + SDL_MouseRect(&area); + + if (_this->UpdateWindowSurface) { + _this->UpdateWindowSurface(_this, window, 1, &area); + } + } +} + +/* Reset the cursor on video mode change + FIXME: Keep track of all cursors, and reset them all. + */ +void +SDL_ResetCursor(void) +{ + int savelen; + + if (SDL_cursor) { + savelen = SDL_cursor->area.w * 4 * SDL_cursor->area.h; + SDL_cursor->area.x = 0; + SDL_cursor->area.y = 0; + SDL_memset(SDL_cursor->save[0], 0, savelen); + } +} +#endif + +struct private_yuvhwdata +{ + Uint16 pitches[3]; + Uint8 *planes[3]; + + SDL_SW_YUVTexture *sw; + + SDL_TextureID textureID; + Uint32 texture_format; +}; + +SDL_Overlay * +SDL_CreateYUVOverlay(int w, int h, Uint32 format, SDL_Surface * display) +{ + SDL_Overlay *overlay; + Uint32 texture_format; + + if ((display->flags & SDL_OPENGL) == SDL_OPENGL) { + SDL_SetError("YUV overlays are not supported in OpenGL mode"); + return NULL; + } + + if (display != SDL_PublicSurface) { + SDL_SetError("YUV display is only supported on the screen surface"); + return NULL; + } + + switch (format) { + case SDL_YV12_OVERLAY: + texture_format = SDL_PIXELFORMAT_YV12; + break; + case SDL_IYUV_OVERLAY: + texture_format = SDL_PIXELFORMAT_IYUV; + break; + case SDL_YUY2_OVERLAY: + texture_format = SDL_PIXELFORMAT_YUY2; + break; + case SDL_UYVY_OVERLAY: + texture_format = SDL_PIXELFORMAT_UYVY; + break; + case SDL_YVYU_OVERLAY: + texture_format = SDL_PIXELFORMAT_YVYU; + break; + default: + SDL_SetError("Unknown YUV format"); + return NULL; + } + + overlay = (SDL_Overlay *) SDL_malloc(sizeof(*overlay)); + if (!overlay) { + SDL_OutOfMemory(); + return NULL; + } + SDL_zerop(overlay); + + overlay->hwdata = + (struct private_yuvhwdata *) SDL_malloc(sizeof(*overlay->hwdata)); + if (!overlay->hwdata) { + SDL_free(overlay); + SDL_OutOfMemory(); + return NULL; + } + + overlay->format = format; + overlay->w = w; + overlay->h = h; + if (format == SDL_YV12_OVERLAY || format == SDL_IYUV_OVERLAY) { + overlay->planes = 3; + } else { + overlay->planes = 1; + } + overlay->pitches = overlay->hwdata->pitches; + overlay->pixels = overlay->hwdata->planes; + + switch (format) { + case SDL_YV12_OVERLAY: + case SDL_IYUV_OVERLAY: + overlay->pitches[0] = overlay->w; + overlay->pitches[1] = overlay->w / 2; + overlay->pitches[2] = overlay->w / 2; + break; + case SDL_YUY2_OVERLAY: + case SDL_UYVY_OVERLAY: + case SDL_YVYU_OVERLAY: + overlay->pitches[0] = overlay->w * 2; + break; + } + + overlay->hwdata->textureID = + SDL_CreateTexture(texture_format, SDL_TEXTUREACCESS_STREAMING, w, h); + if (overlay->hwdata->textureID) { + overlay->hwdata->sw = NULL; + } else { + SDL_DisplayMode current_mode; + + overlay->hwdata->sw = SDL_SW_CreateYUVTexture(texture_format, w, h); + if (!overlay->hwdata->sw) { + SDL_FreeYUVOverlay(overlay); + return NULL; + } + + /* Create a supported RGB format texture for display */ + SDL_GetCurrentDisplayMode(¤t_mode); + texture_format = current_mode.format; + overlay->hwdata->textureID = + SDL_CreateTexture(texture_format, + SDL_TEXTUREACCESS_STREAMING, w, h); + } + if (!overlay->hwdata->textureID) { + SDL_FreeYUVOverlay(overlay); + return NULL; + } + overlay->hwdata->texture_format = texture_format; + + return overlay; +} + +int +SDL_LockYUVOverlay(SDL_Overlay * overlay) +{ + void *pixels; + int pitch; + + if (!overlay) { + SDL_SetError("Passed a NULL overlay"); + return -1; + } + if (overlay->hwdata->sw) { + if (SDL_SW_QueryYUVTexturePixels(overlay->hwdata->sw, &pixels, &pitch) + < 0) { + return -1; + } + } else { + if (SDL_LockTexture + (overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) + < 0) { + return -1; + } + } + overlay->pixels[0] = (Uint8 *) pixels; + overlay->pitches[0] = pitch; + switch (overlay->format) { + case SDL_YV12_OVERLAY: + case SDL_IYUV_OVERLAY: + overlay->pitches[1] = pitch / 2; + overlay->pitches[2] = pitch / 2; + overlay->pixels[1] = + overlay->pixels[0] + overlay->pitches[0] * overlay->h; + overlay->pixels[2] = + overlay->pixels[1] + overlay->pitches[1] * overlay->h / 2; + break; + case SDL_YUY2_OVERLAY: + case SDL_UYVY_OVERLAY: + case SDL_YVYU_OVERLAY: + break; + } + return 0; +} + +void +SDL_UnlockYUVOverlay(SDL_Overlay * overlay) +{ + if (!overlay) { + return; + } + if (overlay->hwdata->sw) { + void *pixels; + int pitch; + if (SDL_LockTexture + (overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) == 0) { + SDL_Rect srcrect; + + srcrect.x = 0; + srcrect.y = 0; + srcrect.w = overlay->w; + srcrect.h = overlay->h; + SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect, + overlay->hwdata->texture_format, + overlay->w, overlay->h, pixels, pitch); + SDL_UnlockTexture(overlay->hwdata->textureID); + } + } else { + SDL_UnlockTexture(overlay->hwdata->textureID); + } +} + +int +SDL_DisplayYUVOverlay(SDL_Overlay * overlay, SDL_Rect * dstrect) +{ + if (!overlay || !dstrect) { + SDL_SetError("Passed a NULL overlay or dstrect"); + return -1; + } + if (SDL_RenderCopy(overlay->hwdata->textureID, NULL, dstrect) < 0) { + return -1; + } + SDL_RenderPresent(); + return 0; +} + +void +SDL_FreeYUVOverlay(SDL_Overlay * overlay) +{ + if (!overlay) { + return; + } + if (overlay->hwdata) { + if (overlay->hwdata->textureID) { + SDL_DestroyTexture(overlay->hwdata->textureID); + } + SDL_free(overlay->hwdata); + } + SDL_free(overlay); +} + +void +SDL_GL_SwapBuffers(void) +{ + SDL_GL_SwapWindow(SDL_VideoWindow); +} + + +int +SDL_EnableKeyRepeat(int delay, int interval) +{ + return 0; +} + +void +SDL_GetKeyRepeat(int *delay, int *interval) +{ + if (delay) { + *delay = SDL_DEFAULT_REPEAT_DELAY; + } + if (interval) { + *interval = SDL_DEFAULT_REPEAT_INTERVAL; + } +} + +int +SDL_EnableUNICODE(int enable) +{ + int previous = SDL_enabled_UNICODE; + + switch (enable) { + case 1: + SDL_enabled_UNICODE = 1; + SDL_StartTextInput(); + break; + case 0: + SDL_enabled_UNICODE = 0; + SDL_StopTextInput(); + break; + } + return previous; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/SDL_error.c b/Externals/SDL/src/SDL_error.c new file mode 100644 index 0000000000..9953ac40ef --- /dev/null +++ b/Externals/SDL/src/SDL_error.c @@ -0,0 +1,259 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Simple error handling in SDL */ + +#include "SDL_error.h" +#include "SDL_error_c.h" + +/* Routine to get the thread-specific error variable */ +#if SDL_THREADS_DISABLED +/* !!! FIXME: what does this comment mean? Victim of Search and Replace? */ +/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */ +static SDL_error SDL_global_error; +#define SDL_GetErrBuf() (&SDL_global_error) +#else +extern SDL_error *SDL_GetErrBuf(void); +#endif /* SDL_THREADS_DISABLED */ + +#define SDL_ERRBUFIZE 1024 + +/* Private functions */ + +static const char * +SDL_LookupString(const char *key) +{ + /* FIXME: Add code to lookup key in language string hash-table */ + return key; +} + +/* Public functions */ + +void +SDL_SetError(const char *fmt, ...) +{ + va_list ap; + SDL_error *error; + + /* Copy in the key, mark error as valid */ + error = SDL_GetErrBuf(); + error->error = 1; + SDL_strlcpy((char *) error->key, fmt, sizeof(error->key)); + + va_start(ap, fmt); + error->argc = 0; + while (*fmt) { + if (*fmt++ == '%') { + while (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) { + ++fmt; + } + switch (*fmt++) { + case 0: /* Malformed format string.. */ + --fmt; + break; + case 'c': + case 'i': + case 'd': + case 'u': + case 'o': + case 'x': + case 'X': + error->args[error->argc++].value_i = va_arg(ap, int); + break; + case 'f': + error->args[error->argc++].value_f = va_arg(ap, double); + break; + case 'p': + error->args[error->argc++].value_ptr = va_arg(ap, void *); + break; + case 's': + { + int i = error->argc; + const char *str = va_arg(ap, const char *); + if (str == NULL) + str = "(null)"; + SDL_strlcpy((char *) error->args[i].buf, str, + ERR_MAX_STRLEN); + error->argc++; + } + break; + default: + break; + } + if (error->argc >= ERR_MAX_ARGS) { + break; + } + } + } + va_end(ap); + + /* If we are in debug mode, print out an error message */ +#ifdef DEBUG_ERROR + fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError()); +#endif +} + +/* This function has a bit more overhead than most error functions + so that it supports internationalization and thread-safe errors. +*/ +char * +SDL_GetErrorMsg(char *errstr, unsigned int maxlen) +{ + SDL_error *error; + + /* Clear the error string */ + *errstr = '\0'; + --maxlen; + + /* Get the thread-safe error, and print it out */ + error = SDL_GetErrBuf(); + if (error->error) { + const char *fmt; + char *msg = errstr; + int len; + int argi; + + fmt = SDL_LookupString(error->key); + argi = 0; + while (*fmt && (maxlen > 0)) { + if (*fmt == '%') { + char tmp[32], *spot = tmp; + *spot++ = *fmt++; + while ((*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) + && spot < (tmp + SDL_arraysize(tmp) - 2)) { + *spot++ = *fmt++; + } + *spot++ = *fmt++; + *spot++ = '\0'; + switch (spot[-2]) { + case '%': + *msg++ = '%'; + maxlen -= 1; + break; + case 'c': + case 'i': + case 'd': + case 'u': + case 'o': + case 'x': + case 'X': + len = + SDL_snprintf(msg, maxlen, tmp, + error->args[argi++].value_i); + msg += len; + maxlen -= len; + break; + case 'f': + len = + SDL_snprintf(msg, maxlen, tmp, + error->args[argi++].value_f); + msg += len; + maxlen -= len; + break; + case 'p': + len = + SDL_snprintf(msg, maxlen, tmp, + error->args[argi++].value_ptr); + msg += len; + maxlen -= len; + break; + case 's': + len = + SDL_snprintf(msg, maxlen, tmp, + SDL_LookupString(error->args[argi++]. + buf)); + msg += len; + maxlen -= len; + break; + } + } else { + *msg++ = *fmt++; + maxlen -= 1; + } + } + *msg = 0; /* NULL terminate the string */ + } + return (errstr); +} + +/* Available for backwards compatibility */ +char * +SDL_GetError(void) +{ + static char errmsg[SDL_ERRBUFIZE]; + + return ((char *) SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE)); +} + +void +SDL_ClearError(void) +{ + SDL_error *error; + + error = SDL_GetErrBuf(); + error->error = 0; +} + +/* Very common errors go here */ +void +SDL_Error(SDL_errorcode code) +{ + switch (code) { + case SDL_ENOMEM: + SDL_SetError("Out of memory"); + break; + case SDL_EFREAD: + SDL_SetError("Error reading from datastream"); + break; + case SDL_EFWRITE: + SDL_SetError("Error writing to datastream"); + break; + case SDL_EFSEEK: + SDL_SetError("Error seeking in datastream"); + break; + case SDL_UNSUPPORTED: + SDL_SetError("That operation is not supported"); + break; + default: + SDL_SetError("Unknown SDL error"); + break; + } +} + +#ifdef TEST_ERROR +int +main(int argc, char *argv[]) +{ + char buffer[BUFSIZ + 1]; + + SDL_SetError("Hi there!"); + printf("Error 1: %s\n", SDL_GetError()); + SDL_ClearError(); + SDL_memset(buffer, '1', BUFSIZ); + buffer[BUFSIZ] = 0; + SDL_SetError("This is the error: %s (%f)", buffer, 1.0); + printf("Error 2: %s\n", SDL_GetError()); + exit(0); +} +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/SDL_error_c.h b/Externals/SDL/src/SDL_error_c.h new file mode 100644 index 0000000000..6d16a8e41b --- /dev/null +++ b/Externals/SDL/src/SDL_error_c.h @@ -0,0 +1,61 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* This file defines a structure that carries language-independent + error messages +*/ + +#ifndef _SDL_error_c_h +#define _SDL_error_c_h + +#define ERR_MAX_STRLEN 128 +#define ERR_MAX_ARGS 5 + +typedef struct SDL_error +{ + /* This is a numeric value corresponding to the current error */ + int error; + + /* This is a key used to index into a language hashtable containing + internationalized versions of the SDL error messages. If the key + is not in the hashtable, or no hashtable is available, the key is + used directly as an error message format string. + */ + char key[ERR_MAX_STRLEN]; + + /* These are the arguments for the error functions */ + int argc; + union + { + void *value_ptr; +#if 0 /* What is a character anyway? (UNICODE issues) */ + unsigned char value_c; +#endif + int value_i; + double value_f; + char buf[ERR_MAX_STRLEN]; + } args[ERR_MAX_ARGS]; +} SDL_error; + +#endif /* _SDL_error_c_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/SDL_fatal.c b/Externals/SDL/src/SDL_fatal.c new file mode 100644 index 0000000000..ad30fcbdce --- /dev/null +++ b/Externals/SDL/src/SDL_fatal.c @@ -0,0 +1,140 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* General fatal signal handling code for SDL */ + +#ifdef HAVE_SIGNAL_H + +#include + +#include "SDL_stdinc.h" +#include "SDL_fatal.h" + +/* This installs some signal handlers for the more common fatal signals, + so that if the programmer is lazy, the app doesn't die so horribly if + the program crashes. +*/ + +static void +SDL_Parachute(int sig) +{ + signal(sig, SIG_DFL); + SDL_Quit(); + raise(sig); +} + +static const int SDL_fatal_signals[] = { + SIGSEGV, +#ifdef SIGBUS + SIGBUS, +#endif +#ifdef SIGFPE + SIGFPE, +#endif +#ifdef SIGQUIT + SIGQUIT, +#endif + 0 +}; + +void +SDL_InstallParachute(void) +{ + /* Set a handler for any fatal signal not already handled */ + int i; +#ifdef HAVE_SIGACTION + struct sigaction action; + + for (i = 0; SDL_fatal_signals[i]; ++i) { + sigaction(SDL_fatal_signals[i], NULL, &action); + if (action.sa_handler == SIG_DFL) { + action.sa_handler = SDL_Parachute; + sigaction(SDL_fatal_signals[i], &action, NULL); + } + } +#ifdef SIGALRM + /* Set SIGALRM to be ignored -- necessary on Solaris */ + sigaction(SIGALRM, NULL, &action); + if (action.sa_handler == SIG_DFL) { + action.sa_handler = SIG_IGN; + sigaction(SIGALRM, &action, NULL); + } +#endif +#else + void (*ohandler) (int); + + for (i = 0; SDL_fatal_signals[i]; ++i) { + ohandler = signal(SDL_fatal_signals[i], SDL_Parachute); + if (ohandler != SIG_DFL) { + signal(SDL_fatal_signals[i], ohandler); + } + } +#endif /* HAVE_SIGACTION */ + return; +} + +void +SDL_UninstallParachute(void) +{ + /* Remove a handler for any fatal signal handled */ + int i; +#ifdef HAVE_SIGACTION + struct sigaction action; + + for (i = 0; SDL_fatal_signals[i]; ++i) { + sigaction(SDL_fatal_signals[i], NULL, &action); + if (action.sa_handler == SDL_Parachute) { + action.sa_handler = SIG_DFL; + sigaction(SDL_fatal_signals[i], &action, NULL); + } + } +#else + void (*ohandler) (int); + + for (i = 0; SDL_fatal_signals[i]; ++i) { + ohandler = signal(SDL_fatal_signals[i], SIG_DFL); + if (ohandler != SDL_Parachute) { + signal(SDL_fatal_signals[i], ohandler); + } + } +#endif /* HAVE_SIGACTION */ +} + +#else + +/* No signals on this platform, nothing to do.. */ + +void +SDL_InstallParachute(void) +{ + return; +} + +void +SDL_UninstallParachute(void) +{ + return; +} + +#endif /* HAVE_SIGNAL_H */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/SDL_fatal.h b/Externals/SDL/src/SDL_fatal.h new file mode 100644 index 0000000000..d5b8d326f4 --- /dev/null +++ b/Externals/SDL/src/SDL_fatal.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* General fatal signal handling code for SDL */ + +extern void SDL_InstallParachute(void); +extern void SDL_UninstallParachute(void); +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/atomic/dummy/SDL_atomic.c b/Externals/SDL/src/atomic/dummy/SDL_atomic.c new file mode 100644 index 0000000000..6d37287557 --- /dev/null +++ b/Externals/SDL/src/atomic/dummy/SDL_atomic.c @@ -0,0 +1,469 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + Contributed by Bob Pendleton, bob@pendleton.com +*/ + +#include "SDL_stdinc.h" +#include "SDL_atomic.h" + +#include "SDL_error.h" + +/* + This file provides 32, and 64 bit atomic operations. If the + operations are provided by the native hardware and operating system + they are used. If they are not then the operations are emulated + using the SDL spin lock operations. If spin lock can not be + implemented then these functions must fail. +*/ + +/* + DUMMY VERSION. + + This version of the code assumes there is no support for atomic + operations. Therefore, every function sets the SDL error + message. Oddly enough, if you only have one thread then this + version actuallys works. +*/ + +/* + Native spinlock routines. Because this is the dummy implementation + these will always call SDL_SetError() and do nothing. +*/ + +void +SDL_AtomicLock(SDL_SpinLock *lock) +{ + SDL_SetError("SDL_atomic.c: is not implemented on this platform"); +} + +void +SDL_AtomicUnlock(SDL_SpinLock *lock) +{ + SDL_SetError("SDL_atomic.c: is not implemented on this platform"); +} + +/* + Note that platform specific versions can be built from this version + by changing the #undefs to #defines and adding platform specific + code. +*/ + +#undef nativeTestThenSet32 +#undef nativeClear32 +#undef nativeFetchThenIncrement32 +#undef nativeFetchThenDecrement32 +#undef nativeFetchThenAdd32 +#undef nativeFetchThenSubtract32 +#undef nativeIncrementThenFetch32 +#undef nativeDecrementThenFetch32 +#undef nativeAddThenFetch32 +#undef nativeSubtractThenFetch32 + +#undef nativeTestThenSet64 +#undef nativeClear64 +#undef nativeFetchThenIncrement64 +#undef nativeFetchThenDecrement64 +#undef nativeFetchThenAdd64 +#undef nativeFetchThenSubtract64 +#undef nativeIncrementThenFetch64 +#undef nativeDecrementThenFetch64 +#undef nativeAddThenFetch64 +#undef nativeSubtractThenFetch64 + +/* + If any of the operations are not provided then we must emulate some + of them. That means we need a nice implementation of spin locks + that avoids the "one big lock" problem. We use a vector of spin + locks and pick which one to use based on the address of the operand + of the function. + + To generate the index of the lock we first shift by 3 bits to get + rid on the zero bits that result from 32 and 64 bit allignment of + data. We then mask off all but 5 bits and use those 5 bits as an + index into the table. + + Picking the lock this way insures that accesses to the same data at + the same time will go to the same lock. OTOH, accesses to different + data have only a 1/32 chance of hitting the same lock. That should + pretty much eliminate the chances of several atomic operations on + different data from waiting on the same "big lock". If it isn't + then the table of locks can be expanded to a new size so long as + the new size is a power of two. +*/ + +static SDL_SpinLock locks[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static __inline__ void +privateWaitLock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicLock(&locks[index]); +} + +static __inline__ void +privateUnlock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicUnlock(&locks[index]); +} + +/* 32 bit atomic operations */ + +SDL_bool +SDL_AtomicTestThenSet32(volatile Uint32 * ptr) +{ +#ifdef nativeTestThenSet32 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear32(volatile Uint32 * ptr) +{ +#ifdef nativeClear32 +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint32 +SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenIncrement32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenDecrement32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenAdd32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenSubtract32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeIncrementThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeDecrementThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeAddThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeSubtractThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +/* 64 bit atomic operations */ +#ifdef SDL_HAS_64BIT_TYPE + +SDL_bool +SDL_AtomicTestThenSet64(volatile Uint64 * ptr) +{ +#ifdef nativeTestThenSet64 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear64(volatile Uint64 * ptr) +{ +#ifdef nativeClear64 +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint64 +SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenIncrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenDecrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenAdd64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenSubtract64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeIncrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeDecrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeAddThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeSubtractThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} +#endif + diff --git a/Externals/SDL/src/atomic/linux/SDL_atomic.c b/Externals/SDL/src/atomic/linux/SDL_atomic.c new file mode 100644 index 0000000000..b2d75361f6 --- /dev/null +++ b/Externals/SDL/src/atomic/linux/SDL_atomic.c @@ -0,0 +1,510 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + Contributed by Bob Pendleton, bob@pendleton.com +*/ + +#include "SDL_stdinc.h" +#include "SDL_atomic.h" + +#include "SDL_error.h" + +/* + This file provides 32, and 64 bit atomic operations. If the + operations are provided by the native hardware and operating system + they are used. If they are not then the operations are emulated + using the SDL spin lock operations. If spin lock can not be + implemented then these functions must fail. +*/ + +/* + LINUX/GCC VERSION. + + This version of the code assumes support of the atomic builtins as + documented at gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html This + code should work on any modern x86 or other processor supported by + GCC. + + Some processors will only support some of these operations so + #ifdefs will have to be added as incompatibilities are discovered +*/ + +/* + Native spinlock routines. +*/ + +void +SDL_AtomicLock(SDL_SpinLock *lock) +{ + while (0 != __sync_lock_test_and_set(lock, 1)) + { + } +} + +void +SDL_AtomicUnlock(SDL_SpinLock *lock) +{ + __sync_lock_test_and_set(lock, 0); +} + +/* + Note that platform specific versions can be built from this version + by changing the #undefs to #defines and adding platform specific + code. +*/ + +#define nativeTestThenSet32 +#define nativeClear32 +#define nativeFetchThenIncrement32 +#define nativeFetchThenDecrement32 +#define nativeFetchThenAdd32 +#define nativeFetchThenSubtract32 +#define nativeIncrementThenFetch32 +#define nativeDecrementThenFetch32 +#define nativeAddThenFetch32 +#define nativeSubtractThenFetch32 + +#ifdef SDL_HAS_64BIT_TYPE + #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 + #define nativeTestThenSet64 + #define nativeClear64 + #define nativeFetchThenIncrement64 + #define nativeFetchThenDecrement64 + #define nativeFetchThenAdd64 + #define nativeFetchThenSubtract64 + #define nativeIncrementThenFetch64 + #define nativeDecrementThenFetch64 + #define nativeAddThenFetch64 + #define nativeSubtractThenFetch64 + #else + #undef nativeTestThenSet64 + #undef nativeClear64 + #undef nativeFetchThenIncrement64 + #undef nativeFetchThenDecrement64 + #undef nativeFetchThenAdd64 + #undef nativeFetchThenSubtract64 + #undef nativeIncrementThenFetch64 + #undef nativeDecrementThenFetch64 + #undef nativeAddThenFetch64 + #undef nativeSubtractThenFetch64 + #endif /* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 */ +#endif /* SDL_HAS_64BIT_TYPE */ + +/* + If any of the operations are not provided then we must emulate some + of them. That means we need a nice implementation of spin locks + that avoids the "one big lock" problem. We use a vector of spin + locks and pick which one to use based on the address of the operand + of the function. + + To generate the index of the lock we first shift by 3 bits to get + rid on the zero bits that result from 32 and 64 bit allignment of + data. We then mask off all but 5 bits and use those 5 bits as an + index into the table. + + Picking the lock this way insures that accesses to the same data at + the same time will go to the same lock. OTOH, accesses to different + data have only a 1/32 chance of hitting the same lock. That should + pretty much eliminate the chances of several atomic operations on + different data from waiting on the same "big lock". If it isn't + then the table of locks can be expanded to a new size so long as + the new size is a power of two. +*/ + +static SDL_SpinLock locks[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static __inline__ void +privateWaitLock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicLock(&locks[index]); +} + +static __inline__ void +privateUnlock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicUnlock(&locks[index]); +} + +/* 32 bit atomic operations */ + +SDL_bool +SDL_AtomicTestThenSet32(volatile Uint32 * ptr) +{ +#ifdef nativeTestThenSet32 + return 0 == __sync_lock_test_and_set(ptr, 1); +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear32(volatile Uint32 * ptr) +{ +#ifdef nativeClear32 + __sync_lock_test_and_set(ptr, 0); + return; +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint32 +SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenIncrement32 + return __sync_fetch_and_add(ptr, 1); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenDecrement32 + return __sync_fetch_and_sub(ptr, 1); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenAdd32 + return __sync_fetch_and_add(ptr, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenSubtract32 + return __sync_fetch_and_sub(ptr, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeIncrementThenFetch32 + return __sync_add_and_fetch(ptr, 1); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeDecrementThenFetch32 + return __sync_sub_and_fetch(ptr, 1); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeAddThenFetch32 + return __sync_add_and_fetch(ptr, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeSubtractThenFetch32 + return __sync_sub_and_fetch(ptr, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +/* 64 bit atomic operations */ +#ifdef SDL_HAS_64BIT_TYPE + +SDL_bool +SDL_AtomicTestThenSet64(volatile Uint64 * ptr) +{ +#ifdef nativeTestThenSet64 + return 0 == __sync_lock_test_and_set(ptr, 1); +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear64(volatile Uint64 * ptr) +{ +#ifdef nativeClear64 + __sync_lock_test_and_set(ptr, 0); + return; +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint64 +SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenIncrement64 + return __sync_fetch_and_add(ptr, 1); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenDecrement64 + return __sync_fetch_and_sub(ptr, 1); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenAdd64 + return __sync_fetch_and_add(ptr, value); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenSubtract64 + return __sync_fetch_and_sub(ptr, value); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeIncrementThenFetch64 + return __sync_add_and_fetch(ptr, 1); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeDecrementThenFetch64 + return __sync_sub_and_fetch(ptr, 1); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeAddThenFetch64 + return __sync_add_and_fetch(ptr, value); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeSubtractThenFetch64 + return __sync_sub_and_fetch(ptr, value); +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +#endif /* SDL_HAS_64BIT_TYPE */ diff --git a/Externals/SDL/src/atomic/macosx/SDL_atomic.c b/Externals/SDL/src/atomic/macosx/SDL_atomic.c new file mode 100644 index 0000000000..6d37287557 --- /dev/null +++ b/Externals/SDL/src/atomic/macosx/SDL_atomic.c @@ -0,0 +1,469 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + Contributed by Bob Pendleton, bob@pendleton.com +*/ + +#include "SDL_stdinc.h" +#include "SDL_atomic.h" + +#include "SDL_error.h" + +/* + This file provides 32, and 64 bit atomic operations. If the + operations are provided by the native hardware and operating system + they are used. If they are not then the operations are emulated + using the SDL spin lock operations. If spin lock can not be + implemented then these functions must fail. +*/ + +/* + DUMMY VERSION. + + This version of the code assumes there is no support for atomic + operations. Therefore, every function sets the SDL error + message. Oddly enough, if you only have one thread then this + version actuallys works. +*/ + +/* + Native spinlock routines. Because this is the dummy implementation + these will always call SDL_SetError() and do nothing. +*/ + +void +SDL_AtomicLock(SDL_SpinLock *lock) +{ + SDL_SetError("SDL_atomic.c: is not implemented on this platform"); +} + +void +SDL_AtomicUnlock(SDL_SpinLock *lock) +{ + SDL_SetError("SDL_atomic.c: is not implemented on this platform"); +} + +/* + Note that platform specific versions can be built from this version + by changing the #undefs to #defines and adding platform specific + code. +*/ + +#undef nativeTestThenSet32 +#undef nativeClear32 +#undef nativeFetchThenIncrement32 +#undef nativeFetchThenDecrement32 +#undef nativeFetchThenAdd32 +#undef nativeFetchThenSubtract32 +#undef nativeIncrementThenFetch32 +#undef nativeDecrementThenFetch32 +#undef nativeAddThenFetch32 +#undef nativeSubtractThenFetch32 + +#undef nativeTestThenSet64 +#undef nativeClear64 +#undef nativeFetchThenIncrement64 +#undef nativeFetchThenDecrement64 +#undef nativeFetchThenAdd64 +#undef nativeFetchThenSubtract64 +#undef nativeIncrementThenFetch64 +#undef nativeDecrementThenFetch64 +#undef nativeAddThenFetch64 +#undef nativeSubtractThenFetch64 + +/* + If any of the operations are not provided then we must emulate some + of them. That means we need a nice implementation of spin locks + that avoids the "one big lock" problem. We use a vector of spin + locks and pick which one to use based on the address of the operand + of the function. + + To generate the index of the lock we first shift by 3 bits to get + rid on the zero bits that result from 32 and 64 bit allignment of + data. We then mask off all but 5 bits and use those 5 bits as an + index into the table. + + Picking the lock this way insures that accesses to the same data at + the same time will go to the same lock. OTOH, accesses to different + data have only a 1/32 chance of hitting the same lock. That should + pretty much eliminate the chances of several atomic operations on + different data from waiting on the same "big lock". If it isn't + then the table of locks can be expanded to a new size so long as + the new size is a power of two. +*/ + +static SDL_SpinLock locks[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static __inline__ void +privateWaitLock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicLock(&locks[index]); +} + +static __inline__ void +privateUnlock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicUnlock(&locks[index]); +} + +/* 32 bit atomic operations */ + +SDL_bool +SDL_AtomicTestThenSet32(volatile Uint32 * ptr) +{ +#ifdef nativeTestThenSet32 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear32(volatile Uint32 * ptr) +{ +#ifdef nativeClear32 +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint32 +SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenIncrement32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenDecrement32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenAdd32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenSubtract32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeIncrementThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeDecrementThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeAddThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeSubtractThenFetch32 +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +/* 64 bit atomic operations */ +#ifdef SDL_HAS_64BIT_TYPE + +SDL_bool +SDL_AtomicTestThenSet64(volatile Uint64 * ptr) +{ +#ifdef nativeTestThenSet64 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear64(volatile Uint64 * ptr) +{ +#ifdef nativeClear64 +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint64 +SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenIncrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenDecrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenAdd64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenSubtract64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeIncrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeDecrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeAddThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeSubtractThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} +#endif + diff --git a/Externals/SDL/src/atomic/qnx/SDL_atomic.c b/Externals/SDL/src/atomic/qnx/SDL_atomic.c new file mode 100644 index 0000000000..c39f15ac62 --- /dev/null +++ b/Externals/SDL/src/atomic/qnx/SDL_atomic.c @@ -0,0 +1,505 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + QNX native atomic operations + Copyright (C) 2009 Mike Gorchak + (mike@malva.ua, lestat@i.com.ua) +*/ + +#include "SDL_stdinc.h" +#include "SDL_atomic.h" +#include "SDL_error.h" + +#include + +/* SMP Exchange for PPC platform */ +#ifdef __PPC__ +#include +#endif /* __PPC__ */ + +/* SMP Exchange for ARM platform */ +#ifdef __ARM__ +#include +#endif /* __ARM__ */ + +/* SMP Exchange for MIPS platform */ +#if defined (__MIPSEB__) || defined(__MIPSEL__) +#include +#endif /* __MIPSEB__ || __MIPSEL__ */ + +/* SMP Exchange for SH platform */ +#ifdef __SH__ +#include +#endif /* __SH__ */ + +/* SMP Exchange for x86 platform */ +#ifdef __X86__ +#include +#endif /* __X86__ */ + +/* + This file provides 32, and 64 bit atomic operations. If the + operations are provided by the native hardware and operating system + they are used. If they are not then the operations are emulated + using the SDL spin lock operations. If spin lock can not be + implemented then these functions must fail. +*/ + +void +SDL_AtomicLock(SDL_SpinLock *lock) +{ + unsigned volatile* l = (unsigned volatile*)lock; + Uint32 oldval = 0; + Uint32 newval = 1; + + oldval = _smp_xchg(l, newval); + while(1 == oldval) + { + oldval = _smp_xchg(l, newval); + } +} + +void +SDL_AtomicUnlock(SDL_SpinLock *lock) +{ + unsigned volatile* l = (unsigned volatile*)lock; + Uint32 newval = 0; + + _smp_xchg(l, newval); +} + +/* + QNX 6.4.1 supports only 32 bit atomic access +*/ + +#undef nativeTestThenSet32 +#define nativeClear32 +#define nativeFetchThenIncrement32 +#define nativeFetchThenDecrement32 +#define nativeFetchThenAdd32 +#define nativeFetchThenSubtract32 +#define nativeIncrementThenFetch32 +#define nativeDecrementThenFetch32 +#define nativeAddThenFetch32 +#define nativeSubtractThenFetch32 + +#undef nativeTestThenSet64 +#undef nativeClear64 +#undef nativeFetchThenIncrement64 +#undef nativeFetchThenDecrement64 +#undef nativeFetchThenAdd64 +#undef nativeFetchThenSubtract64 +#undef nativeIncrementThenFetch64 +#undef nativeDecrementThenFetch64 +#undef nativeAddThenFetch64 +#undef nativeSubtractThenFetch64 + +/* + If any of the operations are not provided then we must emulate some + of them. That means we need a nice implementation of spin locks + that avoids the "one big lock" problem. We use a vector of spin + locks and pick which one to use based on the address of the operand + of the function. + + To generate the index of the lock we first shift by 3 bits to get + rid on the zero bits that result from 32 and 64 bit allignment of + data. We then mask off all but 5 bits and use those 5 bits as an + index into the table. + + Picking the lock this way insures that accesses to the same data at + the same time will go to the same lock. OTOH, accesses to different + data have only a 1/32 chance of hitting the same lock. That should + pretty much eliminate the chances of several atomic operations on + different data from waiting on the same "big lock". If it isn't + then the table of locks can be expanded to a new size so long as + the new size is a power of two. +*/ + +static SDL_SpinLock locks[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static __inline__ void +privateWaitLock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif /* SIZEOF_VOIDP */ + + SDL_AtomicLock(&locks[index]); +} + +static __inline__ void +privateUnlock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif /* SIZEOF_VOIDP */ + + SDL_AtomicUnlock(&locks[index]); +} + +/* 32 bit atomic operations */ + +SDL_bool +SDL_AtomicTestThenSet32(volatile Uint32 * ptr) +{ +#ifdef nativeTestThenSet32 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif /* nativeTestThenSet32 */ +} + +void +SDL_AtomicClear32(volatile Uint32 * ptr) +{ +#ifdef nativeClear32 + atomic_clr(ptr, 0xFFFFFFFF); +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif /* nativeClear32 */ +} + +Uint32 +SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenIncrement32 + return atomic_add_value(ptr, 0x00000001); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenIncrement32 */ +} + +Uint32 +SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenDecrement32 + return atomic_sub_value(ptr, 0x00000001); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenDecrement32 */ +} + +Uint32 +SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenAdd32 + return atomic_add_value(ptr, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenAdd32 */ +} + +Uint32 +SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenSubtract32 + return atomic_sub_value(ptr, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenSubtract32 */ +} + +Uint32 +SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeIncrementThenFetch32 + atomic_add(ptr, 0x00000001); + return atomic_add_value(ptr, 0x00000000); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeIncrementThenFetch32 */ +} + +Uint32 +SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeDecrementThenFetch32 + atomic_sub(ptr, 0x00000001); + return atomic_sub_value(ptr, 0x00000000); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeDecrementThenFetch32 */ +} + +Uint32 +SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeAddThenFetch32 + atomic_add(ptr, value); + return atomic_add_value(ptr, 0x00000000); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeAddThenFetch32 */ +} + +Uint32 +SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeSubtractThenFetch32 + atomic_sub(ptr, value); + return atomic_sub_value(ptr, 0x00000000); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeSubtractThenFetch32 */ +} + +/* 64 bit atomic operations */ +#ifdef SDL_HAS_64BIT_TYPE + +SDL_bool +SDL_AtomicTestThenSet64(volatile Uint64 * ptr) +{ +#ifdef nativeTestThenSet64 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif /* nativeTestThenSet64 */ +} + +void +SDL_AtomicClear64(volatile Uint64 * ptr) +{ +#ifdef nativeClear64 +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif /* nativeClear64 */ +} + +Uint64 +SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenIncrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenIncrement64 */ +} + +Uint64 +SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenDecrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenDecrement64 */ +} + +Uint64 +SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenAdd64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenAdd64 */ +} + +Uint64 +SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenSubtract64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif /* nativeFetchThenSubtract64 */ +} + +Uint64 +SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeIncrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeIncrementThenFetch64 */ +} + +Uint64 +SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeDecrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeDecrementThenFetch64 */ +} + +Uint64 +SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeAddThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeAddThenFetch64 */ +} + +Uint64 +SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeSubtractThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif /* nativeSubtractThenFetch64 */ +} + +#endif /* SDL_HAS_64BIT_TYPE */ diff --git a/Externals/SDL/src/atomic/win32/SDL_atomic.c b/Externals/SDL/src/atomic/win32/SDL_atomic.c new file mode 100644 index 0000000000..eda237728a --- /dev/null +++ b/Externals/SDL/src/atomic/win32/SDL_atomic.c @@ -0,0 +1,510 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + Contributed by Bob Pendleton, bob@pendleton.com +*/ + +#include "SDL_stdinc.h" +#include "SDL_atomic.h" + +#include "SDL_error.h" +#include "Windows.h" + +/* + This file provides 32, and 64 bit atomic operations. If the + operations are provided by the native hardware and operating system + they are used. If they are not then the operations are emulated + using the SDL spin lock operations. If spin lock can not be + implemented then these functions must fail. +*/ + +/* + WIN32 VERSION. + + This makes use of native Windows atomic operations. +*/ + +/* + Native spinlock routines. Because this is the dummy implementation + these will always call SDL_SetError() and do nothing. +*/ + +void +SDL_AtomicLock(SDL_SpinLock *lock) +{ + long volatile * l = (long volatile *)lock; + Uint32 old = 0; + Uint32 new = 1; + + old = InterlockedExchange(l, new); + while(1 == old) + { + old = InterlockedExchange(l, new); + } +} + +void +SDL_AtomicUnlock(SDL_SpinLock *lock) +{ + long volatile * l = (long volatile *)lock; + Uint32 new = 0; + + InterlockedExchange(l, new); +} + +/* + Note that platform specific versions can be built from this version + by changing the #undefs to #defines and adding platform specific + code. +*/ + +#define nativeTestThenSet32 +#define nativeClear32 +#define nativeFetchThenIncrement32 +#define nativeFetchThenDecrement32 +#define nativeFetchThenAdd32 +#define nativeFetchThenSubtract32 +#define nativeIncrementThenFetch32 +#define nativeDecrementThenFetch32 +#define nativeAddThenFetch32 +#define nativeSubtractThenFetch32 + +#undef nativeTestThenSet64 +#undef nativeClear64 +#undef nativeFetchThenIncrement64 +#undef nativeFetchThenDecrement64 +#undef nativeFetchThenAdd64 +#undef nativeFetchThenSubtract64 +#undef nativeIncrementThenFetch64 +#undef nativeDecrementThenFetch64 +#undef nativeAddThenFetch64 +#undef nativeSubtractThenFetch64 + +/* + If any of the operations are not provided then we must emulate some + of them. That means we need a nice implementation of spin locks + that avoids the "one big lock" problem. We use a vector of spin + locks and pick which one to use based on the address of the operand + of the function. + + To generate the index of the lock we first shift by 3 bits to get + rid on the zero bits that result from 32 and 64 bit allignment of + data. We then mask off all but 5 bits and use those 5 bits as an + index into the table. + + Picking the lock this way insures that accesses to the same data at + the same time will go to the same lock. OTOH, accesses to different + data have only a 1/32 chance of hitting the same lock. That should + pretty much eliminate the chances of several atomic operations on + different data from waiting on the same "big lock". If it isn't + then the table of locks can be expanded to a new size so long as + the new size is a power of two. +*/ + +static SDL_SpinLock locks[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static __inline__ void +privateWaitLock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicLock(&locks[index]); +} + +static __inline__ void +privateUnlock(volatile void *ptr) +{ +#if SIZEOF_VOIDP == 4 + Uint32 index = ((((Uint32)ptr) >> 3) & 0x1f); +#elif SIZEOF_VOIDP == 8 + Uint64 index = ((((Uint64)ptr) >> 3) & 0x1f); +#endif + + SDL_AtomicUnlock(&locks[index]); +} + +/* 32 bit atomic operations */ + +SDL_bool +SDL_AtomicTestThenSet32(volatile Uint32 * ptr) +{ +#ifdef nativeTestThenSet32 + long volatile * p = (long volatile *)ptr; + Uint32 new = 1; + + return 0 == InterlockedExchange(p, new); +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear32(volatile Uint32 * ptr) +{ +#ifdef nativeClear32 + long volatile * p = (long volatile *)ptr; + Uint32 new = 0; + + InterlockedExchange(p, new); +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint32 +SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenIncrement32 + long volatile * p = (long volatile *)ptr; + + return InterlockedExchangeAdd(p, 1); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr) +{ +#ifdef nativeFetchThenDecrement32 + long volatile * p = (long volatile *)ptr; + + return InterlockedExchangeAdd(p, -1); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenAdd32 + long volatile * p = (long volatile *)ptr; + + return InterlockedExchangeAdd(p, value); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeFetchThenSubtract32 + long volatile * p = (long volatile *)ptr; + + return InterlockedExchangeAdd(p, (0 - value)); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeIncrementThenFetch32 + long volatile * p = (LONG volatile *)ptr; + + return InterlockedIncrement(p); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr) +{ +#ifdef nativeDecrementThenFetch32 + long volatile * p = (LONG volatile *)ptr; + + return InterlockedDecrement(p); +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeAddThenFetch32 + long volatile * p = (long volatile *)ptr; + + return InterlockedExchangeAdd(p, value) + value; +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint32 +SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value) +{ +#ifdef nativeSubtractThenFetch32 + long volatile * p = (long volatile *)ptr; + + return InterlockedExchangeAdd(p, (0 - value)) - value; +#else + Uint32 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +/* 64 bit atomic operations */ +#ifdef SDL_HAS_64BIT_TYPE + +SDL_bool +SDL_AtomicTestThenSet64(volatile Uint64 * ptr) +{ +#ifdef nativeTestThenSet64 +#else + SDL_bool result = SDL_FALSE; + + privateWaitLock(ptr); + result = (*ptr == 0); + if (result) + { + *ptr = 1; + } + privateUnlock(ptr); + + return result; +#endif +} + +void +SDL_AtomicClear64(volatile Uint64 * ptr) +{ +#ifdef nativeClear64 +#else + privateWaitLock(ptr); + *ptr = 0; + privateUnlock(ptr); + + return; +#endif +} + +Uint64 +SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenIncrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr) +{ +#ifdef nativeFetchThenDecrement64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr) -= 1; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenAdd64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)+= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeFetchThenSubtract64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + tmp = *ptr; + (*ptr)-= value; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeIncrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr) +{ +#ifdef nativeDecrementThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= 1; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeAddThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)+= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} + +Uint64 +SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value) +{ +#ifdef nativeSubtractThenFetch64 +#else + Uint64 tmp = 0; + + privateWaitLock(ptr); + (*ptr)-= value; + tmp = *ptr; + privateUnlock(ptr); + + return tmp; +#endif +} +#endif + diff --git a/Externals/SDL/src/audio/SDL_audio.c b/Externals/SDL/src/audio/SDL_audio.c new file mode 100644 index 0000000000..ded87969ec --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audio.c @@ -0,0 +1,1230 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#include "SDL.h" +#include "SDL_audio.h" +#include "SDL_audio_c.h" +#include "SDL_audiomem.h" +#include "SDL_sysaudio.h" + +#define _THIS SDL_AudioDevice *this + +static SDL_AudioDriver current_audio; +static SDL_AudioDevice *open_devices[16]; + +/* !!! FIXME: These are wordy and unlocalized... */ +#define DEFAULT_OUTPUT_DEVNAME "System audio output device" +#define DEFAULT_INPUT_DEVNAME "System audio capture device" + + +/* + * Not all of these will be compiled and linked in, but it's convenient + * to have a complete list here and saves yet-another block of #ifdefs... + * Please see bootstrap[], below, for the actual #ifdef mess. + */ +extern AudioBootStrap BSD_AUDIO_bootstrap; +extern AudioBootStrap DSP_bootstrap; +extern AudioBootStrap DMA_bootstrap; +extern AudioBootStrap ALSA_bootstrap; +extern AudioBootStrap PULSEAUDIO_bootstrap; +extern AudioBootStrap QSAAUDIO_bootstrap; +extern AudioBootStrap SUNAUDIO_bootstrap; +extern AudioBootStrap DMEDIA_bootstrap; +extern AudioBootStrap ARTS_bootstrap; +extern AudioBootStrap ESD_bootstrap; +extern AudioBootStrap NAS_bootstrap; +extern AudioBootStrap DSOUND_bootstrap; +extern AudioBootStrap WINWAVEOUT_bootstrap; +extern AudioBootStrap PAUDIO_bootstrap; +extern AudioBootStrap BEOSAUDIO_bootstrap; +extern AudioBootStrap COREAUDIO_bootstrap; +extern AudioBootStrap COREAUDIOIPHONE_bootstrap; +extern AudioBootStrap SNDMGR_bootstrap; +extern AudioBootStrap DISKAUD_bootstrap; +extern AudioBootStrap DUMMYAUD_bootstrap; +extern AudioBootStrap DCAUD_bootstrap; +extern AudioBootStrap MMEAUDIO_bootstrap; +extern AudioBootStrap DART_bootstrap; +extern AudioBootStrap NDSAUD_bootstrap; +extern AudioBootStrap FUSIONSOUND_bootstrap; + + +/* Available audio drivers */ +static const AudioBootStrap *const bootstrap[] = { +#if SDL_AUDIO_DRIVER_BSD + &BSD_AUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_PULSEAUDIO + &PULSEAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_ALSA + &ALSA_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_OSS + &DSP_bootstrap, + &DMA_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_QSA + &QSAAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_SUNAUDIO + &SUNAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_DMEDIA + &DMEDIA_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_ARTS + &ARTS_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_ESD + &ESD_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_NAS + &NAS_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_DSOUND + &DSOUND_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_WINWAVEOUT + &WINWAVEOUT_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_PAUDIO + &PAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_BEOSAUDIO + &BEOSAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_COREAUDIO + &COREAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_COREAUDIOIPHONE + &COREAUDIOIPHONE_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_DISK + &DISKAUD_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_DUMMY + &DUMMYAUD_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_MMEAUDIO + &MMEAUDIO_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_NDS + &NDSAUD_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_FUSIONSOUND + &FUSIONSOUND_bootstrap, +#endif + NULL +}; + +static SDL_AudioDevice * +get_audio_device(SDL_AudioDeviceID id) +{ + id--; + if ((id >= SDL_arraysize(open_devices)) || (open_devices[id] == NULL)) { + SDL_SetError("Invalid audio device ID"); + return NULL; + } + + return open_devices[id]; +} + + +/* stubs for audio drivers that don't need a specific entry point... */ +static int +SDL_AudioDetectDevices_Default(int iscapture) +{ + return -1; +} + +static void +SDL_AudioThreadInit_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioWaitDevice_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioPlayDevice_Default(_THIS) +{ /* no-op. */ +} + +static Uint8 * +SDL_AudioGetDeviceBuf_Default(_THIS) +{ + return NULL; +} + +static void +SDL_AudioWaitDone_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioCloseDevice_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioDeinitialize_Default(void) +{ /* no-op. */ +} + +static int +SDL_AudioOpenDevice_Default(_THIS, const char *devname, int iscapture) +{ + return 0; +} + +static const char * +SDL_AudioGetDeviceName_Default(int index, int iscapture) +{ + SDL_SetError("No such device"); + return NULL; +} + +static void +SDL_AudioLockDevice_Default(SDL_AudioDevice * device) +{ + if (device->thread && (SDL_ThreadID() == device->threadid)) { + return; + } + SDL_mutexP(device->mixer_lock); +} + +static void +SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device) +{ + if (device->thread && (SDL_ThreadID() == device->threadid)) { + return; + } + SDL_mutexV(device->mixer_lock); +} + + +static void +finalize_audio_entry_points(void) +{ + /* + * Fill in stub functions for unused driver entry points. This lets us + * blindly call them without having to check for validity first. + */ + +#define FILL_STUB(x) \ + if (current_audio.impl.x == NULL) { \ + current_audio.impl.x = SDL_Audio##x##_Default; \ + } + FILL_STUB(DetectDevices); + FILL_STUB(GetDeviceName); + FILL_STUB(OpenDevice); + FILL_STUB(ThreadInit); + FILL_STUB(WaitDevice); + FILL_STUB(PlayDevice); + FILL_STUB(GetDeviceBuf); + FILL_STUB(WaitDone); + FILL_STUB(CloseDevice); + FILL_STUB(LockDevice); + FILL_STUB(UnlockDevice); + FILL_STUB(Deinitialize); +#undef FILL_STUB +} + +/* Streaming functions (for when the input and output buffer sizes are different) */ +/* Write [length] bytes from buf into the streamer */ +void +SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length) +{ + int i; + + for (i = 0; i < length; ++i) { + stream->buffer[stream->write_pos] = buf[i]; + ++stream->write_pos; + } +} + +/* Read [length] bytes out of the streamer into buf */ +void +SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length) +{ + int i; + + for (i = 0; i < length; ++i) { + buf[i] = stream->buffer[stream->read_pos]; + ++stream->read_pos; + } +} + +int +SDL_StreamLength(SDL_AudioStreamer * stream) +{ + return (stream->write_pos - stream->read_pos) % stream->max_len; +} + +/* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */ +int +SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence) +{ + /* First try to allocate the buffer */ + stream->buffer = (Uint8 *) SDL_malloc(max_len); + if (stream->buffer == NULL) { + return -1; + } + + stream->max_len = max_len; + stream->read_pos = 0; + stream->write_pos = 0; + + /* Zero out the buffer */ + SDL_memset(stream->buffer, silence, max_len); + + return 0; +} + +/* Deinitialize the stream simply by freeing the buffer */ +void +SDL_StreamDeinit(SDL_AudioStreamer * stream) +{ + if (stream->buffer != NULL) { + SDL_free(stream->buffer); + } +} + + +/* The general mixing thread function */ +int SDLCALL +SDL_RunAudio(void *devicep) +{ + SDL_AudioDevice *device = (SDL_AudioDevice *) devicep; + Uint8 *stream; + int stream_len; + void *udata; + void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len); + int silence; + Uint32 delay; + + /* For streaming when the buffer sizes don't match up */ + Uint8 *istream; + int istream_len; + + /* Perform any thread setup */ + device->threadid = SDL_ThreadID(); + current_audio.impl.ThreadInit(device); + + /* Set up the mixing function */ + fill = device->spec.callback; + udata = device->spec.userdata; + + /* By default do not stream */ + device->use_streamer = 0; + + if (device->convert.needed) { + if (device->convert.src_format == AUDIO_U8) { + silence = 0x80; + } else { + silence = 0; + } + +#if 0 /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */ + /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */ + if (device->convert.len_mult != 1 || device->convert.len_div != 1) { + /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */ + stream_max_len = 2 * device->spec.size; + if (device->convert.len_mult > device->convert.len_div) { + stream_max_len *= device->convert.len_mult; + stream_max_len /= device->convert.len_div; + } + if (SDL_StreamInit(&device->streamer, stream_max_len, silence) < + 0) + return -1; + device->use_streamer = 1; + + /* istream_len should be the length of what we grab from the callback and feed to conversion, + so that we get close to spec_size. I.e. we want device.spec_size = istream_len * u / d + */ + istream_len = + device->spec.size * device->convert.len_div / + device->convert.len_mult; + } +#endif + + /* stream_len = device->convert.len; */ + stream_len = device->spec.size; + } else { + silence = device->spec.silence; + stream_len = device->spec.size; + } + + /* Calculate the delay while paused */ + delay = ((device->spec.samples * 1000) / device->spec.freq); + + /* Determine if the streamer is necessary here */ + if (device->use_streamer == 1) { + /* This code is almost the same as the old code. The difference is, instead of reading + directly from the callback into "stream", then converting and sending the audio off, + we go: callback -> "istream" -> (conversion) -> streamer -> stream -> device. + However, reading and writing with streamer are done separately: + - We only call the callback and write to the streamer when the streamer does not + contain enough samples to output to the device. + - We only read from the streamer and tell the device to play when the streamer + does have enough samples to output. + This allows us to perform resampling in the conversion step, where the output of the + resampling process can be any number. We will have to see what a good size for the + stream's maximum length is, but I suspect 2*max(len_cvt, stream_len) is a good figure. + */ + while (device->enabled) { + + if (device->paused) { + SDL_Delay(delay); + continue; + } + + /* Only read in audio if the streamer doesn't have enough already (if it does not have enough samples to output) */ + if (SDL_StreamLength(&device->streamer) < stream_len) { + /* Set up istream */ + if (device->convert.needed) { + if (device->convert.buf) { + istream = device->convert.buf; + } else { + continue; + } + } else { +/* FIXME: Ryan, this is probably wrong. I imagine we don't want to get + * a device buffer both here and below in the stream output. + */ + istream = current_audio.impl.GetDeviceBuf(device); + if (istream == NULL) { + istream = device->fake_stream; + } + } + + /* Read from the callback into the _input_ stream */ + SDL_mutexP(device->mixer_lock); + (*fill) (udata, istream, istream_len); + SDL_mutexV(device->mixer_lock); + + /* Convert the audio if necessary and write to the streamer */ + if (device->convert.needed) { + SDL_ConvertAudio(&device->convert); + if (istream == NULL) { + istream = device->fake_stream; + } + /*SDL_memcpy(istream, device->convert.buf, device->convert.len_cvt); */ + SDL_StreamWrite(&device->streamer, device->convert.buf, + device->convert.len_cvt); + } else { + SDL_StreamWrite(&device->streamer, istream, istream_len); + } + } + + /* Only output audio if the streamer has enough to output */ + if (SDL_StreamLength(&device->streamer) >= stream_len) { + /* Set up the output stream */ + if (device->convert.needed) { + if (device->convert.buf) { + stream = device->convert.buf; + } else { + continue; + } + } else { + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; + } + } + + /* Now read from the streamer */ + SDL_StreamRead(&device->streamer, stream, stream_len); + + /* Ready current buffer for play and change current buffer */ + if (stream != device->fake_stream) { + current_audio.impl.PlayDevice(device); + /* Wait for an audio buffer to become available */ + current_audio.impl.WaitDevice(device); + } else { + SDL_Delay(delay); + } + } + + } + } else { + /* Otherwise, do not use the streamer. This is the old code. */ + + /* Loop, filling the audio buffers */ + while (device->enabled) { + + if (device->paused) { + SDL_Delay(delay); + continue; + } + + /* Fill the current buffer with sound */ + if (device->convert.needed) { + if (device->convert.buf) { + stream = device->convert.buf; + } else { + continue; + } + } else { + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; + } + } + + SDL_mutexP(device->mixer_lock); + (*fill) (udata, stream, stream_len); + SDL_mutexV(device->mixer_lock); + + /* Convert the audio if necessary */ + if (device->convert.needed) { + SDL_ConvertAudio(&device->convert); + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; + } + SDL_memcpy(stream, device->convert.buf, + device->convert.len_cvt); + } + + /* Ready current buffer for play and change current buffer */ + if (stream != device->fake_stream) { + current_audio.impl.PlayDevice(device); + /* Wait for an audio buffer to become available */ + current_audio.impl.WaitDevice(device); + } else { + SDL_Delay(delay); + } + } + } + + /* Wait for the audio to drain.. */ + current_audio.impl.WaitDone(device); + + /* If necessary, deinit the streamer */ + if (device->use_streamer == 1) + SDL_StreamDeinit(&device->streamer); + + return (0); +} + + +static SDL_AudioFormat +SDL_ParseAudioFormat(const char *string) +{ +#define CHECK_FMT_STRING(x) if (SDL_strcmp(string, #x) == 0) return AUDIO_##x + CHECK_FMT_STRING(U8); + CHECK_FMT_STRING(S8); + CHECK_FMT_STRING(U16LSB); + CHECK_FMT_STRING(S16LSB); + CHECK_FMT_STRING(U16MSB); + CHECK_FMT_STRING(S16MSB); + CHECK_FMT_STRING(U16SYS); + CHECK_FMT_STRING(S16SYS); + CHECK_FMT_STRING(U16); + CHECK_FMT_STRING(S16); + CHECK_FMT_STRING(S32LSB); + CHECK_FMT_STRING(S32MSB); + CHECK_FMT_STRING(S32SYS); + CHECK_FMT_STRING(S32); + CHECK_FMT_STRING(F32LSB); + CHECK_FMT_STRING(F32MSB); + CHECK_FMT_STRING(F32SYS); + CHECK_FMT_STRING(F32); +#undef CHECK_FMT_STRING + return 0; +} + +int +SDL_GetNumAudioDrivers(void) +{ + return (SDL_arraysize(bootstrap) - 1); +} + +const char * +SDL_GetAudioDriver(int index) +{ + if (index >= 0 && index < SDL_GetNumAudioDrivers()) { + return (bootstrap[index]->name); + } + return (NULL); +} + +int +SDL_AudioInit(const char *driver_name) +{ + int i = 0; + int initialized = 0; + int tried_to_init = 0; + int rc = 0; + int best_choice = -1; + + if (SDL_WasInit(SDL_INIT_AUDIO)) { + SDL_AudioQuit(); /* shutdown driver if already running. */ + } + + SDL_memset(¤t_audio, '\0', sizeof(current_audio)); + SDL_memset(open_devices, '\0', sizeof(open_devices)); + + /* Select the proper audio driver */ + if (driver_name == NULL) { + driver_name = SDL_getenv("SDL_AUDIODRIVER"); + } + + for (i = 0; (!initialized) && (bootstrap[i]); ++i) { + /* make sure we should even try this driver before doing so... */ + const AudioBootStrap *backend = bootstrap[i]; + if (((driver_name) && (SDL_strcasecmp(backend->name, driver_name))) || + ((!driver_name) && (backend->demand_only))) { + continue; + } + + tried_to_init = 1; + SDL_memset(¤t_audio, 0, sizeof(current_audio)); + current_audio.name = backend->name; + current_audio.desc = backend->desc; + rc = backend->init(¤t_audio.impl); + if (rc == 2) { /* init'd, and devices available. Take it! */ + initialized = 1; + best_choice = i; + } else if (rc == 1) { /* init'd, but can't see any devices. */ + if (current_audio.impl.Deinitialize) { + current_audio.impl.Deinitialize(); + } + if (best_choice == -1) { + best_choice = i; + } + } + } + + /* No definite choice. Pick one that works but can't promise a device. */ + if ((!initialized) && (best_choice != -1)) { + const AudioBootStrap *backend = bootstrap[best_choice]; + SDL_memset(¤t_audio, 0, sizeof(current_audio)); + current_audio.name = backend->name; + current_audio.desc = backend->desc; + initialized = (backend->init(¤t_audio.impl) > 0); + } + + if (!initialized) { + /* specific drivers will set the error message if they fail... */ + if (!tried_to_init) { + if (driver_name) { + SDL_SetError("%s not available", driver_name); + } else { + SDL_SetError("No available audio device"); + } + } + + SDL_memset(¤t_audio, 0, sizeof(current_audio)); + return (-1); /* No driver was available, so fail. */ + } + + finalize_audio_entry_points(); + + return (0); +} + +/* + * Get the current audio driver name + */ +const char * +SDL_GetCurrentAudioDriver() +{ + return current_audio.name; +} + + +int +SDL_GetNumAudioDevices(int iscapture) +{ + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + return -1; + } + if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { + return 0; + } + + if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + return 1; + } + + if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + return 1; + } + + return current_audio.impl.DetectDevices(iscapture); +} + + +const char * +SDL_GetAudioDeviceName(int index, int iscapture) +{ + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + SDL_SetError("Audio subsystem is not initialized"); + return NULL; + } + + if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { + SDL_SetError("No capture support"); + return NULL; + } + + if (index < 0) { + SDL_SetError("No such device"); + return NULL; + } + + if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + return DEFAULT_INPUT_DEVNAME; + } + + if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + return DEFAULT_OUTPUT_DEVNAME; + } + + return current_audio.impl.GetDeviceName(index, iscapture); +} + + +static void +close_audio_device(SDL_AudioDevice * device) +{ + device->enabled = 0; + if (device->thread != NULL) { + SDL_WaitThread(device->thread, NULL); + } + if (device->mixer_lock != NULL) { + SDL_DestroyMutex(device->mixer_lock); + } + if (device->fake_stream != NULL) { + SDL_FreeAudioMem(device->fake_stream); + } + if (device->convert.needed) { + SDL_FreeAudioMem(device->convert.buf); + } + if (device->opened) { + current_audio.impl.CloseDevice(device); + device->opened = 0; + } + SDL_FreeAudioMem(device); +} + + +/* + * Sanity check desired AudioSpec for SDL_OpenAudio() in (orig). + * Fills in a sanitized copy in (prepared). + * Returns non-zero if okay, zero on fatal parameters in (orig). + */ +static int +prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared) +{ + SDL_memcpy(prepared, orig, sizeof(SDL_AudioSpec)); + + if (orig->callback == NULL) { + SDL_SetError("SDL_OpenAudio() passed a NULL callback"); + return 0; + } + + if (orig->freq == 0) { + const char *env = SDL_getenv("SDL_AUDIO_FREQUENCY"); + if ((!env) || ((prepared->freq = SDL_atoi(env)) == 0)) { + prepared->freq = 22050; /* a reasonable default */ + } + } + + if (orig->format == 0) { + const char *env = SDL_getenv("SDL_AUDIO_FORMAT"); + if ((!env) || ((prepared->format = SDL_ParseAudioFormat(env)) == 0)) { + prepared->format = AUDIO_S16; /* a reasonable default */ + } + } + + switch (orig->channels) { + case 0:{ + const char *env = SDL_getenv("SDL_AUDIO_CHANNELS"); + if ((!env) || ((prepared->channels = (Uint8) SDL_atoi(env)) == 0)) { + prepared->channels = 2; /* a reasonable default */ + } + break; + } + case 1: /* Mono */ + case 2: /* Stereo */ + case 4: /* surround */ + case 6: /* surround with center and lfe */ + break; + default: + SDL_SetError("Unsupported number of audio channels."); + return 0; + } + + if (orig->samples == 0) { + const char *env = SDL_getenv("SDL_AUDIO_SAMPLES"); + if ((!env) || ((prepared->samples = (Uint16) SDL_atoi(env)) == 0)) { + /* Pick a default of ~46 ms at desired frequency */ + /* !!! FIXME: remove this when the non-Po2 resampling is in. */ + const int samples = (prepared->freq / 1000) * 46; + int power2 = 1; + while (power2 < samples) { + power2 *= 2; + } + prepared->samples = power2; + } + } + + /* Calculate the silence and size of the audio specification */ + SDL_CalculateAudioSpec(prepared); + + return 1; +} + + +static SDL_AudioDeviceID +open_audio_device(const char *devname, int iscapture, + const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, + int allowed_changes, int min_id) +{ + SDL_AudioDeviceID id = 0; + SDL_AudioSpec _obtained; + SDL_AudioDevice *device; + SDL_bool build_cvt; + int i = 0; + + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + SDL_SetError("Audio subsystem is not initialized"); + return 0; + } + + if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { + SDL_SetError("No capture support"); + return 0; + } + + if (!obtained) { + obtained = &_obtained; + } + if (!prepare_audiospec(desired, obtained)) { + return 0; + } + + /* If app doesn't care about a specific device, let the user override. */ + if (devname == NULL) { + devname = SDL_getenv("SDL_AUDIO_DEVICE_NAME"); + } + + /* + * Catch device names at the high level for the simple case... + * This lets us have a basic "device enumeration" for systems that + * don't have multiple devices, but makes sure the device name is + * always NULL when it hits the low level. + * + * Also make sure that the simple case prevents multiple simultaneous + * opens of the default system device. + */ + + if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + if ((devname) && (SDL_strcmp(devname, DEFAULT_INPUT_DEVNAME) != 0)) { + SDL_SetError("No such device"); + return 0; + } + devname = NULL; + + for (i = 0; i < SDL_arraysize(open_devices); i++) { + if ((open_devices[i]) && (open_devices[i]->iscapture)) { + SDL_SetError("Audio device already open"); + return 0; + } + } + } + + if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + if ((devname) && (SDL_strcmp(devname, DEFAULT_OUTPUT_DEVNAME) != 0)) { + SDL_SetError("No such device"); + return 0; + } + devname = NULL; + + for (i = 0; i < SDL_arraysize(open_devices); i++) { + if ((open_devices[i]) && (!open_devices[i]->iscapture)) { + SDL_SetError("Audio device already open"); + return 0; + } + } + } + + device = (SDL_AudioDevice *) SDL_AllocAudioMem(sizeof(SDL_AudioDevice)); + if (device == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(device, '\0', sizeof(SDL_AudioDevice)); + device->spec = *obtained; + device->enabled = 1; + device->paused = 1; + device->iscapture = iscapture; + + /* Create a semaphore for locking the sound buffers */ + if (!current_audio.impl.SkipMixerLock) { + device->mixer_lock = SDL_CreateMutex(); + if (device->mixer_lock == NULL) { + close_audio_device(device); + SDL_SetError("Couldn't create mixer lock"); + return 0; + } + } + + if (!current_audio.impl.OpenDevice(device, devname, iscapture)) { + close_audio_device(device); + return 0; + } + device->opened = 1; + + /* Allocate a fake audio memory buffer */ + device->fake_stream = SDL_AllocAudioMem(device->spec.size); + if (device->fake_stream == NULL) { + close_audio_device(device); + SDL_OutOfMemory(); + return 0; + } + + /* If the audio driver changes the buffer size, accept it */ + if (device->spec.samples != obtained->samples) { + obtained->samples = device->spec.samples; + SDL_CalculateAudioSpec(obtained); + } + + /* See if we need to do any conversion */ + build_cvt = SDL_FALSE; + if (obtained->freq != device->spec.freq) { + if (allowed_changes & SDL_AUDIO_ALLOW_FREQUENCY_CHANGE) { + obtained->freq = device->spec.freq; + } else { + build_cvt = SDL_TRUE; + } + } + if (obtained->format != device->spec.format) { + if (allowed_changes & SDL_AUDIO_ALLOW_FORMAT_CHANGE) { + obtained->format = device->spec.format; + } else { + build_cvt = SDL_TRUE; + } + } + if (obtained->channels != device->spec.channels) { + if (allowed_changes & SDL_AUDIO_ALLOW_CHANNELS_CHANGE) { + obtained->channels = device->spec.channels; + } else { + build_cvt = SDL_TRUE; + } + } + if (build_cvt) { + /* Build an audio conversion block */ + if (SDL_BuildAudioCVT(&device->convert, + obtained->format, obtained->channels, + obtained->freq, + device->spec.format, device->spec.channels, + device->spec.freq) < 0) { + close_audio_device(device); + return 0; + } + if (device->convert.needed) { + device->convert.len = (int) (((double) obtained->size) / + device->convert.len_ratio); + + device->convert.buf = + (Uint8 *) SDL_AllocAudioMem(device->convert.len * + device->convert.len_mult); + if (device->convert.buf == NULL) { + close_audio_device(device); + SDL_OutOfMemory(); + return 0; + } + } + } + + /* Find an available device ID and store the structure... */ + for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) { + if (open_devices[id] == NULL) { + open_devices[id] = device; + break; + } + } + + if (id == SDL_arraysize(open_devices)) { + SDL_SetError("Too many open audio devices"); + close_audio_device(device); + return 0; + } + + /* Start the audio thread if necessary */ + if (!current_audio.impl.ProvidesOwnCallbackThread) { + /* Start the audio thread */ +/* !!! FIXME: this is nasty. */ +#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) +#undef SDL_CreateThread + device->thread = SDL_CreateThread(SDL_RunAudio, device, NULL, NULL); +#else + device->thread = SDL_CreateThread(SDL_RunAudio, device); +#endif + if (device->thread == NULL) { + SDL_CloseAudioDevice(id + 1); + SDL_SetError("Couldn't create audio thread"); + return 0; + } + } + + return id + 1; +} + + +int +SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) +{ + SDL_AudioDeviceID id = 0; + + /* Start up the audio driver, if necessary. This is legacy behaviour! */ + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { + return (-1); + } + } + + /* SDL_OpenAudio() is legacy and can only act on Device ID #1. */ + if (open_devices[0] != NULL) { + SDL_SetError("Audio device is already opened"); + return (-1); + } + + if (obtained) { + id = open_audio_device(NULL, 0, desired, obtained, + SDL_AUDIO_ALLOW_ANY_CHANGE, 1); + } else { + id = open_audio_device(NULL, 0, desired, desired, 0, 1); + } + if (id > 1) { /* this should never happen in theory... */ + SDL_CloseAudioDevice(id); + SDL_SetError("Internal error"); /* MUST be Device ID #1! */ + return (-1); + } + + return ((id == 0) ? -1 : 0); +} + +SDL_AudioDeviceID +SDL_OpenAudioDevice(const char *device, int iscapture, + const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, + int allowed_changes) +{ + return open_audio_device(device, iscapture, desired, obtained, + allowed_changes, 2); +} + +SDL_audiostatus +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) +{ + SDL_AudioDevice *device = get_audio_device(devid); + SDL_audiostatus status = SDL_AUDIO_STOPPED; + if (device && device->enabled) { + if (device->paused) { + status = SDL_AUDIO_PAUSED; + } else { + status = SDL_AUDIO_PLAYING; + } + } + return (status); +} + + +SDL_audiostatus +SDL_GetAudioStatus(void) +{ + return SDL_GetAudioDeviceStatus(1); +} + +void +SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on) +{ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + device->paused = pause_on; + } +} + +void +SDL_PauseAudio(int pause_on) +{ + SDL_PauseAudioDevice(1, pause_on); +} + + +void +SDL_LockAudioDevice(SDL_AudioDeviceID devid) +{ + /* Obtain a lock on the mixing buffers */ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + current_audio.impl.LockDevice(device); + } +} + +void +SDL_LockAudio(void) +{ + SDL_LockAudioDevice(1); +} + +void +SDL_UnlockAudioDevice(SDL_AudioDeviceID devid) +{ + /* Obtain a lock on the mixing buffers */ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + current_audio.impl.UnlockDevice(device); + } +} + +void +SDL_UnlockAudio(void) +{ + SDL_UnlockAudioDevice(1); +} + +void +SDL_CloseAudioDevice(SDL_AudioDeviceID devid) +{ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + close_audio_device(device); + open_devices[devid - 1] = NULL; + } +} + +void +SDL_CloseAudio(void) +{ + SDL_CloseAudioDevice(1); +} + +void +SDL_AudioQuit(void) +{ + SDL_AudioDeviceID i; + for (i = 0; i < SDL_arraysize(open_devices); i++) { + SDL_CloseAudioDevice(i); + } + + /* Free the driver data */ + current_audio.impl.Deinitialize(); + SDL_memset(¤t_audio, '\0', sizeof(current_audio)); + SDL_memset(open_devices, '\0', sizeof(open_devices)); +} + +#define NUM_FORMATS 10 +static int format_idx; +static int format_idx_sub; +static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = { + {AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB}, + {AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB}, + {AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S32LSB, + AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S32MSB, + AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S32LSB, + AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_S32MSB, + AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S16LSB, + AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S16MSB, + AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S16LSB, + AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_S16MSB, + AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8}, +}; + +SDL_AudioFormat +SDL_FirstAudioFormat(SDL_AudioFormat format) +{ + for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) { + if (format_list[format_idx][0] == format) { + break; + } + } + format_idx_sub = 0; + return (SDL_NextAudioFormat()); +} + +SDL_AudioFormat +SDL_NextAudioFormat(void) +{ + if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) { + return (0); + } + return (format_list[format_idx][format_idx_sub++]); +} + +void +SDL_CalculateAudioSpec(SDL_AudioSpec * spec) +{ + switch (spec->format) { + case AUDIO_U8: + spec->silence = 0x80; + break; + default: + spec->silence = 0x00; + break; + } + spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8; + spec->size *= spec->channels; + spec->size *= spec->samples; +} + + +/* + * Moved here from SDL_mixer.c, since it relies on internals of an opened + * audio device (and is deprecated, by the way!). + */ +void +SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume) +{ + /* Mix the user-level audio format */ + SDL_AudioDevice *device = get_audio_device(1); + if (device != NULL) { + SDL_AudioFormat format; + if (device->convert.needed) { + format = device->convert.src_format; + } else { + format = device->spec.format; + } + SDL_MixAudioFormat(dst, src, format, len, volume); + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_audio_c.h b/Externals/SDL/src/audio/SDL_audio_c.h new file mode 100644 index 0000000000..84ed690fa4 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audio_c.h @@ -0,0 +1,56 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */ + +/* Functions to get a list of "close" audio formats */ +extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format); +extern SDL_AudioFormat SDL_NextAudioFormat(void); + +/* Function to calculate the size and silence for a SDL_AudioSpec */ +extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec); + +/* The actual mixing thread function */ +extern int SDLCALL SDL_RunAudio(void *audiop); + +/* this is used internally to access some autogenerated code. */ +typedef struct +{ + SDL_AudioFormat src_fmt; + SDL_AudioFormat dst_fmt; + SDL_AudioFilter filter; +} SDL_AudioTypeFilters; +extern const SDL_AudioTypeFilters sdl_audio_type_filters[]; + +/* this is used internally to access some autogenerated code. */ +typedef struct +{ + SDL_AudioFormat fmt; + int channels; + int upsample; + int multiple; + SDL_AudioFilter filter; +} SDL_AudioRateFilters; +extern const SDL_AudioRateFilters sdl_audio_rate_filters[]; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_audiocvt.c b/Externals/SDL/src/audio/SDL_audiocvt.c new file mode 100644 index 0000000000..8fb096e52d --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audiocvt.c @@ -0,0 +1,1075 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Functions for audio drivers to perform runtime conversion of audio format */ + +#include "SDL_audio.h" +#include "SDL_audio_c.h" + +/* #define DEBUG_CONVERT */ + +/* !!! FIXME */ +#ifndef assert +#define assert(x) +#endif + +/* Effectively mix right and left channels into a single channel */ +static void SDLCALL +SDL_ConvertMono(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + Sint32 sample; + +#ifdef DEBUG_CONVERT + fprintf(stderr, "Converting to mono\n"); +#endif + switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) { + case AUDIO_U8: + { + Uint8 *src, *dst; + + src = cvt->buf; + dst = cvt->buf; + for (i = cvt->len_cvt / 2; i; --i) { + sample = src[0] + src[1]; + *dst = (Uint8) (sample / 2); + src += 2; + dst += 1; + } + } + break; + + case AUDIO_S8: + { + Sint8 *src, *dst; + + src = (Sint8 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / 2; i; --i) { + sample = src[0] + src[1]; + *dst = (Sint8) (sample / 2); + src += 2; + dst += 1; + } + } + break; + + case AUDIO_U16: + { + Uint8 *src, *dst; + + src = cvt->buf; + dst = cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Uint16) ((src[0] << 8) | src[1]) + + (Uint16) ((src[2] << 8) | src[3]); + sample /= 2; + dst[1] = (sample & 0xFF); + sample >>= 8; + dst[0] = (sample & 0xFF); + src += 4; + dst += 2; + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Uint16) ((src[1] << 8) | src[0]) + + (Uint16) ((src[3] << 8) | src[2]); + sample /= 2; + dst[0] = (sample & 0xFF); + sample >>= 8; + dst[1] = (sample & 0xFF); + src += 4; + dst += 2; + } + } + } + break; + + case AUDIO_S16: + { + Uint8 *src, *dst; + + src = cvt->buf; + dst = cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Sint16) ((src[0] << 8) | src[1]) + + (Sint16) ((src[2] << 8) | src[3]); + sample /= 2; + dst[1] = (sample & 0xFF); + sample >>= 8; + dst[0] = (sample & 0xFF); + src += 4; + dst += 2; + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Sint16) ((src[1] << 8) | src[0]) + + (Sint16) ((src[3] << 8) | src[2]); + sample /= 2; + dst[0] = (sample & 0xFF); + sample >>= 8; + dst[1] = (sample & 0xFF); + src += 4; + dst += 2; + } + } + } + break; + + case AUDIO_S32: + { + const Uint32 *src = (const Uint32 *) cvt->buf; + Uint32 *dst = (Uint32 *) cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const Sint64 added = + (((Sint64) (Sint32) SDL_SwapBE32(src[0])) + + ((Sint64) (Sint32) SDL_SwapBE32(src[1]))); + *(dst++) = SDL_SwapBE32((Uint32) ((Sint32) (added / 2))); + } + } else { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const Sint64 added = + (((Sint64) (Sint32) SDL_SwapLE32(src[0])) + + ((Sint64) (Sint32) SDL_SwapLE32(src[1]))); + *(dst++) = SDL_SwapLE32((Uint32) ((Sint32) (added / 2))); + } + } + } + break; + + case AUDIO_F32: + { + const float *src = (const float *) cvt->buf; + float *dst = (float *) cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const float src1 = SDL_SwapFloatBE(src[0]); + const float src2 = SDL_SwapFloatBE(src[1]); + const double added = ((double) src1) + ((double) src2); + const float halved = (float) (added * 0.5); + *(dst++) = SDL_SwapFloatBE(halved); + } + } else { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const float src1 = SDL_SwapFloatLE(src[0]); + const float src2 = SDL_SwapFloatLE(src[1]); + const double added = ((double) src1) + ((double) src2); + const float halved = (float) (added * 0.5); + *(dst++) = SDL_SwapFloatLE(halved); + } + } + } + break; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +/* Discard top 4 channels */ +static void SDLCALL +SDL_ConvertStrip(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + +#ifdef DEBUG_CONVERT + fprintf(stderr, "Converting down from 6 channels to stereo\n"); +#endif + +#define strip_chans_6_to_2(type) \ + { \ + const type *src = (const type *) cvt->buf; \ + type *dst = (type *) cvt->buf; \ + for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \ + dst[0] = src[0]; \ + dst[1] = src[1]; \ + src += 6; \ + dst += 2; \ + } \ + } + + /* this function only cares about typesize, and data as a block of bits. */ + switch (SDL_AUDIO_BITSIZE(format)) { + case 8: + strip_chans_6_to_2(Uint8); + break; + case 16: + strip_chans_6_to_2(Uint16); + break; + case 32: + strip_chans_6_to_2(Uint32); + break; + } + +#undef strip_chans_6_to_2 + + cvt->len_cvt /= 3; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +/* Discard top 2 channels of 6 */ +static void SDLCALL +SDL_ConvertStrip_2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + +#ifdef DEBUG_CONVERT + fprintf(stderr, "Converting 6 down to quad\n"); +#endif + +#define strip_chans_6_to_4(type) \ + { \ + const type *src = (const type *) cvt->buf; \ + type *dst = (type *) cvt->buf; \ + for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \ + dst[0] = src[0]; \ + dst[1] = src[1]; \ + dst[2] = src[2]; \ + dst[3] = src[3]; \ + src += 6; \ + dst += 4; \ + } \ + } + + /* this function only cares about typesize, and data as a block of bits. */ + switch (SDL_AUDIO_BITSIZE(format)) { + case 8: + strip_chans_6_to_4(Uint8); + break; + case 16: + strip_chans_6_to_4(Uint16); + break; + case 32: + strip_chans_6_to_4(Uint32); + break; + } + +#undef strip_chans_6_to_4 + + cvt->len_cvt /= 6; + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +/* Duplicate a mono channel to both stereo channels */ +static void SDLCALL +SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + +#ifdef DEBUG_CONVERT + fprintf(stderr, "Converting to stereo\n"); +#endif + +#define dup_chans_1_to_2(type) \ + { \ + const type *src = (const type *) (cvt->buf + cvt->len_cvt); \ + type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \ + for (i = cvt->len_cvt / 2; i; --i, --src) { \ + const type val = *src; \ + dst -= 2; \ + dst[0] = dst[1] = val; \ + } \ + } + + /* this function only cares about typesize, and data as a block of bits. */ + switch (SDL_AUDIO_BITSIZE(format)) { + case 8: + dup_chans_1_to_2(Uint8); + break; + case 16: + dup_chans_1_to_2(Uint16); + break; + case 32: + dup_chans_1_to_2(Uint32); + break; + } + +#undef dup_chans_1_to_2 + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +/* Duplicate a stereo channel to a pseudo-5.1 stream */ +static void SDLCALL +SDL_ConvertSurround(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + +#ifdef DEBUG_CONVERT + fprintf(stderr, "Converting stereo to surround\n"); +#endif + + switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) { + case AUDIO_U8: + { + Uint8 *src, *dst, lf, rf, ce; + + src = (Uint8 *) (cvt->buf + cvt->len_cvt); + dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 3); + for (i = cvt->len_cvt; i; --i) { + dst -= 6; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + dst[4] = ce; + dst[5] = ce; + } + } + break; + + case AUDIO_S8: + { + Sint8 *src, *dst, lf, rf, ce; + + src = (Sint8 *) cvt->buf + cvt->len_cvt; + dst = (Sint8 *) cvt->buf + cvt->len_cvt * 3; + for (i = cvt->len_cvt; i; --i) { + dst -= 6; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + dst[4] = ce; + dst[5] = ce; + } + } + break; + + case AUDIO_U16: + { + Uint8 *src, *dst; + Uint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Uint16) ((src[0] << 8) | src[1]); + rf = (Uint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + + dst[1 + 8] = (ce & 0xFF); + dst[0 + 8] = ((ce >> 8) & 0xFF); + dst[3 + 8] = (ce & 0xFF); + dst[2 + 8] = ((ce >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Uint16) ((src[1] << 8) | src[0]); + rf = (Uint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + + dst[0 + 8] = (ce & 0xFF); + dst[1 + 8] = ((ce >> 8) & 0xFF); + dst[2 + 8] = (ce & 0xFF); + dst[3 + 8] = ((ce >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S16: + { + Uint8 *src, *dst; + Sint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Sint16) ((src[0] << 8) | src[1]); + rf = (Sint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + + dst[1 + 8] = (ce & 0xFF); + dst[0 + 8] = ((ce >> 8) & 0xFF); + dst[3 + 8] = (ce & 0xFF); + dst[2 + 8] = ((ce >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Sint16) ((src[1] << 8) | src[0]); + rf = (Sint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + + dst[0 + 8] = (ce & 0xFF); + dst[1 + 8] = ((ce >> 8) & 0xFF); + dst[2 + 8] = (ce & 0xFF); + dst[3 + 8] = ((ce >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S32: + { + Sint32 lf, rf, ce; + const Uint32 *src = (const Uint32 *) cvt->buf + cvt->len_cvt; + Uint32 *dst = (Uint32 *) cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = (Sint32) SDL_SwapBE32(src[0]); + rf = (Sint32) SDL_SwapBE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = SDL_SwapBE32((Uint32) lf); + dst[1] = SDL_SwapBE32((Uint32) rf); + dst[2] = SDL_SwapBE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapBE32((Uint32) (rf - ce)); + dst[4] = SDL_SwapBE32((Uint32) ce); + dst[5] = SDL_SwapBE32((Uint32) ce); + } + } else { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = (Sint32) SDL_SwapLE32(src[0]); + rf = (Sint32) SDL_SwapLE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapLE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapLE32((Uint32) (rf - ce)); + dst[4] = SDL_SwapLE32((Uint32) ce); + dst[5] = SDL_SwapLE32((Uint32) ce); + } + } + } + break; + + case AUDIO_F32: + { + float lf, rf, ce; + const float *src = (const float *) cvt->buf + cvt->len_cvt; + float *dst = (float *) cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = SDL_SwapFloatBE(src[0]); + rf = SDL_SwapFloatBE(src[1]); + ce = (lf * 0.5f) + (rf * 0.5f); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapFloatBE(lf - ce); + dst[3] = SDL_SwapFloatBE(rf - ce); + dst[4] = dst[5] = SDL_SwapFloatBE(ce); + } + } else { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = SDL_SwapFloatLE(src[0]); + rf = SDL_SwapFloatLE(src[1]); + ce = (lf * 0.5f) + (rf * 0.5f); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapFloatLE(lf - ce); + dst[3] = SDL_SwapFloatLE(rf - ce); + dst[4] = dst[5] = SDL_SwapFloatLE(ce); + } + } + } + break; + + } + cvt->len_cvt *= 3; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +/* Duplicate a stereo channel to a pseudo-4.0 stream */ +static void SDLCALL +SDL_ConvertSurround_4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + +#ifdef DEBUG_CONVERT + fprintf(stderr, "Converting stereo to quad\n"); +#endif + + switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) { + case AUDIO_U8: + { + Uint8 *src, *dst, lf, rf, ce; + + src = (Uint8 *) (cvt->buf + cvt->len_cvt); + dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 2); + for (i = cvt->len_cvt; i; --i) { + dst -= 4; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + } + } + break; + + case AUDIO_S8: + { + Sint8 *src, *dst, lf, rf, ce; + + src = (Sint8 *) cvt->buf + cvt->len_cvt; + dst = (Sint8 *) cvt->buf + cvt->len_cvt * 2; + for (i = cvt->len_cvt; i; --i) { + dst -= 4; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + } + } + break; + + case AUDIO_U16: + { + Uint8 *src, *dst; + Uint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 2; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Uint16) ((src[0] << 8) | src[1]); + rf = (Uint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Uint16) ((src[1] << 8) | src[0]); + rf = (Uint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S16: + { + Uint8 *src, *dst; + Sint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 2; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Sint16) ((src[0] << 8) | src[1]); + rf = (Sint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Sint16) ((src[1] << 8) | src[0]); + rf = (Sint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S32: + { + const Uint32 *src = (const Uint32 *) (cvt->buf + cvt->len_cvt); + Uint32 *dst = (Uint32 *) (cvt->buf + cvt->len_cvt * 2); + Sint32 lf, rf, ce; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 4; + src -= 2; + lf = (Sint32) SDL_SwapBE32(src[0]); + rf = (Sint32) SDL_SwapBE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapBE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapBE32((Uint32) (rf - ce)); + } + } else { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 4; + src -= 2; + lf = (Sint32) SDL_SwapLE32(src[0]); + rf = (Sint32) SDL_SwapLE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapLE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapLE32((Uint32) (rf - ce)); + } + } + } + break; + } + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +int +SDL_ConvertAudio(SDL_AudioCVT * cvt) +{ + /* !!! FIXME: (cvt) should be const; stack-copy it here. */ + /* !!! FIXME: (actually, we can't...len_cvt needs to be updated. Grr.) */ + + /* Make sure there's data to convert */ + if (cvt->buf == NULL) { + SDL_SetError("No buffer allocated for conversion"); + return (-1); + } + /* Return okay if no conversion is necessary */ + cvt->len_cvt = cvt->len; + if (cvt->filters[0] == NULL) { + return (0); + } + + /* Set up the conversion and go! */ + cvt->filter_index = 0; + cvt->filters[0] (cvt, cvt->src_format); + return (0); +} + + +static SDL_AudioFilter +SDL_HandTunedTypeCVT(SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt) +{ + /* + * Fill in any future conversions that are specialized to a + * processor, platform, compiler, or library here. + */ + + return NULL; /* no specialized converter code available. */ +} + + +/* + * Find a converter between two data types. We try to select a hand-tuned + * asm/vectorized/optimized function first, and then fallback to an + * autogenerated function that is customized to convert between two + * specific data types. + */ +static int +SDL_BuildAudioTypeCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt) +{ + if (src_fmt != dst_fmt) { + const Uint16 src_bitsize = SDL_AUDIO_BITSIZE(src_fmt); + const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt); + SDL_AudioFilter filter = SDL_HandTunedTypeCVT(src_fmt, dst_fmt); + + /* No hand-tuned converter? Try the autogenerated ones. */ + if (filter == NULL) { + int i; + for (i = 0; sdl_audio_type_filters[i].filter != NULL; i++) { + const SDL_AudioTypeFilters *filt = &sdl_audio_type_filters[i]; + if ((filt->src_fmt == src_fmt) && (filt->dst_fmt == dst_fmt)) { + filter = filt->filter; + break; + } + } + + if (filter == NULL) { + return -1; /* Still no matching converter?! */ + } + } + + /* Update (cvt) with filter details... */ + cvt->filters[cvt->filter_index++] = filter; + if (src_bitsize < dst_bitsize) { + const int mult = (dst_bitsize / src_bitsize); + cvt->len_mult *= mult; + cvt->len_ratio *= mult; + } else if (src_bitsize > dst_bitsize) { + cvt->len_ratio /= (src_bitsize / dst_bitsize); + } + + return 1; /* added a converter. */ + } + + return 0; /* no conversion necessary. */ +} + + +static SDL_AudioFilter +SDL_HandTunedResampleCVT(SDL_AudioCVT * cvt, int dst_channels, + int src_rate, int dst_rate) +{ + /* + * Fill in any future conversions that are specialized to a + * processor, platform, compiler, or library here. + */ + + return NULL; /* no specialized converter code available. */ +} + +static int +SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate) +{ + int retval = 0; + + /* If we only built with the arbitrary resamplers, ignore multiples. */ +#if !LESS_RESAMPLERS + int lo, hi; + int div; + + assert(src_rate != 0); + assert(dst_rate != 0); + assert(src_rate != dst_rate); + + if (src_rate < dst_rate) { + lo = src_rate; + hi = dst_rate; + } else { + lo = dst_rate; + hi = src_rate; + } + + /* zero means "not a supported multiple" ... we only do 2x and 4x. */ + if ((hi % lo) != 0) + return 0; /* not a multiple. */ + + div = hi / lo; + retval = ((div == 2) || (div == 4)) ? div : 0; +#endif + + return retval; +} + +static int +SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels, + int src_rate, int dst_rate) +{ + if (src_rate != dst_rate) { + SDL_AudioFilter filter = SDL_HandTunedResampleCVT(cvt, dst_channels, + src_rate, dst_rate); + + /* No hand-tuned converter? Try the autogenerated ones. */ + if (filter == NULL) { + int i; + const int upsample = (src_rate < dst_rate) ? 1 : 0; + const int multiple = + SDL_FindFrequencyMultiple(src_rate, dst_rate); + + for (i = 0; sdl_audio_rate_filters[i].filter != NULL; i++) { + const SDL_AudioRateFilters *filt = &sdl_audio_rate_filters[i]; + if ((filt->fmt == cvt->dst_format) && + (filt->channels == dst_channels) && + (filt->upsample == upsample) && + (filt->multiple == multiple)) { + filter = filt->filter; + break; + } + } + + if (filter == NULL) { + return -1; /* Still no matching converter?! */ + } + } + + /* Update (cvt) with filter details... */ + cvt->filters[cvt->filter_index++] = filter; + if (src_rate < dst_rate) { + const double mult = ((double) dst_rate) / ((double) src_rate); + cvt->len_mult *= (int) SDL_ceil(mult); + cvt->len_ratio *= mult; + } else { + cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate); + } + + return 1; /* added a converter. */ + } + + return 0; /* no conversion necessary. */ +} + + +/* Creates a set of audio filters to convert from one format to another. + Returns -1 if the format conversion is not supported, 0 if there's + no conversion needed, or 1 if the audio filter is set up. +*/ + +int +SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_fmt, Uint8 src_channels, int src_rate, + SDL_AudioFormat dst_fmt, Uint8 dst_channels, int dst_rate) +{ + /* + * !!! FIXME: reorder filters based on which grow/shrink the buffer. + * !!! FIXME: ideally, we should do everything that shrinks the buffer + * !!! FIXME: first, so we don't have to process as many bytes in a given + * !!! FIXME: filter and abuse the CPU cache less. This might not be as + * !!! FIXME: good in practice as it sounds in theory, though. + */ + + /* there are no unsigned types over 16 bits, so catch this upfront. */ + if ((SDL_AUDIO_BITSIZE(src_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(src_fmt))) { + return -1; + } + if ((SDL_AUDIO_BITSIZE(dst_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(dst_fmt))) { + return -1; + } + + /* prevent possible divisions by zero, etc. */ + if ((src_rate == 0) || (dst_rate == 0)) { + return -1; + } +#ifdef DEBUG_CONVERT + printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n", + src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate); +#endif + + /* Start off with no conversion necessary */ + SDL_zerop(cvt); + cvt->src_format = src_fmt; + cvt->dst_format = dst_fmt; + cvt->needed = 0; + cvt->filter_index = 0; + cvt->filters[0] = NULL; + cvt->len_mult = 1; + cvt->len_ratio = 1.0; + cvt->rate_incr = ((double) dst_rate) / ((double) src_rate); + + /* Convert data types, if necessary. Updates (cvt). */ + if (SDL_BuildAudioTypeCVT(cvt, src_fmt, dst_fmt) == -1) { + return -1; /* shouldn't happen, but just in case... */ + } + + /* Channel conversion */ + if (src_channels != dst_channels) { + if ((src_channels == 1) && (dst_channels > 1)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStereo; + cvt->len_mult *= 2; + src_channels = 2; + cvt->len_ratio *= 2; + } + if ((src_channels == 2) && (dst_channels == 6)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertSurround; + src_channels = 6; + cvt->len_mult *= 3; + cvt->len_ratio *= 3; + } + if ((src_channels == 2) && (dst_channels == 4)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertSurround_4; + src_channels = 4; + cvt->len_mult *= 2; + cvt->len_ratio *= 2; + } + while ((src_channels * 2) <= dst_channels) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStereo; + cvt->len_mult *= 2; + src_channels *= 2; + cvt->len_ratio *= 2; + } + if ((src_channels == 6) && (dst_channels <= 2)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStrip; + src_channels = 2; + cvt->len_ratio /= 3; + } + if ((src_channels == 6) && (dst_channels == 4)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStrip_2; + src_channels = 4; + cvt->len_ratio /= 2; + } + /* This assumes that 4 channel audio is in the format: + Left {front/back} + Right {front/back} + so converting to L/R stereo works properly. + */ + while (((src_channels % 2) == 0) && + ((src_channels / 2) >= dst_channels)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertMono; + src_channels /= 2; + cvt->len_ratio /= 2; + } + if (src_channels != dst_channels) { + /* Uh oh.. */ ; + } + } + + /* Do rate conversion, if necessary. Updates (cvt). */ + if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) == + -1) { + return -1; /* shouldn't happen, but just in case... */ + } + + /* Set up the filter information */ + if (cvt->filter_index != 0) { + cvt->needed = 1; + cvt->src_format = src_fmt; + cvt->dst_format = dst_fmt; + cvt->len = 0; + cvt->buf = NULL; + cvt->filters[cvt->filter_index] = NULL; + } + return (cvt->needed); +} + + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_audiodev.c b/Externals/SDL/src/audio/SDL_audiodev.c new file mode 100644 index 0000000000..90ac18a8d9 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audiodev.c @@ -0,0 +1,138 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Get the name of the audio device we use for output */ + +#if SDL_AUDIO_DRIVER_BSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO + +#include +#include +#include + +#include "SDL_stdinc.h" +#include "SDL_audiodev_c.h" + +#ifndef _PATH_DEV_DSP +#if defined(__NETBSD__) || defined(__OPENBSD__) +#define _PATH_DEV_DSP "/dev/audio" +#else +#define _PATH_DEV_DSP "/dev/dsp" +#endif +#endif +#ifndef _PATH_DEV_DSP24 +#define _PATH_DEV_DSP24 "/dev/sound/dsp" +#endif +#ifndef _PATH_DEV_AUDIO +#define _PATH_DEV_AUDIO "/dev/audio" +#endif + +static inline void +test_device(const char *fname, int flags, int (*test) (int fd), + char ***devices, int *devCount) +{ + struct stat sb; + if ((stat(fname, &sb) == 0) && (S_ISCHR(sb.st_mode))) { + int audio_fd = open(fname, flags, 0); + if ((audio_fd >= 0) && (test(audio_fd))) { + void *p = + SDL_realloc(*devices, ((*devCount) + 1) * sizeof(char *)); + if (p != NULL) { + size_t len = strlen(fname) + 1; + char *str = (char *) SDL_malloc(len); + *devices = (char **) p; + if (str != NULL) { + SDL_strlcpy(str, fname, len); + (*devices)[(*devCount)++] = str; + } + } + close(audio_fd); + } + } +} + +void +SDL_FreeUnixAudioDevices(char ***devices, int *devCount) +{ + int i = *devCount; + if ((i > 0) && (*devices != NULL)) { + while (i--) { + SDL_free((*devices)[i]); + } + } + + if (*devices != NULL) { + SDL_free(*devices); + } + + *devices = NULL; + *devCount = 0; +} + +static int +test_stub(int fd) +{ + return 1; +} + +void +SDL_EnumUnixAudioDevices(int flags, int classic, int (*test) (int fd), + char ***devices, int *devCount) +{ + const char *audiodev; + char audiopath[1024]; + + if (test == NULL) + test = test_stub; + + /* Figure out what our audio device is */ + if (((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) && + ((audiodev = SDL_getenv("AUDIODEV")) == NULL)) { + if (classic) { + audiodev = _PATH_DEV_AUDIO; + } else { + struct stat sb; + + /* Added support for /dev/sound/\* in Linux 2.4 */ + if (((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) + && ((stat(_PATH_DEV_DSP24, &sb) == 0) + && S_ISCHR(sb.st_mode))) { + audiodev = _PATH_DEV_DSP24; + } else { + audiodev = _PATH_DEV_DSP; + } + } + } + test_device(audiodev, flags, test, devices, devCount); + + if (SDL_strlen(audiodev) < (sizeof(audiopath) - 3)) { + int instance = 0; + while (instance++ <= 64) { + SDL_snprintf(audiopath, SDL_arraysize(audiopath), + "%s%d", audiodev, instance); + test_device(audiopath, flags, test, devices, devCount); + } + } +} + +#endif /* Audio driver selection */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_audiodev_c.h b/Externals/SDL/src/audio/SDL_audiodev_c.h new file mode 100644 index 0000000000..ec672dbcdb --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audiodev_c.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +void SDL_EnumUnixAudioDevices(int flags, int classic, int (*test) (int fd), + char ***devs, int *count); +void SDL_FreeUnixAudioDevices(char ***devices, int *devCount); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_audiomem.h b/Externals/SDL/src/audio/SDL_audiomem.h new file mode 100644 index 0000000000..fee508faab --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audiomem.h @@ -0,0 +1,26 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#define SDL_AllocAudioMem SDL_malloc +#define SDL_FreeAudioMem SDL_free +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_audiotypecvt.c b/Externals/SDL/src/audio/SDL_audiotypecvt.c new file mode 100644 index 0000000000..7157c791c7 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_audiotypecvt.c @@ -0,0 +1,16216 @@ +/* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#include "SDL_config.h" +#include "SDL_audio.h" +#include "SDL_audio_c.h" + +#ifndef DEBUG_CONVERT +#define DEBUG_CONVERT 0 +#endif + + +/* If you can guarantee your data and need space, you can eliminate code... */ + +/* Just build the arbitrary resamplers if you're saving code space. */ +#ifndef LESS_RESAMPLERS +#define LESS_RESAMPLERS 0 +#endif + +/* Don't build any resamplers if you're REALLY saving code space. */ +#ifndef NO_RESAMPLERS +#define NO_RESAMPLERS 0 +#endif + +/* Don't build any type converters if you're saving code space. */ +#ifndef NO_CONVERTERS +#define NO_CONVERTERS 0 +#endif + + +/* *INDENT-OFF* */ + +#define DIVBY127 0.0078740157480315f +#define DIVBY32767 3.05185094759972e-05f +#define DIVBY2147483647 4.6566128752458e-10f + +#if !NO_CONVERTERS + +static void SDLCALL +SDL_Convert_U8_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n"); +#endif + + src = (const Uint8 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) { + const Sint8 val = ((*src) ^ 0x80); + *dst = ((Sint8) val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_U8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) *src) << 8); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) *src) << 8); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = ((((float) *src) * DIVBY127) - 1.0f); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = ((((float) *src) * DIVBY127) - 1.0f); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n"); +#endif + + src = (const Uint8 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) { + const Uint8 val = ((((Sint8) *src)) ^ 0x80); + *dst = val; + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((Sint8) *src)) << 8); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((Sint8) *src)) << 8); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint8) *src)) << 24); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint8) *src)) << 24); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = (((float) ((Sint8) *src)) * DIVBY127); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = (((float) ((Sint8) *src)) * DIVBY127); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = SDL_SwapLE16(*src); + *dst = SDL_SwapBE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000); + *dst = SDL_SwapLE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000); + *dst = SDL_SwapBE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) SDL_SwapLE16(*src)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = SDL_SwapBE16(*src); + *dst = SDL_SwapLE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000); + *dst = SDL_SwapLE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) SDL_SwapBE16(*src)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000); + *dst = SDL_SwapBE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) SDL_SwapLE32(*src)); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatLE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatBE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) SDL_SwapBE32(*src)); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatLE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatBE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) ((SDL_SwapFloatLE(*src) + 1.0f) * 127.0f)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const float val = SDL_SwapFloatLE(*src); + *dst = SDL_SwapFloatBE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) ((SDL_SwapFloatBE(*src) + 1.0f) * 127.0f)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const float val = SDL_SwapFloatBE(*src); + *dst = SDL_SwapFloatLE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +#endif /* !NO_CONVERTERS */ + + +const SDL_AudioTypeFilters sdl_audio_type_filters[] = +{ +#if !NO_CONVERTERS + { AUDIO_U8, AUDIO_S8, SDL_Convert_U8_to_S8 }, + { AUDIO_U8, AUDIO_U16LSB, SDL_Convert_U8_to_U16LSB }, + { AUDIO_U8, AUDIO_S16LSB, SDL_Convert_U8_to_S16LSB }, + { AUDIO_U8, AUDIO_U16MSB, SDL_Convert_U8_to_U16MSB }, + { AUDIO_U8, AUDIO_S16MSB, SDL_Convert_U8_to_S16MSB }, + { AUDIO_U8, AUDIO_S32LSB, SDL_Convert_U8_to_S32LSB }, + { AUDIO_U8, AUDIO_S32MSB, SDL_Convert_U8_to_S32MSB }, + { AUDIO_U8, AUDIO_F32LSB, SDL_Convert_U8_to_F32LSB }, + { AUDIO_U8, AUDIO_F32MSB, SDL_Convert_U8_to_F32MSB }, + { AUDIO_S8, AUDIO_U8, SDL_Convert_S8_to_U8 }, + { AUDIO_S8, AUDIO_U16LSB, SDL_Convert_S8_to_U16LSB }, + { AUDIO_S8, AUDIO_S16LSB, SDL_Convert_S8_to_S16LSB }, + { AUDIO_S8, AUDIO_U16MSB, SDL_Convert_S8_to_U16MSB }, + { AUDIO_S8, AUDIO_S16MSB, SDL_Convert_S8_to_S16MSB }, + { AUDIO_S8, AUDIO_S32LSB, SDL_Convert_S8_to_S32LSB }, + { AUDIO_S8, AUDIO_S32MSB, SDL_Convert_S8_to_S32MSB }, + { AUDIO_S8, AUDIO_F32LSB, SDL_Convert_S8_to_F32LSB }, + { AUDIO_S8, AUDIO_F32MSB, SDL_Convert_S8_to_F32MSB }, + { AUDIO_U16LSB, AUDIO_U8, SDL_Convert_U16LSB_to_U8 }, + { AUDIO_U16LSB, AUDIO_S8, SDL_Convert_U16LSB_to_S8 }, + { AUDIO_U16LSB, AUDIO_S16LSB, SDL_Convert_U16LSB_to_S16LSB }, + { AUDIO_U16LSB, AUDIO_U16MSB, SDL_Convert_U16LSB_to_U16MSB }, + { AUDIO_U16LSB, AUDIO_S16MSB, SDL_Convert_U16LSB_to_S16MSB }, + { AUDIO_U16LSB, AUDIO_S32LSB, SDL_Convert_U16LSB_to_S32LSB }, + { AUDIO_U16LSB, AUDIO_S32MSB, SDL_Convert_U16LSB_to_S32MSB }, + { AUDIO_U16LSB, AUDIO_F32LSB, SDL_Convert_U16LSB_to_F32LSB }, + { AUDIO_U16LSB, AUDIO_F32MSB, SDL_Convert_U16LSB_to_F32MSB }, + { AUDIO_S16LSB, AUDIO_U8, SDL_Convert_S16LSB_to_U8 }, + { AUDIO_S16LSB, AUDIO_S8, SDL_Convert_S16LSB_to_S8 }, + { AUDIO_S16LSB, AUDIO_U16LSB, SDL_Convert_S16LSB_to_U16LSB }, + { AUDIO_S16LSB, AUDIO_U16MSB, SDL_Convert_S16LSB_to_U16MSB }, + { AUDIO_S16LSB, AUDIO_S16MSB, SDL_Convert_S16LSB_to_S16MSB }, + { AUDIO_S16LSB, AUDIO_S32LSB, SDL_Convert_S16LSB_to_S32LSB }, + { AUDIO_S16LSB, AUDIO_S32MSB, SDL_Convert_S16LSB_to_S32MSB }, + { AUDIO_S16LSB, AUDIO_F32LSB, SDL_Convert_S16LSB_to_F32LSB }, + { AUDIO_S16LSB, AUDIO_F32MSB, SDL_Convert_S16LSB_to_F32MSB }, + { AUDIO_U16MSB, AUDIO_U8, SDL_Convert_U16MSB_to_U8 }, + { AUDIO_U16MSB, AUDIO_S8, SDL_Convert_U16MSB_to_S8 }, + { AUDIO_U16MSB, AUDIO_U16LSB, SDL_Convert_U16MSB_to_U16LSB }, + { AUDIO_U16MSB, AUDIO_S16LSB, SDL_Convert_U16MSB_to_S16LSB }, + { AUDIO_U16MSB, AUDIO_S16MSB, SDL_Convert_U16MSB_to_S16MSB }, + { AUDIO_U16MSB, AUDIO_S32LSB, SDL_Convert_U16MSB_to_S32LSB }, + { AUDIO_U16MSB, AUDIO_S32MSB, SDL_Convert_U16MSB_to_S32MSB }, + { AUDIO_U16MSB, AUDIO_F32LSB, SDL_Convert_U16MSB_to_F32LSB }, + { AUDIO_U16MSB, AUDIO_F32MSB, SDL_Convert_U16MSB_to_F32MSB }, + { AUDIO_S16MSB, AUDIO_U8, SDL_Convert_S16MSB_to_U8 }, + { AUDIO_S16MSB, AUDIO_S8, SDL_Convert_S16MSB_to_S8 }, + { AUDIO_S16MSB, AUDIO_U16LSB, SDL_Convert_S16MSB_to_U16LSB }, + { AUDIO_S16MSB, AUDIO_S16LSB, SDL_Convert_S16MSB_to_S16LSB }, + { AUDIO_S16MSB, AUDIO_U16MSB, SDL_Convert_S16MSB_to_U16MSB }, + { AUDIO_S16MSB, AUDIO_S32LSB, SDL_Convert_S16MSB_to_S32LSB }, + { AUDIO_S16MSB, AUDIO_S32MSB, SDL_Convert_S16MSB_to_S32MSB }, + { AUDIO_S16MSB, AUDIO_F32LSB, SDL_Convert_S16MSB_to_F32LSB }, + { AUDIO_S16MSB, AUDIO_F32MSB, SDL_Convert_S16MSB_to_F32MSB }, + { AUDIO_S32LSB, AUDIO_U8, SDL_Convert_S32LSB_to_U8 }, + { AUDIO_S32LSB, AUDIO_S8, SDL_Convert_S32LSB_to_S8 }, + { AUDIO_S32LSB, AUDIO_U16LSB, SDL_Convert_S32LSB_to_U16LSB }, + { AUDIO_S32LSB, AUDIO_S16LSB, SDL_Convert_S32LSB_to_S16LSB }, + { AUDIO_S32LSB, AUDIO_U16MSB, SDL_Convert_S32LSB_to_U16MSB }, + { AUDIO_S32LSB, AUDIO_S16MSB, SDL_Convert_S32LSB_to_S16MSB }, + { AUDIO_S32LSB, AUDIO_S32MSB, SDL_Convert_S32LSB_to_S32MSB }, + { AUDIO_S32LSB, AUDIO_F32LSB, SDL_Convert_S32LSB_to_F32LSB }, + { AUDIO_S32LSB, AUDIO_F32MSB, SDL_Convert_S32LSB_to_F32MSB }, + { AUDIO_S32MSB, AUDIO_U8, SDL_Convert_S32MSB_to_U8 }, + { AUDIO_S32MSB, AUDIO_S8, SDL_Convert_S32MSB_to_S8 }, + { AUDIO_S32MSB, AUDIO_U16LSB, SDL_Convert_S32MSB_to_U16LSB }, + { AUDIO_S32MSB, AUDIO_S16LSB, SDL_Convert_S32MSB_to_S16LSB }, + { AUDIO_S32MSB, AUDIO_U16MSB, SDL_Convert_S32MSB_to_U16MSB }, + { AUDIO_S32MSB, AUDIO_S16MSB, SDL_Convert_S32MSB_to_S16MSB }, + { AUDIO_S32MSB, AUDIO_S32LSB, SDL_Convert_S32MSB_to_S32LSB }, + { AUDIO_S32MSB, AUDIO_F32LSB, SDL_Convert_S32MSB_to_F32LSB }, + { AUDIO_S32MSB, AUDIO_F32MSB, SDL_Convert_S32MSB_to_F32MSB }, + { AUDIO_F32LSB, AUDIO_U8, SDL_Convert_F32LSB_to_U8 }, + { AUDIO_F32LSB, AUDIO_S8, SDL_Convert_F32LSB_to_S8 }, + { AUDIO_F32LSB, AUDIO_U16LSB, SDL_Convert_F32LSB_to_U16LSB }, + { AUDIO_F32LSB, AUDIO_S16LSB, SDL_Convert_F32LSB_to_S16LSB }, + { AUDIO_F32LSB, AUDIO_U16MSB, SDL_Convert_F32LSB_to_U16MSB }, + { AUDIO_F32LSB, AUDIO_S16MSB, SDL_Convert_F32LSB_to_S16MSB }, + { AUDIO_F32LSB, AUDIO_S32LSB, SDL_Convert_F32LSB_to_S32LSB }, + { AUDIO_F32LSB, AUDIO_S32MSB, SDL_Convert_F32LSB_to_S32MSB }, + { AUDIO_F32LSB, AUDIO_F32MSB, SDL_Convert_F32LSB_to_F32MSB }, + { AUDIO_F32MSB, AUDIO_U8, SDL_Convert_F32MSB_to_U8 }, + { AUDIO_F32MSB, AUDIO_S8, SDL_Convert_F32MSB_to_S8 }, + { AUDIO_F32MSB, AUDIO_U16LSB, SDL_Convert_F32MSB_to_U16LSB }, + { AUDIO_F32MSB, AUDIO_S16LSB, SDL_Convert_F32MSB_to_S16LSB }, + { AUDIO_F32MSB, AUDIO_U16MSB, SDL_Convert_F32MSB_to_U16MSB }, + { AUDIO_F32MSB, AUDIO_S16MSB, SDL_Convert_F32MSB_to_S16MSB }, + { AUDIO_F32MSB, AUDIO_S32LSB, SDL_Convert_F32MSB_to_S32LSB }, + { AUDIO_F32MSB, AUDIO_S32MSB, SDL_Convert_F32MSB_to_S32MSB }, + { AUDIO_F32MSB, AUDIO_F32LSB, SDL_Convert_F32MSB_to_F32LSB }, +#endif /* !NO_CONVERTERS */ + { 0, 0, NULL } +}; + + +#if !NO_RESAMPLERS + +static void SDLCALL +SDL_Upsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 1; + Uint8 sample0 = src[0]; + Uint8 last_sample0 = sample0; + while (dst != target) { + dst[0] = sample0; + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst++; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 2; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst != target) { + dst[1] = sample1; + dst[0] = sample0; + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst += 2; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 4; + Uint8 sample3 = src[3]; + Uint8 sample2 = src[2]; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample3 = sample3; + Uint8 last_sample2 = sample2; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst != target) { + dst[3] = sample3; + dst[2] = sample2; + dst[1] = sample1; + dst[0] = sample0; + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 sample2 = src[2]; + Uint8 sample3 = src[3]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + Uint8 last_sample2 = sample2; + Uint8 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst[2] = sample2; + dst[3] = sample3; + dst += 4; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 6; + Uint8 sample5 = src[5]; + Uint8 sample4 = src[4]; + Uint8 sample3 = src[3]; + Uint8 sample2 = src[2]; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample5 = sample5; + Uint8 last_sample4 = sample4; + Uint8 last_sample3 = sample3; + Uint8 last_sample2 = sample2; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst != target) { + dst[5] = sample5; + dst[4] = sample4; + dst[3] = sample3; + dst[2] = sample2; + dst[1] = sample1; + dst[0] = sample0; + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 sample2 = src[2]; + Uint8 sample3 = src[3]; + Uint8 sample4 = src[4]; + Uint8 sample5 = src[5]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + Uint8 last_sample2 = sample2; + Uint8 last_sample3 = sample3; + Uint8 last_sample4 = sample4; + Uint8 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst[2] = sample2; + dst[3] = sample3; + dst[4] = sample4; + dst[5] = sample5; + dst += 6; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 8; + Uint8 sample7 = src[7]; + Uint8 sample6 = src[6]; + Uint8 sample5 = src[5]; + Uint8 sample4 = src[4]; + Uint8 sample3 = src[3]; + Uint8 sample2 = src[2]; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample7 = sample7; + Uint8 last_sample6 = sample6; + Uint8 last_sample5 = sample5; + Uint8 last_sample4 = sample4; + Uint8 last_sample3 = sample3; + Uint8 last_sample2 = sample2; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst != target) { + dst[7] = sample7; + dst[6] = sample6; + dst[5] = sample5; + dst[4] = sample4; + dst[3] = sample3; + dst[2] = sample2; + dst[1] = sample1; + dst[0] = sample0; + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1); + sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1); + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 sample2 = src[2]; + Uint8 sample3 = src[3]; + Uint8 sample4 = src[4]; + Uint8 sample5 = src[5]; + Uint8 sample6 = src[6]; + Uint8 sample7 = src[7]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + Uint8 last_sample2 = sample2; + Uint8 last_sample3 = sample3; + Uint8 last_sample4 = sample4; + Uint8 last_sample5 = sample5; + Uint8 last_sample6 = sample6; + Uint8 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst[2] = sample2; + dst[3] = sample3; + dst[4] = sample4; + dst[5] = sample5; + dst[6] = sample6; + dst[7] = sample7; + dst += 8; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1); + sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 1; + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample0 = sample0; + while (dst != target) { + dst[0] = ((Sint8) sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst++; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 2; + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst != target) { + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst += 2; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 4; + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample3 = sample3; + Sint8 last_sample2 = sample2; + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst != target) { + dst[3] = ((Sint8) sample3); + dst[2] = ((Sint8) sample2); + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + Sint8 last_sample2 = sample2; + Sint8 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst[2] = ((Sint8) sample2); + dst[3] = ((Sint8) sample3); + dst += 4; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 6; + Sint8 sample5 = ((Sint8) src[5]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample5 = sample5; + Sint8 last_sample4 = sample4; + Sint8 last_sample3 = sample3; + Sint8 last_sample2 = sample2; + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst != target) { + dst[5] = ((Sint8) sample5); + dst[4] = ((Sint8) sample4); + dst[3] = ((Sint8) sample3); + dst[2] = ((Sint8) sample2); + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + Sint8 last_sample2 = sample2; + Sint8 last_sample3 = sample3; + Sint8 last_sample4 = sample4; + Sint8 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst[2] = ((Sint8) sample2); + dst[3] = ((Sint8) sample3); + dst[4] = ((Sint8) sample4); + dst[5] = ((Sint8) sample5); + dst += 6; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 8; + Sint8 sample7 = ((Sint8) src[7]); + Sint8 sample6 = ((Sint8) src[6]); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample7 = sample7; + Sint8 last_sample6 = sample6; + Sint8 last_sample5 = sample5; + Sint8 last_sample4 = sample4; + Sint8 last_sample3 = sample3; + Sint8 last_sample2 = sample2; + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst != target) { + dst[7] = ((Sint8) sample7); + dst[6] = ((Sint8) sample6); + dst[5] = ((Sint8) sample5); + dst[4] = ((Sint8) sample4); + dst[3] = ((Sint8) sample3); + dst[2] = ((Sint8) sample2); + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1); + sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1); + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 sample6 = ((Sint8) src[6]); + Sint8 sample7 = ((Sint8) src[7]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + Sint8 last_sample2 = sample2; + Sint8 last_sample3 = sample3; + Sint8 last_sample4 = sample4; + Sint8 last_sample5 = sample5; + Sint8 last_sample6 = sample6; + Sint8 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst[2] = ((Sint8) sample2); + dst[3] = ((Sint8) sample3); + dst[4] = ((Sint8) sample4); + dst[5] = ((Sint8) sample5); + dst[6] = ((Sint8) sample6); + dst[7] = ((Sint8) sample7); + dst += 8; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1); + sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 1; + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[0] = SDL_SwapLE16(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst++; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 2; + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst += 2; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 4; + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[3] = SDL_SwapLE16(sample3); + dst[2] = SDL_SwapLE16(sample2); + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst[2] = SDL_SwapLE16(sample2); + dst[3] = SDL_SwapLE16(sample3); + dst += 4; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 6; + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[5] = SDL_SwapLE16(sample5); + dst[4] = SDL_SwapLE16(sample4); + dst[3] = SDL_SwapLE16(sample3); + dst[2] = SDL_SwapLE16(sample2); + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst[2] = SDL_SwapLE16(sample2); + dst[3] = SDL_SwapLE16(sample3); + dst[4] = SDL_SwapLE16(sample4); + dst[5] = SDL_SwapLE16(sample5); + dst += 6; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 8; + Uint16 sample7 = SDL_SwapLE16(src[7]); + Uint16 sample6 = SDL_SwapLE16(src[6]); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample7 = sample7; + Uint16 last_sample6 = sample6; + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[7] = SDL_SwapLE16(sample7); + dst[6] = SDL_SwapLE16(sample6); + dst[5] = SDL_SwapLE16(sample5); + dst[4] = SDL_SwapLE16(sample4); + dst[3] = SDL_SwapLE16(sample3); + dst[2] = SDL_SwapLE16(sample2); + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 sample6 = SDL_SwapLE16(src[6]); + Uint16 sample7 = SDL_SwapLE16(src[7]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + Uint16 last_sample6 = sample6; + Uint16 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst[2] = SDL_SwapLE16(sample2); + dst[3] = SDL_SwapLE16(sample3); + dst[4] = SDL_SwapLE16(sample4); + dst[5] = SDL_SwapLE16(sample5); + dst[6] = SDL_SwapLE16(sample6); + dst[7] = SDL_SwapLE16(sample7); + dst += 8; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 1; + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst++; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst += 2; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst += 4; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 6; + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst += 6; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 8; + Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7])); + Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6])); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample7 = sample7; + Sint16 last_sample6 = sample6; + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[7] = ((Sint16) SDL_SwapLE16(sample7)); + dst[6] = ((Sint16) SDL_SwapLE16(sample6)); + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6])); + Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + Sint16 last_sample6 = sample6; + Sint16 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst[6] = ((Sint16) SDL_SwapLE16(sample6)); + dst[7] = ((Sint16) SDL_SwapLE16(sample7)); + dst += 8; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 1; + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[0] = SDL_SwapBE16(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst++; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 2; + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst += 2; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 4; + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[3] = SDL_SwapBE16(sample3); + dst[2] = SDL_SwapBE16(sample2); + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst[2] = SDL_SwapBE16(sample2); + dst[3] = SDL_SwapBE16(sample3); + dst += 4; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 6; + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[5] = SDL_SwapBE16(sample5); + dst[4] = SDL_SwapBE16(sample4); + dst[3] = SDL_SwapBE16(sample3); + dst[2] = SDL_SwapBE16(sample2); + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst[2] = SDL_SwapBE16(sample2); + dst[3] = SDL_SwapBE16(sample3); + dst[4] = SDL_SwapBE16(sample4); + dst[5] = SDL_SwapBE16(sample5); + dst += 6; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 8; + Uint16 sample7 = SDL_SwapBE16(src[7]); + Uint16 sample6 = SDL_SwapBE16(src[6]); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample7 = sample7; + Uint16 last_sample6 = sample6; + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst != target) { + dst[7] = SDL_SwapBE16(sample7); + dst[6] = SDL_SwapBE16(sample6); + dst[5] = SDL_SwapBE16(sample5); + dst[4] = SDL_SwapBE16(sample4); + dst[3] = SDL_SwapBE16(sample3); + dst[2] = SDL_SwapBE16(sample2); + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 sample6 = SDL_SwapBE16(src[6]); + Uint16 sample7 = SDL_SwapBE16(src[7]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + Uint16 last_sample6 = sample6; + Uint16 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst[2] = SDL_SwapBE16(sample2); + dst[3] = SDL_SwapBE16(sample3); + dst[4] = SDL_SwapBE16(sample4); + dst[5] = SDL_SwapBE16(sample5); + dst[6] = SDL_SwapBE16(sample6); + dst[7] = SDL_SwapBE16(sample7); + dst += 8; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 1; + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst++; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst += 2; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst += 4; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 6; + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst += 6; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 8; + Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7])); + Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6])); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample7 = sample7; + Sint16 last_sample6 = sample6; + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst != target) { + dst[7] = ((Sint16) SDL_SwapBE16(sample7)); + dst[6] = ((Sint16) SDL_SwapBE16(sample6)); + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6])); + Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + Sint16 last_sample6 = sample6; + Sint16 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst[6] = ((Sint16) SDL_SwapBE16(sample6)); + dst[7] = ((Sint16) SDL_SwapBE16(sample7)); + dst += 8; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 1; + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst++; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 2; + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst += 2; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 4; + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst += 4; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 6; + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst += 6; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 8; + Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7])); + Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6])); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample7 = sample7; + Sint32 last_sample6 = sample6; + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[7] = ((Sint32) SDL_SwapLE32(sample7)); + dst[6] = ((Sint32) SDL_SwapLE32(sample6)); + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6])); + Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + Sint32 last_sample6 = sample6; + Sint32 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst[6] = ((Sint32) SDL_SwapLE32(sample6)); + dst[7] = ((Sint32) SDL_SwapLE32(sample7)); + dst += 8; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 1; + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst++; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 2; + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst += 2; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 4; + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst += 4; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 6; + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst += 6; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 8; + Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7])); + Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6])); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample7 = sample7; + Sint32 last_sample6 = sample6; + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst != target) { + dst[7] = ((Sint32) SDL_SwapBE32(sample7)); + dst[6] = ((Sint32) SDL_SwapBE32(sample6)); + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6])); + Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + Sint32 last_sample6 = sample6; + Sint32 last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst[6] = ((Sint32) SDL_SwapBE32(sample6)); + dst[7] = ((Sint32) SDL_SwapBE32(sample7)); + dst += 8; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf) - 1; + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample0 = sample0; + while (dst != target) { + dst[0] = SDL_SwapFloatLE(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst++; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf) - 2; + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float last_sample0 = sample0; + float last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst += 2; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf) - 4; + float sample3 = SDL_SwapFloatLE(src[3]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[3] = SDL_SwapFloatLE(sample3); + dst[2] = SDL_SwapFloatLE(sample2); + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample3 = SDL_SwapFloatLE(src[3]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst[2] = SDL_SwapFloatLE(sample2); + dst[3] = SDL_SwapFloatLE(sample3); + dst += 4; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf) - 6; + float sample5 = SDL_SwapFloatLE(src[5]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[5] = SDL_SwapFloatLE(sample5); + dst[4] = SDL_SwapFloatLE(sample4); + dst[3] = SDL_SwapFloatLE(sample3); + dst[2] = SDL_SwapFloatLE(sample2); + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample5 = SDL_SwapFloatLE(src[5]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst[2] = SDL_SwapFloatLE(sample2); + dst[3] = SDL_SwapFloatLE(sample3); + dst[4] = SDL_SwapFloatLE(sample4); + dst[5] = SDL_SwapFloatLE(sample5); + dst += 6; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf) - 8; + float sample7 = SDL_SwapFloatLE(src[7]); + float sample6 = SDL_SwapFloatLE(src[6]); + float sample5 = SDL_SwapFloatLE(src[5]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample7 = sample7; + float last_sample6 = sample6; + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[7] = SDL_SwapFloatLE(sample7); + dst[6] = SDL_SwapFloatLE(sample6); + dst[5] = SDL_SwapFloatLE(sample5); + dst[4] = SDL_SwapFloatLE(sample4); + dst[3] = SDL_SwapFloatLE(sample3); + dst[2] = SDL_SwapFloatLE(sample2); + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample5 = SDL_SwapFloatLE(src[5]); + float sample6 = SDL_SwapFloatLE(src[6]); + float sample7 = SDL_SwapFloatLE(src[7]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + float last_sample6 = sample6; + float last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst[2] = SDL_SwapFloatLE(sample2); + dst[3] = SDL_SwapFloatLE(sample3); + dst[4] = SDL_SwapFloatLE(sample4); + dst[5] = SDL_SwapFloatLE(sample5); + dst[6] = SDL_SwapFloatLE(sample6); + dst[7] = SDL_SwapFloatLE(sample7); + dst += 8; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5); + sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf) - 1; + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample0 = sample0; + while (dst != target) { + dst[0] = SDL_SwapFloatBE(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample0 = sample0; + while (dst != target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst++; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf) - 2; + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float last_sample0 = sample0; + float last_sample1 = sample1; + while (dst != target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst += 2; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf) - 4; + float sample3 = SDL_SwapFloatBE(src[3]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[3] = SDL_SwapFloatBE(sample3); + dst[2] = SDL_SwapFloatBE(sample2); + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample3 = SDL_SwapFloatBE(src[3]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + while (dst != target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst[2] = SDL_SwapFloatBE(sample2); + dst[3] = SDL_SwapFloatBE(sample3); + dst += 4; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf) - 6; + float sample5 = SDL_SwapFloatBE(src[5]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[5] = SDL_SwapFloatBE(sample5); + dst[4] = SDL_SwapFloatBE(sample4); + dst[3] = SDL_SwapFloatBE(sample3); + dst[2] = SDL_SwapFloatBE(sample2); + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample5 = SDL_SwapFloatBE(src[5]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + while (dst != target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst[2] = SDL_SwapFloatBE(sample2); + dst[3] = SDL_SwapFloatBE(sample3); + dst[4] = SDL_SwapFloatBE(sample4); + dst[5] = SDL_SwapFloatBE(sample5); + dst += 6; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf) - 8; + float sample7 = SDL_SwapFloatBE(src[7]); + float sample6 = SDL_SwapFloatBE(src[6]); + float sample5 = SDL_SwapFloatBE(src[5]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample7 = sample7; + float last_sample6 = sample6; + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst != target) { + dst[7] = SDL_SwapFloatBE(sample7); + dst[6] = SDL_SwapFloatBE(sample6); + dst[5] = SDL_SwapFloatBE(sample5); + dst[4] = SDL_SwapFloatBE(sample4); + dst[3] = SDL_SwapFloatBE(sample3); + dst[2] = SDL_SwapFloatBE(sample2); + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample5 = SDL_SwapFloatBE(src[5]); + float sample6 = SDL_SwapFloatBE(src[6]); + float sample7 = SDL_SwapFloatBE(src[7]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + float last_sample6 = sample6; + float last_sample7 = sample7; + while (dst != target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst[2] = SDL_SwapFloatBE(sample2); + dst[3] = SDL_SwapFloatBE(sample3); + dst[4] = SDL_SwapFloatBE(sample4); + dst[5] = SDL_SwapFloatBE(sample5); + dst[6] = SDL_SwapFloatBE(sample6); + dst[7] = SDL_SwapFloatBE(sample7); + dst += 8; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5); + sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +#if !LESS_RESAMPLERS + +static void SDLCALL +SDL_Upsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 1; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + src--; + dst[1] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint8) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + src += 2; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 1; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + src--; + dst[3] = (Uint8) sample0; + dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + src += 4; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 2; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 2; + dst[3] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + src += 4; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 2; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 2; + dst[7] = (Uint8) sample1; + dst[6] = (Uint8) sample0; + dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + src += 8; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 4; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 4; + dst[7] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + src += 8; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 4; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 4; + dst[15] = (Uint8) sample3; + dst[14] = (Uint8) sample2; + dst[13] = (Uint8) sample1; + dst[12] = (Uint8) sample0; + dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + src += 16; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 6; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 6; + dst[11] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint8) sample5; + dst[4] = (Uint8) sample4; + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + src += 12; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 6; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 6; + dst[23] = (Uint8) sample5; + dst[22] = (Uint8) sample4; + dst[21] = (Uint8) sample3; + dst[20] = (Uint8) sample2; + dst[19] = (Uint8) sample1; + dst[18] = (Uint8) sample0; + dst[17] = (Uint8) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Uint8) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Uint8) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Uint8) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + src += 24; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 8; + Sint16 last_sample7 = (Sint16) src[7]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample7 = (Sint16) src[7]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 8; + dst[15] = (Uint8) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint8) sample7; + dst[6] = (Uint8) sample6; + dst[5] = (Uint8) sample5; + dst[4] = (Uint8) sample4; + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample7 = (Sint16) src[7]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample7 = (Sint16) src[7]; + src += 16; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint8 *target = ((const Uint8 *) cvt->buf) - 8; + Sint16 last_sample7 = (Sint16) src[7]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst != target) { + const Sint16 sample7 = (Sint16) src[7]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 8; + dst[31] = (Uint8) sample7; + dst[30] = (Uint8) sample6; + dst[29] = (Uint8) sample5; + dst[28] = (Uint8) sample4; + dst[27] = (Uint8) sample3; + dst[26] = (Uint8) sample2; + dst[25] = (Uint8) sample1; + dst[24] = (Uint8) sample0; + dst[23] = (Uint8) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Uint8) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Uint8) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Uint8) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Uint8) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Uint8) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Uint8) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample7 = (Sint16) src[7]; + while (dst != target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample7 = (Sint16) src[7]; + src += 32; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 1; + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src--; + dst[1] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint8) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src += 2; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 1; + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src--; + dst[3] = (Sint8) sample0; + dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src += 4; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 2; + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 2; + dst[3] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + src += 4; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 2; + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 2; + dst[7] = (Sint8) sample1; + dst[6] = (Sint8) sample0; + dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + src += 8; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 4; + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 4; + dst[7] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + src += 8; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 4; + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 4; + dst[15] = (Sint8) sample3; + dst[14] = (Sint8) sample2; + dst[13] = (Sint8) sample1; + dst[12] = (Sint8) sample0; + dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + src += 16; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 6; + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 6; + dst[11] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint8) sample5; + dst[4] = (Sint8) sample4; + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + src += 12; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 6; + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 6; + dst[23] = (Sint8) sample5; + dst[22] = (Sint8) sample4; + dst[21] = (Sint8) sample3; + dst[20] = (Sint8) sample2; + dst[19] = (Sint8) sample1; + dst[18] = (Sint8) sample0; + dst[17] = (Sint8) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Sint8) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Sint8) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Sint8) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + src += 24; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 8; + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 8; + dst[15] = (Sint8) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint8) sample7; + dst[6] = (Sint8) sample6; + dst[5] = (Sint8) sample5; + dst[4] = (Sint8) sample4; + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + src += 16; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint8 *target = ((const Sint8 *) cvt->buf) - 8; + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst != target) { + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 8; + dst[31] = (Sint8) sample7; + dst[30] = (Sint8) sample6; + dst[29] = (Sint8) sample5; + dst[28] = (Sint8) sample4; + dst[27] = (Sint8) sample3; + dst[26] = (Sint8) sample2; + dst[25] = (Sint8) sample1; + dst[24] = (Sint8) sample0; + dst[23] = (Sint8) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Sint8) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Sint8) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Sint8) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Sint8) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Sint8) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Sint8) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + while (dst != target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + src += 32; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src--; + dst[1] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src += 2; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src--; + dst[3] = (Uint16) sample0; + dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 2; + dst[3] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 2; + dst[7] = (Uint16) sample1; + dst[6] = (Uint16) sample0; + dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 4; + dst[7] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 4; + dst[15] = (Uint16) sample3; + dst[14] = (Uint16) sample2; + dst[13] = (Uint16) sample1; + dst[12] = (Uint16) sample0; + dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 6; + dst[11] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + src += 12; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 6; + dst[23] = (Uint16) sample5; + dst[22] = (Uint16) sample4; + dst[21] = (Uint16) sample3; + dst[20] = (Uint16) sample2; + dst[19] = (Uint16) sample1; + dst[18] = (Uint16) sample0; + dst[17] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + src += 24; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 8; + dst[15] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) sample7; + dst[6] = (Uint16) sample6; + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst != target) { + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 8; + dst[31] = (Uint16) sample7; + dst[30] = (Uint16) sample6; + dst[29] = (Uint16) sample5; + dst[28] = (Uint16) sample4; + dst[27] = (Uint16) sample3; + dst[26] = (Uint16) sample2; + dst[25] = (Uint16) sample1; + dst[24] = (Uint16) sample0; + dst[23] = (Uint16) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Uint16) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + src += 32; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src--; + dst[1] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src += 2; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src--; + dst[3] = (Sint16) sample0; + dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 2; + dst[3] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 2; + dst[7] = (Sint16) sample1; + dst[6] = (Sint16) sample0; + dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 4; + dst[7] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 4; + dst[15] = (Sint16) sample3; + dst[14] = (Sint16) sample2; + dst[13] = (Sint16) sample1; + dst[12] = (Sint16) sample0; + dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 6; + dst[11] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + src += 12; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 6; + dst[23] = (Sint16) sample5; + dst[22] = (Sint16) sample4; + dst[21] = (Sint16) sample3; + dst[20] = (Sint16) sample2; + dst[19] = (Sint16) sample1; + dst[18] = (Sint16) sample0; + dst[17] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + src += 24; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 8; + dst[15] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) sample7; + dst[6] = (Sint16) sample6; + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst != target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 8; + dst[31] = (Sint16) sample7; + dst[30] = (Sint16) sample6; + dst[29] = (Sint16) sample5; + dst[28] = (Sint16) sample4; + dst[27] = (Sint16) sample3; + dst[26] = (Sint16) sample2; + dst[25] = (Sint16) sample1; + dst[24] = (Sint16) sample0; + dst[23] = (Sint16) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Sint16) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + src += 32; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src--; + dst[1] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src += 2; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src--; + dst[3] = (Uint16) sample0; + dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 2; + dst[3] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 2; + dst[7] = (Uint16) sample1; + dst[6] = (Uint16) sample0; + dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 4; + dst[7] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 4; + dst[15] = (Uint16) sample3; + dst[14] = (Uint16) sample2; + dst[13] = (Uint16) sample1; + dst[12] = (Uint16) sample0; + dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 6; + dst[11] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + src += 12; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 6; + dst[23] = (Uint16) sample5; + dst[22] = (Uint16) sample4; + dst[21] = (Uint16) sample3; + dst[20] = (Uint16) sample2; + dst[19] = (Uint16) sample1; + dst[18] = (Uint16) sample0; + dst[17] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + src += 24; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 8; + dst[15] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) sample7; + dst[6] = (Uint16) sample6; + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst != target) { + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 8; + dst[31] = (Uint16) sample7; + dst[30] = (Uint16) sample6; + dst[29] = (Uint16) sample5; + dst[28] = (Uint16) sample4; + dst[27] = (Uint16) sample3; + dst[26] = (Uint16) sample2; + dst[25] = (Uint16) sample1; + dst[24] = (Uint16) sample0; + dst[23] = (Uint16) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Uint16) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + while (dst != target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + src += 32; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src--; + dst[1] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src += 2; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 1; + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src--; + dst[3] = (Sint16) sample0; + dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 2; + dst[3] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 2; + dst[7] = (Sint16) sample1; + dst[6] = (Sint16) sample0; + dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 4; + dst[7] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 4; + dst[15] = (Sint16) sample3; + dst[14] = (Sint16) sample2; + dst[13] = (Sint16) sample1; + dst[12] = (Sint16) sample0; + dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 6; + dst[11] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + src += 12; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 6; + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 6; + dst[23] = (Sint16) sample5; + dst[22] = (Sint16) sample4; + dst[21] = (Sint16) sample3; + dst[20] = (Sint16) sample2; + dst[19] = (Sint16) sample1; + dst[18] = (Sint16) sample0; + dst[17] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + src += 24; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 8; + dst[15] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) sample7; + dst[6] = (Sint16) sample6; + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf) - 8; + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst != target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 8; + dst[31] = (Sint16) sample7; + dst[30] = (Sint16) sample6; + dst[29] = (Sint16) sample5; + dst[28] = (Sint16) sample4; + dst[27] = (Sint16) sample3; + dst[26] = (Sint16) sample2; + dst[25] = (Sint16) sample1; + dst[24] = (Sint16) sample0; + dst[23] = (Sint16) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Sint16) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + while (dst != target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + src += 32; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 1; + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src--; + dst[1] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint32) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src += 2; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 1; + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src--; + dst[3] = (Sint32) sample0; + dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 2; + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 2; + dst[3] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 2; + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 2; + dst[7] = (Sint32) sample1; + dst[6] = (Sint32) sample0; + dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 4; + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 4; + dst[7] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 4; + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 4; + dst[15] = (Sint32) sample3; + dst[14] = (Sint32) sample2; + dst[13] = (Sint32) sample1; + dst[12] = (Sint32) sample0; + dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 6; + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 6; + dst[11] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + src += 12; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 6; + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 6; + dst[23] = (Sint32) sample5; + dst[22] = (Sint32) sample4; + dst[21] = (Sint32) sample3; + dst[20] = (Sint32) sample2; + dst[19] = (Sint32) sample1; + dst[18] = (Sint32) sample0; + dst[17] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + src += 24; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 8; + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 8; + dst[15] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) sample7; + dst[6] = (Sint32) sample6; + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 8; + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst != target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 8; + dst[31] = (Sint32) sample7; + dst[30] = (Sint32) sample6; + dst[29] = (Sint32) sample5; + dst[28] = (Sint32) sample4; + dst[27] = (Sint32) sample3; + dst[26] = (Sint32) sample2; + dst[25] = (Sint32) sample1; + dst[24] = (Sint32) sample0; + dst[23] = (Sint32) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Sint32) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + src += 32; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 1; + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src--; + dst[1] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint32) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src += 2; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 1; + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src--; + dst[3] = (Sint32) sample0; + dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 2; + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 2; + dst[3] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 2; + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 2; + dst[7] = (Sint32) sample1; + dst[6] = (Sint32) sample0; + dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 4; + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 4; + dst[7] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 4; + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 4; + dst[15] = (Sint32) sample3; + dst[14] = (Sint32) sample2; + dst[13] = (Sint32) sample1; + dst[12] = (Sint32) sample0; + dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 6; + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 6; + dst[11] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + src += 12; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 6; + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 6; + dst[23] = (Sint32) sample5; + dst[22] = (Sint32) sample4; + dst[21] = (Sint32) sample3; + dst[20] = (Sint32) sample2; + dst[19] = (Sint32) sample1; + dst[18] = (Sint32) sample0; + dst[17] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[16] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[15] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[14] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[13] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[12] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[11] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + src += 24; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 8; + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 8; + dst[15] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) sample7; + dst[6] = (Sint32) sample6; + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf) - 8; + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst != target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 8; + dst[31] = (Sint32) sample7; + dst[30] = (Sint32) sample6; + dst[29] = (Sint32) sample5; + dst[28] = (Sint32) sample4; + dst[27] = (Sint32) sample3; + dst[26] = (Sint32) sample2; + dst[25] = (Sint32) sample1; + dst[24] = (Sint32) sample0; + dst[23] = (Sint32) (((3 * sample7) + last_sample7) >> 2); + dst[22] = (Sint32) (((3 * sample6) + last_sample6) >> 2); + dst[21] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[20] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[19] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[18] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[17] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[16] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[15] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2); + dst[6] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2); + dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + while (dst != target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + src += 32; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf) - 1; + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src--; + dst[1] = (float) ((sample0 + last_sample0) * 0.5); + dst[0] = (float) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src += 2; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf) - 1; + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src--; + dst[3] = (float) sample0; + dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[1] = (float) ((sample0 + last_sample0) * 0.5); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf) - 2; + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 2; + dst[3] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf) - 2; + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 2; + dst[7] = (float) sample1; + dst[6] = (float) sample0; + dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[3] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf) - 4; + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 4; + dst[7] = (float) ((sample3 + last_sample3) * 0.5); + dst[6] = (float) ((sample2 + last_sample2) * 0.5); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf) - 4; + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 4; + dst[15] = (float) sample3; + dst[14] = (float) sample2; + dst[13] = (float) sample1; + dst[12] = (float) sample0; + dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[7] = (float) ((sample3 + last_sample3) * 0.5); + dst[6] = (float) ((sample2 + last_sample2) * 0.5); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf) - 6; + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 6; + dst[11] = (float) ((sample5 + last_sample5) * 0.5); + dst[10] = (float) ((sample4 + last_sample4) * 0.5); + dst[9] = (float) ((sample3 + last_sample3) * 0.5); + dst[8] = (float) ((sample2 + last_sample2) * 0.5); + dst[7] = (float) ((sample1 + last_sample1) * 0.5); + dst[6] = (float) ((sample0 + last_sample0) * 0.5); + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + src += 12; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf) - 6; + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 6; + dst[23] = (float) sample5; + dst[22] = (float) sample4; + dst[21] = (float) sample3; + dst[20] = (float) sample2; + dst[19] = (float) sample1; + dst[18] = (float) sample0; + dst[17] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[16] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[15] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[14] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[13] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[12] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[11] = (float) ((sample5 + last_sample5) * 0.5); + dst[10] = (float) ((sample4 + last_sample4) * 0.5); + dst[9] = (float) ((sample3 + last_sample3) * 0.5); + dst[8] = (float) ((sample2 + last_sample2) * 0.5); + dst[7] = (float) ((sample1 + last_sample1) * 0.5); + dst[6] = (float) ((sample0 + last_sample0) * 0.5); + dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + src += 24; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf) - 8; + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 8; + dst[15] = (float) ((sample7 + last_sample7) * 0.5); + dst[14] = (float) ((sample6 + last_sample6) * 0.5); + dst[13] = (float) ((sample5 + last_sample5) * 0.5); + dst[12] = (float) ((sample4 + last_sample4) * 0.5); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) sample7; + dst[6] = (float) sample6; + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf) - 8; + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst != target) { + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 8; + dst[31] = (float) sample7; + dst[30] = (float) sample6; + dst[29] = (float) sample5; + dst[28] = (float) sample4; + dst[27] = (float) sample3; + dst[26] = (float) sample2; + dst[25] = (float) sample1; + dst[24] = (float) sample0; + dst[23] = (float) (((3.0 * sample7) + last_sample7) * 0.25); + dst[22] = (float) (((3.0 * sample6) + last_sample6) * 0.25); + dst[21] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[20] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[19] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[18] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[17] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[16] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[15] = (float) ((sample7 + last_sample7) * 0.5); + dst[14] = (float) ((sample6 + last_sample6) * 0.5); + dst[13] = (float) ((sample5 + last_sample5) * 0.5); + dst[12] = (float) ((sample4 + last_sample4) * 0.5); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25); + dst[6] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25); + dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + src += 32; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf) - 1; + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src--; + dst[1] = (float) ((sample0 + last_sample0) * 0.5); + dst[0] = (float) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src += 2; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf) - 1; + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src--; + dst[3] = (float) sample0; + dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[1] = (float) ((sample0 + last_sample0) * 0.5); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf) - 2; + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 2; + dst[3] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf) - 2; + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 2; + dst[7] = (float) sample1; + dst[6] = (float) sample0; + dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[3] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf) - 4; + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 4; + dst[7] = (float) ((sample3 + last_sample3) * 0.5); + dst[6] = (float) ((sample2 + last_sample2) * 0.5); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf) - 4; + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 4; + dst[15] = (float) sample3; + dst[14] = (float) sample2; + dst[13] = (float) sample1; + dst[12] = (float) sample0; + dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[7] = (float) ((sample3 + last_sample3) * 0.5); + dst[6] = (float) ((sample2 + last_sample2) * 0.5); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf) - 6; + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 6; + dst[11] = (float) ((sample5 + last_sample5) * 0.5); + dst[10] = (float) ((sample4 + last_sample4) * 0.5); + dst[9] = (float) ((sample3 + last_sample3) * 0.5); + dst[8] = (float) ((sample2 + last_sample2) * 0.5); + dst[7] = (float) ((sample1 + last_sample1) * 0.5); + dst[6] = (float) ((sample0 + last_sample0) * 0.5); + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + src += 12; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf) - 6; + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 6; + dst[23] = (float) sample5; + dst[22] = (float) sample4; + dst[21] = (float) sample3; + dst[20] = (float) sample2; + dst[19] = (float) sample1; + dst[18] = (float) sample0; + dst[17] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[16] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[15] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[14] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[13] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[12] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[11] = (float) ((sample5 + last_sample5) * 0.5); + dst[10] = (float) ((sample4 + last_sample4) * 0.5); + dst[9] = (float) ((sample3 + last_sample3) * 0.5); + dst[8] = (float) ((sample2 + last_sample2) * 0.5); + dst[7] = (float) ((sample1 + last_sample1) * 0.5); + dst[6] = (float) ((sample0 + last_sample0) * 0.5); + dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + src += 24; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf) - 8; + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 8; + dst[15] = (float) ((sample7 + last_sample7) * 0.5); + dst[14] = (float) ((sample6 + last_sample6) * 0.5); + dst[13] = (float) ((sample5 + last_sample5) * 0.5); + dst[12] = (float) ((sample4 + last_sample4) * 0.5); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) sample7; + dst[6] = (float) sample6; + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf) - 8; + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst != target) { + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 8; + dst[31] = (float) sample7; + dst[30] = (float) sample6; + dst[29] = (float) sample5; + dst[28] = (float) sample4; + dst[27] = (float) sample3; + dst[26] = (float) sample2; + dst[25] = (float) sample1; + dst[24] = (float) sample0; + dst[23] = (float) (((3.0 * sample7) + last_sample7) * 0.25); + dst[22] = (float) (((3.0 * sample6) + last_sample6) * 0.25); + dst[21] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[20] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[19] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[18] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[17] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[16] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[15] = (float) ((sample7 + last_sample7) * 0.5); + dst[14] = (float) ((sample6 + last_sample6) * 0.5); + dst[13] = (float) ((sample5 + last_sample5) * 0.5); + dst[12] = (float) ((sample4 + last_sample4) * 0.5); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25); + dst[6] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25); + dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int srcsize = cvt->len_cvt; + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + while (dst != target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + src += 32; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +#endif /* !LESS_RESAMPLERS */ +#endif /* !NO_RESAMPLERS */ + + +const SDL_AudioRateFilters sdl_audio_rate_filters[] = +{ +#if !NO_RESAMPLERS + { AUDIO_U8, 1, 0, 0, SDL_Downsample_U8_1c }, + { AUDIO_U8, 1, 1, 0, SDL_Upsample_U8_1c }, + { AUDIO_U8, 2, 0, 0, SDL_Downsample_U8_2c }, + { AUDIO_U8, 2, 1, 0, SDL_Upsample_U8_2c }, + { AUDIO_U8, 4, 0, 0, SDL_Downsample_U8_4c }, + { AUDIO_U8, 4, 1, 0, SDL_Upsample_U8_4c }, + { AUDIO_U8, 6, 0, 0, SDL_Downsample_U8_6c }, + { AUDIO_U8, 6, 1, 0, SDL_Upsample_U8_6c }, + { AUDIO_U8, 8, 0, 0, SDL_Downsample_U8_8c }, + { AUDIO_U8, 8, 1, 0, SDL_Upsample_U8_8c }, + { AUDIO_S8, 1, 0, 0, SDL_Downsample_S8_1c }, + { AUDIO_S8, 1, 1, 0, SDL_Upsample_S8_1c }, + { AUDIO_S8, 2, 0, 0, SDL_Downsample_S8_2c }, + { AUDIO_S8, 2, 1, 0, SDL_Upsample_S8_2c }, + { AUDIO_S8, 4, 0, 0, SDL_Downsample_S8_4c }, + { AUDIO_S8, 4, 1, 0, SDL_Upsample_S8_4c }, + { AUDIO_S8, 6, 0, 0, SDL_Downsample_S8_6c }, + { AUDIO_S8, 6, 1, 0, SDL_Upsample_S8_6c }, + { AUDIO_S8, 8, 0, 0, SDL_Downsample_S8_8c }, + { AUDIO_S8, 8, 1, 0, SDL_Upsample_S8_8c }, + { AUDIO_U16LSB, 1, 0, 0, SDL_Downsample_U16LSB_1c }, + { AUDIO_U16LSB, 1, 1, 0, SDL_Upsample_U16LSB_1c }, + { AUDIO_U16LSB, 2, 0, 0, SDL_Downsample_U16LSB_2c }, + { AUDIO_U16LSB, 2, 1, 0, SDL_Upsample_U16LSB_2c }, + { AUDIO_U16LSB, 4, 0, 0, SDL_Downsample_U16LSB_4c }, + { AUDIO_U16LSB, 4, 1, 0, SDL_Upsample_U16LSB_4c }, + { AUDIO_U16LSB, 6, 0, 0, SDL_Downsample_U16LSB_6c }, + { AUDIO_U16LSB, 6, 1, 0, SDL_Upsample_U16LSB_6c }, + { AUDIO_U16LSB, 8, 0, 0, SDL_Downsample_U16LSB_8c }, + { AUDIO_U16LSB, 8, 1, 0, SDL_Upsample_U16LSB_8c }, + { AUDIO_S16LSB, 1, 0, 0, SDL_Downsample_S16LSB_1c }, + { AUDIO_S16LSB, 1, 1, 0, SDL_Upsample_S16LSB_1c }, + { AUDIO_S16LSB, 2, 0, 0, SDL_Downsample_S16LSB_2c }, + { AUDIO_S16LSB, 2, 1, 0, SDL_Upsample_S16LSB_2c }, + { AUDIO_S16LSB, 4, 0, 0, SDL_Downsample_S16LSB_4c }, + { AUDIO_S16LSB, 4, 1, 0, SDL_Upsample_S16LSB_4c }, + { AUDIO_S16LSB, 6, 0, 0, SDL_Downsample_S16LSB_6c }, + { AUDIO_S16LSB, 6, 1, 0, SDL_Upsample_S16LSB_6c }, + { AUDIO_S16LSB, 8, 0, 0, SDL_Downsample_S16LSB_8c }, + { AUDIO_S16LSB, 8, 1, 0, SDL_Upsample_S16LSB_8c }, + { AUDIO_U16MSB, 1, 0, 0, SDL_Downsample_U16MSB_1c }, + { AUDIO_U16MSB, 1, 1, 0, SDL_Upsample_U16MSB_1c }, + { AUDIO_U16MSB, 2, 0, 0, SDL_Downsample_U16MSB_2c }, + { AUDIO_U16MSB, 2, 1, 0, SDL_Upsample_U16MSB_2c }, + { AUDIO_U16MSB, 4, 0, 0, SDL_Downsample_U16MSB_4c }, + { AUDIO_U16MSB, 4, 1, 0, SDL_Upsample_U16MSB_4c }, + { AUDIO_U16MSB, 6, 0, 0, SDL_Downsample_U16MSB_6c }, + { AUDIO_U16MSB, 6, 1, 0, SDL_Upsample_U16MSB_6c }, + { AUDIO_U16MSB, 8, 0, 0, SDL_Downsample_U16MSB_8c }, + { AUDIO_U16MSB, 8, 1, 0, SDL_Upsample_U16MSB_8c }, + { AUDIO_S16MSB, 1, 0, 0, SDL_Downsample_S16MSB_1c }, + { AUDIO_S16MSB, 1, 1, 0, SDL_Upsample_S16MSB_1c }, + { AUDIO_S16MSB, 2, 0, 0, SDL_Downsample_S16MSB_2c }, + { AUDIO_S16MSB, 2, 1, 0, SDL_Upsample_S16MSB_2c }, + { AUDIO_S16MSB, 4, 0, 0, SDL_Downsample_S16MSB_4c }, + { AUDIO_S16MSB, 4, 1, 0, SDL_Upsample_S16MSB_4c }, + { AUDIO_S16MSB, 6, 0, 0, SDL_Downsample_S16MSB_6c }, + { AUDIO_S16MSB, 6, 1, 0, SDL_Upsample_S16MSB_6c }, + { AUDIO_S16MSB, 8, 0, 0, SDL_Downsample_S16MSB_8c }, + { AUDIO_S16MSB, 8, 1, 0, SDL_Upsample_S16MSB_8c }, + { AUDIO_S32LSB, 1, 0, 0, SDL_Downsample_S32LSB_1c }, + { AUDIO_S32LSB, 1, 1, 0, SDL_Upsample_S32LSB_1c }, + { AUDIO_S32LSB, 2, 0, 0, SDL_Downsample_S32LSB_2c }, + { AUDIO_S32LSB, 2, 1, 0, SDL_Upsample_S32LSB_2c }, + { AUDIO_S32LSB, 4, 0, 0, SDL_Downsample_S32LSB_4c }, + { AUDIO_S32LSB, 4, 1, 0, SDL_Upsample_S32LSB_4c }, + { AUDIO_S32LSB, 6, 0, 0, SDL_Downsample_S32LSB_6c }, + { AUDIO_S32LSB, 6, 1, 0, SDL_Upsample_S32LSB_6c }, + { AUDIO_S32LSB, 8, 0, 0, SDL_Downsample_S32LSB_8c }, + { AUDIO_S32LSB, 8, 1, 0, SDL_Upsample_S32LSB_8c }, + { AUDIO_S32MSB, 1, 0, 0, SDL_Downsample_S32MSB_1c }, + { AUDIO_S32MSB, 1, 1, 0, SDL_Upsample_S32MSB_1c }, + { AUDIO_S32MSB, 2, 0, 0, SDL_Downsample_S32MSB_2c }, + { AUDIO_S32MSB, 2, 1, 0, SDL_Upsample_S32MSB_2c }, + { AUDIO_S32MSB, 4, 0, 0, SDL_Downsample_S32MSB_4c }, + { AUDIO_S32MSB, 4, 1, 0, SDL_Upsample_S32MSB_4c }, + { AUDIO_S32MSB, 6, 0, 0, SDL_Downsample_S32MSB_6c }, + { AUDIO_S32MSB, 6, 1, 0, SDL_Upsample_S32MSB_6c }, + { AUDIO_S32MSB, 8, 0, 0, SDL_Downsample_S32MSB_8c }, + { AUDIO_S32MSB, 8, 1, 0, SDL_Upsample_S32MSB_8c }, + { AUDIO_F32LSB, 1, 0, 0, SDL_Downsample_F32LSB_1c }, + { AUDIO_F32LSB, 1, 1, 0, SDL_Upsample_F32LSB_1c }, + { AUDIO_F32LSB, 2, 0, 0, SDL_Downsample_F32LSB_2c }, + { AUDIO_F32LSB, 2, 1, 0, SDL_Upsample_F32LSB_2c }, + { AUDIO_F32LSB, 4, 0, 0, SDL_Downsample_F32LSB_4c }, + { AUDIO_F32LSB, 4, 1, 0, SDL_Upsample_F32LSB_4c }, + { AUDIO_F32LSB, 6, 0, 0, SDL_Downsample_F32LSB_6c }, + { AUDIO_F32LSB, 6, 1, 0, SDL_Upsample_F32LSB_6c }, + { AUDIO_F32LSB, 8, 0, 0, SDL_Downsample_F32LSB_8c }, + { AUDIO_F32LSB, 8, 1, 0, SDL_Upsample_F32LSB_8c }, + { AUDIO_F32MSB, 1, 0, 0, SDL_Downsample_F32MSB_1c }, + { AUDIO_F32MSB, 1, 1, 0, SDL_Upsample_F32MSB_1c }, + { AUDIO_F32MSB, 2, 0, 0, SDL_Downsample_F32MSB_2c }, + { AUDIO_F32MSB, 2, 1, 0, SDL_Upsample_F32MSB_2c }, + { AUDIO_F32MSB, 4, 0, 0, SDL_Downsample_F32MSB_4c }, + { AUDIO_F32MSB, 4, 1, 0, SDL_Upsample_F32MSB_4c }, + { AUDIO_F32MSB, 6, 0, 0, SDL_Downsample_F32MSB_6c }, + { AUDIO_F32MSB, 6, 1, 0, SDL_Upsample_F32MSB_6c }, + { AUDIO_F32MSB, 8, 0, 0, SDL_Downsample_F32MSB_8c }, + { AUDIO_F32MSB, 8, 1, 0, SDL_Upsample_F32MSB_8c }, +#if !LESS_RESAMPLERS + { AUDIO_U8, 1, 0, 2, SDL_Downsample_U8_1c_x2 }, + { AUDIO_U8, 1, 1, 2, SDL_Upsample_U8_1c_x2 }, + { AUDIO_U8, 1, 0, 4, SDL_Downsample_U8_1c_x4 }, + { AUDIO_U8, 1, 1, 4, SDL_Upsample_U8_1c_x4 }, + { AUDIO_U8, 2, 0, 2, SDL_Downsample_U8_2c_x2 }, + { AUDIO_U8, 2, 1, 2, SDL_Upsample_U8_2c_x2 }, + { AUDIO_U8, 2, 0, 4, SDL_Downsample_U8_2c_x4 }, + { AUDIO_U8, 2, 1, 4, SDL_Upsample_U8_2c_x4 }, + { AUDIO_U8, 4, 0, 2, SDL_Downsample_U8_4c_x2 }, + { AUDIO_U8, 4, 1, 2, SDL_Upsample_U8_4c_x2 }, + { AUDIO_U8, 4, 0, 4, SDL_Downsample_U8_4c_x4 }, + { AUDIO_U8, 4, 1, 4, SDL_Upsample_U8_4c_x4 }, + { AUDIO_U8, 6, 0, 2, SDL_Downsample_U8_6c_x2 }, + { AUDIO_U8, 6, 1, 2, SDL_Upsample_U8_6c_x2 }, + { AUDIO_U8, 6, 0, 4, SDL_Downsample_U8_6c_x4 }, + { AUDIO_U8, 6, 1, 4, SDL_Upsample_U8_6c_x4 }, + { AUDIO_U8, 8, 0, 2, SDL_Downsample_U8_8c_x2 }, + { AUDIO_U8, 8, 1, 2, SDL_Upsample_U8_8c_x2 }, + { AUDIO_U8, 8, 0, 4, SDL_Downsample_U8_8c_x4 }, + { AUDIO_U8, 8, 1, 4, SDL_Upsample_U8_8c_x4 }, + { AUDIO_S8, 1, 0, 2, SDL_Downsample_S8_1c_x2 }, + { AUDIO_S8, 1, 1, 2, SDL_Upsample_S8_1c_x2 }, + { AUDIO_S8, 1, 0, 4, SDL_Downsample_S8_1c_x4 }, + { AUDIO_S8, 1, 1, 4, SDL_Upsample_S8_1c_x4 }, + { AUDIO_S8, 2, 0, 2, SDL_Downsample_S8_2c_x2 }, + { AUDIO_S8, 2, 1, 2, SDL_Upsample_S8_2c_x2 }, + { AUDIO_S8, 2, 0, 4, SDL_Downsample_S8_2c_x4 }, + { AUDIO_S8, 2, 1, 4, SDL_Upsample_S8_2c_x4 }, + { AUDIO_S8, 4, 0, 2, SDL_Downsample_S8_4c_x2 }, + { AUDIO_S8, 4, 1, 2, SDL_Upsample_S8_4c_x2 }, + { AUDIO_S8, 4, 0, 4, SDL_Downsample_S8_4c_x4 }, + { AUDIO_S8, 4, 1, 4, SDL_Upsample_S8_4c_x4 }, + { AUDIO_S8, 6, 0, 2, SDL_Downsample_S8_6c_x2 }, + { AUDIO_S8, 6, 1, 2, SDL_Upsample_S8_6c_x2 }, + { AUDIO_S8, 6, 0, 4, SDL_Downsample_S8_6c_x4 }, + { AUDIO_S8, 6, 1, 4, SDL_Upsample_S8_6c_x4 }, + { AUDIO_S8, 8, 0, 2, SDL_Downsample_S8_8c_x2 }, + { AUDIO_S8, 8, 1, 2, SDL_Upsample_S8_8c_x2 }, + { AUDIO_S8, 8, 0, 4, SDL_Downsample_S8_8c_x4 }, + { AUDIO_S8, 8, 1, 4, SDL_Upsample_S8_8c_x4 }, + { AUDIO_U16LSB, 1, 0, 2, SDL_Downsample_U16LSB_1c_x2 }, + { AUDIO_U16LSB, 1, 1, 2, SDL_Upsample_U16LSB_1c_x2 }, + { AUDIO_U16LSB, 1, 0, 4, SDL_Downsample_U16LSB_1c_x4 }, + { AUDIO_U16LSB, 1, 1, 4, SDL_Upsample_U16LSB_1c_x4 }, + { AUDIO_U16LSB, 2, 0, 2, SDL_Downsample_U16LSB_2c_x2 }, + { AUDIO_U16LSB, 2, 1, 2, SDL_Upsample_U16LSB_2c_x2 }, + { AUDIO_U16LSB, 2, 0, 4, SDL_Downsample_U16LSB_2c_x4 }, + { AUDIO_U16LSB, 2, 1, 4, SDL_Upsample_U16LSB_2c_x4 }, + { AUDIO_U16LSB, 4, 0, 2, SDL_Downsample_U16LSB_4c_x2 }, + { AUDIO_U16LSB, 4, 1, 2, SDL_Upsample_U16LSB_4c_x2 }, + { AUDIO_U16LSB, 4, 0, 4, SDL_Downsample_U16LSB_4c_x4 }, + { AUDIO_U16LSB, 4, 1, 4, SDL_Upsample_U16LSB_4c_x4 }, + { AUDIO_U16LSB, 6, 0, 2, SDL_Downsample_U16LSB_6c_x2 }, + { AUDIO_U16LSB, 6, 1, 2, SDL_Upsample_U16LSB_6c_x2 }, + { AUDIO_U16LSB, 6, 0, 4, SDL_Downsample_U16LSB_6c_x4 }, + { AUDIO_U16LSB, 6, 1, 4, SDL_Upsample_U16LSB_6c_x4 }, + { AUDIO_U16LSB, 8, 0, 2, SDL_Downsample_U16LSB_8c_x2 }, + { AUDIO_U16LSB, 8, 1, 2, SDL_Upsample_U16LSB_8c_x2 }, + { AUDIO_U16LSB, 8, 0, 4, SDL_Downsample_U16LSB_8c_x4 }, + { AUDIO_U16LSB, 8, 1, 4, SDL_Upsample_U16LSB_8c_x4 }, + { AUDIO_S16LSB, 1, 0, 2, SDL_Downsample_S16LSB_1c_x2 }, + { AUDIO_S16LSB, 1, 1, 2, SDL_Upsample_S16LSB_1c_x2 }, + { AUDIO_S16LSB, 1, 0, 4, SDL_Downsample_S16LSB_1c_x4 }, + { AUDIO_S16LSB, 1, 1, 4, SDL_Upsample_S16LSB_1c_x4 }, + { AUDIO_S16LSB, 2, 0, 2, SDL_Downsample_S16LSB_2c_x2 }, + { AUDIO_S16LSB, 2, 1, 2, SDL_Upsample_S16LSB_2c_x2 }, + { AUDIO_S16LSB, 2, 0, 4, SDL_Downsample_S16LSB_2c_x4 }, + { AUDIO_S16LSB, 2, 1, 4, SDL_Upsample_S16LSB_2c_x4 }, + { AUDIO_S16LSB, 4, 0, 2, SDL_Downsample_S16LSB_4c_x2 }, + { AUDIO_S16LSB, 4, 1, 2, SDL_Upsample_S16LSB_4c_x2 }, + { AUDIO_S16LSB, 4, 0, 4, SDL_Downsample_S16LSB_4c_x4 }, + { AUDIO_S16LSB, 4, 1, 4, SDL_Upsample_S16LSB_4c_x4 }, + { AUDIO_S16LSB, 6, 0, 2, SDL_Downsample_S16LSB_6c_x2 }, + { AUDIO_S16LSB, 6, 1, 2, SDL_Upsample_S16LSB_6c_x2 }, + { AUDIO_S16LSB, 6, 0, 4, SDL_Downsample_S16LSB_6c_x4 }, + { AUDIO_S16LSB, 6, 1, 4, SDL_Upsample_S16LSB_6c_x4 }, + { AUDIO_S16LSB, 8, 0, 2, SDL_Downsample_S16LSB_8c_x2 }, + { AUDIO_S16LSB, 8, 1, 2, SDL_Upsample_S16LSB_8c_x2 }, + { AUDIO_S16LSB, 8, 0, 4, SDL_Downsample_S16LSB_8c_x4 }, + { AUDIO_S16LSB, 8, 1, 4, SDL_Upsample_S16LSB_8c_x4 }, + { AUDIO_U16MSB, 1, 0, 2, SDL_Downsample_U16MSB_1c_x2 }, + { AUDIO_U16MSB, 1, 1, 2, SDL_Upsample_U16MSB_1c_x2 }, + { AUDIO_U16MSB, 1, 0, 4, SDL_Downsample_U16MSB_1c_x4 }, + { AUDIO_U16MSB, 1, 1, 4, SDL_Upsample_U16MSB_1c_x4 }, + { AUDIO_U16MSB, 2, 0, 2, SDL_Downsample_U16MSB_2c_x2 }, + { AUDIO_U16MSB, 2, 1, 2, SDL_Upsample_U16MSB_2c_x2 }, + { AUDIO_U16MSB, 2, 0, 4, SDL_Downsample_U16MSB_2c_x4 }, + { AUDIO_U16MSB, 2, 1, 4, SDL_Upsample_U16MSB_2c_x4 }, + { AUDIO_U16MSB, 4, 0, 2, SDL_Downsample_U16MSB_4c_x2 }, + { AUDIO_U16MSB, 4, 1, 2, SDL_Upsample_U16MSB_4c_x2 }, + { AUDIO_U16MSB, 4, 0, 4, SDL_Downsample_U16MSB_4c_x4 }, + { AUDIO_U16MSB, 4, 1, 4, SDL_Upsample_U16MSB_4c_x4 }, + { AUDIO_U16MSB, 6, 0, 2, SDL_Downsample_U16MSB_6c_x2 }, + { AUDIO_U16MSB, 6, 1, 2, SDL_Upsample_U16MSB_6c_x2 }, + { AUDIO_U16MSB, 6, 0, 4, SDL_Downsample_U16MSB_6c_x4 }, + { AUDIO_U16MSB, 6, 1, 4, SDL_Upsample_U16MSB_6c_x4 }, + { AUDIO_U16MSB, 8, 0, 2, SDL_Downsample_U16MSB_8c_x2 }, + { AUDIO_U16MSB, 8, 1, 2, SDL_Upsample_U16MSB_8c_x2 }, + { AUDIO_U16MSB, 8, 0, 4, SDL_Downsample_U16MSB_8c_x4 }, + { AUDIO_U16MSB, 8, 1, 4, SDL_Upsample_U16MSB_8c_x4 }, + { AUDIO_S16MSB, 1, 0, 2, SDL_Downsample_S16MSB_1c_x2 }, + { AUDIO_S16MSB, 1, 1, 2, SDL_Upsample_S16MSB_1c_x2 }, + { AUDIO_S16MSB, 1, 0, 4, SDL_Downsample_S16MSB_1c_x4 }, + { AUDIO_S16MSB, 1, 1, 4, SDL_Upsample_S16MSB_1c_x4 }, + { AUDIO_S16MSB, 2, 0, 2, SDL_Downsample_S16MSB_2c_x2 }, + { AUDIO_S16MSB, 2, 1, 2, SDL_Upsample_S16MSB_2c_x2 }, + { AUDIO_S16MSB, 2, 0, 4, SDL_Downsample_S16MSB_2c_x4 }, + { AUDIO_S16MSB, 2, 1, 4, SDL_Upsample_S16MSB_2c_x4 }, + { AUDIO_S16MSB, 4, 0, 2, SDL_Downsample_S16MSB_4c_x2 }, + { AUDIO_S16MSB, 4, 1, 2, SDL_Upsample_S16MSB_4c_x2 }, + { AUDIO_S16MSB, 4, 0, 4, SDL_Downsample_S16MSB_4c_x4 }, + { AUDIO_S16MSB, 4, 1, 4, SDL_Upsample_S16MSB_4c_x4 }, + { AUDIO_S16MSB, 6, 0, 2, SDL_Downsample_S16MSB_6c_x2 }, + { AUDIO_S16MSB, 6, 1, 2, SDL_Upsample_S16MSB_6c_x2 }, + { AUDIO_S16MSB, 6, 0, 4, SDL_Downsample_S16MSB_6c_x4 }, + { AUDIO_S16MSB, 6, 1, 4, SDL_Upsample_S16MSB_6c_x4 }, + { AUDIO_S16MSB, 8, 0, 2, SDL_Downsample_S16MSB_8c_x2 }, + { AUDIO_S16MSB, 8, 1, 2, SDL_Upsample_S16MSB_8c_x2 }, + { AUDIO_S16MSB, 8, 0, 4, SDL_Downsample_S16MSB_8c_x4 }, + { AUDIO_S16MSB, 8, 1, 4, SDL_Upsample_S16MSB_8c_x4 }, + { AUDIO_S32LSB, 1, 0, 2, SDL_Downsample_S32LSB_1c_x2 }, + { AUDIO_S32LSB, 1, 1, 2, SDL_Upsample_S32LSB_1c_x2 }, + { AUDIO_S32LSB, 1, 0, 4, SDL_Downsample_S32LSB_1c_x4 }, + { AUDIO_S32LSB, 1, 1, 4, SDL_Upsample_S32LSB_1c_x4 }, + { AUDIO_S32LSB, 2, 0, 2, SDL_Downsample_S32LSB_2c_x2 }, + { AUDIO_S32LSB, 2, 1, 2, SDL_Upsample_S32LSB_2c_x2 }, + { AUDIO_S32LSB, 2, 0, 4, SDL_Downsample_S32LSB_2c_x4 }, + { AUDIO_S32LSB, 2, 1, 4, SDL_Upsample_S32LSB_2c_x4 }, + { AUDIO_S32LSB, 4, 0, 2, SDL_Downsample_S32LSB_4c_x2 }, + { AUDIO_S32LSB, 4, 1, 2, SDL_Upsample_S32LSB_4c_x2 }, + { AUDIO_S32LSB, 4, 0, 4, SDL_Downsample_S32LSB_4c_x4 }, + { AUDIO_S32LSB, 4, 1, 4, SDL_Upsample_S32LSB_4c_x4 }, + { AUDIO_S32LSB, 6, 0, 2, SDL_Downsample_S32LSB_6c_x2 }, + { AUDIO_S32LSB, 6, 1, 2, SDL_Upsample_S32LSB_6c_x2 }, + { AUDIO_S32LSB, 6, 0, 4, SDL_Downsample_S32LSB_6c_x4 }, + { AUDIO_S32LSB, 6, 1, 4, SDL_Upsample_S32LSB_6c_x4 }, + { AUDIO_S32LSB, 8, 0, 2, SDL_Downsample_S32LSB_8c_x2 }, + { AUDIO_S32LSB, 8, 1, 2, SDL_Upsample_S32LSB_8c_x2 }, + { AUDIO_S32LSB, 8, 0, 4, SDL_Downsample_S32LSB_8c_x4 }, + { AUDIO_S32LSB, 8, 1, 4, SDL_Upsample_S32LSB_8c_x4 }, + { AUDIO_S32MSB, 1, 0, 2, SDL_Downsample_S32MSB_1c_x2 }, + { AUDIO_S32MSB, 1, 1, 2, SDL_Upsample_S32MSB_1c_x2 }, + { AUDIO_S32MSB, 1, 0, 4, SDL_Downsample_S32MSB_1c_x4 }, + { AUDIO_S32MSB, 1, 1, 4, SDL_Upsample_S32MSB_1c_x4 }, + { AUDIO_S32MSB, 2, 0, 2, SDL_Downsample_S32MSB_2c_x2 }, + { AUDIO_S32MSB, 2, 1, 2, SDL_Upsample_S32MSB_2c_x2 }, + { AUDIO_S32MSB, 2, 0, 4, SDL_Downsample_S32MSB_2c_x4 }, + { AUDIO_S32MSB, 2, 1, 4, SDL_Upsample_S32MSB_2c_x4 }, + { AUDIO_S32MSB, 4, 0, 2, SDL_Downsample_S32MSB_4c_x2 }, + { AUDIO_S32MSB, 4, 1, 2, SDL_Upsample_S32MSB_4c_x2 }, + { AUDIO_S32MSB, 4, 0, 4, SDL_Downsample_S32MSB_4c_x4 }, + { AUDIO_S32MSB, 4, 1, 4, SDL_Upsample_S32MSB_4c_x4 }, + { AUDIO_S32MSB, 6, 0, 2, SDL_Downsample_S32MSB_6c_x2 }, + { AUDIO_S32MSB, 6, 1, 2, SDL_Upsample_S32MSB_6c_x2 }, + { AUDIO_S32MSB, 6, 0, 4, SDL_Downsample_S32MSB_6c_x4 }, + { AUDIO_S32MSB, 6, 1, 4, SDL_Upsample_S32MSB_6c_x4 }, + { AUDIO_S32MSB, 8, 0, 2, SDL_Downsample_S32MSB_8c_x2 }, + { AUDIO_S32MSB, 8, 1, 2, SDL_Upsample_S32MSB_8c_x2 }, + { AUDIO_S32MSB, 8, 0, 4, SDL_Downsample_S32MSB_8c_x4 }, + { AUDIO_S32MSB, 8, 1, 4, SDL_Upsample_S32MSB_8c_x4 }, + { AUDIO_F32LSB, 1, 0, 2, SDL_Downsample_F32LSB_1c_x2 }, + { AUDIO_F32LSB, 1, 1, 2, SDL_Upsample_F32LSB_1c_x2 }, + { AUDIO_F32LSB, 1, 0, 4, SDL_Downsample_F32LSB_1c_x4 }, + { AUDIO_F32LSB, 1, 1, 4, SDL_Upsample_F32LSB_1c_x4 }, + { AUDIO_F32LSB, 2, 0, 2, SDL_Downsample_F32LSB_2c_x2 }, + { AUDIO_F32LSB, 2, 1, 2, SDL_Upsample_F32LSB_2c_x2 }, + { AUDIO_F32LSB, 2, 0, 4, SDL_Downsample_F32LSB_2c_x4 }, + { AUDIO_F32LSB, 2, 1, 4, SDL_Upsample_F32LSB_2c_x4 }, + { AUDIO_F32LSB, 4, 0, 2, SDL_Downsample_F32LSB_4c_x2 }, + { AUDIO_F32LSB, 4, 1, 2, SDL_Upsample_F32LSB_4c_x2 }, + { AUDIO_F32LSB, 4, 0, 4, SDL_Downsample_F32LSB_4c_x4 }, + { AUDIO_F32LSB, 4, 1, 4, SDL_Upsample_F32LSB_4c_x4 }, + { AUDIO_F32LSB, 6, 0, 2, SDL_Downsample_F32LSB_6c_x2 }, + { AUDIO_F32LSB, 6, 1, 2, SDL_Upsample_F32LSB_6c_x2 }, + { AUDIO_F32LSB, 6, 0, 4, SDL_Downsample_F32LSB_6c_x4 }, + { AUDIO_F32LSB, 6, 1, 4, SDL_Upsample_F32LSB_6c_x4 }, + { AUDIO_F32LSB, 8, 0, 2, SDL_Downsample_F32LSB_8c_x2 }, + { AUDIO_F32LSB, 8, 1, 2, SDL_Upsample_F32LSB_8c_x2 }, + { AUDIO_F32LSB, 8, 0, 4, SDL_Downsample_F32LSB_8c_x4 }, + { AUDIO_F32LSB, 8, 1, 4, SDL_Upsample_F32LSB_8c_x4 }, + { AUDIO_F32MSB, 1, 0, 2, SDL_Downsample_F32MSB_1c_x2 }, + { AUDIO_F32MSB, 1, 1, 2, SDL_Upsample_F32MSB_1c_x2 }, + { AUDIO_F32MSB, 1, 0, 4, SDL_Downsample_F32MSB_1c_x4 }, + { AUDIO_F32MSB, 1, 1, 4, SDL_Upsample_F32MSB_1c_x4 }, + { AUDIO_F32MSB, 2, 0, 2, SDL_Downsample_F32MSB_2c_x2 }, + { AUDIO_F32MSB, 2, 1, 2, SDL_Upsample_F32MSB_2c_x2 }, + { AUDIO_F32MSB, 2, 0, 4, SDL_Downsample_F32MSB_2c_x4 }, + { AUDIO_F32MSB, 2, 1, 4, SDL_Upsample_F32MSB_2c_x4 }, + { AUDIO_F32MSB, 4, 0, 2, SDL_Downsample_F32MSB_4c_x2 }, + { AUDIO_F32MSB, 4, 1, 2, SDL_Upsample_F32MSB_4c_x2 }, + { AUDIO_F32MSB, 4, 0, 4, SDL_Downsample_F32MSB_4c_x4 }, + { AUDIO_F32MSB, 4, 1, 4, SDL_Upsample_F32MSB_4c_x4 }, + { AUDIO_F32MSB, 6, 0, 2, SDL_Downsample_F32MSB_6c_x2 }, + { AUDIO_F32MSB, 6, 1, 2, SDL_Upsample_F32MSB_6c_x2 }, + { AUDIO_F32MSB, 6, 0, 4, SDL_Downsample_F32MSB_6c_x4 }, + { AUDIO_F32MSB, 6, 1, 4, SDL_Upsample_F32MSB_6c_x4 }, + { AUDIO_F32MSB, 8, 0, 2, SDL_Downsample_F32MSB_8c_x2 }, + { AUDIO_F32MSB, 8, 1, 2, SDL_Upsample_F32MSB_8c_x2 }, + { AUDIO_F32MSB, 8, 0, 4, SDL_Downsample_F32MSB_8c_x4 }, + { AUDIO_F32MSB, 8, 1, 4, SDL_Upsample_F32MSB_8c_x4 }, +#endif /* !LESS_RESAMPLERS */ +#endif /* !NO_RESAMPLERS */ + { 0, 0, 0, 0, NULL } +}; + +/* 390 converters generated. */ + +/* *INDENT-ON* */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer.c b/Externals/SDL/src/audio/SDL_mixer.c new file mode 100644 index 0000000000..3bbf017f0f --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer.c @@ -0,0 +1,361 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* This provides the default mixing callback for the SDL audio routines */ + +#include "SDL_cpuinfo.h" +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "SDL_sysaudio.h" +#include "SDL_mixer_MMX.h" +#include "SDL_mixer_MMX_VC.h" +#include "SDL_mixer_m68k.h" + +/* This table is used to add two sound values together and pin + * the value to avoid overflow. (used with permission from ARDI) + * Changed to use 0xFE instead of 0xFF for better sound quality. + */ +static const Uint8 mix8[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, + 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, + 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, + 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, + 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, + 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, + 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, + 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, + 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, + 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, + 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, + 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, + 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, + 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, + 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, + 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE +}; + +/* The volume ranges from 0 - 128 */ +#define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME) +#define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128) + + +void +SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, + Uint32 len, int volume) +{ + if (volume == 0) { + return; + } + + switch (format) { + + case AUDIO_U8: + { +#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES) + SDL_MixAudio_m68k_U8((char *) dst, (char *) src, + (unsigned long) len, (long) volume, + (char *) mix8); +#else + Uint8 src_sample; + + while (len--) { + src_sample = *src; + ADJUST_VOLUME_U8(src_sample, volume); + *dst = mix8[*dst + src_sample]; + ++dst; + ++src; + } +#endif + } + break; + + case AUDIO_S8: + { +#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) + if (SDL_HasMMX()) { + SDL_MixAudio_MMX_S8((char *) dst, (char *) src, + (unsigned int) len, (int) volume); + } else +#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) + if (SDL_HasMMX()) { + SDL_MixAudio_MMX_S8_VC((char *) dst, (char *) src, + (unsigned int) len, (int) volume); + } else +#endif +#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES) + SDL_MixAudio_m68k_S8((char *) dst, (char *) src, + (unsigned long) len, (long) volume); +#else + { + Sint8 *dst8, *src8; + Sint8 src_sample; + int dst_sample; + const int max_audioval = ((1 << (8 - 1)) - 1); + const int min_audioval = -(1 << (8 - 1)); + + src8 = (Sint8 *) src; + dst8 = (Sint8 *) dst; + while (len--) { + src_sample = *src8; + ADJUST_VOLUME(src_sample, volume); + dst_sample = *dst8 + src_sample; + if (dst_sample > max_audioval) { + *dst8 = max_audioval; + } else if (dst_sample < min_audioval) { + *dst8 = min_audioval; + } else { + *dst8 = dst_sample; + } + ++dst8; + ++src8; + } + } +#endif + } + break; + + case AUDIO_S16LSB: + { +#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) + if (SDL_HasMMX()) { + SDL_MixAudio_MMX_S16((char *) dst, (char *) src, + (unsigned int) len, (int) volume); + } else +#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) + if (SDL_HasMMX()) { + SDL_MixAudio_MMX_S16_VC((char *) dst, (char *) src, + (unsigned int) len, (int) volume); + } else +#endif +#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES) + SDL_MixAudio_m68k_S16LSB((short *) dst, (short *) src, + (unsigned long) len, (long) volume); +#else + { + Sint16 src1, src2; + int dst_sample; + const int max_audioval = ((1 << (16 - 1)) - 1); + const int min_audioval = -(1 << (16 - 1)); + + len /= 2; + while (len--) { + src1 = ((src[1]) << 8 | src[0]); + ADJUST_VOLUME(src1, volume); + src2 = ((dst[1]) << 8 | dst[0]); + src += 2; + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + dst[0] = dst_sample & 0xFF; + dst_sample >>= 8; + dst[1] = dst_sample & 0xFF; + dst += 2; + } + } +#endif + } + break; + + case AUDIO_S16MSB: + { +#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES) + SDL_MixAudio_m68k_S16MSB((short *) dst, (short *) src, + (unsigned long) len, (long) volume); +#else + Sint16 src1, src2; + int dst_sample; + const int max_audioval = ((1 << (16 - 1)) - 1); + const int min_audioval = -(1 << (16 - 1)); + + len /= 2; + while (len--) { + src1 = ((src[0]) << 8 | src[1]); + ADJUST_VOLUME(src1, volume); + src2 = ((dst[0]) << 8 | dst[1]); + src += 2; + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + dst[1] = dst_sample & 0xFF; + dst_sample >>= 8; + dst[0] = dst_sample & 0xFF; + dst += 2; + } +#endif + } + break; + + case AUDIO_S32LSB: + { + const Uint32 *src32 = (Uint32 *) src; + Uint32 *dst32 = (Uint32 *) dst; + Sint64 src1, src2; + Sint64 dst_sample; + const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1); + const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1)); + + len /= 4; + while (len--) { + src1 = (Sint64) ((Sint32) SDL_SwapLE32(*src32)); + src32++; + ADJUST_VOLUME(src1, volume); + src2 = (Sint64) ((Sint32) SDL_SwapLE32(*dst32)); + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapLE32((Uint32) ((Sint32) dst_sample)); + } + } + break; + + case AUDIO_S32MSB: + { + const Uint32 *src32 = (Uint32 *) src; + Uint32 *dst32 = (Uint32 *) dst; + Sint64 src1, src2; + Sint64 dst_sample; + const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1); + const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1)); + + len /= 4; + while (len--) { + src1 = (Sint64) ((Sint32) SDL_SwapBE32(*src32)); + src32++; + ADJUST_VOLUME(src1, volume); + src2 = (Sint64) ((Sint32) SDL_SwapBE32(*dst32)); + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapBE32((Uint32) ((Sint32) dst_sample)); + } + } + break; + + case AUDIO_F32LSB: + { + const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME); + const float fvolume = (float) volume; + const float *src32 = (float *) src; + float *dst32 = (float *) dst; + float src1, src2; + double dst_sample; + /* !!! FIXME: are these right? */ + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; + + len /= 4; + while (len--) { + src1 = ((SDL_SwapFloatLE(*src32) * fvolume) * fmaxvolume); + src2 = SDL_SwapFloatLE(*dst32); + src32++; + + dst_sample = ((double) src1) + ((double) src2); + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapFloatLE((float) dst_sample); + } + } + break; + + case AUDIO_F32MSB: + { + const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME); + const float fvolume = (float) volume; + const float *src32 = (float *) src; + float *dst32 = (float *) dst; + float src1, src2; + double dst_sample; + /* !!! FIXME: are these right? */ + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; + + len /= 4; + while (len--) { + src1 = ((SDL_SwapFloatBE(*src32) * fvolume) * fmaxvolume); + src2 = SDL_SwapFloatBE(*dst32); + src32++; + + dst_sample = ((double) src1) + ((double) src2); + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapFloatBE((float) dst_sample); + } + } + break; + + default: /* If this happens... FIXME! */ + SDL_SetError("SDL_MixAudio(): unknown audio format"); + return; + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer_MMX.c b/Externals/SDL/src/audio/SDL_mixer_MMX.c new file mode 100644 index 0000000000..56b674457f --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer_MMX.c @@ -0,0 +1,120 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* + MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples + Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) + This code is licensed under the LGPL (see COPYING for details) + + Assumes buffer size in bytes is a multiple of 16 + Assumes SDL_MIX_MAXVOLUME = 128 +*/ + + +/*********************************************** +* Mixing for 16 bit signed buffers +***********************************************/ + +#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) +void +SDL_MixAudio_MMX_S16(char *dst, char *src, unsigned int size, int volume) +{ + __asm__ __volatile__(" movl %3,%%eax\n" /* eax = volume */ + " movl %2,%%edx\n" /* edx = size */ + " shrl $4,%%edx\n" /* process 16 bytes per iteration = 8 samples */ + " jz .endS16\n" " pxor %%mm0,%%mm0\n" " movd %%eax,%%mm0\n" " movq %%mm0,%%mm1\n" " psllq $16,%%mm0\n" " por %%mm1,%%mm0\n" " psllq $16,%%mm0\n" " por %%mm1,%%mm0\n" " psllq $16,%%mm0\n" " por %%mm1,%%mm0\n" /* mm0 = vol|vol|vol|vol */ + ".align 8\n" " .mixloopS16:\n" " movq (%1),%%mm1\n" /* mm1 = a|b|c|d */ + " movq %%mm1,%%mm2\n" /* mm2 = a|b|c|d */ + " movq 8(%1),%%mm4\n" /* mm4 = e|f|g|h */ + /* pré charger le buffer dst dans mm7 */ + " movq (%0),%%mm7\n" /* mm7 = dst[0] */ + /* multiplier par le volume */ + " pmullw %%mm0,%%mm1\n" /* mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */ + " pmulhw %%mm0,%%mm2\n" /* mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v) */ + " movq %%mm4,%%mm5\n" /* mm5 = e|f|g|h */ + " pmullw %%mm0,%%mm4\n" /* mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */ + " pmulhw %%mm0,%%mm5\n" /* mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v) */ + " movq %%mm1,%%mm3\n" /* mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */ + " punpckhwd %%mm2,%%mm1\n" /* mm1 = a*v|b*v */ + " movq %%mm4,%%mm6\n" /* mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */ + " punpcklwd %%mm2,%%mm3\n" /* mm3 = c*v|d*v */ + " punpckhwd %%mm5,%%mm4\n" /* mm4 = e*f|f*v */ + " punpcklwd %%mm5,%%mm6\n" /* mm6 = g*v|h*v */ + /* pré charger le buffer dst dans mm5 */ + " movq 8(%0),%%mm5\n" /* mm5 = dst[1] */ + /* diviser par 128 */ + " psrad $7,%%mm1\n" /* mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME */ + " add $16,%1\n" " psrad $7,%%mm3\n" /* mm3 = c*v/128|d*v/128 */ + " psrad $7,%%mm4\n" /* mm4 = e*v/128|f*v/128 */ + /* mm1 = le sample avec le volume modifié */ + " packssdw %%mm1,%%mm3\n" /* mm3 = s(a*v|b*v|c*v|d*v) */ + " psrad $7,%%mm6\n" /* mm6= g*v/128|h*v/128 */ + " paddsw %%mm7,%%mm3\n" /* mm3 = adjust_volume(src)+dst */ + /* mm4 = le sample avec le volume modifié */ + " packssdw %%mm4,%%mm6\n" /* mm6 = s(e*v|f*v|g*v|h*v) */ + " movq %%mm3,(%0)\n" " paddsw %%mm5,%%mm6\n" /* mm6 = adjust_volume(src)+dst */ + " movq %%mm6,8(%0)\n" + " add $16,%0\n" + " dec %%edx\n" + " jnz .mixloopS16\n" + " emms\n" + ".endS16:\n"::"r"(dst), "r"(src), + "m"(size), "m"(volume):"eax", "edx", "memory"); +} + + + +/*////////////////////////////////////////////// */ +/* Mixing for 8 bit signed buffers */ +/*////////////////////////////////////////////// */ + +void +SDL_MixAudio_MMX_S8(char *dst, char *src, unsigned int size, int volume) +{ + __asm__ __volatile__(" movl %3,%%eax\n" /* eax = volume */ + " movd %%eax,%%mm0\n" " movq %%mm0,%%mm1\n" " psllq $16,%%mm0\n" " por %%mm1,%%mm0\n" " psllq $16,%%mm0\n" " por %%mm1,%%mm0\n" " psllq $16,%%mm0\n" " por %%mm1,%%mm0\n" " movl %2,%%edx\n" /* edx = size */ + " shr $3,%%edx\n" /* process 8 bytes per iteration = 8 samples */ + " cmp $0,%%edx\n" " je .endS8\n" ".align 8\n" " .mixloopS8:\n" " pxor %%mm2,%%mm2\n" /* mm2 = 0 */ + " movq (%1),%%mm1\n" /* mm1 = a|b|c|d|e|f|g|h */ + " movq %%mm1,%%mm3\n" /* mm3 = a|b|c|d|e|f|g|h */ + /* on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 */ + " pcmpgtb %%mm1,%%mm2\n" /* mm2 = 11111111|00000000|00000000.... */ + " punpckhbw %%mm2,%%mm1\n" /* mm1 = 0|a|0|b|0|c|0|d */ + " punpcklbw %%mm2,%%mm3\n" /* mm3 = 0|e|0|f|0|g|0|h */ + " movq (%0),%%mm2\n" /* mm2 = destination */ + " pmullw %%mm0,%%mm1\n" /* mm1 = v*a|v*b|v*c|v*d */ + " add $8,%1\n" " pmullw %%mm0,%%mm3\n" /* mm3 = v*e|v*f|v*g|v*h */ + " psraw $7,%%mm1\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128 */ + " psraw $7,%%mm3\n" /* mm3 = v*e/128|v*f/128|v*g/128|v*h/128 */ + " packsswb %%mm1,%%mm3\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128 */ + " paddsb %%mm2,%%mm3\n" /* add to destination buffer */ + " movq %%mm3,(%0)\n" /* store back to ram */ + " add $8,%0\n" + " dec %%edx\n" + " jnz .mixloopS8\n" + ".endS8:\n" + " emms\n"::"r"(dst), "r"(src), "m"(size), + "m"(volume):"eax", "edx", "memory"); +} +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer_MMX.h b/Externals/SDL/src/audio/SDL_mixer_MMX.h new file mode 100644 index 0000000000..4b376314b1 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer_MMX.h @@ -0,0 +1,15 @@ +/* + headers for MMX assembler version of SDL_MixAudio + Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) + This code is licensed under the LGPL (see COPYING for details) + + Assumes buffer size in bytes is a multiple of 16 + Assumes SDL_MIX_MAXVOLUME = 128 +*/ +#include "SDL_config.h" + +#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) +void SDL_MixAudio_MMX_S16(char *, char *, unsigned int, int); +void SDL_MixAudio_MMX_S8(char *, char *, unsigned int, int); +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer_MMX_VC.c b/Externals/SDL/src/audio/SDL_mixer_MMX_VC.c new file mode 100644 index 0000000000..403c03250a --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer_MMX_VC.c @@ -0,0 +1,188 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#include "SDL_mixer_MMX_VC.h" + +#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) +// MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples +// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) +// Converted to Intel ASM notation by Cth +// This code is licensed under the LGPL (see COPYING for details) +// +// Assumes buffer size in bytes is a multiple of 16 +// Assumes SDL_MIX_MAXVOLUME = 128 + + +//////////////////////////////////////////////// +// Mixing for 16 bit signed buffers +//////////////////////////////////////////////// + +void +SDL_MixAudio_MMX_S16_VC(char *dst, char *src, unsigned int nSize, int volume) +{ + /* *INDENT-OFF* */ + __asm + { + + push edi + push esi + push ebx + + mov edi, dst // edi = dst + mov esi, src // esi = src + mov eax, volume // eax = volume + mov ebx, nSize // ebx = size + shr ebx, 4 // process 16 bytes per iteration = 8 samples + jz endS16 + + pxor mm0, mm0 + movd mm0, eax //%%eax,%%mm0 + movq mm1, mm0 //%%mm0,%%mm1 + psllq mm0, 16 //$16,%%mm0 + por mm0, mm1 //%%mm1,%%mm0 + psllq mm0, 16 //$16,%%mm0 + por mm0, mm1 //%%mm1,%%mm0 + psllq mm0, 16 //$16,%%mm0 + por mm0, mm1 //%%mm1,%%mm0 // mm0 = vol|vol|vol|vol + + #ifndef __WATCOMC__ + align 16 + #endif +mixloopS16: + movq mm1, [esi] //(%%esi),%%mm1\n" // mm1 = a|b|c|d + movq mm2, mm1 //%%mm1,%%mm2\n" // mm2 = a|b|c|d + movq mm4, [esi + 8] //8(%%esi),%%mm4\n" // mm4 = e|f|g|h + // pre charger le buffer dst dans mm7 + movq mm7, [edi] //(%%edi),%%mm7\n" // mm7 = dst[0]" + // multiplier par le volume + pmullw mm1, mm0 //%%mm0,%%mm1\n" // mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v) + pmulhw mm2, mm0 //%%mm0,%%mm2\n" // mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v) + movq mm5, mm4 //%%mm4,%%mm5\n" // mm5 = e|f|g|h + pmullw mm4, mm0 //%%mm0,%%mm4\n" // mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v) + pmulhw mm5, mm0 //%%mm0,%%mm5\n" // mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v) + movq mm3, mm1 //%%mm1,%%mm3\n" // mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v) + punpckhwd mm1, mm2 //%%mm2,%%mm1\n" // mm1 = a*v|b*v + movq mm6, mm4 //%%mm4,%%mm6\n" // mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v) + punpcklwd mm3, mm2 //%%mm2,%%mm3\n" // mm3 = c*v|d*v + punpckhwd mm4, mm5 //%%mm5,%%mm4\n" // mm4 = e*f|f*v + punpcklwd mm6, mm5 //%%mm5,%%mm6\n" // mm6 = g*v|h*v + // pre charger le buffer dst dans mm5 + movq mm5, [edi + 8] //8(%%edi),%%mm5\n" // mm5 = dst[1] + // diviser par 128 + psrad mm1, 7 //$7,%%mm1\n" // mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME + add esi, 16 //$16,%%esi\n" + psrad mm3, 7 //$7,%%mm3\n" // mm3 = c*v/128|d*v/128 + psrad mm4, 7 //$7,%%mm4\n" // mm4 = e*v/128|f*v/128 + // mm1 = le sample avec le volume modifie + packssdw mm3, mm1 //%%mm1,%%mm3\n" // mm3 = s(a*v|b*v|c*v|d*v) + psrad mm6, 7 //$7,%%mm6\n" // mm6= g*v/128|h*v/128 + paddsw mm3, mm7 //%%mm7,%%mm3\n" // mm3 = adjust_volume(src)+dst + // mm4 = le sample avec le volume modifie + packssdw mm6, mm4 //%%mm4,%%mm6\n" // mm6 = s(e*v|f*v|g*v|h*v) + movq [edi], mm3 //%%mm3,(%%edi)\n" + paddsw mm6, mm5 //%%mm5,%%mm6\n" // mm6 = adjust_volume(src)+dst + movq [edi + 8], mm6 //%%mm6,8(%%edi)\n" + add edi, 16 //$16,%%edi\n" + dec ebx //%%ebx\n" + jnz mixloopS16 + +endS16: + emms + + pop ebx + pop esi + pop edi + } + /* *INDENT-ON* */ +} + +//////////////////////////////////////////////// +// Mixing for 8 bit signed buffers +//////////////////////////////////////////////// + +void +SDL_MixAudio_MMX_S8_VC(char *dst, char *src, unsigned int nSize, int volume) +{ + /* *INDENT-OFF* */ + _asm + { + + push edi + push esi + push ebx + + mov edi, dst //movl %0,%%edi // edi = dst + mov esi, src //%1,%%esi // esi = src + mov eax, volume //%3,%%eax // eax = volume + + movd mm0, eax //%%eax,%%mm0 + movq mm1, mm0 //%%mm0,%%mm1 + psllq mm0, 16 //$16,%%mm0 + por mm0, mm1 //%%mm1,%%mm0 + psllq mm0, 16 //$16,%%mm0 + por mm0, mm1 //%%mm1,%%mm0 + psllq mm0, 16 //$16,%%mm0 + por mm0, mm1 //%%mm1,%%mm0 + + mov ebx, nSize //%2,%%ebx // ebx = size + shr ebx, 3 //$3,%%ebx // process 8 bytes per iteration = 8 samples + cmp ebx, 0 //$0,%%ebx + je endS8 + + #ifndef __WATCOMC__ + align 16 + #endif +mixloopS8: + pxor mm2, mm2 //%%mm2,%%mm2 // mm2 = 0 + movq mm1, [esi] //(%%esi),%%mm1 // mm1 = a|b|c|d|e|f|g|h + movq mm3, mm1 //%%mm1,%%mm3 // mm3 = a|b|c|d|e|f|g|h + // on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 + pcmpgtb mm2, mm1 //%%mm1,%%mm2 // mm2 = 11111111|00000000|00000000.... + punpckhbw mm1, mm2 //%%mm2,%%mm1 // mm1 = 0|a|0|b|0|c|0|d + punpcklbw mm3, mm2 //%%mm2,%%mm3 // mm3 = 0|e|0|f|0|g|0|h + movq mm2, [edi] //(%%edi),%%mm2 // mm2 = destination + pmullw mm1, mm0 //%%mm0,%%mm1 // mm1 = v*a|v*b|v*c|v*d + add esi, 8 //$8,%%esi + pmullw mm3, mm0 //%%mm0,%%mm3 // mm3 = v*e|v*f|v*g|v*h + psraw mm1, 7 //$7,%%mm1 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128 + psraw mm3, 7 //$7,%%mm3 // mm3 = v*e/128|v*f/128|v*g/128|v*h/128 + packsswb mm3, mm1 //%%mm1,%%mm3 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128 + paddsb mm3, mm2 //%%mm2,%%mm3 // add to destination buffer + movq [edi], mm3 //%%mm3,(%%edi) // store back to ram + add edi, 8 //$8,%%edi + dec ebx //%%ebx + jnz mixloopS8 + +endS8: + emms + + pop ebx + pop esi + pop edi + } + /* *INDENT-ON* */ +} + +#endif /* SDL_ASSEMBLY_ROUTINES */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer_MMX_VC.h b/Externals/SDL/src/audio/SDL_mixer_MMX_VC.h new file mode 100644 index 0000000000..2383b74d8b --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer_MMX_VC.h @@ -0,0 +1,37 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + + +#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) +/* headers for MMX assembler version of SDL_MixAudio + Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) + Converted to Intel ASM notation by Cth + This code is licensed under the LGPL (see COPYING for details) + + Assumes buffer size in bytes is a multiple of 16 + Assumes SDL_MIX_MAXVOLUME = 128 +*/ +void SDL_MixAudio_MMX_S16_VC(char *, char *, unsigned int, int); +void SDL_MixAudio_MMX_S8_VC(char *, char *, unsigned int, int); +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer_m68k.c b/Externals/SDL/src/audio/SDL_mixer_m68k.c new file mode 100644 index 0000000000..f911043fb2 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer_m68k.c @@ -0,0 +1,140 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* + m68k assembly mix routines + + Patrice Mandin +*/ + +#if defined(__M68000__) && defined(__GNUC__) +void +SDL_MixAudio_m68k_U8(char *dst, char *src, long len, long volume, char *mix8) +{ + __asm__ __volatile__("tstl %2\n" " beqs stoploop_u8\n" "mixloop_u8:\n" + /* Mix a sample */ + " moveq #0,%%d0\n" " moveq #0,%%d1\n" " moveb %1@+,%%d0\n" /* d0 = *src++ */ + " sub #128,%%d0\n" /* d0 -= 128 */ + " muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ + " moveb %0@,%%d1\n" /* d1 = *dst */ + " asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ + " add #128,%%d0\n" /* d0 += 128 */ + " add %%d1,%%d0\n" + " moveb %4@(%%d0:w),%0@+\n" + /* Loop till done */ + " subql #1,%2\n" " bhis mixloop_u8\n" "stoploop_u8:\n": /* no return value */ + : /* input */ + "a"(dst), "a"(src), "d"(len), "d"(volume), "a"(mix8): /* clobbered registers */ + "d0", "d1", "cc", "memory"); +} + +void +SDL_MixAudio_m68k_S8(char *dst, char *src, long len, long volume) +{ + __asm__ __volatile__("tstl %2\n" + " beqs stoploop_s8\n" + " moveq #-128,%%d2\n" + " moveq #127,%%d3\n" "mixloop_s8:\n" + /* Mix a sample */ + " moveq #0,%%d0\n" " moveq #0,%%d1\n" " moveb %1@+,%%d0\n" /* d0 = *src++ */ + " muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ + " moveb %0@,%%d1\n" /* d1 = *dst */ + " asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ + " add %%d1,%%d0\n" + " cmp %%d2,%%d0\n" + " bges lower_limit_s8\n" + " move %%d2,%%d0\n" + "lower_limit_s8:\n" + " cmp %%d3,%%d0\n" + " bles upper_limit_s8\n" + " move %%d3,%%d0\n" + "upper_limit_s8:\n" " moveb %%d0,%0@+\n" + /* Loop till done */ + " subql #1,%2\n" " bhis mixloop_s8\n" "stoploop_s8:\n": /* no return value */ + : /* input */ + "a"(dst), "a"(src), "d"(len), "d"(volume): /* clobbered registers */ + "d0", "d1", "d2", "d3", "cc", "memory"); +} + +void +SDL_MixAudio_m68k_S16MSB(short *dst, short *src, long len, long volume) +{ + __asm__ __volatile__("tstl %2\n" + " beqs stoploop_s16msb\n" + " movel #-32768,%%d2\n" + " movel #32767,%%d3\n" + " lsrl #1,%2\n" "mixloop_s16msb:\n" + /* Mix a sample */ + " move %1@+,%%d0\n" /* d0 = *src++ */ + " muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ + " move %0@,%%d1\n" /* d1 = *dst */ + " extl %%d1\n" /* extend d1 to 32 bits */ + " asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ + " addl %%d1,%%d0\n" + " cmpl %%d2,%%d0\n" + " bges lower_limit_s16msb\n" + " move %%d2,%%d0\n" + "lower_limit_s16msb:\n" + " cmpl %%d3,%%d0\n" + " bles upper_limit_s16msb\n" + " move %%d3,%%d0\n" + "upper_limit_s16msb:\n" " move %%d0,%0@+\n" + /* Loop till done */ + " subql #1,%2\n" " bhis mixloop_s16msb\n" "stoploop_s16msb:\n": /* no return value */ + : /* input */ + "a"(dst), "a"(src), "d"(len), "d"(volume): /* clobbered registers */ + "d0", "d1", "d2", "d3", "cc", "memory"); +} + +void +SDL_MixAudio_m68k_S16LSB(short *dst, short *src, long len, long volume) +{ + __asm__ __volatile__("tstl %2\n" + " beqs stoploop_s16lsb\n" + " movel #-32768,%%d2\n" + " movel #32767,%%d3\n" + " lsrl #1,%2\n" "mixloop_s16lsb:\n" + /* Mix a sample */ + " move %1@+,%%d0\n" /* d0 = *src++ */ + " rorw #8,%%d0\n" " muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ + " move %0@,%%d1\n" /* d1 = *dst */ + " rorw #8,%%d1\n" " extl %%d1\n" /* extend d1 to 32 bits */ + " asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ + " addl %%d1,%%d0\n" + " cmpl %%d2,%%d0\n" + " bges lower_limit_s16lsb\n" + " move %%d2,%%d0\n" + "lower_limit_s16lsb:\n" + " cmpl %%d3,%%d0\n" + " bles upper_limit_s16lsb\n" + " move %%d3,%%d0\n" + "upper_limit_s16lsb:\n" + " rorw #8,%%d0\n" " move %%d0,%0@+\n" + /* Loop till done */ + " subql #1,%2\n" " bhis mixloop_s16lsb\n" "stoploop_s16lsb:\n": /* no return value */ + : /* input */ + "a"(dst), "a"(src), "d"(len), "d"(volume): /* clobbered registers */ + "d0", "d1", "d2", "d3", "cc", "memory"); +} +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_mixer_m68k.h b/Externals/SDL/src/audio/SDL_mixer_m68k.h new file mode 100644 index 0000000000..3f6ce47fc4 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_mixer_m68k.h @@ -0,0 +1,38 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* + m68k assembly mix routines + + Patrice Mandin +*/ + +#if defined(__M68000__) && defined(__GNUC__) +void SDL_MixAudio_m68k_U8(char *dst, char *src, long len, long volume, + char *mix8); +void SDL_MixAudio_m68k_S8(char *dst, char *src, long len, long volume); + +void SDL_MixAudio_m68k_S16MSB(short *dst, short *src, long len, long volume); +void SDL_MixAudio_m68k_S16LSB(short *dst, short *src, long len, long volume); +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_sysaudio.h b/Externals/SDL/src/audio/SDL_sysaudio.h new file mode 100644 index 0000000000..d86947166e --- /dev/null +++ b/Externals/SDL/src/audio/SDL_sysaudio.h @@ -0,0 +1,129 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is SDL_free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_sysaudio_h +#define _SDL_sysaudio_h + +#include "SDL_mutex.h" +#include "SDL_thread.h" + +/* The SDL audio driver */ +typedef struct SDL_AudioDevice SDL_AudioDevice; +#define _THIS SDL_AudioDevice *_this + +typedef struct SDL_AudioDriverImpl +{ + int (*DetectDevices) (int iscapture); + const char *(*GetDeviceName) (int index, int iscapture); + int (*OpenDevice) (_THIS, const char *devname, int iscapture); + void (*ThreadInit) (_THIS); /* Called by audio thread at start */ + void (*WaitDevice) (_THIS); + void (*PlayDevice) (_THIS); + Uint8 *(*GetDeviceBuf) (_THIS); + void (*WaitDone) (_THIS); + void (*CloseDevice) (_THIS); + void (*LockDevice) (_THIS); + void (*UnlockDevice) (_THIS); + void (*Deinitialize) (void); + + /* Some flags to push duplicate code into the core and reduce #ifdefs. */ + int ProvidesOwnCallbackThread:1; + int SkipMixerLock:1; + int HasCaptureSupport:1; + int OnlyHasDefaultOutputDevice:1; + int OnlyHasDefaultInputDevice:1; +} SDL_AudioDriverImpl; + + +typedef struct SDL_AudioDriver +{ + /* * * */ + /* The name of this audio driver */ + const char *name; + + /* * * */ + /* The description of this audio driver */ + const char *desc; + + SDL_AudioDriverImpl impl; +} SDL_AudioDriver; + + +/* Streamer */ +typedef struct +{ + Uint8 *buffer; + int max_len; /* the maximum length in bytes */ + int read_pos, write_pos; /* the position of the write and read heads in bytes */ +} SDL_AudioStreamer; + + +/* Define the SDL audio driver structure */ +struct SDL_AudioDevice +{ + /* * * */ + /* Data common to all devices */ + + /* The current audio specification (shared with audio thread) */ + SDL_AudioSpec spec; + + /* An audio conversion block for audio format emulation */ + SDL_AudioCVT convert; + + /* The streamer, if sample rate conversion necessitates it */ + int use_streamer; + SDL_AudioStreamer streamer; + + /* Current state flags */ + int iscapture; + int enabled; + int paused; + int opened; + + /* Fake audio buffer for when the audio hardware is busy */ + Uint8 *fake_stream; + + /* A semaphore for locking the mixing buffers */ + SDL_mutex *mixer_lock; + + /* A thread to feed the audio device */ + SDL_Thread *thread; + Uint32 threadid; + + /* * * */ + /* Data private to this driver */ + struct SDL_PrivateAudioData *hidden; +}; +#undef _THIS + +typedef struct AudioBootStrap +{ + const char *name; + const char *desc; + int (*init) (SDL_AudioDriverImpl * impl); + int demand_only:1; /* 1==request explicitly, or it won't be available. */ +} AudioBootStrap; + +#endif /* _SDL_sysaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_wave.c b/Externals/SDL/src/audio/SDL_wave.c new file mode 100644 index 0000000000..800643eab6 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_wave.c @@ -0,0 +1,633 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Microsoft WAVE file loading routines */ + +#include "SDL_audio.h" +#include "SDL_wave.h" + + +static int ReadChunk(SDL_RWops * src, Chunk * chunk); + +struct MS_ADPCM_decodestate +{ + Uint8 hPredictor; + Uint16 iDelta; + Sint16 iSamp1; + Sint16 iSamp2; +}; +static struct MS_ADPCM_decoder +{ + WaveFMT wavefmt; + Uint16 wSamplesPerBlock; + Uint16 wNumCoef; + Sint16 aCoeff[7][2]; + /* * * */ + struct MS_ADPCM_decodestate state[2]; +} MS_ADPCM_state; + +static int +InitMS_ADPCM(WaveFMT * format) +{ + Uint8 *rogue_feel; + Uint16 extra_info; + int i; + + /* Set the rogue pointer to the MS_ADPCM specific data */ + MS_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); + MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); + MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); + MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate); + MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign); + MS_ADPCM_state.wavefmt.bitspersample = + SDL_SwapLE16(format->bitspersample); + rogue_feel = (Uint8 *) format + sizeof(*format); + if (sizeof(*format) == 16) { + extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + } + MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + MS_ADPCM_state.wNumCoef = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + if (MS_ADPCM_state.wNumCoef != 7) { + SDL_SetError("Unknown set of MS_ADPCM coefficients"); + return (-1); + } + for (i = 0; i < MS_ADPCM_state.wNumCoef; ++i) { + MS_ADPCM_state.aCoeff[i][0] = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + MS_ADPCM_state.aCoeff[i][1] = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + } + return (0); +} + +static Sint32 +MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state, + Uint8 nybble, Sint16 * coeff) +{ + const Sint32 max_audioval = ((1 << (16 - 1)) - 1); + const Sint32 min_audioval = -(1 << (16 - 1)); + const Sint32 adaptive[] = { + 230, 230, 230, 230, 307, 409, 512, 614, + 768, 614, 512, 409, 307, 230, 230, 230 + }; + Sint32 new_sample, delta; + + new_sample = ((state->iSamp1 * coeff[0]) + + (state->iSamp2 * coeff[1])) / 256; + if (nybble & 0x08) { + new_sample += state->iDelta * (nybble - 0x10); + } else { + new_sample += state->iDelta * nybble; + } + if (new_sample < min_audioval) { + new_sample = min_audioval; + } else if (new_sample > max_audioval) { + new_sample = max_audioval; + } + delta = ((Sint32) state->iDelta * adaptive[nybble]) / 256; + if (delta < 16) { + delta = 16; + } + state->iDelta = (Uint16) delta; + state->iSamp2 = state->iSamp1; + state->iSamp1 = (Sint16) new_sample; + return (new_sample); +} + +static int +MS_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len) +{ + struct MS_ADPCM_decodestate *state[2]; + Uint8 *freeable, *encoded, *decoded; + Sint32 encoded_len, samplesleft; + Sint8 nybble, stereo; + Sint16 *coeff[2]; + Sint32 new_sample; + + /* Allocate the proper sized output buffer */ + encoded_len = *audio_len; + encoded = *audio_buf; + freeable = *audio_buf; + *audio_len = (encoded_len / MS_ADPCM_state.wavefmt.blockalign) * + MS_ADPCM_state.wSamplesPerBlock * + MS_ADPCM_state.wavefmt.channels * sizeof(Sint16); + *audio_buf = (Uint8 *) SDL_malloc(*audio_len); + if (*audio_buf == NULL) { + SDL_Error(SDL_ENOMEM); + return (-1); + } + decoded = *audio_buf; + + /* Get ready... Go! */ + stereo = (MS_ADPCM_state.wavefmt.channels == 2); + state[0] = &MS_ADPCM_state.state[0]; + state[1] = &MS_ADPCM_state.state[stereo]; + while (encoded_len >= MS_ADPCM_state.wavefmt.blockalign) { + /* Grab the initial information for this block */ + state[0]->hPredictor = *encoded++; + if (stereo) { + state[1]->hPredictor = *encoded++; + } + state[0]->iDelta = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + if (stereo) { + state[1]->iDelta = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + } + state[0]->iSamp1 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + if (stereo) { + state[1]->iSamp1 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + } + state[0]->iSamp2 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + if (stereo) { + state[1]->iSamp2 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + } + coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor]; + coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor]; + + /* Store the two initial samples we start with */ + decoded[0] = state[0]->iSamp2 & 0xFF; + decoded[1] = state[0]->iSamp2 >> 8; + decoded += 2; + if (stereo) { + decoded[0] = state[1]->iSamp2 & 0xFF; + decoded[1] = state[1]->iSamp2 >> 8; + decoded += 2; + } + decoded[0] = state[0]->iSamp1 & 0xFF; + decoded[1] = state[0]->iSamp1 >> 8; + decoded += 2; + if (stereo) { + decoded[0] = state[1]->iSamp1 & 0xFF; + decoded[1] = state[1]->iSamp1 >> 8; + decoded += 2; + } + + /* Decode and store the other samples in this block */ + samplesleft = (MS_ADPCM_state.wSamplesPerBlock - 2) * + MS_ADPCM_state.wavefmt.channels; + while (samplesleft > 0) { + nybble = (*encoded) >> 4; + new_sample = MS_ADPCM_nibble(state[0], nybble, coeff[0]); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2; + + nybble = (*encoded) & 0x0F; + new_sample = MS_ADPCM_nibble(state[1], nybble, coeff[1]); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2; + + ++encoded; + samplesleft -= 2; + } + encoded_len -= MS_ADPCM_state.wavefmt.blockalign; + } + SDL_free(freeable); + return (0); +} + +struct IMA_ADPCM_decodestate +{ + Sint32 sample; + Sint8 index; +}; +static struct IMA_ADPCM_decoder +{ + WaveFMT wavefmt; + Uint16 wSamplesPerBlock; + /* * * */ + struct IMA_ADPCM_decodestate state[2]; +} IMA_ADPCM_state; + +static int +InitIMA_ADPCM(WaveFMT * format) +{ + Uint8 *rogue_feel; + Uint16 extra_info; + + /* Set the rogue pointer to the IMA_ADPCM specific data */ + IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); + IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); + IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); + IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate); + IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign); + IMA_ADPCM_state.wavefmt.bitspersample = + SDL_SwapLE16(format->bitspersample); + rogue_feel = (Uint8 *) format + sizeof(*format); + if (sizeof(*format) == 16) { + extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + } + IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]); + return (0); +} + +static Sint32 +IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble) +{ + const Sint32 max_audioval = ((1 << (16 - 1)) - 1); + const Sint32 min_audioval = -(1 << (16 - 1)); + const int index_table[16] = { + -1, -1, -1, -1, + 2, 4, 6, 8, + -1, -1, -1, -1, + 2, 4, 6, 8 + }; + const Sint32 step_table[89] = { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, + 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, + 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, + 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, + 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, + 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, + 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, + 22385, 24623, 27086, 29794, 32767 + }; + Sint32 delta, step; + + /* Compute difference and new sample value */ + step = step_table[state->index]; + delta = step >> 3; + if (nybble & 0x04) + delta += step; + if (nybble & 0x02) + delta += (step >> 1); + if (nybble & 0x01) + delta += (step >> 2); + if (nybble & 0x08) + delta = -delta; + state->sample += delta; + + /* Update index value */ + state->index += index_table[nybble]; + if (state->index > 88) { + state->index = 88; + } else if (state->index < 0) { + state->index = 0; + } + + /* Clamp output sample */ + if (state->sample > max_audioval) { + state->sample = max_audioval; + } else if (state->sample < min_audioval) { + state->sample = min_audioval; + } + return (state->sample); +} + +/* Fill the decode buffer with a channel block of data (8 samples) */ +static void +Fill_IMA_ADPCM_block(Uint8 * decoded, Uint8 * encoded, + int channel, int numchannels, + struct IMA_ADPCM_decodestate *state) +{ + int i; + Sint8 nybble; + Sint32 new_sample; + + decoded += (channel * 2); + for (i = 0; i < 4; ++i) { + nybble = (*encoded) & 0x0F; + new_sample = IMA_ADPCM_nibble(state, nybble); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2 * numchannels; + + nybble = (*encoded) >> 4; + new_sample = IMA_ADPCM_nibble(state, nybble); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2 * numchannels; + + ++encoded; + } +} + +static int +IMA_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len) +{ + struct IMA_ADPCM_decodestate *state; + Uint8 *freeable, *encoded, *decoded; + Sint32 encoded_len, samplesleft; + unsigned int c, channels; + + /* Check to make sure we have enough variables in the state array */ + channels = IMA_ADPCM_state.wavefmt.channels; + if (channels > SDL_arraysize(IMA_ADPCM_state.state)) { + SDL_SetError("IMA ADPCM decoder can only handle %d channels", + SDL_arraysize(IMA_ADPCM_state.state)); + return (-1); + } + state = IMA_ADPCM_state.state; + + /* Allocate the proper sized output buffer */ + encoded_len = *audio_len; + encoded = *audio_buf; + freeable = *audio_buf; + *audio_len = (encoded_len / IMA_ADPCM_state.wavefmt.blockalign) * + IMA_ADPCM_state.wSamplesPerBlock * + IMA_ADPCM_state.wavefmt.channels * sizeof(Sint16); + *audio_buf = (Uint8 *) SDL_malloc(*audio_len); + if (*audio_buf == NULL) { + SDL_Error(SDL_ENOMEM); + return (-1); + } + decoded = *audio_buf; + + /* Get ready... Go! */ + while (encoded_len >= IMA_ADPCM_state.wavefmt.blockalign) { + /* Grab the initial information for this block */ + for (c = 0; c < channels; ++c) { + /* Fill the state information for this block */ + state[c].sample = ((encoded[1] << 8) | encoded[0]); + encoded += 2; + if (state[c].sample & 0x8000) { + state[c].sample -= 0x10000; + } + state[c].index = *encoded++; + /* Reserved byte in buffer header, should be 0 */ + if (*encoded++ != 0) { + /* Uh oh, corrupt data? Buggy code? */ ; + } + + /* Store the initial sample we start with */ + decoded[0] = (Uint8) (state[c].sample & 0xFF); + decoded[1] = (Uint8) (state[c].sample >> 8); + decoded += 2; + } + + /* Decode and store the other samples in this block */ + samplesleft = (IMA_ADPCM_state.wSamplesPerBlock - 1) * channels; + while (samplesleft > 0) { + for (c = 0; c < channels; ++c) { + Fill_IMA_ADPCM_block(decoded, encoded, + c, channels, &state[c]); + encoded += 4; + samplesleft -= 8; + } + decoded += (channels * 8 * 2); + } + encoded_len -= IMA_ADPCM_state.wavefmt.blockalign; + } + SDL_free(freeable); + return (0); +} + +SDL_AudioSpec * +SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, + SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len) +{ + int was_error; + Chunk chunk; + int lenread; + int IEEE_float_encoded, MS_ADPCM_encoded, IMA_ADPCM_encoded; + int samplesize; + + /* WAV magic header */ + Uint32 RIFFchunk; + Uint32 wavelen = 0; + Uint32 WAVEmagic; + Uint32 headerDiff = 0; + + /* FMT chunk */ + WaveFMT *format = NULL; + + /* Make sure we are passed a valid data source */ + was_error = 0; + if (src == NULL) { + was_error = 1; + goto done; + } + + /* Check the magic header */ + RIFFchunk = SDL_ReadLE32(src); + wavelen = SDL_ReadLE32(src); + if (wavelen == WAVE) { /* The RIFFchunk has already been read */ + WAVEmagic = wavelen; + wavelen = RIFFchunk; + RIFFchunk = RIFF; + } else { + WAVEmagic = SDL_ReadLE32(src); + } + if ((RIFFchunk != RIFF) || (WAVEmagic != WAVE)) { + SDL_SetError("Unrecognized file type (not WAVE)"); + was_error = 1; + goto done; + } + headerDiff += sizeof(Uint32); /* for WAVE */ + + /* Read the audio data format chunk */ + chunk.data = NULL; + do { + if (chunk.data != NULL) { + SDL_free(chunk.data); + } + lenread = ReadChunk(src, &chunk); + if (lenread < 0) { + was_error = 1; + goto done; + } + /* 2 Uint32's for chunk header+len, plus the lenread */ + headerDiff += lenread + 2 * sizeof(Uint32); + } while ((chunk.magic == FACT) || (chunk.magic == LIST)); + + /* Decode the audio data format */ + format = (WaveFMT *) chunk.data; + if (chunk.magic != FMT) { + SDL_SetError("Complex WAVE files not supported"); + was_error = 1; + goto done; + } + IEEE_float_encoded = MS_ADPCM_encoded = IMA_ADPCM_encoded = 0; + switch (SDL_SwapLE16(format->encoding)) { + case PCM_CODE: + /* We can understand this */ + break; + case IEEE_FLOAT_CODE: + IEEE_float_encoded = 1; + /* We can understand this */ + break; + case MS_ADPCM_CODE: + /* Try to understand this */ + if (InitMS_ADPCM(format) < 0) { + was_error = 1; + goto done; + } + MS_ADPCM_encoded = 1; + break; + case IMA_ADPCM_CODE: + /* Try to understand this */ + if (InitIMA_ADPCM(format) < 0) { + was_error = 1; + goto done; + } + IMA_ADPCM_encoded = 1; + break; + case MP3_CODE: + SDL_SetError("MPEG Layer 3 data not supported", + SDL_SwapLE16(format->encoding)); + was_error = 1; + goto done; + default: + SDL_SetError("Unknown WAVE data format: 0x%.4x", + SDL_SwapLE16(format->encoding)); + was_error = 1; + goto done; + } + SDL_memset(spec, 0, (sizeof *spec)); + spec->freq = SDL_SwapLE32(format->frequency); + + if (IEEE_float_encoded) { + if ((SDL_SwapLE16(format->bitspersample)) != 32) { + was_error = 1; + } else { + spec->format = AUDIO_F32; + } + } else { + switch (SDL_SwapLE16(format->bitspersample)) { + case 4: + if (MS_ADPCM_encoded || IMA_ADPCM_encoded) { + spec->format = AUDIO_S16; + } else { + was_error = 1; + } + break; + case 8: + spec->format = AUDIO_U8; + break; + case 16: + spec->format = AUDIO_S16; + break; + case 32: + spec->format = AUDIO_S32; + break; + default: + was_error = 1; + break; + } + } + + if (was_error) { + SDL_SetError("Unknown %d-bit PCM data format", + SDL_SwapLE16(format->bitspersample)); + goto done; + } + spec->channels = (Uint8) SDL_SwapLE16(format->channels); + spec->samples = 4096; /* Good default buffer size */ + + /* Read the audio data chunk */ + *audio_buf = NULL; + do { + if (*audio_buf != NULL) { + SDL_free(*audio_buf); + } + lenread = ReadChunk(src, &chunk); + if (lenread < 0) { + was_error = 1; + goto done; + } + *audio_len = lenread; + *audio_buf = chunk.data; + if (chunk.magic != DATA) + headerDiff += lenread + 2 * sizeof(Uint32); + } while (chunk.magic != DATA); + headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */ + + if (MS_ADPCM_encoded) { + if (MS_ADPCM_decode(audio_buf, audio_len) < 0) { + was_error = 1; + goto done; + } + } + if (IMA_ADPCM_encoded) { + if (IMA_ADPCM_decode(audio_buf, audio_len) < 0) { + was_error = 1; + goto done; + } + } + + /* Don't return a buffer that isn't a multiple of samplesize */ + samplesize = ((SDL_AUDIO_BITSIZE(spec->format)) / 8) * spec->channels; + *audio_len &= ~(samplesize - 1); + + done: + if (format != NULL) { + SDL_free(format); + } + if (src) { + if (freesrc) { + SDL_RWclose(src); + } else { + /* seek to the end of the file (given by the RIFF chunk) */ + SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR); + } + } + if (was_error) { + spec = NULL; + } + return (spec); +} + +/* Since the WAV memory is allocated in the shared library, it must also + be freed here. (Necessary under Win32, VC++) + */ +void +SDL_FreeWAV(Uint8 * audio_buf) +{ + if (audio_buf != NULL) { + SDL_free(audio_buf); + } +} + +static int +ReadChunk(SDL_RWops * src, Chunk * chunk) +{ + chunk->magic = SDL_ReadLE32(src); + chunk->length = SDL_ReadLE32(src); + chunk->data = (Uint8 *) SDL_malloc(chunk->length); + if (chunk->data == NULL) { + SDL_Error(SDL_ENOMEM); + return (-1); + } + if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) { + SDL_Error(SDL_EFREAD); + SDL_free(chunk->data); + return (-1); + } + return (chunk->length); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/SDL_wave.h b/Externals/SDL/src/audio/SDL_wave.h new file mode 100644 index 0000000000..72563deb91 --- /dev/null +++ b/Externals/SDL/src/audio/SDL_wave.h @@ -0,0 +1,65 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is SDL_free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* WAVE files are little-endian */ + +/*******************************************/ +/* Define values for Microsoft WAVE format */ +/*******************************************/ +#define RIFF 0x46464952 /* "RIFF" */ +#define WAVE 0x45564157 /* "WAVE" */ +#define FACT 0x74636166 /* "fact" */ +#define LIST 0x5453494c /* "LIST" */ +#define FMT 0x20746D66 /* "fmt " */ +#define DATA 0x61746164 /* "data" */ +#define PCM_CODE 0x0001 +#define MS_ADPCM_CODE 0x0002 +#define IEEE_FLOAT_CODE 0x0003 +#define IMA_ADPCM_CODE 0x0011 +#define MP3_CODE 0x0055 +#define WAVE_MONO 1 +#define WAVE_STEREO 2 + +/* Normally, these three chunks come consecutively in a WAVE file */ +typedef struct WaveFMT +{ +/* Not saved in the chunk we read: + Uint32 FMTchunk; + Uint32 fmtlen; +*/ + Uint16 encoding; + Uint16 channels; /* 1 = mono, 2 = stereo */ + Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */ + Uint32 byterate; /* Average bytes per second */ + Uint16 blockalign; /* Bytes per sample block */ + Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */ +} WaveFMT; + +/* The general chunk found in the WAVE file */ +typedef struct Chunk +{ + Uint32 magic; + Uint32 length; + Uint8 *data; +} Chunk; +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/alsa/SDL_alsa_audio.c b/Externals/SDL/src/audio/alsa/SDL_alsa_audio.c new file mode 100644 index 0000000000..00cd7da0d9 --- /dev/null +++ b/Externals/SDL/src/audio/alsa/SDL_alsa_audio.c @@ -0,0 +1,621 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#include +#include /* For kill() */ +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_alsa_audio.h" + +#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#include "SDL_loadso.h" +#endif + +/* The tag name used by ALSA audio */ +#define DRIVER_NAME "alsa" + +/* The default ALSA audio driver */ +#define DEFAULT_DEVICE "default" + +static int (*ALSA_snd_pcm_open) + (snd_pcm_t **, const char *, snd_pcm_stream_t, int); +static int (*ALSA_snd_pcm_close) (snd_pcm_t * pcm); +static snd_pcm_sframes_t(*ALSA_snd_pcm_writei) + (snd_pcm_t *, const void *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_resume) (snd_pcm_t *); +static int (*ALSA_snd_pcm_prepare) (snd_pcm_t *); +static int (*ALSA_snd_pcm_drain) (snd_pcm_t *); +static const char *(*ALSA_snd_strerror) (int); +static size_t(*ALSA_snd_pcm_hw_params_sizeof) (void); +static size_t(*ALSA_snd_pcm_sw_params_sizeof) (void); +static int (*ALSA_snd_pcm_hw_params_any) (snd_pcm_t *, snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params_set_access) + (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t); +static int (*ALSA_snd_pcm_hw_params_set_format) + (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t); +static int (*ALSA_snd_pcm_hw_params_set_channels) + (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int); +static int (*ALSA_snd_pcm_hw_params_set_rate_near) + (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_set_period_size_near) + (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); +static int (*ALSA_snd_pcm_hw_params_get_channels) + (const snd_pcm_hw_params_t *, unsigned int *); +static snd_pcm_sframes_t(*ALSA_snd_pcm_hw_params_get_period_size) + (const snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params_set_periods_near) + (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_get_periods) (snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params) (snd_pcm_t *, snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_sw_params_current) (snd_pcm_t *, + snd_pcm_sw_params_t *); +static int (*ALSA_snd_pcm_sw_params_set_start_threshold) + (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_sw_params_set_avail_min) + (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_sw_params) (snd_pcm_t *, snd_pcm_sw_params_t *); +static int (*ALSA_snd_pcm_nonblock) (snd_pcm_t *, int); +#define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof +#define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof + + +#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC + +static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC; +static void *alsa_handle = NULL; + +static int +load_alsa_sym(const char *fn, void **addr) +{ + *addr = SDL_LoadFunction(alsa_handle, fn); + if (*addr == NULL) { + /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ + return 0; + } + + return 1; +} + +/* cast funcs to char* first, to please GCC's strict aliasing rules. */ +#define SDL_ALSA_SYM(x) \ + if (!load_alsa_sym(#x, (void **) (char *) &ALSA_##x)) return -1 +#else +#define SDL_ALSA_SYM(x) ALSA_##x = x +#endif + +static int +load_alsa_syms(void) +{ + SDL_ALSA_SYM(snd_pcm_open); + SDL_ALSA_SYM(snd_pcm_close); + SDL_ALSA_SYM(snd_pcm_writei); + SDL_ALSA_SYM(snd_pcm_resume); + SDL_ALSA_SYM(snd_pcm_prepare); + SDL_ALSA_SYM(snd_pcm_drain); + SDL_ALSA_SYM(snd_strerror); + SDL_ALSA_SYM(snd_pcm_hw_params_sizeof); + SDL_ALSA_SYM(snd_pcm_sw_params_sizeof); + SDL_ALSA_SYM(snd_pcm_hw_params_any); + SDL_ALSA_SYM(snd_pcm_hw_params_set_access); + SDL_ALSA_SYM(snd_pcm_hw_params_set_format); + SDL_ALSA_SYM(snd_pcm_hw_params_set_channels); + SDL_ALSA_SYM(snd_pcm_hw_params_get_channels); + SDL_ALSA_SYM(snd_pcm_hw_params_set_rate_near); + SDL_ALSA_SYM(snd_pcm_hw_params_set_period_size_near); + SDL_ALSA_SYM(snd_pcm_hw_params_get_period_size); + SDL_ALSA_SYM(snd_pcm_hw_params_set_periods_near); + SDL_ALSA_SYM(snd_pcm_hw_params_get_periods); + SDL_ALSA_SYM(snd_pcm_hw_params); + SDL_ALSA_SYM(snd_pcm_sw_params_current); + SDL_ALSA_SYM(snd_pcm_sw_params_set_start_threshold); + SDL_ALSA_SYM(snd_pcm_sw_params_set_avail_min); + SDL_ALSA_SYM(snd_pcm_sw_params); + SDL_ALSA_SYM(snd_pcm_nonblock); + return 0; +} + +#undef SDL_ALSA_SYM + +#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC + +static void +UnloadALSALibrary(void) +{ + if (alsa_handle != NULL) { + SDL_UnloadObject(alsa_handle); + alsa_handle = NULL; + } +} + +static int +LoadALSALibrary(void) +{ + int retval = 0; + if (alsa_handle == NULL) { + alsa_handle = SDL_LoadObject(alsa_library); + if (alsa_handle == NULL) { + retval = -1; + /* Don't call SDL_SetError(): SDL_LoadObject already did. */ + } else { + retval = load_alsa_syms(); + if (retval < 0) { + UnloadALSALibrary(); + } + } + } + return retval; +} + +#else + +static void +UnloadALSALibrary(void) +{ +} + +static int +LoadALSALibrary(void) +{ + load_alsa_syms(); + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ + +static const char * +get_audio_device(int channels) +{ + const char *device; + + device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ + if (device == NULL) { + if (channels == 6) + device = "surround51"; + else if (channels == 4) + device = "surround40"; + else + device = DEFAULT_DEVICE; + } + return device; +} + + +/* This function waits until it is possible to write a full sound buffer */ +static void +ALSA_WaitDevice(_THIS) +{ + /* Check to see if the thread-parent process is still alive */ + { + static int cnt = 0; + /* Note that this only works with thread implementations + that use a different process id for each thread. + */ + /* Check every 10 loops */ + if (this->hidden->parent && (((++cnt) % 10) == 0)) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { + this->enabled = 0; + } + } + } +} + + +/* !!! FIXME: is there a channel swizzler in alsalib instead? */ +/* + * http://bugzilla.libsdl.org/show_bug.cgi?id=110 + * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE + * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR" + */ +#define SWIZ6(T) \ + T *ptr = (T *) this->hidden->mixbuf; \ + const Uint32 count = (this->spec.samples / 6); \ + Uint32 i; \ + for (i = 0; i < count; i++, ptr += 6) { \ + T tmp; \ + tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \ + tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \ + } + +static __inline__ void +swizzle_alsa_channels_6_64bit(_THIS) +{ + SWIZ6(Uint64); +} + +static __inline__ void +swizzle_alsa_channels_6_32bit(_THIS) +{ + SWIZ6(Uint32); +} + +static __inline__ void +swizzle_alsa_channels_6_16bit(_THIS) +{ + SWIZ6(Uint16); +} + +static __inline__ void +swizzle_alsa_channels_6_8bit(_THIS) +{ + SWIZ6(Uint8); +} + +#undef SWIZ6 + + +/* + * Called right before feeding this->hidden->mixbuf to the hardware. Swizzle + * channels from Windows/Mac order to the format alsalib will want. + */ +static __inline__ void +swizzle_alsa_channels(_THIS) +{ + if (this->spec.channels == 6) { + const Uint16 fmtsize = (this->spec.format & 0xFF); /* bits/channel. */ + if (fmtsize == 16) + swizzle_alsa_channels_6_16bit(this); + else if (fmtsize == 8) + swizzle_alsa_channels_6_8bit(this); + else if (fmtsize == 32) + swizzle_alsa_channels_6_32bit(this); + else if (fmtsize == 64) + swizzle_alsa_channels_6_64bit(this); + } + + /* !!! FIXME: update this for 7.1 if needed, later. */ +} + + +static void +ALSA_PlayDevice(_THIS) +{ + int status; + int sample_len; + signed short *sample_buf; + + swizzle_alsa_channels(this); + + sample_len = this->spec.samples; + sample_buf = (signed short *) this->hidden->mixbuf; + + while (sample_len > 0) { + status = ALSA_snd_pcm_writei(this->hidden->pcm_handle, + sample_buf, sample_len); + + if (status < 0) { + if (status == -EAGAIN) { + SDL_Delay(1); + continue; + } + if (status == -ESTRPIPE) { + do { + SDL_Delay(1); + status = ALSA_snd_pcm_resume(this->hidden->pcm_handle); + } while (status == -EAGAIN); + } + if (status < 0) { + status = ALSA_snd_pcm_prepare(this->hidden->pcm_handle); + } + if (status < 0) { + /* Hmm, not much we can do - abort */ + this->enabled = 0; + return; + } + continue; + } + sample_buf += status * this->spec.channels; + sample_len -= status; + } +} + +static Uint8 * +ALSA_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static void +ALSA_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->pcm_handle) { + ALSA_snd_pcm_drain(this->hidden->pcm_handle); + ALSA_snd_pcm_close(this->hidden->pcm_handle); + this->hidden->pcm_handle = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +ALSA_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int status = 0; + snd_pcm_t *pcm_handle = NULL; + snd_pcm_hw_params_t *hwparams = NULL; + snd_pcm_sw_params_t *swparams = NULL; + snd_pcm_format_t format = 0; + snd_pcm_uframes_t frames = 0; + SDL_AudioFormat test_format = 0; + unsigned int rate = 0; + unsigned int periods = 0; + unsigned int channels = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + /* Name of device should depend on # channels in spec */ + status = ALSA_snd_pcm_open(&pcm_handle, + get_audio_device(this->spec.channels), + SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); + + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't open audio device: %s", + ALSA_snd_strerror(status)); + return 0; + } + + this->hidden->pcm_handle = pcm_handle; + + /* Figure out what the hardware is capable of */ + snd_pcm_hw_params_alloca(&hwparams); + status = ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't get hardware config: %s", + ALSA_snd_strerror(status)); + return 0; + } + + /* SDL only uses interleaved sample output */ + status = ALSA_snd_pcm_hw_params_set_access(pcm_handle, hwparams, + SND_PCM_ACCESS_RW_INTERLEAVED); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't set interleaved access: %s", + ALSA_snd_strerror(status)); + return 0; + } + + /* Try for a closest match on audio format */ + status = -1; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + test_format && (status < 0);) { + status = 0; /* if we can't support a format, it'll become -1. */ + switch (test_format) { + case AUDIO_U8: + format = SND_PCM_FORMAT_U8; + break; + case AUDIO_S8: + format = SND_PCM_FORMAT_S8; + break; + case AUDIO_S16LSB: + format = SND_PCM_FORMAT_S16_LE; + break; + case AUDIO_S16MSB: + format = SND_PCM_FORMAT_S16_BE; + break; + case AUDIO_U16LSB: + format = SND_PCM_FORMAT_U16_LE; + break; + case AUDIO_U16MSB: + format = SND_PCM_FORMAT_U16_BE; + break; + case AUDIO_S32LSB: + format = SND_PCM_FORMAT_S32_LE; + break; + case AUDIO_S32MSB: + format = SND_PCM_FORMAT_S32_BE; + break; + case AUDIO_F32LSB: + format = SND_PCM_FORMAT_FLOAT_LE; + break; + case AUDIO_F32MSB: + format = SND_PCM_FORMAT_FLOAT_BE; + break; + default: + status = -1; + break; + } + if (status >= 0) { + status = ALSA_snd_pcm_hw_params_set_format(pcm_handle, + hwparams, format); + } + if (status < 0) { + test_format = SDL_NextAudioFormat(); + } + } + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't find any hardware audio formats"); + return 0; + } + this->spec.format = test_format; + + /* Set the number of channels */ + status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams, + this->spec.channels); + channels = this->spec.channels; + if (status < 0) { + status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't set audio channels"); + return 0; + } + this->spec.channels = channels; + } + + /* Set the audio rate */ + rate = this->spec.freq; + status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, + &rate, NULL); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't set audio frequency: %s", + ALSA_snd_strerror(status)); + return 0; + } + this->spec.freq = rate; + + /* Set the buffer size, in samples */ + frames = this->spec.samples; + status = ALSA_snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, + &frames, NULL); + if ( status < 0 ) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't set audio frequency: %s", + ALSA_snd_strerror(status)); + return(-1); + } + this->spec.samples = frames; + + periods = 2; + ALSA_snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, + &periods, NULL); + + /* "set" the hardware with the desired parameters */ + status = ALSA_snd_pcm_hw_params(pcm_handle, hwparams); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't set hardware audio parameters: %s", + ALSA_snd_strerror(status)); + return 0; + } +#if AUDIO_DEBUG + { + snd_pcm_sframes_t bufsize; + int fragments; + bufsize = ALSA_snd_pcm_hw_params_get_period_size(hwparams); + fragments = ALSA_snd_pcm_hw_params_get_periods(hwparams); + fprintf(stderr, "ALSA: bufsize = %ld, fragments = %d\n", bufsize, + fragments); + } +#endif + + /* Set the software parameters */ + snd_pcm_sw_params_alloca(&swparams); + status = ALSA_snd_pcm_sw_params_current(pcm_handle, swparams); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't get software config: %s", + ALSA_snd_strerror(status)); + return 0; + } + status = + ALSA_snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 0); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("ALSA: Couldn't set start threshold: %s", + ALSA_snd_strerror(status)); + return 0; + } + status = + ALSA_snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, frames); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("Couldn't set avail min: %s", ALSA_snd_strerror(status)); + return 0; + } + status = ALSA_snd_pcm_sw_params(pcm_handle, swparams); + if (status < 0) { + ALSA_CloseDevice(this); + SDL_SetError("Couldn't set software audio parameters: %s", + ALSA_snd_strerror(status)); + return 0; + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + ALSA_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* Get the parent process id (we're the parent of the audio thread) */ + this->hidden->parent = getpid(); + + /* Switch to blocking mode for playback */ + ALSA_snd_pcm_nonblock(pcm_handle, 0); + + /* We're ready to rock and roll. :-) */ + return 1; +} + +static void +ALSA_Deinitialize(void) +{ + UnloadALSALibrary(); +} + +static int +ALSA_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadALSALibrary() < 0) { + return 0; + } + + /* Set the function pointers */ + impl->OpenDevice = ALSA_OpenDevice; + impl->WaitDevice = ALSA_WaitDevice; + impl->GetDeviceBuf = ALSA_GetDeviceBuf; + impl->PlayDevice = ALSA_PlayDevice; + impl->CloseDevice = ALSA_CloseDevice; + impl->Deinitialize = ALSA_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: Add device enum! */ + + return 1; /* !!! FIXME: return 2 once device enum is implemented. */ +} + + +AudioBootStrap ALSA_bootstrap = { + DRIVER_NAME, "ALSA 0.9 PCM audio", ALSA_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/alsa/SDL_alsa_audio.h b/Externals/SDL/src/audio/alsa/SDL_alsa_audio.h new file mode 100644 index 0000000000..6621e9d065 --- /dev/null +++ b/Externals/SDL/src/audio/alsa/SDL_alsa_audio.h @@ -0,0 +1,48 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _ALSA_PCM_audio_h +#define _ALSA_PCM_audio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The audio device handle */ + snd_pcm_t *pcm_handle; + + /* The parent process id, to detect when application quits */ + pid_t parent; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; +}; + +#endif /* _ALSA_PCM_audio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/arts/SDL_artsaudio.c b/Externals/SDL/src/audio/arts/SDL_artsaudio.c new file mode 100644 index 0000000000..c4fac313fa --- /dev/null +++ b/Externals/SDL/src/audio/arts/SDL_artsaudio.c @@ -0,0 +1,379 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#ifdef HAVE_SIGNAL_H +#include +#endif +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_artsaudio.h" + +#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#include "SDL_name.h" +#include "SDL_loadso.h" +#else +#define SDL_NAME(X) X +#endif + +/* The tag name used by artsc audio */ +#define ARTS_DRIVER_NAME "arts" + +#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC + +static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC; +static void *arts_handle = NULL; + +/* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */ +static int (*SDL_NAME(arts_init)) (void); +static void (*SDL_NAME(arts_free)) (void); +static arts_stream_t(*SDL_NAME(arts_play_stream)) (int rate, int bits, + int channels, + const char *name); +static int (*SDL_NAME(arts_stream_set)) (arts_stream_t s, + arts_parameter_t param, int value); +static int (*SDL_NAME(arts_stream_get)) (arts_stream_t s, + arts_parameter_t param); +static int (*SDL_NAME(arts_write)) (arts_stream_t s, const void *buffer, + int count); +static void (*SDL_NAME(arts_close_stream)) (arts_stream_t s); +static int (*SDL_NAME(arts_suspended)) (void); +static const char *(*SDL_NAME(arts_error_text)) (int errorcode); + +#define SDL_ARTS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } +static struct +{ + const char *name; + void **func; +} arts_functions[] = { +/* *INDENT-OFF* */ + SDL_ARTS_SYM(arts_init), + SDL_ARTS_SYM(arts_free), + SDL_ARTS_SYM(arts_play_stream), + SDL_ARTS_SYM(arts_stream_set), + SDL_ARTS_SYM(arts_stream_get), + SDL_ARTS_SYM(arts_write), + SDL_ARTS_SYM(arts_close_stream), + SDL_ARTS_SYM(arts_suspended), + SDL_ARTS_SYM(arts_error_text), +/* *INDENT-ON* */ +}; + +#undef SDL_ARTS_SYM + +static void +UnloadARTSLibrary() +{ + if (arts_handle != NULL) { + SDL_UnloadObject(arts_handle); + arts_handle = NULL; + } +} + +static int +LoadARTSLibrary(void) +{ + int i, retval = -1; + + if (arts_handle == NULL) { + arts_handle = SDL_LoadObject(arts_library); + if (arts_handle != NULL) { + retval = 0; + for (i = 0; i < SDL_arraysize(arts_functions); ++i) { + *arts_functions[i].func = + SDL_LoadFunction(arts_handle, arts_functions[i].name); + if (!*arts_functions[i].func) { + retval = -1; + UnloadARTSLibrary(); + break; + } + } + } + } + + return retval; +} + +#else + +static void +UnloadARTSLibrary() +{ + return; +} + +static int +LoadARTSLibrary(void) +{ + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ + +/* This function waits until it is possible to write a full sound buffer */ +static void +ARTS_WaitDevice(_THIS) +{ + Sint32 ticks; + + /* Check to see if the thread-parent process is still alive */ + { + static int cnt = 0; + /* Note that this only works with thread implementations + that use a different process id for each thread. + */ + /* Check every 10 loops */ + if (this->hidden->parent && (((++cnt) % 10) == 0)) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { + this->enabled = 0; + } + } + } + + /* Use timer for general audio synchronization */ + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } +} + +static void +ARTS_PlayDevice(_THIS) +{ + /* Write the audio data */ + int written = SDL_NAME(arts_write) (this->hidden->stream, + this->hidden->mixbuf, + this->hidden->mixlen); + + /* If timer synchronization is enabled, set the next write frame */ + if (this->hidden->frame_ticks) { + this->hidden->next_frame += this->hidden->frame_ticks; + } + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", written); +#endif +} + +static void +ARTS_WaitDone(_THIS) +{ + /* !!! FIXME: camp here until buffer drains... SDL_Delay(???); */ +} + + +static Uint8 * +ARTS_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + + +static void +ARTS_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->stream) { + SDL_NAME(arts_close_stream) (this->hidden->stream); + this->hidden->stream = 0; + } + SDL_NAME(arts_free) (); + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static int +ARTS_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int rc = 0; + int bits = 0, frag_spec = 0; + SDL_AudioFormat test_format = 0, format = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + switch (test_format) { + case AUDIO_U8: + bits = 8; + format = 1; + break; + case AUDIO_S16LSB: + bits = 16; + format = 1; + break; + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + ARTS_CloseDevice(this); + SDL_SetError("Couldn't find any hardware audio formats"); + return 0; + } + this->spec.format = test_format; + + if ((rc = SDL_NAME(arts_init) ()) != 0) { + ARTS_CloseDevice(this); + SDL_SetError("Unable to initialize ARTS: %s", + SDL_NAME(arts_error_text) (rc)); + return 0; + } + + if (!SDL_NAME(arts_suspended) ()) { + ARTS_CloseDevice(this); + SDL_SetError("ARTS can not open audio device"); + return 0; + } + + this->hidden->stream = SDL_NAME(arts_play_stream) (this->spec.freq, + bits, + this->spec.channels, + "SDL"); + + /* Play nothing so we have at least one write (server bug workaround). */ + SDL_NAME(arts_write) (this->hidden->stream, "", 0); + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Determine the power of two of the fragment size */ + for (frag_spec = 0; (0x01 << frag_spec) < this->spec.size; ++frag_spec); + if ((0x01 << frag_spec) != this->spec.size) { + ARTS_CloseDevice(this); + SDL_SetError("Fragment size must be a power of two"); + return 0; + } + frag_spec |= 0x00020000; /* two fragments, for low latency */ + +#ifdef ARTS_P_PACKET_SETTINGS + SDL_NAME(arts_stream_set) (this->hidden->stream, + ARTS_P_PACKET_SETTINGS, frag_spec); +#else + SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_SIZE, + frag_spec & 0xffff); + SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_COUNT, + frag_spec >> 16); +#endif + this->spec.size = SDL_NAME(arts_stream_get) (this->hidden->stream, + ARTS_P_PACKET_SIZE); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + ARTS_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* Get the parent process id (we're the parent of the audio thread) */ + this->hidden->parent = getpid(); + + /* We're ready to rock and roll. :-) */ + return 1; +} + + +static void +ARTS_Deinitialize(void) +{ + UnloadARTSLibrary(); +} + + +static int +ARTS_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadARTSLibrary() < 0) { + return 0; + } else { + if (SDL_NAME(arts_init) () != 0) { + UnloadARTSLibrary(); + SDL_SetError("ARTS: arts_init failed (no audio server?)"); + return 0; + } + + /* Play a stream so aRts doesn't crash */ + if (SDL_NAME(arts_suspended) ()) { + arts_stream_t stream; + stream = SDL_NAME(arts_play_stream) (44100, 16, 2, "SDL"); + SDL_NAME(arts_write) (stream, "", 0); + SDL_NAME(arts_close_stream) (stream); + } + + SDL_NAME(arts_free) (); + } + + /* Set the function pointers */ + impl->OpenDevice = ARTS_OpenDevice; + impl->PlayDevice = ARTS_PlayDevice; + impl->WaitDevice = ARTS_WaitDevice; + impl->GetDeviceBuf = ARTS_GetDeviceBuf; + impl->CloseDevice = ARTS_CloseDevice; + impl->WaitDone = ARTS_WaitDone; + impl->Deinitialize = ARTS_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; +} + + +AudioBootStrap ARTS_bootstrap = { + ARTS_DRIVER_NAME, "Analog RealTime Synthesizer", ARTS_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/arts/SDL_artsaudio.h b/Externals/SDL/src/audio/arts/SDL_artsaudio.h new file mode 100644 index 0000000000..ffe012b898 --- /dev/null +++ b/Externals/SDL/src/audio/arts/SDL_artsaudio.h @@ -0,0 +1,53 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_artscaudio_h +#define _SDL_artscaudio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The stream descriptor for the audio device */ + arts_stream_t stream; + + /* The parent process id, to detect when application quits */ + pid_t parent; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; + + /* Support for audio timing using a timer, in addition to select() */ + float frame_ticks; + float next_frame; +}; +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ + +#endif /* _SDL_artscaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/baudio/SDL_beaudio.cc b/Externals/SDL/src/audio/baudio/SDL_beaudio.cc new file mode 100644 index 0000000000..aa3ea3adae --- /dev/null +++ b/Externals/SDL/src/audio/baudio/SDL_beaudio.cc @@ -0,0 +1,218 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to the audio stream on BeOS */ + +#include + +#include "../../main/beos/SDL_BeApp.h" + +extern "C" +{ + +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "../../thread/beos/SDL_systhread_c.h" +#include "SDL_beaudio.h" + +} + + +/* !!! FIXME: have the callback call the higher level to avoid code dupe. */ +/* The BeOS callback for handling the audio buffer */ +static void +FillSound(void *device, void *stream, size_t len, + const media_raw_audio_format & format) +{ + SDL_AudioDevice *audio = (SDL_AudioDevice *) device; + + /* Silence the buffer, since it's ours */ + SDL_memset(stream, audio->spec.silence, len); + + /* Only do soemthing if audio is enabled */ + if (!audio->enabled) + return; + + if (!audio->paused) { + if (audio->convert.needed) { + SDL_mutexP(audio->mixer_lock); + (*audio->spec.callback) (audio->spec.userdata, + (Uint8 *) audio->convert.buf, + audio->convert.len); + SDL_mutexV(audio->mixer_lock); + SDL_ConvertAudio(&audio->convert); + SDL_memcpy(stream, audio->convert.buf, audio->convert.len_cvt); + } else { + SDL_mutexP(audio->mixer_lock); + (*audio->spec.callback) (audio->spec.userdata, + (Uint8 *) stream, len); + SDL_mutexV(audio->mixer_lock); + } + } +} + +static void +BEOSAUDIO_CloseDevice(_THIS) +{ + if (_this->hidden != NULL) { + if (_this->hidden->audio_obj) { + _this->hidden->audio_obj->Stop(); + delete _this->hidden->audio_obj; + _this->hidden->audio_obj = NULL; + } + + delete _this->hidden; + _this->hidden = NULL; + } +} + +static int +BEOSAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int valid_datatype = 0; + media_raw_audio_format format; + SDL_AudioFormat test_format = SDL_FirstAudioFormat(_this->spec.format); + + /* Initialize all variables that we clean on shutdown */ + _this->hidden = new SDL_PrivateAudioData; + if (_this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(_this->hidden, 0, (sizeof *_this->hidden)); + + /* Parse the audio format and fill the Be raw audio format */ + SDL_memset(&format, '\0', sizeof(media_raw_audio_format)); + format.byte_order = B_MEDIA_LITTLE_ENDIAN; + format.frame_rate = (float) _this->spec.freq; + format.channel_count = _this->spec.channels; /* !!! FIXME: support > 2? */ + while ((!valid_datatype) && (test_format)) { + valid_datatype = 1; + _this->spec.format = test_format; + switch (test_format) { + case AUDIO_S8: + format.format = media_raw_audio_format::B_AUDIO_CHAR; + break; + + case AUDIO_U8: + format.format = media_raw_audio_format::B_AUDIO_UCHAR; + break; + + case AUDIO_S16LSB: + format.format = media_raw_audio_format::B_AUDIO_SHORT; + break; + + case AUDIO_S16MSB: + format.format = media_raw_audio_format::B_AUDIO_SHORT; + format.byte_order = B_MEDIA_BIG_ENDIAN; + break; + + case AUDIO_S32LSB: + format.format = media_raw_audio_format::B_AUDIO_INT; + break; + + case AUDIO_S32MSB: + format.format = media_raw_audio_format::B_AUDIO_INT; + format.byte_order = B_MEDIA_BIG_ENDIAN; + break; + + case AUDIO_F32LSB: + format.format = media_raw_audio_format::B_AUDIO_FLOAT; + break; + + case AUDIO_F32MSB: + format.format = media_raw_audio_format::B_AUDIO_FLOAT; + format.byte_order = B_MEDIA_BIG_ENDIAN; + break; + + default: + valid_datatype = 0; + test_format = SDL_NextAudioFormat(); + break; + } + } + + format.buffer_size = _this->spec.samples; + + if (!valid_datatype) { /* shouldn't happen, but just in case... */ + BEOSAUDIO_CloseDevice(_this); + SDL_SetError("Unsupported audio format"); + return 0; + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&_this->spec); + + /* Subscribe to the audio stream (creates a new thread) */ + sigset_t omask; + SDL_MaskSignals(&omask); + _this->hidden->audio_obj = new BSoundPlayer(&format, "SDL Audio", + FillSound, NULL, _this); + SDL_UnmaskSignals(&omask); + + if (_this->hidden->audio_obj->Start() == B_NO_ERROR) { + _this->hidden->audio_obj->SetHasData(true); + } else { + BEOSAUDIO_CloseDevice(_this); + SDL_SetError("Unable to start Be audio"); + return 0; + } + + /* We're running! */ + return 1; +} + +static void +BEOSAUDIO_Deinitialize(void) +{ + SDL_QuitBeApp(); +} + +static int +BEOSAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Initialize the Be Application, if it's not already started */ + if (SDL_InitBeApp() < 0) { + return 0; + } + + /* Set the function pointers */ + impl->OpenDevice = BEOSAUDIO_OpenDevice; + impl->CloseDevice = BEOSAUDIO_CloseDevice; + impl->Deinitialize = BEOSAUDIO_Deinitialize; + impl->ProvidesOwnCallbackThread = 1; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; +} + +extern "C" +{ + extern AudioBootStrap BEOSAUDIO_bootstrap; +} +AudioBootStrap BEOSAUDIO_bootstrap = { + "baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/baudio/SDL_beaudio.h b/Externals/SDL/src/audio/baudio/SDL_beaudio.h new file mode 100644 index 0000000000..a5fbfd2354 --- /dev/null +++ b/Externals/SDL/src/audio/baudio/SDL_beaudio.h @@ -0,0 +1,39 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_beaudio_h +#define _SDL_beaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *_this + +struct SDL_PrivateAudioData +{ + BSoundPlayer *audio_obj; +}; + +#endif /* _SDL_beaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/bsd/SDL_bsdaudio.c b/Externals/SDL/src/audio/bsd/SDL_bsdaudio.c new file mode 100644 index 0000000000..12dd017b8a --- /dev/null +++ b/Externals/SDL/src/audio/bsd/SDL_bsdaudio.c @@ -0,0 +1,455 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* + * Driver for native OpenBSD/NetBSD audio(4). + * vedge@vedge.com.ar. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" +#include "SDL_bsdaudio.h" + +/* The tag name used by NetBSD/OpenBSD audio */ +#ifdef __NetBSD__ +#define BSD_AUDIO_DRIVER_NAME "netbsd" +#define BSD_AUDIO_DRIVER_DESC "Native NetBSD audio" +#else +#define BSD_AUDIO_DRIVER_NAME "openbsd" +#define BSD_AUDIO_DRIVER_DESC "Native OpenBSD audio" +#endif + +/* Open the audio device for playback, and don't block if busy */ +/* #define USE_BLOCKING_WRITES */ + +/* Use timer for synchronization */ +/* #define USE_TIMER_SYNC */ + +/* #define DEBUG_AUDIO */ +/* #define DEBUG_AUDIO_STREAM */ + +#ifdef USE_BLOCKING_WRITES +#define OPEN_FLAGS_OUTPUT O_WRONLY +#define OPEN_FLAGS_INPUT O_RDONLY +#else +#define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) +#define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) +#endif + +/* !!! FIXME: so much cut and paste with dsp/dma drivers... */ +static char **outputDevices = NULL; +static int outputDeviceCount = 0; +static char **inputDevices = NULL; +static int inputDeviceCount = 0; + +static inline void +free_device_list(char ***devs, int *count) +{ + SDL_FreeUnixAudioDevices(devs, count); +} + +static inline void +build_device_list(int iscapture, char ***devs, int *count) +{ + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + free_device_list(devs, count); + SDL_EnumUnixAudioDevices(flags, 0, NULL, devs, count); +} + +static inline void +build_device_lists(void) +{ + build_device_list(0, &outputDevices, &outputDeviceCount); + build_device_list(1, &inputDevices, &inputDeviceCount); +} + + +static inline void +free_device_lists(void) +{ + free_device_list(&outputDevices, &outputDeviceCount); + free_device_list(&inputDevices, &inputDeviceCount); +} + + +static void +BSDAUDIO_Deinitialize(void) +{ + free_device_lists(); +} + + +static int +BSDAUDIO_DetectDevices(int iscapture) +{ + if (iscapture) { + build_device_list(1, &inputDevices, &inputDeviceCount); + return inputDeviceCount; + } else { + build_device_list(0, &outputDevices, &outputDeviceCount); + return outputDeviceCount; + } + + return 0; /* shouldn't ever hit this. */ +} + +static const char * +BSDAUDIO_GetDeviceName(int index, int iscapture) +{ + if ((iscapture) && (index < inputDeviceCount)) { + return inputDevices[index]; + } else if ((!iscapture) && (index < outputDeviceCount)) { + return outputDevices[index]; + } + + SDL_SetError("No such device"); + return NULL; +} + + +static void +BSDAUDIO_Status(_THIS) +{ +#ifdef DEBUG_AUDIO + /* *INDENT-OFF* */ + audio_info_t info; + + if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) { + fprintf(stderr, "AUDIO_GETINFO failed.\n"); + return; + } + fprintf(stderr, "\n" + "[play/record info]\n" + "buffer size : %d bytes\n" + "sample rate : %i Hz\n" + "channels : %i\n" + "precision : %i-bit\n" + "encoding : 0x%x\n" + "seek : %i\n" + "sample count : %i\n" + "EOF count : %i\n" + "paused : %s\n" + "error occured : %s\n" + "waiting : %s\n" + "active : %s\n" + "", + info.play.buffer_size, + info.play.sample_rate, + info.play.channels, + info.play.precision, + info.play.encoding, + info.play.seek, + info.play.samples, + info.play.eof, + info.play.pause ? "yes" : "no", + info.play.error ? "yes" : "no", + info.play.waiting ? "yes" : "no", + info.play.active ? "yes" : "no"); + + fprintf(stderr, "\n" + "[audio info]\n" + "monitor_gain : %i\n" + "hw block size : %d bytes\n" + "hi watermark : %i\n" + "lo watermark : %i\n" + "audio mode : %s\n" + "", + info.monitor_gain, + info.blocksize, + info.hiwat, info.lowat, + (info.mode == AUMODE_PLAY) ? "PLAY" + : (info.mode = AUMODE_RECORD) ? "RECORD" + : (info.mode == AUMODE_PLAY_ALL ? "PLAY_ALL" : "?")); + /* *INDENT-ON* */ +#endif /* DEBUG_AUDIO */ +} + + +/* This function waits until it is possible to write a full sound buffer */ +static void +BSDAUDIO_WaitDevice(_THIS) +{ +#ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */ + /* See if we need to use timed audio synchronization */ + if (this->hidden->frame_ticks) { + /* Use timer for general audio synchronization */ + Sint32 ticks; + + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - + FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } + } else { + /* Use select() for audio synchronization */ + fd_set fdset; + struct timeval timeout; + + FD_ZERO(&fdset); + FD_SET(this->hidden->audio_fd, &fdset); + timeout.tv_sec = 10; + timeout.tv_usec = 0; +#ifdef DEBUG_AUDIO + fprintf(stderr, "Waiting for audio to get ready\n"); +#endif + if (select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, &timeout) + <= 0) { + const char *message = + "Audio timeout - buggy audio driver? (disabled)"; + /* In general we should never print to the screen, + but in this case we have no other way of letting + the user know what happened. + */ + fprintf(stderr, "SDL: %s\n", message); + this->enabled = 0; + /* Don't try to close - may hang */ + this->hidden->audio_fd = -1; +#ifdef DEBUG_AUDIO + fprintf(stderr, "Done disabling audio\n"); +#endif + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Ready!\n"); +#endif + } +#endif /* !USE_BLOCKING_WRITES */ +} + +static void +BSDAUDIO_PlayDevice(_THIS) +{ + int written, p = 0; + + /* Write the audio data, checking for EAGAIN on broken audio drivers */ + do { + written = write(this->hidden->audio_fd, + &this->hidden->mixbuf[p], this->hidden->mixlen - p); + + if (written > 0) + p += written; + if (written == -1 && errno != 0 && errno != EAGAIN && errno != EINTR) { + /* Non recoverable error has occurred. It should be reported!!! */ + perror("audio"); + break; + } + + if (p < written + || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) { + SDL_Delay(1); /* Let a little CPU time go by */ + } + } while (p < written); + + /* If timer synchronization is enabled, set the next write frame */ + if (this->hidden->frame_ticks) { + this->hidden->next_frame += this->hidden->frame_ticks; + } + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", written); +#endif +} + +static Uint8 * +BSDAUDIO_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static void +BSDAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + close(this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +BSDAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + SDL_AudioFormat format = 0; + audio_info_t info; + + /* We don't care what the devname is...we'll try to open anything. */ + /* ...but default to first name in the list... */ + if (devname == NULL) { + if (((iscapture) && (inputDeviceCount == 0)) || + ((!iscapture) && (outputDeviceCount == 0))) { + SDL_SetError("No such audio device"); + return 0; + } + devname = ((iscapture) ? inputDevices[0] : outputDevices[0]); + } + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + this->hidden->audio_fd = open(devname, flags, 0); + if (this->hidden->audio_fd < 0) { + SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); + return 0; + } + + AUDIO_INITINFO(&info); + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Set to play mode */ + info.mode = AUMODE_PLAY; + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) < 0) { + BSDAUDIO_CloseDevice(this); + SDL_SetError("Couldn't put device into play mode"); + return 0; + } + + AUDIO_INITINFO(&info); + for (format = SDL_FirstAudioFormat(this->spec.format); + format; format = SDL_NextAudioFormat()) { + switch (format) { + case AUDIO_U8: + info.play.encoding = AUDIO_ENCODING_ULINEAR; + info.play.precision = 8; + break; + case AUDIO_S8: + info.play.encoding = AUDIO_ENCODING_SLINEAR; + info.play.precision = 8; + break; + case AUDIO_S16LSB: + info.play.encoding = AUDIO_ENCODING_SLINEAR_LE; + info.play.precision = 16; + break; + case AUDIO_S16MSB: + info.play.encoding = AUDIO_ENCODING_SLINEAR_BE; + info.play.precision = 16; + break; + case AUDIO_U16LSB: + info.play.encoding = AUDIO_ENCODING_ULINEAR_LE; + info.play.precision = 16; + break; + case AUDIO_U16MSB: + info.play.encoding = AUDIO_ENCODING_ULINEAR_BE; + info.play.precision = 16; + break; + default: + continue; + } + + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) { + break; + } + } + + if (!format) { + BSDAUDIO_CloseDevice(this); + SDL_SetError("No supported encoding for 0x%x", this->spec.format); + return 0; + } + + this->spec.format = format; + + AUDIO_INITINFO(&info); + info.play.channels = this->spec.channels; + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == -1) { + this->spec.channels = 1; + } + AUDIO_INITINFO(&info); + info.play.sample_rate = this->spec.freq; + info.blocksize = this->spec.size; + info.hiwat = 5; + info.lowat = 3; + (void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info); + (void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info); + this->spec.freq = info.play.sample_rate; + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + BSDAUDIO_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + BSDAUDIO_Status(this); + + /* We're ready to rock and roll. :-) */ + return (0); +} + +static int +BSDAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = BSDAUDIO_DetectDevices; + impl->GetDeviceName = BSDAUDIO_GetDeviceName; + impl->OpenDevice = BSDAUDIO_OpenDevice; + impl->PlayDevice = BSDAUDIO_PlayDevice; + impl->WaitDevice = BSDAUDIO_WaitDevice; + impl->GetDeviceBuf = BSDAUDIO_GetDeviceBuf; + impl->CloseDevice = BSDAUDIO_CloseDevice; + impl->Deinitialize = BSDAUDIO_Deinitialize; + + build_device_lists(); + return (outputDeviceCount > 0) ? 2 : 1; +} + + +AudioBootStrap BSD_AUDIO_bootstrap = { + BSD_AUDIO_DRIVER_NAME, BSD_AUDIO_DRIVER_DESC, BSDAUDIO_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/bsd/SDL_bsdaudio.h b/Externals/SDL/src/audio/bsd/SDL_bsdaudio.h new file mode 100644 index 0000000000..986f6f761e --- /dev/null +++ b/Externals/SDL/src/audio/bsd/SDL_bsdaudio.h @@ -0,0 +1,52 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_bsdaudio_h +#define _SDL_bsdaudio_h + +#include "../SDL_sysaudio.h" + +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; + + /* The parent process id, to detect when application quits */ + pid_t parent; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; + + /* Support for audio timing using a timer, in addition to select() */ + float frame_ticks; + float next_frame; +}; + +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ + +#endif /* _SDL_bsdaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/disk/SDL_diskaudio.c b/Externals/SDL/src/audio/disk/SDL_diskaudio.c new file mode 100644 index 0000000000..fa0b3c8492 --- /dev/null +++ b/Externals/SDL/src/audio/disk/SDL_diskaudio.c @@ -0,0 +1,168 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + This file written by Ryan C. Gordon (icculus@icculus.org) +*/ +#include "SDL_config.h" + +/* Output raw audio data to a file. */ + +#if HAVE_STDIO_H +#include +#endif + +#include "SDL_rwops.h" +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_diskaudio.h" + +/* The tag name used by DISK audio */ +#define DISKAUD_DRIVER_NAME "disk" + +/* environment variables and defaults. */ +#define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE" +#define DISKDEFAULT_OUTFILE "sdlaudio.raw" +#define DISKENVR_WRITEDELAY "SDL_DISKAUDIODELAY" +#define DISKDEFAULT_WRITEDELAY 150 + +static const char * +DISKAUD_GetOutputFilename(const char *devname) +{ + if (devname == NULL) { + devname = SDL_getenv(DISKENVR_OUTFILE); + if (devname == NULL) { + devname = DISKDEFAULT_OUTFILE; + } + } + return devname; +} + +/* This function waits until it is possible to write a full sound buffer */ +static void +DISKAUD_WaitDevice(_THIS) +{ + SDL_Delay(this->hidden->write_delay); +} + +static void +DISKAUD_PlayDevice(_THIS) +{ + size_t written; + + /* Write the audio data */ + written = SDL_RWwrite(this->hidden->output, + this->hidden->mixbuf, 1, this->hidden->mixlen); + + /* If we couldn't write, assume fatal error for now */ + if (written != this->hidden->mixlen) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", written); +#endif +} + +static Uint8 * +DISKAUD_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static void +DISKAUD_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->output != NULL) { + SDL_RWclose(this->hidden->output); + this->hidden->output = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) +{ + const char *envr = SDL_getenv(DISKENVR_WRITEDELAY); + const char *fname = DISKAUD_GetOutputFilename(devname); + + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc(sizeof(*this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, sizeof(*this->hidden)); + + /* Open the audio device */ + this->hidden->output = SDL_RWFromFile(fname, "wb"); + if (this->hidden->output == NULL) { + DISKAUD_CloseDevice(this); + return 0; + } + + /* Allocate mixing buffer */ + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + DISKAUD_CloseDevice(this); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + this->hidden->mixlen = this->spec.size; + this->hidden->write_delay = + (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY; + +#if HAVE_STDIO_H + fprintf(stderr, + "WARNING: You are using the SDL disk writer audio driver!\n" + " Writing to file [%s].\n", fname); +#endif + + /* We're ready to rock and roll. :-) */ + return 1; +} + +static int +DISKAUD_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = DISKAUD_OpenDevice; + impl->WaitDevice = DISKAUD_WaitDevice; + impl->PlayDevice = DISKAUD_PlayDevice; + impl->GetDeviceBuf = DISKAUD_GetDeviceBuf; + impl->CloseDevice = DISKAUD_CloseDevice; + + return 1; +} + +AudioBootStrap DISKAUD_bootstrap = { + DISKAUD_DRIVER_NAME, "direct-to-disk audio", DISKAUD_Init, 1 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/disk/SDL_diskaudio.h b/Externals/SDL/src/audio/disk/SDL_diskaudio.h new file mode 100644 index 0000000000..032478a984 --- /dev/null +++ b/Externals/SDL/src/audio/disk/SDL_diskaudio.h @@ -0,0 +1,43 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_diskaudio_h +#define _SDL_diskaudio_h + +#include "SDL_rwops.h" +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + SDL_RWops *output; + Uint8 *mixbuf; + Uint32 mixlen; + Uint32 write_delay; +}; + +#endif /* _SDL_diskaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dma/SDL_dmaaudio.c b/Externals/SDL/src/audio/dma/SDL_dmaaudio.c new file mode 100644 index 0000000000..118fff9b4a --- /dev/null +++ b/Externals/SDL/src/audio/dma/SDL_dmaaudio.c @@ -0,0 +1,534 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* !!! FIXME: merge this driver with "dsp". */ + +/* Allow access to a raw mixing buffer */ + +#include +#include /* For strerror() */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +/* This is installed on some systems */ +#include +#else +/* This is recommended by OSS */ +#include +#endif + +#ifndef MAP_FAILED +#define MAP_FAILED ((Uint8 *)-1) +#endif + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" +#include "SDL_dmaaudio.h" + +/* The tag name used by DMA audio */ +#define DMA_DRIVER_NAME "dma" + +/* Open the audio device for playback, and don't block if busy */ +#define OPEN_FLAGS_INPUT (O_RDWR|O_NONBLOCK) +#define OPEN_FLAGS_OUTPUT (O_RDWR|O_NONBLOCK) + +static char **outputDevices = NULL; +static int outputDeviceCount = 0; +static char **inputDevices = NULL; +static int inputDeviceCount = 0; + +static int +test_for_mmap(int fd) +{ + int caps = 0; + struct audio_buf_info info; + if ((ioctl(fd, SNDCTL_DSP_GETCAPS, &caps) == 0) && + (caps & DSP_CAP_TRIGGER) && (caps & DSP_CAP_MMAP) && + (ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) == 0)) { + size_t len = info.fragstotal * info.fragsize; + Uint8 *buf = (Uint8 *) mmap(NULL, len, PROT_WRITE, MAP_SHARED, fd, 0); + if (buf != MAP_FAILED) { + munmap(buf, len); + return 1; + } + } + return 0; +} + + +static inline void +free_device_list(char ***devs, int *count) +{ + SDL_FreeUnixAudioDevices(devs, count); +} + +static inline void +build_device_list(int iscapture, char ***devs, int *count) +{ + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + free_device_list(devs, count); + SDL_EnumUnixAudioDevices(flags, 0, test_for_mmap, devs, count); +} + +static inline void +build_device_lists(void) +{ + build_device_list(0, &outputDevices, &outputDeviceCount); + build_device_list(1, &inputDevices, &inputDeviceCount); +} + + +static inline void +free_device_lists(void) +{ + free_device_list(&outputDevices, &outputDeviceCount); + free_device_list(&inputDevices, &inputDeviceCount); +} + + +static void +DMA_Deinitialize(void) +{ + free_device_lists(); +} + +static int +DMA_DetectDevices(int iscapture) +{ + if (iscapture) { + build_device_list(1, &inputDevices, &inputDeviceCount); + return inputDeviceCount; + } else { + build_device_list(0, &outputDevices, &outputDeviceCount); + return outputDeviceCount; + } + + return 0; /* shouldn't ever hit this. */ +} + + +static const char * +DMA_GetDeviceName(int index, int iscapture) +{ + if ((iscapture) && (index < inputDeviceCount)) { + return inputDevices[index]; + } else if ((!iscapture) && (index < outputDeviceCount)) { + return outputDevices[index]; + } + + SDL_SetError("No such device"); + return NULL; +} + + +static int +DMA_ReopenAudio(_THIS, const char *audiodev, int format, int stereo) +{ + int frag_spec; + int value; + + /* Close and then reopen the audio device */ + close(audio_fd); + audio_fd = open(audiodev, O_RDWR, 0); + if (audio_fd < 0) { + SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); + return (-1); + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Determine the power of two of the fragment size */ + for (frag_spec = 0; (0x01 << frag_spec) < this->spec.size; ++frag_spec); + if ((0x01 << frag_spec) != this->spec.size) { + SDL_SetError("Fragment size must be a power of two"); + return (-1); + } + + /* Set the audio buffering parameters */ + if (ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0) { + SDL_SetError("Couldn't set audio fragment spec"); + return (-1); + } + + /* Set the audio format */ + value = format; + if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || (value != format)) { + SDL_SetError("Couldn't set audio format"); + return (-1); + } + + /* Set mono or stereo audio */ + value = (this->spec.channels > 1); + if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) < 0) || + (value != stereo)) { + SDL_SetError("Couldn't set audio channels"); + return (-1); + } + + /* Set the DSP frequency */ + value = this->spec.freq; + if (ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0) { + SDL_SetError("Couldn't set audio frequency"); + return (-1); + } + this->spec.freq = value; + + /* We successfully re-opened the audio */ + return (0); +} + + +static void +DMA_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (dma_buf != NULL) { + munmap(dma_buf, dma_len); + dma_buf = NULL; + } + if (audio_fd >= 0) { + close(audio_fd); + audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static int +DMA_OpenDevice(_THIS, const char *devname, int iscapture) +{ + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + int format; + int stereo; + int value; + SDL_AudioFormat test_format; + struct audio_buf_info info; + + /* We don't care what the devname is...we'll try to open anything. */ + /* ...but default to first name in the list... */ + if (devname == NULL) { + if (((iscapture) && (inputDeviceCount == 0)) || + ((!iscapture) && (outputDeviceCount == 0))) { + SDL_SetError("No such audio device"); + return 0; + } + devname = ((iscapture) ? inputDevices[0] : outputDevices[0]); + } + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + audio_fd = open(devname, flags, 0); + if (audio_fd < 0) { + DMA_CloseDevice(this); + SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); + return 0; + } + dma_buf = NULL; + ioctl(audio_fd, SNDCTL_DSP_RESET, 0); + + /* Get a list of supported hardware formats */ + if (ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0) { + DMA_CloseDevice(this); + SDL_SetError("Couldn't get audio format list"); + return 0; + } + + /* Try for a closest match on audio format */ + format = 0; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + switch (test_format) { + case AUDIO_U8: + if (value & AFMT_U8) { + format = AFMT_U8; + } + break; + case AUDIO_S8: + if (value & AFMT_S8) { + format = AFMT_S8; + } + break; + case AUDIO_S16LSB: + if (value & AFMT_S16_LE) { + format = AFMT_S16_LE; + } + break; + case AUDIO_S16MSB: + if (value & AFMT_S16_BE) { + format = AFMT_S16_BE; + } + break; + case AUDIO_U16LSB: + if (value & AFMT_U16_LE) { + format = AFMT_U16_LE; + } + break; + case AUDIO_U16MSB: + if (value & AFMT_U16_BE) { + format = AFMT_U16_BE; + } + break; + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + DMA_CloseDevice(this); + SDL_SetError("Couldn't find any hardware audio formats"); + return 0; + } + this->spec.format = test_format; + + /* Set the audio format */ + value = format; + if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || (value != format)) { + DMA_CloseDevice(this); + SDL_SetError("Couldn't set audio format"); + return 0; + } + + /* Set mono or stereo audio (currently only two channels supported) */ + stereo = (this->spec.channels > 1); + ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo); + if (stereo) { + this->spec.channels = 2; + } else { + this->spec.channels = 1; + } + + /* Because some drivers don't allow setting the buffer size + after setting the format, we must re-open the audio device + once we know what format and channels are supported + */ + if (DMA_ReopenAudio(this, devname, format, stereo) < 0) { + DMA_CloseDevice(this); + /* Error is set by DMA_ReopenAudio() */ + return 0; + } + + /* Memory map the audio buffer */ + if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) < 0) { + DMA_CloseDevice(this); + SDL_SetError("Couldn't get OSPACE parameters"); + return 0; + } + this->spec.size = info.fragsize; + this->spec.samples = this->spec.size / ((this->spec.format & 0xFF) / 8); + this->spec.samples /= this->spec.channels; + num_buffers = info.fragstotal; + dma_len = num_buffers * this->spec.size; + dma_buf = (Uint8 *) mmap(NULL, dma_len, PROT_WRITE, MAP_SHARED, + audio_fd, 0); + if (dma_buf == MAP_FAILED) { + DMA_CloseDevice(this); + SDL_SetError("DMA memory map failed"); + dma_buf = NULL; + return 0; + } + SDL_memset(dma_buf, this->spec.silence, dma_len); + + /* Check to see if we need to use select() workaround */ + { + char *workaround; + workaround = SDL_getenv("SDL_DSP_NOSELECT"); + if (workaround) { + frame_ticks = + (float) (this->spec.samples * 1000) / this->spec.freq; + next_frame = SDL_GetTicks() + frame_ticks; + } + } + + /* Trigger audio playback */ + value = 0; + ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value); + value = PCM_ENABLE_OUTPUT; + if (ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value) < 0) { + DMA_CloseDevice(this); + SDL_SetError("Couldn't trigger audio output"); + return 0; + } + + /* Get the parent process id (we're the parent of the audio thread) */ + parent = getpid(); + + /* We're ready to rock and roll. :-) */ + return 1; +} + + +/* This function waits until it is possible to write a full sound buffer */ +static void +DMA_WaitDevice(_THIS) +{ + fd_set fdset; + + /* Check to see if the thread-parent process is still alive */ + { + static int cnt = 0; + /* Note that this only works with thread implementations + that use a different process id for each thread. + */ + if (parent && (((++cnt) % 10) == 0)) { /* Check every 10 loops */ + if (kill(parent, 0) < 0 && errno == ESRCH) { + this->enabled = 0; + } + } + } + + /* See if we need to use timed audio synchronization */ + if (frame_ticks) { + /* Use timer for general audio synchronization */ + Sint32 ticks; + + ticks = ((Sint32) (next_frame - SDL_GetTicks())) - FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } + } else { + /* Use select() for audio synchronization */ + struct timeval timeout; + FD_ZERO(&fdset); + FD_SET(audio_fd, &fdset); + timeout.tv_sec = 10; + timeout.tv_usec = 0; +#ifdef DEBUG_AUDIO + fprintf(stderr, "Waiting for audio to get ready\n"); +#endif + if (select(audio_fd + 1, NULL, &fdset, NULL, &timeout) <= 0) { + const char *message = +#ifdef AUDIO_OSPACE_HACK + "Audio timeout - buggy audio driver? (trying ospace)"; +#else + "Audio timeout - buggy audio driver? (disabled)"; +#endif + /* In general we should never print to the screen, + but in this case we have no other way of letting + the user know what happened. + */ + fprintf(stderr, "SDL: %s\n", message); +#ifdef AUDIO_OSPACE_HACK + /* We may be able to use GET_OSPACE trick */ + frame_ticks = (float) (this->spec.samples * 1000) / + this->spec.freq; + next_frame = SDL_GetTicks() + frame_ticks; +#else + this->enabled = 0; + /* Don't try to close - may hang */ + audio_fd = -1; +#ifdef DEBUG_AUDIO + fprintf(stderr, "Done disabling audio\n"); +#endif +#endif /* AUDIO_OSPACE_HACK */ + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Ready!\n"); +#endif + } +} + +static void +DMA_PlayDevice(_THIS) +{ + /* If timer synchronization is enabled, set the next write frame */ + if (frame_ticks) { + next_frame += frame_ticks; + } + return; +} + +static Uint8 * +DMA_GetDeviceBuf(_THIS) +{ + count_info info; + int playing; + int filling; + + /* Get number of blocks, looping if we're not using select() */ + do { + if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) < 0) { + /* Uh oh... */ + this->enabled = 0; + return (NULL); + } + } while (frame_ticks && (info.blocks < 1)); +#ifdef DEBUG_AUDIO + if (info.blocks > 1) { + printf("Warning: audio underflow (%d frags)\n", info.blocks - 1); + } +#endif + playing = info.ptr / this->spec.size; + filling = (playing + 1) % num_buffers; + return (dma_buf + (filling * this->spec.size)); +} + + +static int +DMA_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = DMA_DetectDevices; + impl->GetDeviceName = DMA_GetDeviceName; + impl->OpenDevice = DMA_OpenDevice; + impl->WaitDevice = DMA_WaitDevice; + impl->PlayDevice = DMA_PlayDevice; + impl->GetDeviceBuf = DMA_GetDeviceBuf; + impl->CloseDevice = DMA_CloseDevice; + impl->Deinitialize = DMA_Deinitialize; + + build_device_lists(); + return (outputDeviceCount > 0) ? 2 : 1; +} + +AudioBootStrap DMA_bootstrap = { + DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio", DMA_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dma/SDL_dmaaudio.h b/Externals/SDL/src/audio/dma/SDL_dmaaudio.h new file mode 100644 index 0000000000..98cece7fc7 --- /dev/null +++ b/Externals/SDL/src/audio/dma/SDL_dmaaudio.h @@ -0,0 +1,63 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_dmaaudio_h +#define _SDL_dmaaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; + + /* The parent process id, to detect when application quits */ + pid_t parent; + + /* Raw mixing buffer */ + Uint8 *dma_buf; + int dma_len; + int num_buffers; + + /* Support for audio timing using a timer, in addition to select() */ + float frame_ticks; + float next_frame; +}; +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ + +/* Old variable names */ +/* !!! FIXME: remove these. */ +#define audio_fd (this->hidden->audio_fd) +#define parent (this->hidden->parent) +#define dma_buf (this->hidden->dma_buf) +#define dma_len (this->hidden->dma_len) +#define num_buffers (this->hidden->num_buffers) +#define frame_ticks (this->hidden->frame_ticks) +#define next_frame (this->hidden->next_frame) + +#endif /* _SDL_dmaaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dmedia/SDL_irixaudio.c b/Externals/SDL/src/audio/dmedia/SDL_irixaudio.c new file mode 100644 index 0000000000..fd86f68988 --- /dev/null +++ b/Externals/SDL/src/audio/dmedia/SDL_irixaudio.c @@ -0,0 +1,238 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */ +/* patch for IRIX 5 by Georg Schwarz 18/07/2004 */ + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_irixaudio.h" + + +#ifndef AL_RESOURCE /* as a test whether we use the old IRIX audio libraries */ +#define OLD_IRIX_AUDIO +#define alClosePort(x) ALcloseport(x) +#define alFreeConfig(x) ALfreeconfig(x) +#define alGetFillable(x) ALgetfillable(x) +#define alNewConfig() ALnewconfig() +#define alOpenPort(x,y,z) ALopenport(x,y,z) +#define alSetChannels(x,y) ALsetchannels(x,y) +#define alSetQueueSize(x,y) ALsetqueuesize(x,y) +#define alSetSampFmt(x,y) ALsetsampfmt(x,y) +#define alSetWidth(x,y) ALsetwidth(x,y) +#endif + +void static +IRIXAUDIO_WaitDevice(_THIS) +{ + Sint32 timeleft; + + timeleft = this->spec.samples - alGetFillable(this->hidden->audio_port); + if (timeleft > 0) { + timeleft /= (this->spec.freq / 1000); + SDL_Delay((Uint32) timeleft); + } +} + +static void +IRIXAUDIO_PlayDevice(_THIS) +{ + /* Write the audio data out */ + ALport port = this->hidden->audio_port; + Uint8 *mixbuf = this->hidden->mixbuf; + if (alWriteFrames(port, mixbuf, this->spec.samples) < 0) { + /* Assume fatal error, for now */ + this->enabled = 0; + } +} + +static Uint8 * +IRIXAUDIO_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static void +IRIXAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_port != NULL) { + alClosePort(this->hidden->audio_port); + this->hidden->audio_port = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +IRIXAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + long width = 0; + long fmt = 0; + int valid = 0; + + /* !!! FIXME: Handle multiple devices and capture? */ + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + +#ifdef OLD_IRIX_AUDIO + { + long audio_param[2]; + audio_param[0] = AL_OUTPUT_RATE; + audio_param[1] = this->spec.freq; + valid = (ALsetparams(AL_DEFAULT_DEVICE, audio_param, 2) < 0); + } +#else + { + ALpv audio_param; + audio_param.param = AL_RATE; + audio_param.value.i = this->spec.freq; + valid = (alSetParams(AL_DEFAULT_OUTPUT, &audio_param, 1) < 0); + } +#endif + + while ((!valid) && (test_format)) { + valid = 1; + this->spec.format = test_format; + + switch (test_format) { + case AUDIO_S8: + width = AL_SAMPLE_8; + fmt = AL_SAMPFMT_TWOSCOMP; + break; + + case AUDIO_S16SYS: + width = AL_SAMPLE_16; + fmt = AL_SAMPFMT_TWOSCOMP; + break; + + case AUDIO_F32SYS: + width = 0; /* not used here... */ + fmt = AL_SAMPFMT_FLOAT; + break; + + /* Docs say there is int24, but not int32.... */ + + default: + valid = 0; + test_format = SDL_NextAudioFormat(); + break; + } + + if (valid) { + ALconfig audio_config = alNewConfig(); + valid = 0; + if (audio_config) { + if (alSetChannels(audio_config, this->spec.channels) < 0) { + if (this->spec.channels > 2) { /* can't handle > stereo? */ + this->spec.channels = 2; /* try again below. */ + } + } + + if ((alSetSampFmt(audio_config, fmt) >= 0) && + ((!width) || (alSetWidth(audio_config, width) >= 0)) && + (alSetQueueSize(audio_config, this->spec.samples * 2) >= + 0) + && (alSetChannels(audio_config, this->spec.channels) >= + 0)) { + + this->hidden->audio_port = alOpenPort("SDL audio", "w", + audio_config); + if (this->hidden->audio_port == NULL) { + /* docs say AL_BAD_CHANNELS happens here, too. */ + int err = oserror(); + if (err == AL_BAD_CHANNELS) { + this->spec.channels = 2; + alSetChannels(audio_config, this->spec.channels); + this->hidden->audio_port = + alOpenPort("SDL audio", "w", audio_config); + } + } + + if (this->hidden->audio_port != NULL) { + valid = 1; + } + } + + alFreeConfig(audio_config); + } + } + } + + if (!valid) { + IRIXAUDIO_CloseDevice(this); + SDL_SetError("Unsupported audio format"); + return 0; + } + + /* Update the fragment size as size in bytes */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->spec.size); + if (this->hidden->mixbuf == NULL) { + IRIXAUDIO_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 1; +} + +static int +IRIXAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = DSP_OpenDevice; + impl->PlayDevice = DSP_PlayDevice; + impl->WaitDevice = DSP_WaitDevice; + impl->GetDeviceBuf = DSP_GetDeviceBuf; + impl->CloseDevice = DSP_CloseDevice; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: not true, I think. */ + + return 1; +} + +AudioBootStrap IRIXAUDIO_bootstrap = { + "AL", "IRIX DMedia audio", IRIXAUDIO_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dmedia/SDL_irixaudio.h b/Externals/SDL/src/audio/dmedia/SDL_irixaudio.h new file mode 100644 index 0000000000..9fbd2c3deb --- /dev/null +++ b/Externals/SDL/src/audio/dmedia/SDL_irixaudio.h @@ -0,0 +1,42 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_irixaudio_h +#define _SDL_irixaudio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + ALport audio_port; /* The handle for the audio device */ + Uint8 *mixbuf; /* The app mixing buffer */ +}; + +#endif /* _SDL_irixaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dsp/SDL_dspaudio.c b/Externals/SDL/src/audio/dsp/SDL_dspaudio.c new file mode 100644 index 0000000000..3c961b4533 --- /dev/null +++ b/Externals/SDL/src/audio/dsp/SDL_dspaudio.c @@ -0,0 +1,392 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + Modified in Oct 2004 by Hannu Savolainen + hannu@opensound.com +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#include /* For perror() */ +#include /* For strerror() */ +#include +#include +#include +#include +#include +#include +#include + +#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +/* This is installed on some systems */ +#include +#else +/* This is recommended by OSS */ +#include +#endif + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" +#include "SDL_dspaudio.h" + +/* The tag name used by DSP audio */ +#define DSP_DRIVER_NAME "dsp" + +/* Open the audio device for playback, and don't block if busy */ +#define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) +#define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) + +static char **outputDevices = NULL; +static int outputDeviceCount = 0; +static char **inputDevices = NULL; +static int inputDeviceCount = 0; + +static inline void +free_device_list(char ***devs, int *count) +{ + SDL_FreeUnixAudioDevices(devs, count); +} + +static inline void +build_device_list(int iscapture, char ***devs, int *count) +{ + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + free_device_list(devs, count); + SDL_EnumUnixAudioDevices(flags, 0, NULL, devs, count); +} + +static inline void +build_device_lists(void) +{ + build_device_list(0, &outputDevices, &outputDeviceCount); + build_device_list(1, &inputDevices, &inputDeviceCount); +} + + +static inline void +free_device_lists(void) +{ + free_device_list(&outputDevices, &outputDeviceCount); + free_device_list(&inputDevices, &inputDeviceCount); +} + + +static void +DSP_Deinitialize(void) +{ + free_device_lists(); +} + + +static int +DSP_DetectDevices(int iscapture) +{ + if (iscapture) { + build_device_list(1, &inputDevices, &inputDeviceCount); + return inputDeviceCount; + } else { + build_device_list(0, &outputDevices, &outputDeviceCount); + return outputDeviceCount; + } + + return 0; /* shouldn't ever hit this. */ +} + +static const char * +DSP_GetDeviceName(int index, int iscapture) +{ + if ((iscapture) && (index < inputDeviceCount)) { + return inputDevices[index]; + } else if ((!iscapture) && (index < outputDeviceCount)) { + return outputDevices[index]; + } + + SDL_SetError("No such device"); + return NULL; +} + + +static void +DSP_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + close(this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static int +DSP_OpenDevice(_THIS, const char *devname, int iscapture) +{ + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + int format; + int value; + int frag_spec; + SDL_AudioFormat test_format; + + /* We don't care what the devname is...we'll try to open anything. */ + /* ...but default to first name in the list... */ + if (devname == NULL) { + if (((iscapture) && (inputDeviceCount == 0)) || + ((!iscapture) && (outputDeviceCount == 0))) { + SDL_SetError("No such audio device"); + return 0; + } + devname = ((iscapture) ? inputDevices[0] : outputDevices[0]); + } + + /* Make sure fragment size stays a power of 2, or OSS fails. */ + /* I don't know which of these are actually legal values, though... */ + if (this->spec.channels > 8) + this->spec.channels = 8; + else if (this->spec.channels > 4) + this->spec.channels = 4; + else if (this->spec.channels > 2) + this->spec.channels = 2; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + this->hidden->audio_fd = open(devname, flags, 0); + if (this->hidden->audio_fd < 0) { + DSP_CloseDevice(this); + SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); + return 0; + } + this->hidden->mixbuf = NULL; + + /* Make the file descriptor use blocking writes with fcntl() */ + { + long ctlflags; + ctlflags = fcntl(this->hidden->audio_fd, F_GETFL); + ctlflags &= ~O_NONBLOCK; + if (fcntl(this->hidden->audio_fd, F_SETFL, ctlflags) < 0) { + DSP_CloseDevice(this); + SDL_SetError("Couldn't set audio blocking mode"); + return 0; + } + } + + /* Get a list of supported hardware formats */ + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0) { + perror("SNDCTL_DSP_GETFMTS"); + DSP_CloseDevice(this); + SDL_SetError("Couldn't get audio format list"); + return 0; + } + + /* Try for a closest match on audio format */ + format = 0; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + switch (test_format) { + case AUDIO_U8: + if (value & AFMT_U8) { + format = AFMT_U8; + } + break; + case AUDIO_S16LSB: + if (value & AFMT_S16_LE) { + format = AFMT_S16_LE; + } + break; + case AUDIO_S16MSB: + if (value & AFMT_S16_BE) { + format = AFMT_S16_BE; + } + break; +#if 0 +/* + * These formats are not used by any real life systems so they are not + * needed here. + */ + case AUDIO_S8: + if (value & AFMT_S8) { + format = AFMT_S8; + } + break; + case AUDIO_U16LSB: + if (value & AFMT_U16_LE) { + format = AFMT_U16_LE; + } + break; + case AUDIO_U16MSB: + if (value & AFMT_U16_BE) { + format = AFMT_U16_BE; + } + break; +#endif + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + DSP_CloseDevice(this); + SDL_SetError("Couldn't find any hardware audio formats"); + return 0; + } + this->spec.format = test_format; + + /* Set the audio format */ + value = format; + if ((ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || + (value != format)) { + perror("SNDCTL_DSP_SETFMT"); + DSP_CloseDevice(this); + SDL_SetError("Couldn't set audio format"); + return 0; + } + + /* Set the number of channels of output */ + value = this->spec.channels; + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0) { + perror("SNDCTL_DSP_CHANNELS"); + DSP_CloseDevice(this); + SDL_SetError("Cannot set the number of channels"); + return 0; + } + this->spec.channels = value; + + /* Set the DSP frequency */ + value = this->spec.freq; + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SPEED, &value) < 0) { + perror("SNDCTL_DSP_SPEED"); + DSP_CloseDevice(this); + SDL_SetError("Couldn't set audio frequency"); + return 0; + } + this->spec.freq = value; + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Determine the power of two of the fragment size */ + for (frag_spec = 0; (0x01U << frag_spec) < this->spec.size; ++frag_spec); + if ((0x01U << frag_spec) != this->spec.size) { + DSP_CloseDevice(this); + SDL_SetError("Fragment size must be a power of two"); + return 0; + } + frag_spec |= 0x00020000; /* two fragments, for low latency */ + + /* Set the audio buffering parameters */ +#ifdef DEBUG_AUDIO + fprintf(stderr, "Requesting %d fragments of size %d\n", + (frag_spec >> 16), 1 << (frag_spec & 0xFFFF)); +#endif + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0) { + perror("SNDCTL_DSP_SETFRAGMENT"); + } +#ifdef DEBUG_AUDIO + { + audio_buf_info info; + ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETOSPACE, &info); + fprintf(stderr, "fragments = %d\n", info.fragments); + fprintf(stderr, "fragstotal = %d\n", info.fragstotal); + fprintf(stderr, "fragsize = %d\n", info.fragsize); + fprintf(stderr, "bytes = %d\n", info.bytes); + } +#endif + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + DSP_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 1; +} + + +static void +DSP_PlayDevice(_THIS) +{ + const Uint8 *mixbuf = this->hidden->mixbuf; + const int mixlen = this->hidden->mixlen; + if (write(this->hidden->audio_fd, mixbuf, mixlen) == -1) { + perror("Audio write"); + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen); +#endif +} + +static Uint8 * +DSP_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static int +DSP_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = DSP_DetectDevices; + impl->GetDeviceName = DSP_GetDeviceName; + impl->OpenDevice = DSP_OpenDevice; + impl->PlayDevice = DSP_PlayDevice; + impl->GetDeviceBuf = DSP_GetDeviceBuf; + impl->CloseDevice = DSP_CloseDevice; + impl->Deinitialize = DSP_Deinitialize; + + build_device_lists(); + return (outputDeviceCount > 0) ? 2 : 1; +} + + +AudioBootStrap DSP_bootstrap = { + DSP_DRIVER_NAME, "OSS /dev/dsp standard audio", DSP_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dsp/SDL_dspaudio.h b/Externals/SDL/src/audio/dsp/SDL_dspaudio.h new file mode 100644 index 0000000000..7a74aa3db2 --- /dev/null +++ b/Externals/SDL/src/audio/dsp/SDL_dspaudio.h @@ -0,0 +1,44 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_dspaudio_h +#define _SDL_dspaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; +}; +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ + +#endif /* _SDL_dspaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dummy/SDL_dummyaudio.c b/Externals/SDL/src/audio/dummy/SDL_dummyaudio.c new file mode 100644 index 0000000000..6cd10c6a36 --- /dev/null +++ b/Externals/SDL/src/audio/dummy/SDL_dummyaudio.c @@ -0,0 +1,51 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + This file written by Ryan C. Gordon (icculus@icculus.org) +*/ +#include "SDL_config.h" + +/* Output audio to nowhere... */ + +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "SDL_dummyaudio.h" + +static int +DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture) +{ + return 1; /* always succeeds. */ +} + +static int +DUMMYAUD_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = DUMMYAUD_OpenDevice; + impl->OnlyHasDefaultOutputDevice = 1; + return 1; +} + +AudioBootStrap DUMMYAUD_bootstrap = { + "dummy", "SDL dummy audio driver", DUMMYAUD_Init, 1 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/dummy/SDL_dummyaudio.h b/Externals/SDL/src/audio/dummy/SDL_dummyaudio.h new file mode 100644 index 0000000000..3506b4dfbe --- /dev/null +++ b/Externals/SDL/src/audio/dummy/SDL_dummyaudio.h @@ -0,0 +1,42 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_dummyaudio_h +#define _SDL_dummyaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + Uint8 *mixbuf; + Uint32 mixlen; + Uint32 write_delay; + Uint32 initial_calls; +}; + +#endif /* _SDL_dummyaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/esd/SDL_esdaudio.c b/Externals/SDL/src/audio/esd/SDL_esdaudio.c new file mode 100644 index 0000000000..c44a504db2 --- /dev/null +++ b/Externals/SDL/src/audio/esd/SDL_esdaudio.c @@ -0,0 +1,354 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to an ESD network stream mixing buffer */ + +#include +#include +#include +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_esdaudio.h" + +#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#include "SDL_name.h" +#include "SDL_loadso.h" +#else +#define SDL_NAME(X) X +#endif + +/* The tag name used by ESD audio */ +#define ESD_DRIVER_NAME "esd" + +#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC + +static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; +static void *esd_handle = NULL; + +static int (*SDL_NAME(esd_open_sound)) (const char *host); +static int (*SDL_NAME(esd_close)) (int esd); +static int (*SDL_NAME(esd_play_stream)) (esd_format_t format, int rate, + const char *host, const char *name); + +#define SDL_ESD_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } +static struct +{ + const char *name; + void **func; +} const esd_functions[] = { + SDL_ESD_SYM(esd_open_sound), + SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream), +}; + +#undef SDL_ESD_SYM + +static void +UnloadESDLibrary() +{ + if (esd_handle != NULL) { + SDL_UnloadObject(esd_handle); + esd_handle = NULL; + } +} + +static int +LoadESDLibrary(void) +{ + int i, retval = -1; + + if (esd_handle == NULL) { + esd_handle = SDL_LoadObject(esd_library); + if (esd_handle) { + retval = 0; + for (i = 0; i < SDL_arraysize(esd_functions); ++i) { + *esd_functions[i].func = + SDL_LoadFunction(esd_handle, esd_functions[i].name); + if (!*esd_functions[i].func) { + retval = -1; + UnloadESDLibrary(); + break; + } + } + } + } + return retval; +} + +#else + +static void +UnloadESDLibrary() +{ + return; +} + +static int +LoadESDLibrary(void) +{ + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ + + +/* This function waits until it is possible to write a full sound buffer */ +static void +ESD_WaitDevice(_THIS) +{ + Sint32 ticks; + + /* Check to see if the thread-parent process is still alive */ + { + static int cnt = 0; + /* Note that this only works with thread implementations + that use a different process id for each thread. + */ + /* Check every 10 loops */ + if (this->hidden->parent && (((++cnt) % 10) == 0)) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { + this->enabled = 0; + } + } + } + + /* Use timer for general audio synchronization */ + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } +} + +static void +ESD_PlayDevice(_THIS) +{ + int written = 0; + + /* Write the audio data, checking for EAGAIN on broken audio drivers */ + do { + written = write(this->hidden->audio_fd, + this->hidden->mixbuf, this->hidden->mixlen); + if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { + SDL_Delay(1); /* Let a little CPU time go by */ + } + } while ((written < 0) && + ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); + + /* Set the next write frame */ + this->hidden->next_frame += this->hidden->frame_ticks; + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } +} + +static Uint8 * +ESD_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static void +ESD_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + SDL_NAME(esd_close) (this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +/* Try to get the name of the program */ +static char * +get_progname(void) +{ + char *progname = NULL; +#ifdef __LINUX__ + FILE *fp; + static char temp[BUFSIZ]; + + SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); + fp = fopen(temp, "r"); + if (fp != NULL) { + if (fgets(temp, sizeof(temp) - 1, fp)) { + progname = SDL_strrchr(temp, '/'); + if (progname == NULL) { + progname = temp; + } else { + progname = progname + 1; + } + } + fclose(fp); + } +#endif + return (progname); +} + + +static int +ESD_OpenDevice(_THIS, const char *devname, int iscapture) +{ + esd_format_t format = (ESD_STREAM | ESD_PLAY); + SDL_AudioFormat test_format = 0; + int found = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + this->hidden->audio_fd = -1; + + /* Convert audio spec to the ESD audio format */ + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !found && test_format; test_format = SDL_NextAudioFormat()) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + found = 1; + switch (test_format) { + case AUDIO_U8: + format |= ESD_BITS8; + break; + case AUDIO_S16SYS: + format |= ESD_BITS16; + break; + default: + found = 0; + break; + } + } + + if (!found) { + ESD_CloseDevice(this); + SDL_SetError("Couldn't find any hardware audio formats"); + return 0; + } + + if (this->spec.channels == 1) { + format |= ESD_MONO; + } else { + format |= ESD_STEREO; + } +#if 0 + this->spec.samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */ +#endif + + /* Open a connection to the ESD audio server */ + this->hidden->audio_fd = + SDL_NAME(esd_play_stream) (format, this->spec.freq, NULL, + get_progname()); + + if (this->hidden->audio_fd < 0) { + ESD_CloseDevice(this); + SDL_SetError("Couldn't open ESD connection"); + return 0; + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + this->hidden->frame_ticks = + (float) (this->spec.samples * 1000) / this->spec.freq; + this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + ESD_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* Get the parent process id (we're the parent of the audio thread) */ + this->hidden->parent = getpid(); + + /* We're ready to rock and roll. :-) */ + return 1; +} + +static void +ESD_Deinitialize(void) +{ + UnloadESDLibrary(); +} + +static int +ESD_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadESDLibrary() < 0) { + return 0; + } else { + int connection = 0; + + /* Don't start ESD if it's not running */ + if (SDL_getenv("ESD_NO_SPAWN") == NULL) { + SDL_putenv("ESD_NO_SPAWN=1"); + } + + connection = SDL_NAME(esd_open_sound) (NULL); + if (connection < 0) { + UnloadESDLibrary(); + SDL_SetError("ESD: esd_open_sound failed (no audio server?)"); + return 0; + } + SDL_NAME(esd_close) (connection); + } + + /* Set the function pointers */ + impl->OpenDevice = ESD_OpenDevice; + impl->PlayDevice = ESD_PlayDevice; + impl->WaitDevice = ESD_WaitDevice; + impl->GetDeviceBuf = ESD_GetDeviceBuf; + impl->CloseDevice = ESD_CloseDevice; + impl->Deinitialize = ESD_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 2; /* return 2 (definitely have a "device"). */ +} + + +AudioBootStrap ESD_bootstrap = { + ESD_DRIVER_NAME, "Enlightened Sound Daemon", ESD_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/esd/SDL_esdaudio.h b/Externals/SDL/src/audio/esd/SDL_esdaudio.h new file mode 100644 index 0000000000..e9faef05a5 --- /dev/null +++ b/Externals/SDL/src/audio/esd/SDL_esdaudio.h @@ -0,0 +1,51 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_esdaudio_h +#define _SDL_esdaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; + + /* The parent process id, to detect when application quits */ + pid_t parent; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; + + /* Support for audio timing using a timer */ + float frame_ticks; + float next_frame; +}; +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ + +#endif /* _SDL_esdaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/fusionsound/SDL_fsaudio.c b/Externals/SDL/src/audio/fusionsound/SDL_fsaudio.c new file mode 100644 index 0000000000..288defdce1 --- /dev/null +++ b/Externals/SDL/src/audio/fusionsound/SDL_fsaudio.c @@ -0,0 +1,351 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#ifdef HAVE_SIGNAL_H +#include +#endif +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_fsaudio.h" + +#include + +//#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" + +#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC +#include "SDL_name.h" +#include "SDL_loadso.h" +#else +#define SDL_NAME(X) X +#endif + +#if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1) +typedef DFBResult DirectResult; +#endif + +/* The tag name used by fusionsoundc audio */ +#define SDL_FS_DRIVER_NAME "fusionsound" +/* Buffers to use - more than 2 gives a lot of latency */ +#define FUSION_BUFFERS (2) + +#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC + +static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC; +static void *fs_handle = NULL; + +static DirectResult (*SDL_NAME(FusionSoundInit)) (int *argc, char *(*argv[])); +static DirectResult (*SDL_NAME(FusionSoundCreate)) (IFusionSound ** + ret_interface); + +#define SDL_FS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } +static struct +{ + const char *name; + void **func; +} fs_functions[] = { +/* *INDENT-OFF* */ + SDL_FS_SYM(FusionSoundInit), + SDL_FS_SYM(FusionSoundCreate), +/* *INDENT-ON* */ +}; + +#undef SDL_FS_SYM + +static void +UnloadFusionSoundLibrary() +{ + if (fs_handle != NULL) { + SDL_UnloadObject(fs_handle); + fs_handle = NULL; + } +} + +static int +LoadFusionSoundLibrary(void) +{ + int i, retval = -1; + + if (fs_handle == NULL) { + fs_handle = SDL_LoadObject(fs_library); + if (fs_handle != NULL) { + retval = 0; + for (i = 0; i < SDL_arraysize(fs_functions); ++i) { + *fs_functions[i].func = + SDL_LoadFunction(fs_handle, fs_functions[i].name); + if (!*fs_functions[i].func) { + retval = -1; + UnloadFusionSoundLibrary(); + break; + } + } + } + } + + return retval; +} + +#else + +static void +UnloadFusionSoundLibrary() +{ + return; +} + +static int +LoadFusionSoundLibrary(void) +{ + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ + +/* This function waits until it is possible to write a full sound buffer */ +static void +SDL_FS_WaitDevice(_THIS) +{ + this->hidden->stream->Wait(this->hidden->stream, + this->hidden->mixsamples); +} + +static void +SDL_FS_PlayDevice(_THIS) +{ + DirectResult ret; + + ret = this->hidden->stream->Write(this->hidden->stream, + this->hidden->mixbuf, + this->hidden->mixsamples); + /* If we couldn't write, assume fatal error for now */ + if (ret) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); +#endif +} + +static void +SDL_FS_WaitDone(_THIS) +{ + this->hidden->stream->Wait(this->hidden->stream, + this->hidden->mixsamples * FUSION_BUFFERS); +} + + +static Uint8 * +SDL_FS_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + + +static void +SDL_FS_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->stream) { + this->hidden->stream->Release(this->hidden->stream); + this->hidden->stream = NULL; + } + if (this->hidden->fs) { + this->hidden->fs->Release(this->hidden->fs); + this->hidden->fs = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static int +SDL_FS_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int bytes; + SDL_AudioFormat test_format = 0, format = 0; + FSSampleFormat fs_format; + FSStreamDescription desc; + DirectResult ret; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + switch (test_format) { + case AUDIO_U8: + fs_format = FSSF_U8; + bytes = 1; + format = 1; + break; + case AUDIO_S16SYS: + fs_format = FSSF_S16; + bytes = 2; + format = 1; + break; + case AUDIO_S32SYS: + fs_format = FSSF_S32; + bytes = 4; + format = 1; + break; + case AUDIO_F32SYS: + fs_format = FSSF_FLOAT; + bytes = 4; + format = 1; + break; + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + + if (format == 0) { + SDL_FS_CloseDevice(this); + SDL_SetError("Couldn't find any hardware audio formats"); + return 0; + } + this->spec.format = test_format; + + /* Retrieve the main sound interface. */ + ret = SDL_NAME(FusionSoundCreate) (&this->hidden->fs); + if (ret) { + SDL_FS_CloseDevice(this); + SDL_SetError("Unable to initialize FusionSound: %d", ret); + return 0; + } + + this->hidden->mixsamples = this->spec.size / bytes / this->spec.channels; + + /* Fill stream description. */ + desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | + FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_PREBUFFER; + desc.samplerate = this->spec.freq; + desc.buffersize = this->spec.size * FUSION_BUFFERS; + desc.channels = this->spec.channels; + desc.prebuffer = 10; + desc.sampleformat = fs_format; + + ret = + this->hidden->fs->CreateStream(this->hidden->fs, &desc, + &this->hidden->stream); + if (ret) { + SDL_FS_CloseDevice(this); + SDL_SetError("Unable to create FusionSoundStream: %d", ret); + return 0; + } + + /* See what we got */ + desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | + FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT; + ret = this->hidden->stream->GetDescription(this->hidden->stream, &desc); + + this->spec.freq = desc.samplerate; + this->spec.size = + desc.buffersize / FUSION_BUFFERS * bytes * desc.channels; + this->spec.channels = desc.channels; + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + SDL_FS_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 1; +} + + +static void +SDL_FS_Deinitialize(void) +{ + UnloadFusionSoundLibrary(); +} + + +static int +SDL_FS_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadFusionSoundLibrary() < 0) { + return 0; + } else { + DirectResult ret; + + ret = SDL_NAME(FusionSoundInit) (NULL, NULL); + if (ret) { + UnloadFusionSoundLibrary(); + SDL_SetError + ("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)", + ret); + return 0; + } + } + + /* Set the function pointers */ + impl->OpenDevice = SDL_FS_OpenDevice; + impl->PlayDevice = SDL_FS_PlayDevice; + impl->WaitDevice = SDL_FS_WaitDevice; + impl->GetDeviceBuf = SDL_FS_GetDeviceBuf; + impl->CloseDevice = SDL_FS_CloseDevice; + impl->WaitDone = SDL_FS_WaitDone; + impl->Deinitialize = SDL_FS_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; +} + + +AudioBootStrap FUSIONSOUND_bootstrap = { + SDL_FS_DRIVER_NAME, "FusionSound", SDL_FS_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/fusionsound/SDL_fsaudio.h b/Externals/SDL/src/audio/fusionsound/SDL_fsaudio.h new file mode 100644 index 0000000000..4130605b45 --- /dev/null +++ b/Externals/SDL/src/audio/fusionsound/SDL_fsaudio.h @@ -0,0 +1,50 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_fsaudio_h +#define _SDL_fsaudio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* Interface */ + IFusionSound *fs; + + /* The stream interface for the audio device */ + IFusionSoundStream *stream; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; + int mixsamples; + +}; + +#endif /* _SDL_fsaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/iphoneos/SDL_coreaudio_iphone.c b/Externals/SDL/src/audio/iphoneos/SDL_coreaudio_iphone.c new file mode 100644 index 0000000000..2e0982b90d --- /dev/null +++ b/Externals/SDL/src/audio/iphoneos/SDL_coreaudio_iphone.c @@ -0,0 +1,340 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#include + +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "SDL_coreaudio_iphone.h" + +#define DEBUG_COREAUDIO 0 + +static void +COREAUDIO_Deinitialize(void) +{ +} + +/* The CoreAudio callback */ +static OSStatus +outputCallback(void *inRefCon, + AudioUnitRenderActionFlags * ioActionFlags, + const AudioTimeStamp * inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList * ioDataList) +{ + SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon; + AudioBuffer *ioData = &ioDataList->mBuffers[0]; + UInt32 remaining, len; + void *ptr; + + /* Is there ever more than one buffer, and what do you do with it? */ + if (ioDataList->mNumberBuffers != 1) { + return noErr; + } + + /* Only do anything if audio is enabled and not paused */ + if (!this->enabled || this->paused) { + SDL_memset(ioData->mData, this->spec.silence, ioData->mDataByteSize); + return 0; + } + + /* No SDL conversion should be needed here, ever, since we accept + any input format in OpenAudio, and leave the conversion to CoreAudio. + */ + /* + assert(!this->convert.needed); + assert(this->spec.channels == ioData->mNumberChannels); + */ + + remaining = ioData->mDataByteSize; + ptr = ioData->mData; + while (remaining > 0) { + if (this->hidden->bufferOffset >= this->hidden->bufferSize) { + /* Generate the data */ + SDL_memset(this->hidden->buffer, this->spec.silence, + this->hidden->bufferSize); + SDL_mutexP(this->mixer_lock); + (*this->spec.callback) (this->spec.userdata, this->hidden->buffer, + this->hidden->bufferSize); + SDL_mutexV(this->mixer_lock); + this->hidden->bufferOffset = 0; + } + + len = this->hidden->bufferSize - this->hidden->bufferOffset; + if (len > remaining) + len = remaining; + SDL_memcpy(ptr, + (char *) this->hidden->buffer + this->hidden->bufferOffset, + len); + ptr = (char *) ptr + len; + remaining -= len; + this->hidden->bufferOffset += len; + } + + return 0; +} + +static OSStatus +inputCallback(void *inRefCon, + AudioUnitRenderActionFlags * ioActionFlags, + const AudioTimeStamp * inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList * ioData) +{ + //err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); + // !!! FIXME: write me! + return noErr; +} + + +static void +COREAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->audioUnitOpened) { + OSStatus result = noErr; + AURenderCallbackStruct callback; + const AudioUnitElement output_bus = 0; + const AudioUnitElement input_bus = 1; + const int iscapture = this->iscapture; + const AudioUnitElement bus = + ((iscapture) ? input_bus : output_bus); + const AudioUnitScope scope = + ((iscapture) ? kAudioUnitScope_Output : + kAudioUnitScope_Input); + + /* stop processing the audio unit */ + result = AudioOutputUnitStop(this->hidden->audioUnit); + + /* Remove the input callback */ + SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct)); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_SetRenderCallback, + scope, bus, &callback, + sizeof(callback)); + + //CloseComponent(this->hidden->audioUnit); + this->hidden->audioUnitOpened = 0; + } + SDL_free(this->hidden->buffer); + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +#define CHECK_RESULT(msg) \ + if (result != noErr) { \ + COREAUDIO_CloseDevice(this); \ + SDL_SetError("CoreAudio error (%s): %d", msg, result); \ + return 0; \ + } + +static int +prepare_audiounit(_THIS, const char *devname, int iscapture, + const AudioStreamBasicDescription * strdesc) +{ + OSStatus result = noErr; + AURenderCallbackStruct callback; + AudioComponentDescription desc; + AudioComponent comp = NULL; + + UInt32 enableIO = 0; + const AudioUnitElement output_bus = 0; + const AudioUnitElement input_bus = 1; + const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); + const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : + kAudioUnitScope_Input); + + SDL_memset(&desc, '\0', sizeof(AudioComponentDescription)); + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_RemoteIO; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + + comp = AudioComponentFindNext(NULL, &desc); + if (comp == NULL) { + SDL_SetError("Couldn't find requested CoreAudio component"); + return 0; + } + + /* Open & initialize the audio unit */ + /* + AudioComponentInstanceNew only available on iPhone OS 2.0 and Mac OS X 10.6 + We can't use OpenAComponent on iPhone because it is not present + */ + result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit); + CHECK_RESULT("AudioComponentInstanceNew"); + + this->hidden->audioUnitOpened = 1; + + // !!! FIXME: this is wrong? + enableIO = ((iscapture) ? 1 : 0); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Input, input_bus, + &enableIO, sizeof(enableIO)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_EnableIO input)"); + + // !!! FIXME: this is wrong? + enableIO = ((iscapture) ? 0 : 1); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Output, output_bus, + &enableIO, sizeof(enableIO)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_EnableIO output)"); + + /*result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, 0, + &this->hidden->deviceID, + sizeof(AudioDeviceID)); + + CHECK_RESULT("AudioUnitSetProperty (kAudioOutputUnitProperty_CurrentDevice)"); */ + + /* Set the data format of the audio unit. */ + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_StreamFormat, + scope, bus, strdesc, sizeof(*strdesc)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)"); + + /* Set the audio callback */ + SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct)); + callback.inputProc = ((iscapture) ? inputCallback : outputCallback); + callback.inputProcRefCon = this; + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_SetRenderCallback, + scope, bus, &callback, sizeof(callback)); + CHECK_RESULT + ("AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)"); + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate a sample buffer */ + this->hidden->bufferOffset = this->hidden->bufferSize = this->spec.size; + this->hidden->buffer = SDL_malloc(this->hidden->bufferSize); + + result = AudioUnitInitialize(this->hidden->audioUnit); + CHECK_RESULT("AudioUnitInitialize"); + + /* Finally, start processing of the audio unit */ + result = AudioOutputUnitStart(this->hidden->audioUnit); + CHECK_RESULT("AudioOutputUnitStart"); + /* We're running! */ + return 1; +} + +static int +COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + AudioStreamBasicDescription strdesc; + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + int valid_datatype = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return (0); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Setup a AudioStreamBasicDescription with the requested format */ + SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); + strdesc.mFormatID = kAudioFormatLinearPCM; + strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; + strdesc.mChannelsPerFrame = this->spec.channels; + strdesc.mSampleRate = this->spec.freq; + strdesc.mFramesPerPacket = 1; + + while ((!valid_datatype) && (test_format)) { + this->spec.format = test_format; + /* Just a list of valid SDL formats, so people don't pass junk here. */ + switch (test_format) { + case AUDIO_U8: + case AUDIO_S8: + case AUDIO_U16LSB: + case AUDIO_S16LSB: + case AUDIO_U16MSB: + case AUDIO_S16MSB: + case AUDIO_S32LSB: + case AUDIO_S32MSB: + case AUDIO_F32LSB: + case AUDIO_F32MSB: + valid_datatype = 1; + strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(this->spec.format); + if (SDL_AUDIO_ISBIGENDIAN(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; + + if (SDL_AUDIO_ISFLOAT(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat; + else if (SDL_AUDIO_ISSIGNED(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + break; + } + } + + if (!valid_datatype) { /* shouldn't happen, but just in case... */ + COREAUDIO_CloseDevice(this); + SDL_SetError("Unsupported audio format"); + return 0; + } + + strdesc.mBytesPerFrame = + strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8; + strdesc.mBytesPerPacket = + strdesc.mBytesPerFrame * strdesc.mFramesPerPacket; + + if (!prepare_audiounit(this, devname, iscapture, &strdesc)) { + COREAUDIO_CloseDevice(this); + return 0; /* prepare_audiounit() will call SDL_SetError()... */ + } + + return 1; /* good to go. */ +} + +static int +COREAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = COREAUDIO_OpenDevice; + impl->CloseDevice = COREAUDIO_CloseDevice; + impl->Deinitialize = COREAUDIO_Deinitialize; + impl->ProvidesOwnCallbackThread = 1; + + /* added for iPhone */ + impl->OnlyHasDefaultInputDevice = 1; + impl->OnlyHasDefaultOutputDevice = 1; + impl->HasCaptureSupport = 0; /* still needs to be written */ + + return 2; /* defitely have an audio device. */ +} + +AudioBootStrap COREAUDIOIPHONE_bootstrap = { + "coreaudio-iphoneos", "SDL CoreAudio (iPhone OS) audio driver", + COREAUDIO_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/iphoneos/SDL_coreaudio_iphone.h b/Externals/SDL/src/audio/iphoneos/SDL_coreaudio_iphone.h new file mode 100644 index 0000000000..a061fa672e --- /dev/null +++ b/Externals/SDL/src/audio/iphoneos/SDL_coreaudio_iphone.h @@ -0,0 +1,43 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_coreaudio_h +#define _SDL_coreaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + AudioUnit audioUnit; + int audioUnitOpened; + void *buffer; + UInt32 bufferOffset; + UInt32 bufferSize; + // AudioDeviceID deviceID; +}; + +#endif /* _SDL_coreaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/macosx/SDL_coreaudio.c b/Externals/SDL/src/audio/macosx/SDL_coreaudio.c new file mode 100644 index 0000000000..5d02216a0c --- /dev/null +++ b/Externals/SDL/src/audio/macosx/SDL_coreaudio.c @@ -0,0 +1,600 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#include +#include +#include +#if MAC_OS_X_VERSION_MAX_ALLOWED == 1050 +#include +#endif + +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "SDL_coreaudio.h" + +#define DEBUG_COREAUDIO 0 + +typedef struct COREAUDIO_DeviceList +{ + AudioDeviceID id; + const char *name; +} COREAUDIO_DeviceList; + +static COREAUDIO_DeviceList *inputDevices = NULL; +static int inputDeviceCount = 0; +static COREAUDIO_DeviceList *outputDevices = NULL; +static int outputDeviceCount = 0; + +static void +free_device_list(COREAUDIO_DeviceList ** devices, int *devCount) +{ + if (*devices) { + int i = *devCount; + while (i--) + SDL_free((void *) (*devices)[i].name); + SDL_free(*devices); + *devices = NULL; + } + *devCount = 0; +} + + +static void +build_device_list(int iscapture, COREAUDIO_DeviceList ** devices, + int *devCount) +{ + Boolean outWritable = 0; + OSStatus result = noErr; + UInt32 size = 0; + AudioDeviceID *devs = NULL; + UInt32 i = 0; + UInt32 max = 0; + + free_device_list(devices, devCount); + + result = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, + &size, &outWritable); + + if (result != kAudioHardwareNoError) + return; + + devs = (AudioDeviceID *) alloca(size); + if (devs == NULL) + return; + + max = size / sizeof(AudioDeviceID); + *devices = (COREAUDIO_DeviceList *) SDL_malloc(max * sizeof(**devices)); + if (*devices == NULL) + return; + + result = AudioHardwareGetProperty(kAudioHardwarePropertyDevices, + &size, devs); + if (result != kAudioHardwareNoError) + return; + + for (i = 0; i < max; i++) { + CFStringRef cfstr = NULL; + char *ptr = NULL; + AudioDeviceID dev = devs[i]; + AudioBufferList *buflist = NULL; + int usable = 0; + CFIndex len = 0; + + result = AudioDeviceGetPropertyInfo(dev, 0, iscapture, + kAudioDevicePropertyStreamConfiguration, + &size, &outWritable); + if (result != noErr) + continue; + + buflist = (AudioBufferList *) SDL_malloc(size); + if (buflist == NULL) + continue; + + result = AudioDeviceGetProperty(dev, 0, iscapture, + kAudioDevicePropertyStreamConfiguration, + &size, buflist); + + if (result == noErr) { + UInt32 j; + for (j = 0; j < buflist->mNumberBuffers; j++) { + if (buflist->mBuffers[j].mNumberChannels > 0) { + usable = 1; + break; + } + } + } + + SDL_free(buflist); + + if (!usable) + continue; + + size = sizeof(CFStringRef); + result = AudioDeviceGetProperty(dev, 0, iscapture, + kAudioDevicePropertyDeviceNameCFString, + &size, &cfstr); + + if (result != kAudioHardwareNoError) + continue; + + len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), + kCFStringEncodingUTF8); + + ptr = (char *) SDL_malloc(len + 1); + usable = ((ptr != NULL) && + (CFStringGetCString + (cfstr, ptr, len + 1, kCFStringEncodingUTF8))); + + CFRelease(cfstr); + + if (usable) { + len = strlen(ptr); + /* Some devices have whitespace at the end...trim it. */ + while ((len > 0) && (ptr[len - 1] == ' ')) { + len--; + } + usable = (len > 0); + } + + if (!usable) { + SDL_free(ptr); + } else { + ptr[len] = '\0'; + +#if DEBUG_COREAUDIO + printf("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n", + ((iscapture) ? "capture" : "output"), + (int) *devCount, ptr, (int) dev); +#endif + + (*devices)[*devCount].id = dev; + (*devices)[*devCount].name = ptr; + (*devCount)++; + } + } +} + +static inline void +build_device_lists(void) +{ + build_device_list(0, &outputDevices, &outputDeviceCount); + build_device_list(1, &inputDevices, &inputDeviceCount); +} + + +static inline void +free_device_lists(void) +{ + free_device_list(&outputDevices, &outputDeviceCount); + free_device_list(&inputDevices, &inputDeviceCount); +} + + +static int +find_device_id(const char *devname, int iscapture, AudioDeviceID * id) +{ + int i = ((iscapture) ? inputDeviceCount : outputDeviceCount); + COREAUDIO_DeviceList *devs = ((iscapture) ? inputDevices : outputDevices); + while (i--) { + if (SDL_strcmp(devname, devs->name) == 0) { + *id = devs->id; + return 1; + } + devs++; + } + + return 0; +} + + +static int +COREAUDIO_DetectDevices(int iscapture) +{ + if (iscapture) { + build_device_list(1, &inputDevices, &inputDeviceCount); + return inputDeviceCount; + } else { + build_device_list(0, &outputDevices, &outputDeviceCount); + return outputDeviceCount; + } + + return 0; /* shouldn't ever hit this. */ +} + + +static const char * +COREAUDIO_GetDeviceName(int index, int iscapture) +{ + if ((iscapture) && (index < inputDeviceCount)) { + return inputDevices[index].name; + } else if ((!iscapture) && (index < outputDeviceCount)) { + return outputDevices[index].name; + } + + SDL_SetError("No such device"); + return NULL; +} + + +static void +COREAUDIO_Deinitialize(void) +{ + free_device_lists(); +} + + +/* The CoreAudio callback */ +static OSStatus +outputCallback(void *inRefCon, + AudioUnitRenderActionFlags * ioActionFlags, + const AudioTimeStamp * inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList * ioDataList) +{ + SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon; + AudioBuffer *ioData = &ioDataList->mBuffers[0]; + UInt32 remaining, len; + void *ptr; + + /* Is there ever more than one buffer, and what do you do with it? */ + if (ioDataList->mNumberBuffers != 1) { + return noErr; + } + + /* Only do anything if audio is enabled and not paused */ + if (!this->enabled || this->paused) { + SDL_memset(ioData->mData, this->spec.silence, ioData->mDataByteSize); + return 0; + } + + /* No SDL conversion should be needed here, ever, since we accept + any input format in OpenAudio, and leave the conversion to CoreAudio. + */ + /* + assert(!this->convert.needed); + assert(this->spec.channels == ioData->mNumberChannels); + */ + + remaining = ioData->mDataByteSize; + ptr = ioData->mData; + while (remaining > 0) { + if (this->hidden->bufferOffset >= this->hidden->bufferSize) { + /* Generate the data */ + SDL_memset(this->hidden->buffer, this->spec.silence, + this->hidden->bufferSize); + SDL_mutexP(this->mixer_lock); + (*this->spec.callback) (this->spec.userdata, this->hidden->buffer, + this->hidden->bufferSize); + SDL_mutexV(this->mixer_lock); + this->hidden->bufferOffset = 0; + } + + len = this->hidden->bufferSize - this->hidden->bufferOffset; + if (len > remaining) + len = remaining; + SDL_memcpy(ptr, + (char *) this->hidden->buffer + this->hidden->bufferOffset, + len); + ptr = (char *) ptr + len; + remaining -= len; + this->hidden->bufferOffset += len; + } + + return 0; +} + +static OSStatus +inputCallback(void *inRefCon, + AudioUnitRenderActionFlags * ioActionFlags, + const AudioTimeStamp * inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList * ioData) +{ + //err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); + // !!! FIXME: write me! + return noErr; +} + + +static void +COREAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->audioUnitOpened) { + OSStatus result = noErr; + AURenderCallbackStruct callback; + const AudioUnitElement output_bus = 0; + const AudioUnitElement input_bus = 1; + const int iscapture = this->iscapture; + const AudioUnitElement bus = + ((iscapture) ? input_bus : output_bus); + const AudioUnitScope scope = + ((iscapture) ? kAudioUnitScope_Output : + kAudioUnitScope_Input); + + /* stop processing the audio unit */ + result = AudioOutputUnitStop(this->hidden->audioUnit); + + /* Remove the input callback */ + SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct)); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_SetRenderCallback, + scope, bus, &callback, + sizeof(callback)); + + CloseComponent(this->hidden->audioUnit); + this->hidden->audioUnitOpened = 0; + } + SDL_free(this->hidden->buffer); + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +#define CHECK_RESULT(msg) \ + if (result != noErr) { \ + COREAUDIO_CloseDevice(this); \ + SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \ + return 0; \ + } + +static int +find_device_by_name(_THIS, const char *devname, int iscapture) +{ + AudioDeviceID devid = 0; + OSStatus result = noErr; + UInt32 size = 0; + UInt32 alive = 0; + pid_t pid = 0; + + if (devname == NULL) { + size = sizeof(AudioDeviceID); + const AudioHardwarePropertyID propid = + ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : + kAudioHardwarePropertyDefaultOutputDevice); + + result = AudioHardwareGetProperty(propid, &size, &devid); + CHECK_RESULT("AudioHardwareGetProperty (default device)"); + } else { + if (!find_device_id(devname, iscapture, &devid)) { + SDL_SetError("CoreAudio: No such audio device."); + return 0; + } + } + + size = sizeof(alive); + result = AudioDeviceGetProperty(devid, 0, iscapture, + kAudioDevicePropertyDeviceIsAlive, + &size, &alive); + CHECK_RESULT + ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); + + if (!alive) { + SDL_SetError("CoreAudio: requested device exists, but isn't alive."); + return 0; + } + + size = sizeof(pid); + result = AudioDeviceGetProperty(devid, 0, iscapture, + kAudioDevicePropertyHogMode, &size, &pid); + + /* some devices don't support this property, so errors are fine here. */ + if ((result == noErr) && (pid != -1)) { + SDL_SetError("CoreAudio: requested device is being hogged."); + return 0; + } + + this->hidden->deviceID = devid; + return 1; +} + + +static int +prepare_audiounit(_THIS, const char *devname, int iscapture, + const AudioStreamBasicDescription * strdesc) +{ + OSStatus result = noErr; + AURenderCallbackStruct callback; + ComponentDescription desc; + Component comp = NULL; + UInt32 enableIO = 0; + const AudioUnitElement output_bus = 0; + const AudioUnitElement input_bus = 1; + const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); + const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : + kAudioUnitScope_Input); + + if (!find_device_by_name(this, devname, iscapture)) { + SDL_SetError("Couldn't find requested CoreAudio device"); + return 0; + } + + SDL_memset(&desc, '\0', sizeof(ComponentDescription)); + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_HALOutput; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + + comp = FindNextComponent(NULL, &desc); + if (comp == NULL) { + SDL_SetError("Couldn't find requested CoreAudio component"); + return 0; + } + + /* Open & initialize the audio unit */ + result = OpenAComponent(comp, &this->hidden->audioUnit); + CHECK_RESULT("OpenAComponent"); + + this->hidden->audioUnitOpened = 1; + + // !!! FIXME: this is wrong? + enableIO = ((iscapture) ? 1 : 0); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Input, input_bus, + &enableIO, sizeof(enableIO)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_EnableIO input)"); + + // !!! FIXME: this is wrong? + enableIO = ((iscapture) ? 0 : 1); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Output, output_bus, + &enableIO, sizeof(enableIO)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_EnableIO output)"); + + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, 0, + &this->hidden->deviceID, + sizeof(AudioDeviceID)); + CHECK_RESULT + ("AudioUnitSetProperty (kAudioOutputUnitProperty_CurrentDevice)"); + + /* Set the data format of the audio unit. */ + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_StreamFormat, + scope, bus, strdesc, sizeof(*strdesc)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)"); + + /* Set the audio callback */ + SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct)); + callback.inputProc = ((iscapture) ? inputCallback : outputCallback); + callback.inputProcRefCon = this; + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_SetRenderCallback, + scope, bus, &callback, sizeof(callback)); + CHECK_RESULT + ("AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)"); + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate a sample buffer */ + this->hidden->bufferOffset = this->hidden->bufferSize = this->spec.size; + this->hidden->buffer = SDL_malloc(this->hidden->bufferSize); + + result = AudioUnitInitialize(this->hidden->audioUnit); + CHECK_RESULT("AudioUnitInitialize"); + + /* Finally, start processing of the audio unit */ + result = AudioOutputUnitStart(this->hidden->audioUnit); + CHECK_RESULT("AudioOutputUnitStart"); + + /* We're running! */ + return 1; +} + + +static int +COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + AudioStreamBasicDescription strdesc; + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + int valid_datatype = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return (0); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Setup a AudioStreamBasicDescription with the requested format */ + SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); + strdesc.mFormatID = kAudioFormatLinearPCM; + strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; + strdesc.mChannelsPerFrame = this->spec.channels; + strdesc.mSampleRate = this->spec.freq; + strdesc.mFramesPerPacket = 1; + + while ((!valid_datatype) && (test_format)) { + this->spec.format = test_format; + /* Just a list of valid SDL formats, so people don't pass junk here. */ + switch (test_format) { + case AUDIO_U8: + case AUDIO_S8: + case AUDIO_U16LSB: + case AUDIO_S16LSB: + case AUDIO_U16MSB: + case AUDIO_S16MSB: + case AUDIO_S32LSB: + case AUDIO_S32MSB: + case AUDIO_F32LSB: + case AUDIO_F32MSB: + valid_datatype = 1; + strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(this->spec.format); + if (SDL_AUDIO_ISBIGENDIAN(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; + + if (SDL_AUDIO_ISFLOAT(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat; + else if (SDL_AUDIO_ISSIGNED(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + break; + } + } + + if (!valid_datatype) { /* shouldn't happen, but just in case... */ + COREAUDIO_CloseDevice(this); + SDL_SetError("Unsupported audio format"); + return 0; + } + + strdesc.mBytesPerFrame = + strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8; + strdesc.mBytesPerPacket = + strdesc.mBytesPerFrame * strdesc.mFramesPerPacket; + + if (!prepare_audiounit(this, devname, iscapture, &strdesc)) { + COREAUDIO_CloseDevice(this); + return 0; /* prepare_audiounit() will call SDL_SetError()... */ + } + + return 1; /* good to go. */ +} + +static int +COREAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = COREAUDIO_DetectDevices; + impl->GetDeviceName = COREAUDIO_GetDeviceName; + impl->OpenDevice = COREAUDIO_OpenDevice; + impl->CloseDevice = COREAUDIO_CloseDevice; + impl->Deinitialize = COREAUDIO_Deinitialize; + impl->ProvidesOwnCallbackThread = 1; + + build_device_lists(); /* do an initial check for devices... */ + + return (outputDeviceCount > 0) ? 2 : 1; +} + +AudioBootStrap COREAUDIO_bootstrap = { + "coreaudio", "Mac OS X CoreAudio", COREAUDIO_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/macosx/SDL_coreaudio.h b/Externals/SDL/src/audio/macosx/SDL_coreaudio.h new file mode 100644 index 0000000000..91124ba0aa --- /dev/null +++ b/Externals/SDL/src/audio/macosx/SDL_coreaudio.h @@ -0,0 +1,43 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +#ifndef _SDL_coreaudio_h +#define _SDL_coreaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + AudioUnit audioUnit; + int audioUnitOpened; + void *buffer; + UInt32 bufferOffset; + UInt32 bufferSize; + AudioDeviceID deviceID; +}; + +#endif /* _SDL_coreaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/mme/SDL_mmeaudio.c b/Externals/SDL/src/audio/mme/SDL_mmeaudio.c new file mode 100644 index 0000000000..1558a35a9f --- /dev/null +++ b/Externals/SDL/src/audio/mme/SDL_mmeaudio.c @@ -0,0 +1,260 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Tru64 UNIX MME support */ +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "SDL_mmeaudio.h" + +static BOOL inUse[NUM_BUFFERS]; + +static void +SetMMerror(char *function, MMRESULT code) +{ + int len; + char errbuf[MAXERRORLENGTH]; + + SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function); + len = SDL_strlen(errbuf); + waveOutGetErrorText(code, errbuf + len, MAXERRORLENGTH - len); + SDL_SetError("%s", errbuf); +} + +static void CALLBACK +MME_Callback(HWAVEOUT hwo, + UINT uMsg, DWORD dwInstance, LPARAM dwParam1, LPARAM dwParam2) +{ + WAVEHDR *wp = (WAVEHDR *) dwParam1; + + if (uMsg == WOM_DONE) + inUse[wp->dwUser] = FALSE; +} + +static int +MME_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int valid_format = 0; + MMRESULT result; + Uint8 *mixbuf = NULL; + int i; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Set basic WAVE format parameters */ + this->hidden->shm = mmeAllocMem(sizeof(*this->hidden->shm)); + if (this->hidden->shm == NULL) { + MME_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + + SDL_memset(this->hidden->shm, '\0', sizeof(*this->hidden->shm)); + this->hidden->shm->sound = 0; + this->hidden->shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM; + + /* Determine the audio parameters from the AudioSpec */ + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !valid_format && test_format;) { + valid_format = 1; + switch (test_format) { + case AUDIO_U8: + case AUDIO_S16: + case AUDIO_S32: + break; + default: + valid_format = 0; + test_format = SDL_NextAudioFormat(); + } + } + + if (!valid_format) { + MME_CloseDevice(this); + SDL_SetError("Unsupported audio format"); + return 0; + } + + this->spec.format = test_format; + this->hidden->shm->wFmt.wBitsPerSample = SDL_AUDIO_BITSIZE(test_format); + + /* !!! FIXME: Can this handle more than stereo? */ + this->hidden->shm->wFmt.wf.nChannels = this->spec.channels; + this->hidden->shm->wFmt.wf.nSamplesPerSec = this->spec.freq; + this->hidden->shm->wFmt.wf.nBlockAlign = + this->hidden->shm->wFmt.wf.nChannels * + this->hidden->shm->wFmt.wBitsPerSample / 8; + this->hidden->shm->wFmt.wf.nAvgBytesPerSec = + this->hidden->shm->wFmt.wf.nSamplesPerSec * + this->hidden->shm->wFmt.wf.nBlockAlign; + + /* Check the buffer size -- minimum of 1/4 second (word aligned) */ + if (this->spec.samples < (this->spec.freq / 4)) + this->spec.samples = ((this->spec.freq / 4) + 3) & ~3; + + /* Update the fragment size as size in bytes */ + SDL_CalculateAudioSpec(&this->spec); + + /* Open the audio device */ + result = waveOutOpen(&(this->hidden->shm->sound), + WAVE_MAPPER, + &(this->hidden->shm->wFmt.wf), + MME_Callback, + NULL, (CALLBACK_FUNCTION | WAVE_OPEN_SHAREABLE)); + if (result != MMSYSERR_NOERROR) { + MME_CloseDevice(this); + SetMMerror("waveOutOpen()", result); + return 0; + } + + /* Create the sound buffers */ + mixbuf = (Uint8 *) mmeAllocBuffer(NUM_BUFFERS * (this->spec.size)); + if (mixbuf == NULL) { + MME_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + this->hidden->mixbuf = mixbuf; + + for (i = 0; i < NUM_BUFFERS; i++) { + this->hidden->shm->wHdr[i].lpData = &mixbuf[i * (this->spec.size)]; + this->hidden->shm->wHdr[i].dwBufferLength = this->spec.size; + this->hidden->shm->wHdr[i].dwFlags = 0; + this->hidden->shm->wHdr[i].dwUser = i; + this->hidden->shm->wHdr[i].dwLoops = 0; /* loop control counter */ + this->hidden->shm->wHdr[i].lpNext = NULL; /* reserved for driver */ + this->hidden->shm->wHdr[i].reserved = 0; + inUse[i] = FALSE; + } + this->hidden->next_buffer = 0; + + return 1; +} + +static void +MME_WaitDevice(_THIS) +{ + while (inUse[this->hidden->next_buffer]) { + mmeWaitForCallbacks(); + mmeProcessCallbacks(); + } +} + +static Uint8 * +MME_GetDeviceBuf(_THIS) +{ + void *retval = this->hidden->shm->wHdr[this->hidden->next_buffer].lpData; + inUse[this->hidden->next_buffer] = TRUE; + return (Uint8 *) retval; +} + +static void +MME_PlayDevice(_THIS) +{ + /* Queue it up */ + waveOutWrite(this->hidden->shm->sound, + &(this->hidden->shm->wHdr[this->hidden->next_buffer]), + sizeof(WAVEHDR)); + this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS; +} + +static void +MME_WaitDone(_THIS) +{ + MMRESULT result; + int i; + + if (this->hidden->shm->sound) { + for (i = 0; i < NUM_BUFFERS; i++) + while (inUse[i]) { + mmeWaitForCallbacks(); + mmeProcessCallbacks(); + } + result = waveOutReset(this->hidden->shm->sound); + if (result != MMSYSERR_NOERROR) + SetMMerror("waveOutReset()", result); + mmeProcessCallbacks(); + } +} + +static void +MME_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + MMRESULT result; + + if (this->hidden->mixbuf) { + result = mmeFreeBuffer(this->hidden->mixbuf); + if (result != MMSYSERR_NOERROR) + SetMMerror("mmeFreeBuffer", result); + this->hidden->mixbuf = NULL; + } + + if (this->hidden->shm) { + if (this->hidden->shm->sound) { + result = waveOutClose(this->hidden->shm->sound); + if (result != MMSYSERR_NOERROR) + SetMMerror("waveOutClose()", result); + mmeProcessCallbacks(); + } + result = mmeFreeMem(this->hidden->shm); + if (result != MMSYSERR_NOERROR) + SetMMerror("mmeFreeMem()", result); + this->hidden->shm = NULL; + } + + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +MME_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = MME_OpenDevice; + impl->WaitDevice = MME_WaitDevice; + impl->WaitDone = MME_WaitDone; + impl->PlayDevice = MME_PlayDevice; + impl->GetDeviceBuf = MME_GetDeviceBuf; + impl->CloseDevice = MME_CloseDevice; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; +} + +/* !!! FIXME: Windows "windib" driver is called waveout, too */ +AudioBootStrap MMEAUDIO_bootstrap = { + "waveout", "Tru64 MME WaveOut", MME_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/mme/SDL_mmeaudio.h b/Externals/SDL/src/audio/mme/SDL_mmeaudio.h new file mode 100644 index 0000000000..2ff56fc022 --- /dev/null +++ b/Externals/SDL/src/audio/mme/SDL_mmeaudio.h @@ -0,0 +1,51 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#ifndef _SDL_mmeaudio_h +#define _SDL_mmeaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this +#define NUM_BUFFERS 2 + +struct SharedMem +{ + HWAVEOUT sound; + WAVEHDR wHdr[NUM_BUFFERS]; + PCMWAVEFORMAT wFmt; +}; + +struct SDL_PrivateAudioData +{ + Uint8 *mixbuf; /* The raw allocated mixing buffer */ + struct SharedMem *shm; + int next_buffer; +}; + +#endif /* _SDL_mmeaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/nas/SDL_nasaudio.c b/Externals/SDL/src/audio/nas/SDL_nasaudio.c new file mode 100644 index 0000000000..59c4f36bc8 --- /dev/null +++ b/Externals/SDL/src/audio/nas/SDL_nasaudio.c @@ -0,0 +1,408 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + This driver was written by: + Erik Inge Bolsø + knan@mo.himolde.no +*/ +#include "SDL_config.h" + +/* Allow access to a raw mixing buffer */ + +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "SDL_loadso.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_nasaudio.h" + +/* The tag name used by nas audio */ +#define NAS_DRIVER_NAME "nas" + +static struct SDL_PrivateAudioData *this2 = NULL; + + +static void (*NAS_AuCloseServer) (AuServer *); +static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *); +static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *); +static AuFlowID(*NAS_AuCreateFlow) (AuServer *, AuStatus *); +static void (*NAS_AuStartFlow) (AuServer *, AuFlowID, AuStatus *); +static void (*NAS_AuSetElements) + (AuServer *, AuFlowID, AuBool, int, AuElement *, AuStatus *); +static void (*NAS_AuWriteElement) + (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuBool, AuStatus *); +static AuServer *(*NAS_AuOpenServer) + (_AuConst char *, int, _AuConst char *, int, _AuConst char *, char **); +static AuEventHandlerRec *(*NAS_AuRegisterEventHandler) + (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer); + + +#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC + +static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC; +static void *nas_handle = NULL; + +static int +load_nas_sym(const char *fn, void **addr) +{ + *addr = SDL_LoadFunction(nas_handle, fn); + if (*addr == NULL) { + return 0; + } + return 1; +} + +/* cast funcs to char* first, to please GCC's strict aliasing rules. */ +#define SDL_NAS_SYM(x) \ + if (!load_nas_sym(#x, (void **) (char *) &NAS_##x)) return -1 +#else +#define SDL_NAS_SYM(x) NAS_##x = x +#endif + +static int +load_nas_syms(void) +{ + SDL_NAS_SYM(AuCloseServer); + SDL_NAS_SYM(AuNextEvent); + SDL_NAS_SYM(AuDispatchEvent); + SDL_NAS_SYM(AuCreateFlow); + SDL_NAS_SYM(AuStartFlow); + SDL_NAS_SYM(AuSetElements); + SDL_NAS_SYM(AuWriteElement); + SDL_NAS_SYM(AuOpenServer); + SDL_NAS_SYM(AuRegisterEventHandler); + return 0; +} + +#undef SDL_NAS_SYM + +#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC + +static void +UnloadNASLibrary(void) +{ + if (nas_handle != NULL) { + SDL_UnloadObject(nas_handle); + nas_handle = NULL; + } +} + +static int +LoadNASLibrary(void) +{ + int retval = 0; + if (nas_handle == NULL) { + nas_handle = SDL_LoadObject(nas_library); + if (nas_handle == NULL) { + /* Copy error string so we can use it in a new SDL_SetError(). */ + char *origerr = SDL_GetError(); + size_t len = SDL_strlen(origerr) + 1; + char *err = (char *) alloca(len); + SDL_strlcpy(err, origerr, len); + retval = -1; + SDL_SetError("NAS: SDL_LoadObject('%s') failed: %s\n", + nas_library, err); + } else { + retval = load_nas_syms(); + if (retval < 0) { + UnloadNASLibrary(); + } + } + } + return retval; +} + +#else + +static void +UnloadNASLibrary(void) +{ +} + +static int +LoadNASLibrary(void) +{ + load_nas_syms(); + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */ + +/* This function waits until it is possible to write a full sound buffer */ +static void +NAS_WaitDevice(_THIS) +{ + while (this->hidden->buf_free < this->hidden->mixlen) { + AuEvent ev; + NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); + NAS_AuDispatchEvent(this->hidden->aud, &ev); + } +} + +static void +NAS_PlayDevice(_THIS) +{ + while (this->hidden->mixlen > this->hidden->buf_free) { + /* + * We think the buffer is full? Yikes! Ask the server for events, + * in the hope that some of them is LowWater events telling us more + * of the buffer is free now than what we think. + */ + AuEvent ev; + NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); + NAS_AuDispatchEvent(this->hidden->aud, &ev); + } + this->hidden->buf_free -= this->hidden->mixlen; + + /* Write the audio data */ + NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, + this->hidden->mixlen, this->hidden->mixbuf, AuFalse, + NULL); + + this->hidden->written += this->hidden->mixlen; + +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); +#endif +} + +static Uint8 * +NAS_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + +static void +NAS_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->aud) { + NAS_AuCloseServer(this->hidden->aud); + this->hidden->aud = 0; + } + SDL_free(this->hidden); + this2 = this->hidden = NULL; + } +} + +static unsigned char +sdlformat_to_auformat(unsigned int fmt) +{ + switch (fmt) { + case AUDIO_U8: + return AuFormatLinearUnsigned8; + case AUDIO_S8: + return AuFormatLinearSigned8; + case AUDIO_U16LSB: + return AuFormatLinearUnsigned16LSB; + case AUDIO_U16MSB: + return AuFormatLinearUnsigned16MSB; + case AUDIO_S16LSB: + return AuFormatLinearSigned16LSB; + case AUDIO_S16MSB: + return AuFormatLinearSigned16MSB; + } + return AuNone; +} + +static AuBool +event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) +{ + switch (ev->type) { + case AuEventTypeElementNotify: + { + AuElementNotifyEvent *event = (AuElementNotifyEvent *) ev; + + switch (event->kind) { + case AuElementNotifyKindLowWater: + if (this2->buf_free >= 0) { + this2->really += event->num_bytes; + gettimeofday(&this2->last_tv, 0); + this2->buf_free += event->num_bytes; + } else { + this2->buf_free = event->num_bytes; + } + break; + case AuElementNotifyKindState: + switch (event->cur_state) { + case AuStatePause: + if (event->reason != AuReasonUser) { + if (this2->buf_free >= 0) { + this2->really += event->num_bytes; + gettimeofday(&this2->last_tv, 0); + this2->buf_free += event->num_bytes; + } else { + this2->buf_free = event->num_bytes; + } + } + break; + } + } + } + } + return AuTrue; +} + +static AuDeviceID +find_device(_THIS, int nch) +{ + /* These "Au" things are all macros, not functions... */ + int i; + for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) { + if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) == + AuComponentKindPhysicalOutput) && + AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) { + return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i)); + } + } + return AuNone; +} + +static int +NAS_OpenDevice(_THIS, const char *devname, int iscapture) +{ + AuElement elms[3]; + int buffer_size; + SDL_AudioFormat test_format, format; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Try for a closest match on audio format */ + format = 0; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { + format = sdlformat_to_auformat(test_format); + if (format == AuNone) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + NAS_CloseDevice(this); + SDL_SetError("NAS: Couldn't find any hardware audio formats"); + return 0; + } + this->spec.format = test_format; + + this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); + if (this->hidden->aud == 0) { + NAS_CloseDevice(this); + SDL_SetError("NAS: Couldn't open connection to NAS server"); + return 0; + } + + this->hidden->dev = find_device(this, this->spec.channels); + if ((this->hidden->dev == AuNone) + || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) { + NAS_CloseDevice(this); + SDL_SetError("NAS: Couldn't find a fitting device on NAS server"); + return 0; + } + + buffer_size = this->spec.freq; + if (buffer_size < 4096) + buffer_size = 4096; + + if (buffer_size > 32768) + buffer_size = 32768; /* So that the buffer won't get unmanageably big. */ + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + this2 = this->hidden; + + AuMakeElementImportClient(elms, this->spec.freq, format, + this->spec.channels, AuTrue, buffer_size, + buffer_size / 4, 0, NULL); + AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq, + AuUnlimitedSamples, 0, NULL); + NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms, + NULL); + NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, + this->hidden->flow, event_handler, + (AuPointer) NULL); + + NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + NAS_CloseDevice(this); + SDL_OutOfMemory(); + return 0; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 1; +} + +static void +NAS_Deinitialize(void) +{ + UnloadNASLibrary(); +} + +static int +NAS_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadNASLibrary() < 0) { + return 0; + } else { + AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); + if (aud == NULL) { + SDL_SetError("NAS: AuOpenServer() failed (no audio server?)"); + return 0; + } + NAS_AuCloseServer(aud); + } + + /* Set the function pointers */ + impl->OpenDevice = NAS_OpenDevice; + impl->PlayDevice = NAS_PlayDevice; + impl->WaitDevice = NAS_WaitDevice; + impl->GetDeviceBuf = NAS_GetDeviceBuf; + impl->CloseDevice = NAS_CloseDevice; + impl->Deinitialize = NAS_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: is this true? */ + + return 2; /* 2 == definitely has an audio device. */ +} + +AudioBootStrap NAS_bootstrap = { + NAS_DRIVER_NAME, "Network Audio System", NAS_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Externals/SDL/src/audio/nas/SDL_nasaudio.h b/Externals/SDL/src/audio/nas/SDL_nasaudio.h new file mode 100644 index 0000000000..19ede2dabd --- /dev/null +++ b/Externals/SDL/src/audio/nas/SDL_nasaudio.h @@ -0,0 +1,61 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org + + This driver was written by: + Erik Inge Bolsø + knan@mo.himolde.no +*/ +#include "SDL_config.h" + +#ifndef _SDL_nasaudio_h +#define _SDL_nasaudio_h + +#ifdef __sgi +#include +#else +#include