mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 07:39:26 +01:00
revert sdl changes, part 1
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4564 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
ee57003ea9
commit
235a19e356
151
Externals/SDL/Iinclude/SDL.h
vendored
Normal file
151
Externals/SDL/Iinclude/SDL.h
vendored
Normal file
@ -0,0 +1,151 @@
|
||||
/*
|
||||
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: */
|
423
Externals/SDL/Iinclude/SDL_audio.h
vendored
Normal file
423
Externals/SDL/Iinclude/SDL_audio.h
vendored
Normal file
@ -0,0 +1,423 @@
|
||||
/*
|
||||
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: */
|
186
Externals/SDL/Iinclude/SDL_cdrom.h
vendored
Normal file
186
Externals/SDL/Iinclude/SDL_cdrom.h
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
/*
|
||||
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_cdrom.h
|
||||
*
|
||||
* This is the CD-audio control API for Simple DirectMedia Layer
|
||||
*/
|
||||
|
||||
#ifndef _SDL_cdrom_h
|
||||
#define _SDL_cdrom_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_CDROM flag. This causes SDL to scan the system
|
||||
for CD-ROM drives, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
/* The maximum number of CD-ROM tracks on a disk */
|
||||
#define SDL_MAX_TRACKS 99
|
||||
|
||||
/* The types of CD-ROM track possible */
|
||||
#define SDL_AUDIO_TRACK 0x00
|
||||
#define SDL_DATA_TRACK 0x04
|
||||
|
||||
/* The possible states which a CD-ROM drive can be in. */
|
||||
typedef enum
|
||||
{
|
||||
CD_TRAYEMPTY,
|
||||
CD_STOPPED,
|
||||
CD_PLAYING,
|
||||
CD_PAUSED,
|
||||
CD_ERROR = -1
|
||||
} CDstatus;
|
||||
|
||||
/* Given a status, returns true if there's a disk in the drive */
|
||||
#define CD_INDRIVE(status) ((int)(status) > 0)
|
||||
|
||||
typedef struct SDL_CDtrack
|
||||
{
|
||||
Uint8 id; /* Track number */
|
||||
Uint8 type; /* Data or audio track */
|
||||
Uint16 unused;
|
||||
Uint32 length; /* Length, in frames, of this track */
|
||||
Uint32 offset; /* Offset, in frames, from start of disk */
|
||||
} SDL_CDtrack;
|
||||
|
||||
/* This structure is only current as of the last call to SDL_CDStatus() */
|
||||
typedef struct SDL_CD
|
||||
{
|
||||
int id; /* Private drive identifier */
|
||||
CDstatus status; /* Current drive status */
|
||||
|
||||
/* The rest of this structure is only valid if there's a CD in drive */
|
||||
int numtracks; /* Number of tracks on disk */
|
||||
int cur_track; /* Current track position */
|
||||
int cur_frame; /* Current frame offset within current track */
|
||||
SDL_CDtrack track[SDL_MAX_TRACKS + 1];
|
||||
} SDL_CD;
|
||||
|
||||
/* Conversion functions from frames to Minute/Second/Frames and vice versa */
|
||||
#define CD_FPS 75
|
||||
#define FRAMES_TO_MSF(f, M,S,F) { \
|
||||
int value = f; \
|
||||
*(F) = value%CD_FPS; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = value%60; \
|
||||
value /= 60; \
|
||||
*(M) = value; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
|
||||
|
||||
/* CD-audio API functions: */
|
||||
|
||||
/* Returns the number of CD-ROM drives on the system, or -1 if
|
||||
SDL_Init() has not been called with the SDL_INIT_CDROM flag.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
|
||||
|
||||
/* Returns a human-readable, system-dependent identifier for the CD-ROM.
|
||||
Example:
|
||||
"/dev/cdrom"
|
||||
"E:"
|
||||
"/dev/disk/ide/1/master"
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_CDName(int drive);
|
||||
|
||||
/* Opens a CD-ROM drive for access. It returns a drive handle on success,
|
||||
or NULL if the drive was invalid or busy. This newly opened CD-ROM
|
||||
becomes the default CD used when other CD functions are passed a NULL
|
||||
CD-ROM handle.
|
||||
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
|
||||
*/
|
||||
extern DECLSPEC SDL_CD *SDLCALL SDL_CDOpen(int drive);
|
||||
|
||||
/* This function returns the current status of the given drive.
|
||||
If the drive has a CD in it, the table of contents of the CD and current
|
||||
play position of the CD will be stored in the SDL_CD structure.
|
||||
*/
|
||||
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD * cdrom);
|
||||
|
||||
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
|
||||
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
|
||||
until the end of the CD. This function will skip data tracks.
|
||||
This function should only be called after calling SDL_CDStatus() to
|
||||
get track information about the CD.
|
||||
For example:
|
||||
// Play entire CD:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
|
||||
// Play last track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
|
||||
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
|
||||
}
|
||||
// Play first and second track and 10 seconds of third track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
|
||||
|
||||
This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD * cdrom,
|
||||
int start_track,
|
||||
int start_frame, int ntracks,
|
||||
int nframes);
|
||||
|
||||
/* Play the given CD starting at 'start' frame for 'length' frames.
|
||||
It returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD * cdrom, int start, int length);
|
||||
|
||||
/* Pause play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD * cdrom);
|
||||
|
||||
/* Resume play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD * cdrom);
|
||||
|
||||
/* Stop play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD * cdrom);
|
||||
|
||||
/* Eject CD-ROM -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD * cdrom);
|
||||
|
||||
/* Closes the handle for the CD-ROM drive */
|
||||
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD * cdrom);
|
||||
|
||||
|
||||
/* 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: */
|
@ -20,30 +20,7 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \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
|
||||
/* This file contains functions for backwards compatibility with SDL 1.2 */
|
||||
|
||||
#ifndef _SDL_compat_h
|
||||
#define _SDL_compat_h
|
||||
@ -59,16 +36,7 @@ extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup Compatibility
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \name Surface flags
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_SWSURFACE 0x00000000 /**< \note Not used */
|
||||
#define SDL_SWSURFACE 0x00000000 /* Not used */
|
||||
#define SDL_SRCALPHA 0x00010000
|
||||
#define SDL_SRCCOLORKEY 0x00020000
|
||||
#define SDL_ANYFORMAT 0x00100000
|
||||
@ -78,11 +46,10 @@ extern "C" {
|
||||
#define SDL_RESIZABLE 0x01000000
|
||||
#define SDL_NOFRAME 0x02000000
|
||||
#define SDL_OPENGL 0x04000000
|
||||
#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_HWSURFACE 0x08000001 /* Not used */
|
||||
#define SDL_ASYNCBLIT 0x08000000 /* Not used */
|
||||
#define SDL_RLEACCELOK 0x08000000 /* Not used */
|
||||
#define SDL_HWACCEL 0x08000000 /* Not used */
|
||||
|
||||
#define SDL_APPMOUSEFOCUS 0x01
|
||||
#define SDL_APPINPUTFOCUS 0x02
|
||||
@ -126,51 +93,35 @@ typedef struct SDL_VideoInfo
|
||||
int current_h;
|
||||
} SDL_VideoInfo;
|
||||
|
||||
/**
|
||||
* \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) */
|
||||
/*@}*//*Overlay formats*/
|
||||
/* The most common video overlay formats.
|
||||
For an explanation of these pixel formats, see:
|
||||
http://www.webartz.com/fourcc/indexyuv.htm
|
||||
|
||||
/**
|
||||
* The YUV hardware video overlay.
|
||||
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) */
|
||||
|
||||
/* 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 */
|
||||
|
||||
/**
|
||||
* \name Hardware-specific surface info
|
||||
*/
|
||||
/*@{*/
|
||||
/* Hardware-specific surface info */
|
||||
struct private_yuvhwfuncs *hwfuncs;
|
||||
struct private_yuvhwdata *hwdata;
|
||||
/*@}*//*Hardware-specific surface info*/
|
||||
|
||||
/**
|
||||
* \name Special flags
|
||||
*/
|
||||
/*@{*/
|
||||
Uint32 hw_overlay:1; /**< Flag: This overlay hardware accelerated? */
|
||||
/* Special flags */
|
||||
Uint32 hw_overlay:1; /* Flag: This overlay hardware accelerated? */
|
||||
Uint32 UnusedBits:31;
|
||||
/*@}*//*Special flags*/
|
||||
} SDL_Overlay;
|
||||
|
||||
typedef enum
|
||||
@ -182,17 +133,9 @@ typedef enum
|
||||
|
||||
struct SDL_SysWMinfo;
|
||||
|
||||
/**
|
||||
* \name Obsolete or renamed key codes
|
||||
*/
|
||||
/*@{*/
|
||||
/* Obsolete or renamed key codes */
|
||||
|
||||
/**
|
||||
* \name Renamed keys
|
||||
*
|
||||
* These key constants were renamed for clarity or consistency.
|
||||
*/
|
||||
/*@{*/
|
||||
/* These key constants were renamed for clarity or consistency. */
|
||||
#define SDLK_0 '0'
|
||||
#define SDLK_1 '1'
|
||||
#define SDLK_2 '2'
|
||||
@ -261,35 +204,19 @@ struct SDL_SysWMinfo;
|
||||
#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
|
||||
#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
|
||||
#define SDLK_PRINT SDLK_PRINTSCREEN
|
||||
/*@}*//*Renamed keys*/
|
||||
|
||||
/**
|
||||
* \name META modifier
|
||||
*
|
||||
* The META modifier is equivalent to the GUI modifier from the USB standard.
|
||||
*/
|
||||
/*@{*/
|
||||
/* 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*/
|
||||
|
||||
/**
|
||||
* \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.
|
||||
*/
|
||||
/*@{*/
|
||||
/* 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
|
||||
@ -350,8 +277,6 @@ 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* */
|
@ -1,39 +1,45 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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 */
|
@ -1,47 +1,45 @@
|
||||
/*
|
||||
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 */
|
||||
/*
|
||||
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 */
|
@ -1,308 +1,327 @@
|
||||
/*
|
||||
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 <stdarg.h>
|
||||
#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 */
|
||||
/*
|
||||
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 <stdarg.h>
|
||||
#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 */
|
107
Externals/SDL/Iinclude/SDL_config_dreamcast.h
vendored
Normal file
107
Externals/SDL/Iinclude/SDL_config_dreamcast.h
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
/*
|
||||
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_dreamcast_h
|
||||
#define _SDL_config_dreamcast_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
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;
|
||||
typedef unsigned long uintptr_t;
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_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_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_STRDUP 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 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_STRCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DC 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_DC 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DC 1
|
||||
#define SDL_HAPTIC_DUMMY 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DUMMY 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_DC 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_DC 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DC 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_dreamcast_h */
|
@ -25,7 +25,6 @@
|
||||
|
||||
#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;
|
||||
@ -33,14 +32,6 @@ 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
|
||||
@ -91,18 +82,6 @@ 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
|
||||
@ -112,6 +91,9 @@ 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
|
||||
|
||||
@ -137,9 +119,6 @@ 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
|
||||
|
@ -1,162 +1,134 @@
|
||||
/*
|
||||
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 <AvailabilityMacros.h>
|
||||
|
||||
/* 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 */
|
||||
/*
|
||||
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 <AvailabilityMacros.h>
|
||||
|
||||
/* 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 */
|
@ -1,68 +1,65 @@
|
||||
/*
|
||||
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 <stdarg.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;
|
||||
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 */
|
||||
/*
|
||||
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 <stdarg.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;
|
||||
|
||||
/* 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 */
|
@ -27,7 +27,6 @@
|
||||
|
||||
/* 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;
|
||||
@ -44,7 +43,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
|
||||
|
||||
@ -96,6 +95,9 @@ 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*/
|
||||
@ -114,7 +116,4 @@ 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 */
|
142
Externals/SDL/Iinclude/SDL_config_os2.h
vendored
Normal file
142
Externals/SDL/Iinclude/SDL_config_os2.h
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
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_os2_h
|
||||
#define _SDL_config_os2_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
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;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Use Watcom's LIBC */
|
||||
#define HAVE_LIBC 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_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__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE__STRLWR 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE__LTOA 1
|
||||
#define HAVE__UITOA 1
|
||||
#define HAVE__ULTOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE__I64TOA 1
|
||||
#define HAVE__UI64TOA 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_STRCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DART 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_OS2 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_OS2 1
|
||||
#define SDL_HAPTIC_DUMMY 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_OS2 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_OS2 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_OS2 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_OS2FS 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
/* Nothing here yet for OS/2... :( */
|
||||
|
||||
/* Enable assembly routines where available */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
|
||||
#endif /* _SDL_config_os2_h */
|
@ -1,197 +1,193 @@
|
||||
/*
|
||||
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 */
|
||||
/*
|
||||
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 */
|
@ -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
|
||||
*/
|
@ -1,92 +1,84 @@
|
||||
/*
|
||||
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: */
|
@ -1,253 +1,240 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
@ -1,78 +1,71 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
File diff suppressed because it is too large
Load Diff
1154
Externals/SDL/Iinclude/SDL_haptic.h
vendored
Normal file
1154
Externals/SDL/Iinclude/SDL_haptic.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,209 +1,181 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
168
Externals/SDL/Iinclude/SDL_keyboard.h
vendored
Normal file
168
Externals/SDL/Iinclude/SDL_keyboard.h
vendored
Normal file
@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
* \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)] ) ... <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: */
|
@ -1,275 +1,277 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
@ -1,86 +1,82 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
@ -1,96 +1,82 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
274
Externals/SDL/Iinclude/SDL_mouse.h
vendored
Normal file
274
Externals/SDL/Iinclude/SDL_mouse.h
vendored
Normal file
@ -0,0 +1,274 @@
|
||||
/*
|
||||
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: */
|
@ -1,223 +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_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: */
|
||||
/*
|
||||
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: */
|
11
Externals/SDL/Iinclude/SDL_name.h
vendored
Normal file
11
Externals/SDL/Iinclude/SDL_name.h
vendored
Normal file
@ -0,0 +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_ */
|
File diff suppressed because it is too large
Load Diff
@ -20,13 +20,10 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \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/
|
||||
/*
|
||||
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_
|
||||
@ -51,9 +48,6 @@ 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
|
||||
@ -347,14 +341,6 @@ 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 */
|
||||
@ -669,29 +655,6 @@ 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 */
|
||||
@ -973,65 +936,11 @@ 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
|
@ -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,19 +37,12 @@ extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name Transparency definitions
|
||||
*
|
||||
* These define alpha as the opacity of a surface.
|
||||
*/
|
||||
/*@{*/
|
||||
/* 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,
|
||||
@ -64,17 +57,14 @@ 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,
|
||||
@ -85,10 +75,8 @@ 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,
|
||||
@ -98,9 +86,8 @@ enum
|
||||
SDL_ARRAYORDER_ABGR
|
||||
};
|
||||
|
||||
/** Packed component layout. */
|
||||
enum
|
||||
{
|
||||
{ /* Packed component layout */
|
||||
SDL_PACKEDLAYOUT_NONE,
|
||||
SDL_PACKEDLAYOUT_332,
|
||||
SDL_PACKEDLAYOUT_4444,
|
||||
@ -130,12 +117,6 @@ 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))
|
||||
|
||||
@ -150,10 +131,10 @@ enum
|
||||
1, 0),
|
||||
SDL_PIXELFORMAT_INDEX4LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
|
||||
4, 0),
|
||||
2, 0),
|
||||
SDL_PIXELFORMAT_INDEX4MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
|
||||
4, 0),
|
||||
2, 0),
|
||||
SDL_PIXELFORMAT_INDEX8 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
|
||||
SDL_PIXELFORMAT_RGB332 =
|
||||
@ -171,9 +152,6 @@ 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),
|
||||
@ -183,9 +161,6 @@ 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),
|
||||
@ -214,15 +189,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')
|
||||
};
|
||||
|
||||
@ -254,9 +229,7 @@ struct SDL_Palette
|
||||
SDL_PaletteWatch *watch;
|
||||
};
|
||||
|
||||
/**
|
||||
* \note Everything in the pixel format structure is read-only.
|
||||
*/
|
||||
/* Everything in the pixel format structure is read-only */
|
||||
typedef struct SDL_PixelFormat
|
||||
{
|
||||
SDL_Palette *palette;
|
||||
@ -277,11 +250,13 @@ typedef struct SDL_PixelFormat
|
||||
} SDL_PixelFormat;
|
||||
|
||||
/**
|
||||
* \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()
|
||||
* \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()
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
||||
int *bpp,
|
||||
@ -291,12 +266,13 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
||||
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()
|
||||
* \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()
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
||||
Uint32 Rmask,
|
||||
@ -305,87 +281,107 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
||||
Uint32 Amask);
|
||||
|
||||
/**
|
||||
* \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()
|
||||
* \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()
|
||||
*/
|
||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
||||
|
||||
/**
|
||||
* \brief Add a callback function which is called when the palette changes.
|
||||
*
|
||||
* \sa SDL_DelPaletteWatch()
|
||||
* \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()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddPaletteWatch(SDL_Palette * palette,
|
||||
SDL_PaletteChangedFunc
|
||||
callback, void *userdata);
|
||||
|
||||
/**
|
||||
* \brief Remove a callback function previously added with
|
||||
* SDL_AddPaletteWatch().
|
||||
*
|
||||
* \sa SDL_AddPaletteWatch()
|
||||
* \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()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DelPaletteWatch(SDL_Palette * palette,
|
||||
SDL_PaletteChangedFunc
|
||||
callback, void *userdata);
|
||||
|
||||
/**
|
||||
* \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.
|
||||
* \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
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
const SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
|
||||
/**
|
||||
* \brief Free a palette created with SDL_AllocPalette().
|
||||
*
|
||||
* \sa SDL_AllocPalette()
|
||||
* \fn void SDL_FreePalette(SDL_Palette *palette)
|
||||
*
|
||||
* \brief Free a palette created with SDL_AllocPalette()
|
||||
*
|
||||
* \sa SDL_AllocPalette()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
||||
|
||||
/**
|
||||
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
|
||||
*
|
||||
* \sa SDL_MapRGBA
|
||||
* \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
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
/**
|
||||
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
|
||||
*
|
||||
* \sa SDL_MapRGB
|
||||
* \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
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b,
|
||||
Uint8 a);
|
||||
|
||||
/**
|
||||
* \brief Maps a pixel value into the RGB components for a given pixel format.
|
||||
*
|
||||
* \sa SDL_GetRGBA
|
||||
* \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
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
Uint8 * r, Uint8 * g, Uint8 * b);
|
||||
|
||||
/**
|
||||
* \brief Maps a pixel value into the RGBA components for a given pixel format.
|
||||
*
|
||||
* \sa SDL_GetRGB
|
||||
* \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
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
@ -1,154 +1,122 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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 */
|
@ -1,59 +1,54 @@
|
||||
/*
|
||||
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 */
|
||||
/*
|
||||
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 */
|
@ -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,13 +43,15 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \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
|
||||
* \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
|
||||
*/
|
||||
typedef struct SDL_Rect
|
||||
{
|
||||
@ -58,44 +60,56 @@ typedef struct SDL_Rect
|
||||
} SDL_Rect;
|
||||
|
||||
/**
|
||||
* \brief Returns true if the rectangle has no area.
|
||||
* \def SDL_RectEmpty()
|
||||
*
|
||||
* \brief Returns true if the rectangle has no area.
|
||||
*/
|
||||
#define SDL_RectEmpty(X) (((X)->w <= 0) || ((X)->h <= 0))
|
||||
|
||||
/**
|
||||
* \brief Returns true if the two rectangles are equal.
|
||||
* \def SDL_RectEquals()
|
||||
*
|
||||
* \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))
|
||||
|
||||
/**
|
||||
* \brief Determine whether two rectangles intersect.
|
||||
*
|
||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \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.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
|
||||
const SDL_Rect * B);
|
||||
|
||||
/**
|
||||
* \brief Calculate the intersection of two rectangles.
|
||||
*
|
||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \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.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
|
||||
const SDL_Rect * B,
|
||||
SDL_Rect * result);
|
||||
|
||||
/**
|
||||
* \brief Calculate the union of two rectangles.
|
||||
* \fn void SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
|
||||
*
|
||||
* \brief Calculate the union of two rectangles
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
|
||||
const SDL_Rect * B,
|
||||
SDL_Rect * result);
|
||||
|
||||
/**
|
||||
* \brief Calculate the intersection of a rectangle and line segment.
|
||||
*
|
||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \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.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
|
||||
rect, int *X1,
|
1
Externals/SDL/Iinclude/SDL_revision.h
vendored
Normal file
1
Externals/SDL/Iinclude/SDL_revision.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#define SDL_REVISION 4404
|
@ -1,203 +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
|
||||
*/
|
||||
|
||||
/**
|
||||
* \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: */
|
||||
/*
|
||||
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: */
|
@ -21,9 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_scancode.h
|
||||
*
|
||||
* Defines keyboard scancodes.
|
||||
* \file SDL_scancode.h
|
||||
*/
|
||||
|
||||
#ifndef _SDL_scancode_h
|
||||
@ -32,25 +30,22 @@
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/**
|
||||
* \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
|
||||
* \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
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_SCANCODE_UNKNOWN = 0,
|
||||
|
||||
/**
|
||||
* \name Usage page 0x07
|
||||
*
|
||||
* These values are from usage page 0x07 (USB keyboard page).
|
||||
*/
|
||||
/*@{*/
|
||||
/* These values are from usage page 0x07 (USB keyboard page) */
|
||||
|
||||
SDL_SCANCODE_A = 4,
|
||||
SDL_SCANCODE_B = 5,
|
||||
@ -100,51 +95,11 @@ 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,
|
||||
@ -167,8 +122,7 @@ 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,
|
||||
@ -179,8 +133,7 @@ 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,
|
||||
@ -198,20 +151,9 @@ 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,
|
||||
@ -230,7 +172,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,
|
||||
@ -246,8 +188,7 @@ 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,
|
||||
@ -335,19 +276,9 @@ 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
|
||||
*/
|
||||
|
||||
/*@}*//*Usage page 0x07*/
|
||||
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 */
|
||||
|
||||
/**
|
||||
* \name Usage page 0x0C
|
||||
*
|
||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
||||
*/
|
||||
/*@{*/
|
||||
/* These values are mapped from usage page 0x0C (USB consumer page) */
|
||||
|
||||
SDL_SCANCODE_AUDIONEXT = 258,
|
||||
SDL_SCANCODE_AUDIOPREV = 259,
|
||||
@ -366,32 +297,21 @@ typedef enum
|
||||
SDL_SCANCODE_AC_STOP = 272,
|
||||
SDL_SCANCODE_AC_REFRESH = 273,
|
||||
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
||||
|
||||
/*@}*//*Usage page 0x0C*/
|
||||
|
||||
/**
|
||||
* \name Walther keys
|
||||
*
|
||||
* These are values that Christian Walther added (for mac keyboard?).
|
||||
*/
|
||||
/*@{*/
|
||||
/* 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 */
|
File diff suppressed because it is too large
Load Diff
533
Externals/SDL/Iinclude/SDL_surface.h
vendored
Normal file
533
Externals/SDL/Iinclude/SDL_surface.h
vendored
Normal file
@ -0,0 +1,533 @@
|
||||
/*
|
||||
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_surface.h
|
||||
*
|
||||
* Header file for SDL_surface definition and management functions
|
||||
*/
|
||||
|
||||
#ifndef _SDL_surface_h
|
||||
#define _SDL_surface_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_pixels.h"
|
||||
#include "SDL_rect.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
|
||||
|
||||
/* 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 */
|
||||
|
||||
/* 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
|
||||
*
|
||||
* \note This structure should be treated as read-only, except for 'pixels',
|
||||
* which, if not NULL, contains the raw pixel data for the surface.
|
||||
*/
|
||||
typedef struct SDL_Surface
|
||||
{
|
||||
Uint32 flags; /**< Read-only */
|
||||
SDL_PixelFormat *format; /**< Read-only */
|
||||
int w, h; /**< Read-only */
|
||||
int pitch; /**< Read-only */
|
||||
void *pixels; /**< Read-write */
|
||||
|
||||
/* Application data associated with the surfade */
|
||||
void *userdata; /**< Read-write */
|
||||
|
||||
/* information needed for surfaces requiring locks */
|
||||
int locked; /**< Read-only */
|
||||
void *lock_data; /**< Read-only */
|
||||
|
||||
/* clipping information */
|
||||
SDL_Rect clip_rect; /**< Read-only */
|
||||
|
||||
/* info for fast blit mapping to other surfaces */
|
||||
struct SDL_BlitMap *map; /**< Private */
|
||||
|
||||
/* format version, bumped at every change to invalidate blit maps */
|
||||
unsigned int format_version; /**< Private */
|
||||
|
||||
/* 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
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
||||
(Uint32 flags, int width, int height, int depth,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
int pitch,
|
||||
Uint32 Rmask,
|
||||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
Uint32 Amask);
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
|
||||
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().
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
||||
int freesrc);
|
||||
|
||||
/* Convenience macro -- load a surface from a file */
|
||||
#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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
||||
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
|
||||
|
||||
/* Convenience macro -- save a surface to a file */
|
||||
#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.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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()
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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().
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
/* 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()
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
|
||||
const SDL_Rect * srcrect,
|
||||
SDL_Surface * dst,
|
||||
const SDL_Rect * dstrect);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_surface_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
244
Externals/SDL/Iinclude/SDL_syswm.h
vendored
Normal file
244
Externals/SDL/Iinclude/SDL_syswm.h
vendored
Normal file
@ -0,0 +1,244 @@
|
||||
/*
|
||||
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 <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#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 <microwin/nano-X.h>
|
||||
|
||||
/* 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 <windows.h>
|
||||
|
||||
/* 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 <sys/neutrino.h>
|
||||
#include <Ph.h>
|
||||
|
||||
/* 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: */
|
@ -1,170 +1,144 @@
|
||||
/*
|
||||
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 <process.h> /* 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: */
|
||||
/*
|
||||
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 <process.h> /* 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: */
|
128
Externals/SDL/Iinclude/SDL_timer.h
vendored
Normal file
128
Externals/SDL/Iinclude/SDL_timer.h
vendored
Normal file
@ -0,0 +1,128 @@
|
||||
/*
|
||||
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 <megastep@lokigames.com>
|
||||
*/
|
||||
|
||||
/* 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: */
|
@ -1,30 +1,24 @@
|
||||
/*
|
||||
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"
|
||||
/*
|
||||
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"
|
@ -1,155 +1,151 @@
|
||||
/*
|
||||
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: */
|
||||
/*
|
||||
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: */
|
1469
Externals/SDL/Iinclude/SDL_video.h
vendored
Normal file
1469
Externals/SDL/Iinclude/SDL_video.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,136 +1,149 @@
|
||||
/*
|
||||
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 */
|
||||
/*
|
||||
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 */
|
@ -1,38 +1,35 @@
|
||||
/*
|
||||
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 */
|
||||
/*
|
||||
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 */
|
94
Externals/SDL/Include_1.2/SDL.h
vendored
Normal file
94
Externals/SDL/Include_1.2/SDL.h
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* Main include header for the SDL library */
|
||||
|
||||
#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 "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#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_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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_H */
|
58
Externals/SDL/Include_1.2/SDL_active.h
vendored
Normal file
58
Externals/SDL/Include_1.2/SDL_active.h
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 file for SDL application focus event handling */
|
||||
|
||||
#ifndef _SDL_active_h
|
||||
#define _SDL_active_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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The available application states */
|
||||
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
|
||||
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
|
||||
#define SDL_APPACTIVE 0x04 /* The application is active */
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* This function returns the current state of the application, which is a
|
||||
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
|
||||
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
|
||||
* see your application, otherwise it has been iconified or disabled.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_active_h */
|
253
Externals/SDL/Include_1.2/SDL_audio.h
vendored
Normal file
253
Externals/SDL/Include_1.2/SDL_audio.h
vendored
Normal file
@ -0,0 +1,253 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* 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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The calculated values in this structure are calculated by SDL_OpenAudio() */
|
||||
typedef struct SDL_AudioSpec {
|
||||
int freq; /* DSP frequency -- samples per second */
|
||||
Uint16 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;
|
||||
|
||||
/* 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
|
||||
|
||||
/* Native audio byte ordering */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define AUDIO_U16SYS AUDIO_U16LSB
|
||||
#define AUDIO_S16SYS AUDIO_S16LSB
|
||||
#else
|
||||
#define AUDIO_U16SYS AUDIO_U16MSB
|
||||
#define AUDIO_S16SYS AUDIO_S16MSB
|
||||
#endif
|
||||
|
||||
|
||||
/* A structure to hold a set of audio conversion filters and buffers */
|
||||
typedef struct SDL_AudioCVT {
|
||||
int needed; /* Set to 1 if conversion possible */
|
||||
Uint16 src_format; /* Source audio format */
|
||||
Uint16 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 */
|
||||
void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
|
||||
int filter_index; /* Current audio conversion function */
|
||||
} SDL_AudioCVT;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* 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 fills the given character buffer with the name of the
|
||||
* current audio driver, and returns a pointer to it if the audio driver has
|
||||
* been initialized. It returns NULL if no driver has been initialized.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
|
||||
Uint16 src_format, Uint8 src_channels, int src_rate,
|
||||
Uint16 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);
|
||||
|
||||
/*
|
||||
* 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_UnlockAudio(void);
|
||||
|
||||
/*
|
||||
* This function shuts down audio processing and closes the audio device.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_audio_h */
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -19,5 +19,6 @@
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
/* DEPRECATED */
|
||||
#include "SDL_endian.h"
|
171
Externals/SDL/Include_1.2/SDL_cdrom.h
vendored
Normal file
171
Externals/SDL/Include_1.2/SDL_cdrom.h
vendored
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 the CD-audio control API for Simple DirectMedia Layer */
|
||||
|
||||
#ifndef _SDL_cdrom_h
|
||||
#define _SDL_cdrom_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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* In order to use these functions, SDL_Init() must have been called
|
||||
with the SDL_INIT_CDROM flag. This causes SDL to scan the system
|
||||
for CD-ROM drives, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
/* The maximum number of CD-ROM tracks on a disk */
|
||||
#define SDL_MAX_TRACKS 99
|
||||
|
||||
/* The types of CD-ROM track possible */
|
||||
#define SDL_AUDIO_TRACK 0x00
|
||||
#define SDL_DATA_TRACK 0x04
|
||||
|
||||
/* The possible states which a CD-ROM drive can be in. */
|
||||
typedef enum {
|
||||
CD_TRAYEMPTY,
|
||||
CD_STOPPED,
|
||||
CD_PLAYING,
|
||||
CD_PAUSED,
|
||||
CD_ERROR = -1
|
||||
} CDstatus;
|
||||
|
||||
/* Given a status, returns true if there's a disk in the drive */
|
||||
#define CD_INDRIVE(status) ((int)(status) > 0)
|
||||
|
||||
typedef struct SDL_CDtrack {
|
||||
Uint8 id; /* Track number */
|
||||
Uint8 type; /* Data or audio track */
|
||||
Uint16 unused;
|
||||
Uint32 length; /* Length, in frames, of this track */
|
||||
Uint32 offset; /* Offset, in frames, from start of disk */
|
||||
} SDL_CDtrack;
|
||||
|
||||
/* This structure is only current as of the last call to SDL_CDStatus() */
|
||||
typedef struct SDL_CD {
|
||||
int id; /* Private drive identifier */
|
||||
CDstatus status; /* Current drive status */
|
||||
|
||||
/* The rest of this structure is only valid if there's a CD in drive */
|
||||
int numtracks; /* Number of tracks on disk */
|
||||
int cur_track; /* Current track position */
|
||||
int cur_frame; /* Current frame offset within current track */
|
||||
SDL_CDtrack track[SDL_MAX_TRACKS+1];
|
||||
} SDL_CD;
|
||||
|
||||
/* Conversion functions from frames to Minute/Second/Frames and vice versa */
|
||||
#define CD_FPS 75
|
||||
#define FRAMES_TO_MSF(f, M,S,F) { \
|
||||
int value = f; \
|
||||
*(F) = value%CD_FPS; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = value%60; \
|
||||
value /= 60; \
|
||||
*(M) = value; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
|
||||
|
||||
/* CD-audio API functions: */
|
||||
|
||||
/* Returns the number of CD-ROM drives on the system, or -1 if
|
||||
SDL_Init() has not been called with the SDL_INIT_CDROM flag.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
|
||||
|
||||
/* Returns a human-readable, system-dependent identifier for the CD-ROM.
|
||||
Example:
|
||||
"/dev/cdrom"
|
||||
"E:"
|
||||
"/dev/disk/ide/1/master"
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
|
||||
|
||||
/* Opens a CD-ROM drive for access. It returns a drive handle on success,
|
||||
or NULL if the drive was invalid or busy. This newly opened CD-ROM
|
||||
becomes the default CD used when other CD functions are passed a NULL
|
||||
CD-ROM handle.
|
||||
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
|
||||
*/
|
||||
extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
|
||||
|
||||
/* This function returns the current status of the given drive.
|
||||
If the drive has a CD in it, the table of contents of the CD and current
|
||||
play position of the CD will be stored in the SDL_CD structure.
|
||||
*/
|
||||
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
|
||||
|
||||
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
|
||||
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
|
||||
until the end of the CD. This function will skip data tracks.
|
||||
This function should only be called after calling SDL_CDStatus() to
|
||||
get track information about the CD.
|
||||
For example:
|
||||
// Play entire CD:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
|
||||
// Play last track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
|
||||
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
|
||||
}
|
||||
// Play first and second track and 10 seconds of third track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
|
||||
|
||||
This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
|
||||
int start_track, int start_frame, int ntracks, int nframes);
|
||||
|
||||
/* Play the given CD starting at 'start' frame for 'length' frames.
|
||||
It returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
|
||||
|
||||
/* Pause play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
|
||||
|
||||
/* Resume play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
|
||||
|
||||
/* Stop play -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
|
||||
|
||||
/* Eject CD-ROM -- returns 0, or -1 on error */
|
||||
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
|
||||
|
||||
/* Closes the handle for the CD-ROM drive */
|
||||
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_video_h */
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -19,25 +19,27 @@
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_diskaudio_h
|
||||
#define _SDL_diskaudio_h
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
#include "SDL_rwops.h"
|
||||
#include "../SDL_sysaudio.h"
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Hidden "this" pointer for the audio functions */
|
||||
#define _THIS SDL_AudioDevice *this
|
||||
/* Add any platform that doesn't build using the configure system */
|
||||
#if defined(__DREAMCAST__)
|
||||
#include "SDL_config_dreamcast.h"
|
||||
#elif defined(__MACOS__)
|
||||
#include "SDL_config_macos.h"
|
||||
#elif defined(__MACOSX__)
|
||||
#include "SDL_config_macosx.h"
|
||||
#elif defined(__SYMBIAN32__)
|
||||
#include "SDL_config_symbian.h" /* must be before win32! */
|
||||
#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 */
|
||||
|
||||
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: */
|
||||
#endif /* _SDL_config_h */
|
306
Externals/SDL/Include_1.2/SDL_config.h.in
vendored
Normal file
306
Externals/SDL/Include_1.2/SDL_config.h.in
vendored
Normal file
@ -0,0 +1,306 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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_ICONV
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
#undef HAVE_CLOCK_GETTIME
|
||||
#undef HAVE_DLVSYM
|
||||
#undef HAVE_GETPAGESIZE
|
||||
#undef HAVE_MPROTECT
|
||||
|
||||
#else
|
||||
/* We may need some replacement for stdarg.h here */
|
||||
#include <stdarg.h>
|
||||
#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_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_BAUDIO
|
||||
#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_PULSE
|
||||
#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
|
||||
#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_OSS
|
||||
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
|
||||
#undef SDL_AUDIO_DRIVER_PAUD
|
||||
#undef SDL_AUDIO_DRIVER_QNXNTO
|
||||
#undef SDL_AUDIO_DRIVER_SNDMGR
|
||||
#undef SDL_AUDIO_DRIVER_SUNAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_WAVEOUT
|
||||
|
||||
/* 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_MACOS
|
||||
#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_DUMMY
|
||||
#undef SDL_JOYSTICK_IOKIT
|
||||
#undef SDL_JOYSTICK_LINUX
|
||||
#undef SDL_JOYSTICK_MACOS
|
||||
#undef SDL_JOYSTICK_MINT
|
||||
#undef SDL_JOYSTICK_OS2
|
||||
#undef SDL_JOYSTICK_RISCOS
|
||||
#undef SDL_JOYSTICK_WINMM
|
||||
#undef SDL_JOYSTICK_USBHID
|
||||
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
|
||||
|
||||
/* 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_MACOS
|
||||
#undef SDL_LOADSO_OS2
|
||||
#undef SDL_LOADSO_WIN32
|
||||
|
||||
/* Enable various threading systems */
|
||||
#undef SDL_THREAD_BEOS
|
||||
#undef SDL_THREAD_DC
|
||||
#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_MACOS
|
||||
#undef SDL_TIMER_MINT
|
||||
#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_AALIB
|
||||
#undef SDL_VIDEO_DRIVER_BWINDOW
|
||||
#undef SDL_VIDEO_DRIVER_DC
|
||||
#undef SDL_VIDEO_DRIVER_DDRAW
|
||||
#undef SDL_VIDEO_DRIVER_DGA
|
||||
#undef SDL_VIDEO_DRIVER_DIRECTFB
|
||||
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
|
||||
#undef SDL_VIDEO_DRIVER_DUMMY
|
||||
#undef SDL_VIDEO_DRIVER_FBCON
|
||||
#undef SDL_VIDEO_DRIVER_GAPI
|
||||
#undef SDL_VIDEO_DRIVER_GEM
|
||||
#undef SDL_VIDEO_DRIVER_GGI
|
||||
#undef SDL_VIDEO_DRIVER_IPOD
|
||||
#undef SDL_VIDEO_DRIVER_NANOX
|
||||
#undef SDL_VIDEO_DRIVER_OS2FS
|
||||
#undef SDL_VIDEO_DRIVER_PHOTON
|
||||
#undef SDL_VIDEO_DRIVER_PICOGUI
|
||||
#undef SDL_VIDEO_DRIVER_PS2GS
|
||||
#undef SDL_VIDEO_DRIVER_QTOPIA
|
||||
#undef SDL_VIDEO_DRIVER_QUARTZ
|
||||
#undef SDL_VIDEO_DRIVER_RISCOS
|
||||
#undef SDL_VIDEO_DRIVER_SVGALIB
|
||||
#undef SDL_VIDEO_DRIVER_TOOLBOX
|
||||
#undef SDL_VIDEO_DRIVER_VGL
|
||||
#undef SDL_VIDEO_DRIVER_WINDIB
|
||||
#undef SDL_VIDEO_DRIVER_WSCONS
|
||||
#undef SDL_VIDEO_DRIVER_X11
|
||||
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
|
||||
#undef SDL_VIDEO_DRIVER_X11_DPMS
|
||||
#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_VIDMODE
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
|
||||
#undef SDL_VIDEO_DRIVER_X11_XME
|
||||
#undef SDL_VIDEO_DRIVER_X11_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_XV
|
||||
#undef SDL_VIDEO_DRIVER_XBIOS
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#undef SDL_VIDEO_OPENGL
|
||||
#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_HERMES_BLITTERS
|
||||
#undef SDL_ALTIVEC_BLITTERS
|
||||
|
||||
#endif /* _SDL_config_h */
|
106
Externals/SDL/Include_1.2/SDL_config_dreamcast.h
vendored
Normal file
106
Externals/SDL/Include_1.2/SDL_config_dreamcast.h
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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_dreamcast_h
|
||||
#define _SDL_config_dreamcast_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
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;
|
||||
typedef unsigned long uintptr_t;
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_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_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_STRDUP 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 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_STRCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DC 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_DC 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DC 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DUMMY 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_DC 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_DC 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DC 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_dreamcast_h */
|
112
Externals/SDL/Include_1.2/SDL_config_macos.h
vendored
Normal file
112
Externals/SDL/Include_1.2/SDL_config_macos.h
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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_macos_h
|
||||
#define _SDL_config_macos_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#include <MacTypes.h>
|
||||
|
||||
typedef SInt8 int8_t;
|
||||
typedef UInt8 uint8_t;
|
||||
typedef SInt16 int16_t;
|
||||
typedef UInt16 uint16_t;
|
||||
typedef SInt32 int32_t;
|
||||
typedef UInt32 uint32_t;
|
||||
typedef SInt64 int64_t;
|
||||
typedef UInt64 uint64_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* 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
|
||||
#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_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_SNDMGR 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#if TARGET_API_MAC_CARBON
|
||||
#define SDL_CDROM_DUMMY 1
|
||||
#else
|
||||
#define SDL_CDROM_MACOS 1
|
||||
#endif
|
||||
|
||||
/* Enable various input drivers */
|
||||
#if TARGET_API_MAC_CARBON
|
||||
#define SDL_JOYSTICK_DUMMY 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_MACOS 1
|
||||
#endif
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_MACOS 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_MACOS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
|
||||
#define SDL_VIDEO_DRIVER_TOOLBOX 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
|
||||
#endif /* _SDL_config_macos_h */
|
135
Externals/SDL/Include_1.2/SDL_config_macosx.h
vendored
Normal file
135
Externals/SDL/Include_1.2/SDL_config_macosx.h
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 <AvailabilityMacros.h>
|
||||
|
||||
/* 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
|
||||
|
||||
/* 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_DUMMY 1
|
||||
#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
|
||||
#define SDL_VIDEO_DRIVER_TOOLBOX 1
|
||||
#else
|
||||
#define SDL_VIDEO_DRIVER_QUARTZ 1
|
||||
#endif
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
|
||||
/* Enable assembly routines */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
#ifdef __ppc__
|
||||
#define SDL_ALTIVEC_BLITTERS 1
|
||||
#endif
|
||||
|
||||
#endif /* _SDL_config_macosx_h */
|
62
Externals/SDL/Include_1.2/SDL_config_minimal.h
vendored
Normal file
62
Externals/SDL/Include_1.2/SDL_config_minimal.h
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 <stdarg.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;
|
||||
|
||||
/* 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 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 */
|
@ -1,120 +1,115 @@
|
||||
/*
|
||||
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"
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#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_STRLEN 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_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_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_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
|
||||
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_OSS 1
|
||||
|
||||
#define SDL_INPUT_LINUXEV 1
|
||||
#define SDL_INPUT_TSLIB 1
|
||||
#define SDL_JOYSTICK_LINUX 1
|
||||
#define SDL_HAPTIC_LINUX 1
|
||||
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
|
||||
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_X11 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XINPUT 1
|
||||
#define SDL_VIDEO_DRIVER_PANDORA 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
|
||||
#endif /* _SDL_config_h */
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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_nds_h
|
||||
#define _SDL_config_nds_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* C datatypes */
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Endianness */
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 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_ICONV_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_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_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_SETJMP 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_NDS 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_NDS 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 various timer systems */
|
||||
#define SDL_TIMER_NDS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_NDS 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_nds_h */
|
141
Externals/SDL/Include_1.2/SDL_config_os2.h
vendored
Normal file
141
Externals/SDL/Include_1.2/SDL_config_os2.h
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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_os2_h
|
||||
#define _SDL_config_os2_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
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;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Use Watcom's LIBC */
|
||||
#define HAVE_LIBC 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_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__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE__STRLWR 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE__LTOA 1
|
||||
#define HAVE__UITOA 1
|
||||
#define HAVE__ULTOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE__I64TOA 1
|
||||
#define HAVE__UI64TOA 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_STRCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DART 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_OS2 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_OS2 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_OS2 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_OS2 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_OS2 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_OS2FS 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
/* Nothing here yet for OS/2... :( */
|
||||
|
||||
/* Enable assembly routines where available */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
|
||||
#endif /* _SDL_config_os2_h */
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2006 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -27,23 +27,22 @@
|
||||
|
||||
/* 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;
|
||||
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;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#endif
|
||||
@ -54,7 +53,7 @@ typedef unsigned int uintptr_t;
|
||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
||||
#define LONG_PTR LONG
|
||||
#endif
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
@ -69,17 +68,10 @@ 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
|
||||
#define HAVE_LIBC 1
|
||||
#ifdef HAVE_LIBC
|
||||
/* Useful headers */
|
||||
#define HAVE_STDIO_H 1
|
||||
@ -124,19 +116,6 @@ typedef unsigned int uintptr_t;
|
||||
#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
|
||||
@ -146,17 +125,22 @@ typedef unsigned int uintptr_t;
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
||||
#endif
|
||||
#define SDL_AUDIO_DRIVER_WINWAVEOUT 1
|
||||
#define SDL_AUDIO_DRIVER_WAVEOUT 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
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_DINPUT 1
|
||||
#define SDL_HAPTIC_DINPUT 1
|
||||
#define SDL_JOYSTICK_WINMM 1
|
||||
#endif
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
@ -173,22 +157,21 @@ typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
|
||||
/* Enable various video drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_VIDEO_DRIVER_GAPI 1
|
||||
#endif
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_VIDEO_DRIVER_DDRAW 1
|
||||
#endif
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_WIN32 1
|
||||
|
||||
#define SDL_VIDEO_RENDER_D3D 1
|
||||
#define SDL_VIDEO_RENDER_GDI 1
|
||||
#define SDL_VIDEO_DRIVER_WINDIB 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
|
@ -1,26 +1,22 @@
|
||||
/*
|
||||
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"
|
||||
|
||||
extern void PND_PumpEvents(_THIS);
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
75
Externals/SDL/Include_1.2/SDL_cpuinfo.h
vendored
Normal file
75
Externals/SDL/Include_1.2/SDL_cpuinfo.h
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* 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
|
||||
extern "C" {
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_cpuinfo_h */
|
194
Externals/SDL/Include_1.2/SDL_endian.h
vendored
Normal file
194
Externals/SDL/Include_1.2/SDL_endian.h
vendored
Normal file
@ -0,0 +1,194 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* 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
|
||||
extern "C" {
|
||||
#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__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
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__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
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 */
|
||||
|
||||
|
||||
/* 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_SwapBE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapBE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapBE64(X) SDL_Swap64(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_SwapBE16(X) (X)
|
||||
#define SDL_SwapBE32(X) (X)
|
||||
#define SDL_SwapBE64(X) (X)
|
||||
#endif
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_endian_h */
|
61
Externals/SDL/Include_1.2/SDL_error.h
vendored
Normal file
61
Externals/SDL/Include_1.2/SDL_error.h
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* 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
|
||||
extern "C" {
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_error_h */
|
337
Externals/SDL/Include_1.2/SDL_events.h
vendored
Normal file
337
Externals/SDL/Include_1.2/SDL_events.h
vendored
Normal file
@ -0,0 +1,337 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 file for SDL event handling */
|
||||
|
||||
#ifndef _SDL_events_h
|
||||
#define _SDL_events_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_active.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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* General keyboard/mouse state definitions */
|
||||
#define SDL_RELEASED 0
|
||||
#define SDL_PRESSED 1
|
||||
|
||||
/* Event enumerations */
|
||||
typedef enum {
|
||||
SDL_NOEVENT = 0, /* Unused (do not remove) */
|
||||
SDL_ACTIVEEVENT, /* Application loses/gains visibility */
|
||||
SDL_KEYDOWN, /* Keys pressed */
|
||||
SDL_KEYUP, /* Keys released */
|
||||
SDL_MOUSEMOTION, /* Mouse moved */
|
||||
SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */
|
||||
SDL_MOUSEBUTTONUP, /* Mouse button released */
|
||||
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_EVENT_RESERVEDA, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVEDB, /* Reserved for future use.. */
|
||||
SDL_VIDEORESIZE, /* User resized video mode */
|
||||
SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */
|
||||
SDL_EVENT_RESERVED2, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED3, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED4, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED5, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED6, /* Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED7, /* 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;
|
||||
|
||||
/* Predefined event masks */
|
||||
#define SDL_EVENTMASK(X) (1<<(X))
|
||||
typedef enum {
|
||||
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
|
||||
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
|
||||
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
|
||||
SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
|
||||
SDL_EVENTMASK(SDL_KEYUP),
|
||||
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
|
||||
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
|
||||
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
|
||||
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_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
|
||||
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
|
||||
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
|
||||
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
|
||||
} SDL_EventMask ;
|
||||
#define SDL_ALLEVENTS 0xFFFFFFFF
|
||||
|
||||
/* Application visibility event structure */
|
||||
typedef struct SDL_ActiveEvent {
|
||||
Uint8 type; /* SDL_ACTIVEEVENT */
|
||||
Uint8 gain; /* Whether given states were gained or lost (1/0) */
|
||||
Uint8 state; /* A mask of the focus states */
|
||||
} SDL_ActiveEvent;
|
||||
|
||||
/* Keyboard event structure */
|
||||
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;
|
||||
} SDL_KeyboardEvent;
|
||||
|
||||
/* Mouse motion event structure */
|
||||
typedef struct SDL_MouseMotionEvent {
|
||||
Uint8 type; /* SDL_MOUSEMOTION */
|
||||
Uint8 which; /* The mouse device index */
|
||||
Uint8 state; /* The current button state */
|
||||
Uint16 x, y; /* The X/Y coordinates of the mouse */
|
||||
Sint16 xrel; /* The relative motion in the X direction */
|
||||
Sint16 yrel; /* The relative motion in the Y direction */
|
||||
} SDL_MouseMotionEvent;
|
||||
|
||||
/* Mouse button event structure */
|
||||
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 */
|
||||
Uint16 x, y; /* The X/Y coordinates of the mouse at press time */
|
||||
} SDL_MouseButtonEvent;
|
||||
|
||||
/* Joystick axis motion event structure */
|
||||
typedef struct SDL_JoyAxisEvent {
|
||||
Uint8 type; /* SDL_JOYAXISMOTION */
|
||||
Uint8 which; /* The joystick device index */
|
||||
Uint8 axis; /* The joystick axis index */
|
||||
Sint16 value; /* The axis value (range: -32768 to 32767) */
|
||||
} SDL_JoyAxisEvent;
|
||||
|
||||
/* Joystick trackball motion event structure */
|
||||
typedef struct SDL_JoyBallEvent {
|
||||
Uint8 type; /* SDL_JOYBALLMOTION */
|
||||
Uint8 which; /* The joystick device index */
|
||||
Uint8 ball; /* The joystick trackball index */
|
||||
Sint16 xrel; /* The relative motion in the X direction */
|
||||
Sint16 yrel; /* The relative motion in the Y direction */
|
||||
} SDL_JoyBallEvent;
|
||||
|
||||
/* Joystick hat position change event structure */
|
||||
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;
|
||||
|
||||
/* Joystick button event structure */
|
||||
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;
|
||||
|
||||
/* The "window resized" event
|
||||
When you get this event, you are responsible for setting a new video
|
||||
mode with the new width and height.
|
||||
*/
|
||||
typedef struct SDL_ResizeEvent {
|
||||
Uint8 type; /* SDL_VIDEORESIZE */
|
||||
int w; /* New width */
|
||||
int h; /* New height */
|
||||
} SDL_ResizeEvent;
|
||||
|
||||
/* The "screen redraw" event */
|
||||
typedef struct SDL_ExposeEvent {
|
||||
Uint8 type; /* SDL_VIDEOEXPOSE */
|
||||
} SDL_ExposeEvent;
|
||||
|
||||
/* The "quit requested" event */
|
||||
typedef struct SDL_QuitEvent {
|
||||
Uint8 type; /* SDL_QUIT */
|
||||
} SDL_QuitEvent;
|
||||
|
||||
/* A user-defined event type */
|
||||
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_UserEvent;
|
||||
|
||||
/* 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_SysWMmsg *msg;
|
||||
} SDL_SysWMEvent;
|
||||
|
||||
/* General event structure */
|
||||
typedef union SDL_Event {
|
||||
Uint8 type;
|
||||
SDL_ActiveEvent active;
|
||||
SDL_KeyboardEvent key;
|
||||
SDL_MouseMotionEvent motion;
|
||||
SDL_MouseButtonEvent button;
|
||||
SDL_JoyAxisEvent jaxis;
|
||||
SDL_JoyBallEvent jball;
|
||||
SDL_JoyHatEvent jhat;
|
||||
SDL_JoyButtonEvent jbutton;
|
||||
SDL_ResizeEvent resize;
|
||||
SDL_ExposeEvent expose;
|
||||
SDL_QuitEvent quit;
|
||||
SDL_UserEvent user;
|
||||
SDL_SysWMEvent syswm;
|
||||
} 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);
|
||||
|
||||
/* 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 0 on success, 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)(const 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);
|
||||
|
||||
/*
|
||||
Return the current event filter - can be used to "chain" filters.
|
||||
If there is no event filter set, this function returns NULL.
|
||||
*/
|
||||
extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
|
||||
|
||||
/*
|
||||
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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_events_h */
|
24
Externals/SDL/Include_1.2/SDL_getenv.h
vendored
Normal file
24
Externals/SDL/Include_1.2/SDL_getenv.h
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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"
|
167
Externals/SDL/Include_1.2/SDL_joystick.h
vendored
Normal file
167
Externals/SDL/Include_1.2/SDL_joystick.h
vendored
Normal file
@ -0,0 +1,167 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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
|
||||
extern "C" {
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_joystick_h */
|
121
Externals/SDL/Include_1.2/SDL_keyboard.h
vendored
Normal file
121
Externals/SDL/Include_1.2/SDL_keyboard.h
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Keysym structure
|
||||
- The scancode is hardware dependent, and should not be used by general
|
||||
applications. If no hardware scancode is available, it will be 0.
|
||||
|
||||
- The 'unicode' translated character is only available when character
|
||||
translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
|
||||
this is a UNICODE character corresponding to the keypress. If the
|
||||
high 9 bits of the character are 0, then this maps to the equivalent
|
||||
ASCII character:
|
||||
char ch;
|
||||
if ( (keysym.unicode & 0xFF80) == 0 ) {
|
||||
ch = keysym.unicode & 0x7F;
|
||||
} else {
|
||||
An international character..
|
||||
}
|
||||
*/
|
||||
typedef struct SDL_keysym {
|
||||
Uint8 scancode; /* hardware specific scancode */
|
||||
SDLKey sym; /* SDL virtual keysym */
|
||||
SDLMod mod; /* current key modifiers */
|
||||
Uint16 unicode; /* translated character */
|
||||
} SDL_keysym;
|
||||
|
||||
/* This is the mask which refers to all hotkey bindings */
|
||||
#define SDL_ALL_HOTKEYS 0xFFFFFFFF
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* Enable/Disable UNICODE translation of keyboard input.
|
||||
* This translation has some overhead, so translation defaults off.
|
||||
* If 'enable' is 1, translation is enabled.
|
||||
* If 'enable' is 0, translation is disabled.
|
||||
* If 'enable' is -1, the translation state is not changed.
|
||||
* It returns the previous state of keyboard translation.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
|
||||
|
||||
/*
|
||||
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
|
||||
* 'delay' is the initial delay in ms between the time when a key is
|
||||
* pressed, and keyboard repeat begins.
|
||||
* 'interval' is the time in ms between keyboard repeat events.
|
||||
*/
|
||||
#define SDL_DEFAULT_REPEAT_DELAY 500
|
||||
#define SDL_DEFAULT_REPEAT_INTERVAL 30
|
||||
/*
|
||||
* If 'delay' is set to 0, keyboard repeat is disabled.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
|
||||
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
|
||||
|
||||
/*
|
||||
* Get a snapshot of the current state of the keyboard.
|
||||
* Returns an array of keystates, indexed by the SDLK_* syms.
|
||||
* Used:
|
||||
* Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
|
||||
*/
|
||||
extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
|
||||
|
||||
/*
|
||||
* Get the current key modifier state
|
||||
*/
|
||||
extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
|
||||
|
||||
/*
|
||||
* Set the current key modifier state
|
||||
* This does not change the keyboard state, only the key modifier flags.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
|
||||
|
||||
/*
|
||||
* Get the name of an SDL virtual keysym
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_keyboard_h */
|
311
Externals/SDL/Include_1.2/SDL_keysym.h
vendored
Normal file
311
Externals/SDL/Include_1.2/SDL_keysym.h
vendored
Normal file
@ -0,0 +1,311 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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_keysym_h
|
||||
#define _SDL_keysym_h
|
||||
|
||||
/* What we really want is a mapping of every raw key on the keyboard.
|
||||
To support international keyboards, we use the range 0xA1 - 0xFF
|
||||
as international virtual keycodes. We'll follow in the footsteps of X11...
|
||||
The names of the keys
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
/* The keyboard syms have been cleverly chosen to map to ASCII */
|
||||
SDLK_UNKNOWN = 0,
|
||||
SDLK_FIRST = 0,
|
||||
SDLK_BACKSPACE = 8,
|
||||
SDLK_TAB = 9,
|
||||
SDLK_CLEAR = 12,
|
||||
SDLK_RETURN = 13,
|
||||
SDLK_PAUSE = 19,
|
||||
SDLK_ESCAPE = 27,
|
||||
SDLK_SPACE = 32,
|
||||
SDLK_EXCLAIM = 33,
|
||||
SDLK_QUOTEDBL = 34,
|
||||
SDLK_HASH = 35,
|
||||
SDLK_DOLLAR = 36,
|
||||
SDLK_AMPERSAND = 38,
|
||||
SDLK_QUOTE = 39,
|
||||
SDLK_LEFTPAREN = 40,
|
||||
SDLK_RIGHTPAREN = 41,
|
||||
SDLK_ASTERISK = 42,
|
||||
SDLK_PLUS = 43,
|
||||
SDLK_COMMA = 44,
|
||||
SDLK_MINUS = 45,
|
||||
SDLK_PERIOD = 46,
|
||||
SDLK_SLASH = 47,
|
||||
SDLK_0 = 48,
|
||||
SDLK_1 = 49,
|
||||
SDLK_2 = 50,
|
||||
SDLK_3 = 51,
|
||||
SDLK_4 = 52,
|
||||
SDLK_5 = 53,
|
||||
SDLK_6 = 54,
|
||||
SDLK_7 = 55,
|
||||
SDLK_8 = 56,
|
||||
SDLK_9 = 57,
|
||||
SDLK_COLON = 58,
|
||||
SDLK_SEMICOLON = 59,
|
||||
SDLK_LESS = 60,
|
||||
SDLK_EQUALS = 61,
|
||||
SDLK_GREATER = 62,
|
||||
SDLK_QUESTION = 63,
|
||||
SDLK_AT = 64,
|
||||
/*
|
||||
Skip uppercase letters
|
||||
*/
|
||||
SDLK_LEFTBRACKET = 91,
|
||||
SDLK_BACKSLASH = 92,
|
||||
SDLK_RIGHTBRACKET = 93,
|
||||
SDLK_CARET = 94,
|
||||
SDLK_UNDERSCORE = 95,
|
||||
SDLK_BACKQUOTE = 96,
|
||||
SDLK_a = 97,
|
||||
SDLK_b = 98,
|
||||
SDLK_c = 99,
|
||||
SDLK_d = 100,
|
||||
SDLK_e = 101,
|
||||
SDLK_f = 102,
|
||||
SDLK_g = 103,
|
||||
SDLK_h = 104,
|
||||
SDLK_i = 105,
|
||||
SDLK_j = 106,
|
||||
SDLK_k = 107,
|
||||
SDLK_l = 108,
|
||||
SDLK_m = 109,
|
||||
SDLK_n = 110,
|
||||
SDLK_o = 111,
|
||||
SDLK_p = 112,
|
||||
SDLK_q = 113,
|
||||
SDLK_r = 114,
|
||||
SDLK_s = 115,
|
||||
SDLK_t = 116,
|
||||
SDLK_u = 117,
|
||||
SDLK_v = 118,
|
||||
SDLK_w = 119,
|
||||
SDLK_x = 120,
|
||||
SDLK_y = 121,
|
||||
SDLK_z = 122,
|
||||
SDLK_DELETE = 127,
|
||||
/* End of ASCII mapped keysyms */
|
||||
|
||||
/* International keyboard syms */
|
||||
SDLK_WORLD_0 = 160, /* 0xA0 */
|
||||
SDLK_WORLD_1 = 161,
|
||||
SDLK_WORLD_2 = 162,
|
||||
SDLK_WORLD_3 = 163,
|
||||
SDLK_WORLD_4 = 164,
|
||||
SDLK_WORLD_5 = 165,
|
||||
SDLK_WORLD_6 = 166,
|
||||
SDLK_WORLD_7 = 167,
|
||||
SDLK_WORLD_8 = 168,
|
||||
SDLK_WORLD_9 = 169,
|
||||
SDLK_WORLD_10 = 170,
|
||||
SDLK_WORLD_11 = 171,
|
||||
SDLK_WORLD_12 = 172,
|
||||
SDLK_WORLD_13 = 173,
|
||||
SDLK_WORLD_14 = 174,
|
||||
SDLK_WORLD_15 = 175,
|
||||
SDLK_WORLD_16 = 176,
|
||||
SDLK_WORLD_17 = 177,
|
||||
SDLK_WORLD_18 = 178,
|
||||
SDLK_WORLD_19 = 179,
|
||||
SDLK_WORLD_20 = 180,
|
||||
SDLK_WORLD_21 = 181,
|
||||
SDLK_WORLD_22 = 182,
|
||||
SDLK_WORLD_23 = 183,
|
||||
SDLK_WORLD_24 = 184,
|
||||
SDLK_WORLD_25 = 185,
|
||||
SDLK_WORLD_26 = 186,
|
||||
SDLK_WORLD_27 = 187,
|
||||
SDLK_WORLD_28 = 188,
|
||||
SDLK_WORLD_29 = 189,
|
||||
SDLK_WORLD_30 = 190,
|
||||
SDLK_WORLD_31 = 191,
|
||||
SDLK_WORLD_32 = 192,
|
||||
SDLK_WORLD_33 = 193,
|
||||
SDLK_WORLD_34 = 194,
|
||||
SDLK_WORLD_35 = 195,
|
||||
SDLK_WORLD_36 = 196,
|
||||
SDLK_WORLD_37 = 197,
|
||||
SDLK_WORLD_38 = 198,
|
||||
SDLK_WORLD_39 = 199,
|
||||
SDLK_WORLD_40 = 200,
|
||||
SDLK_WORLD_41 = 201,
|
||||
SDLK_WORLD_42 = 202,
|
||||
SDLK_WORLD_43 = 203,
|
||||
SDLK_WORLD_44 = 204,
|
||||
SDLK_WORLD_45 = 205,
|
||||
SDLK_WORLD_46 = 206,
|
||||
SDLK_WORLD_47 = 207,
|
||||
SDLK_WORLD_48 = 208,
|
||||
SDLK_WORLD_49 = 209,
|
||||
SDLK_WORLD_50 = 210,
|
||||
SDLK_WORLD_51 = 211,
|
||||
SDLK_WORLD_52 = 212,
|
||||
SDLK_WORLD_53 = 213,
|
||||
SDLK_WORLD_54 = 214,
|
||||
SDLK_WORLD_55 = 215,
|
||||
SDLK_WORLD_56 = 216,
|
||||
SDLK_WORLD_57 = 217,
|
||||
SDLK_WORLD_58 = 218,
|
||||
SDLK_WORLD_59 = 219,
|
||||
SDLK_WORLD_60 = 220,
|
||||
SDLK_WORLD_61 = 221,
|
||||
SDLK_WORLD_62 = 222,
|
||||
SDLK_WORLD_63 = 223,
|
||||
SDLK_WORLD_64 = 224,
|
||||
SDLK_WORLD_65 = 225,
|
||||
SDLK_WORLD_66 = 226,
|
||||
SDLK_WORLD_67 = 227,
|
||||
SDLK_WORLD_68 = 228,
|
||||
SDLK_WORLD_69 = 229,
|
||||
SDLK_WORLD_70 = 230,
|
||||
SDLK_WORLD_71 = 231,
|
||||
SDLK_WORLD_72 = 232,
|
||||
SDLK_WORLD_73 = 233,
|
||||
SDLK_WORLD_74 = 234,
|
||||
SDLK_WORLD_75 = 235,
|
||||
SDLK_WORLD_76 = 236,
|
||||
SDLK_WORLD_77 = 237,
|
||||
SDLK_WORLD_78 = 238,
|
||||
SDLK_WORLD_79 = 239,
|
||||
SDLK_WORLD_80 = 240,
|
||||
SDLK_WORLD_81 = 241,
|
||||
SDLK_WORLD_82 = 242,
|
||||
SDLK_WORLD_83 = 243,
|
||||
SDLK_WORLD_84 = 244,
|
||||
SDLK_WORLD_85 = 245,
|
||||
SDLK_WORLD_86 = 246,
|
||||
SDLK_WORLD_87 = 247,
|
||||
SDLK_WORLD_88 = 248,
|
||||
SDLK_WORLD_89 = 249,
|
||||
SDLK_WORLD_90 = 250,
|
||||
SDLK_WORLD_91 = 251,
|
||||
SDLK_WORLD_92 = 252,
|
||||
SDLK_WORLD_93 = 253,
|
||||
SDLK_WORLD_94 = 254,
|
||||
SDLK_WORLD_95 = 255, /* 0xFF */
|
||||
|
||||
/* Numeric keypad */
|
||||
SDLK_KP0 = 256,
|
||||
SDLK_KP1 = 257,
|
||||
SDLK_KP2 = 258,
|
||||
SDLK_KP3 = 259,
|
||||
SDLK_KP4 = 260,
|
||||
SDLK_KP5 = 261,
|
||||
SDLK_KP6 = 262,
|
||||
SDLK_KP7 = 263,
|
||||
SDLK_KP8 = 264,
|
||||
SDLK_KP9 = 265,
|
||||
SDLK_KP_PERIOD = 266,
|
||||
SDLK_KP_DIVIDE = 267,
|
||||
SDLK_KP_MULTIPLY = 268,
|
||||
SDLK_KP_MINUS = 269,
|
||||
SDLK_KP_PLUS = 270,
|
||||
SDLK_KP_ENTER = 271,
|
||||
SDLK_KP_EQUALS = 272,
|
||||
|
||||
/* Arrows + Home/End pad */
|
||||
SDLK_UP = 273,
|
||||
SDLK_DOWN = 274,
|
||||
SDLK_RIGHT = 275,
|
||||
SDLK_LEFT = 276,
|
||||
SDLK_INSERT = 277,
|
||||
SDLK_HOME = 278,
|
||||
SDLK_END = 279,
|
||||
SDLK_PAGEUP = 280,
|
||||
SDLK_PAGEDOWN = 281,
|
||||
|
||||
/* Function keys */
|
||||
SDLK_F1 = 282,
|
||||
SDLK_F2 = 283,
|
||||
SDLK_F3 = 284,
|
||||
SDLK_F4 = 285,
|
||||
SDLK_F5 = 286,
|
||||
SDLK_F6 = 287,
|
||||
SDLK_F7 = 288,
|
||||
SDLK_F8 = 289,
|
||||
SDLK_F9 = 290,
|
||||
SDLK_F10 = 291,
|
||||
SDLK_F11 = 292,
|
||||
SDLK_F12 = 293,
|
||||
SDLK_F13 = 294,
|
||||
SDLK_F14 = 295,
|
||||
SDLK_F15 = 296,
|
||||
|
||||
/* Key state modifier keys */
|
||||
SDLK_NUMLOCK = 300,
|
||||
SDLK_CAPSLOCK = 301,
|
||||
SDLK_SCROLLOCK = 302,
|
||||
SDLK_RSHIFT = 303,
|
||||
SDLK_LSHIFT = 304,
|
||||
SDLK_RCTRL = 305,
|
||||
SDLK_LCTRL = 306,
|
||||
SDLK_RALT = 307,
|
||||
SDLK_LALT = 308,
|
||||
SDLK_RMETA = 309,
|
||||
SDLK_LMETA = 310,
|
||||
SDLK_LSUPER = 311, /* Left "Windows" key */
|
||||
SDLK_RSUPER = 312, /* Right "Windows" key */
|
||||
SDLK_MODE = 313, /* "Alt Gr" key */
|
||||
SDLK_COMPOSE = 314, /* Multi-key compose key */
|
||||
|
||||
/* Miscellaneous function keys */
|
||||
SDLK_HELP = 315,
|
||||
SDLK_PRINT = 316,
|
||||
SDLK_SYSREQ = 317,
|
||||
SDLK_BREAK = 318,
|
||||
SDLK_MENU = 319,
|
||||
SDLK_POWER = 320, /* Power Macintosh power key */
|
||||
SDLK_EURO = 321, /* Some european keyboards */
|
||||
SDLK_UNDO = 322, /* Atari keyboard has Undo */
|
||||
|
||||
/* Add any other keys here */
|
||||
|
||||
SDLK_LAST
|
||||
} SDLKey;
|
||||
|
||||
/* 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_LMETA = 0x0400,
|
||||
KMOD_RMETA = 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_META (KMOD_LMETA|KMOD_RMETA)
|
||||
|
||||
#endif /* _SDL_keysym_h */
|
74
Externals/SDL/Include_1.2/SDL_loadso.h
vendored
Normal file
74
Externals/SDL/Include_1.2/SDL_loadso.h
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* 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
|
||||
extern "C" {
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_loadso_h */
|
98
Externals/SDL/Include_1.2/SDL_main.h
vendored
Normal file
98
Externals/SDL/Include_1.2/SDL_main.h
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 Win32 and MacOS so that it is called by winmain.c */
|
||||
|
||||
#if defined(__WIN32__) || \
|
||||
(defined(__MWERKS__) && !defined(__BEOS__)) || \
|
||||
defined(__MACOS__) || defined(__MACOSX__) || \
|
||||
defined(__SYMBIAN32__) || defined(QWS)
|
||||
|
||||
#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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This should be called from your WinMain() function, if any */
|
||||
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
|
||||
/* This can also be called, but is no longer necessary */
|
||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
|
||||
/* This can also be called, but is no longer necessary (SDL_Quit calls it) */
|
||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
#endif
|
||||
|
||||
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
|
||||
#if defined(__MACOS__)
|
||||
|
||||
#include "begin_code.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declaration so we don't need to include QuickDraw.h */
|
||||
struct QDGlobals;
|
||||
|
||||
/* This should be called from your main() function, if any */
|
||||
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
#endif
|
||||
|
||||
#endif /* Need to redefine main()? */
|
||||
|
||||
#endif /* _SDL_main_h */
|
140
Externals/SDL/Include_1.2/SDL_mouse.h
vendored
Normal file
140
Externals/SDL/Include_1.2/SDL_mouse.h
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct WMcursor WMcursor; /* Implementation dependent */
|
||||
typedef struct SDL_Cursor {
|
||||
SDL_Rect area; /* The area of the mouse cursor */
|
||||
Sint16 hot_x, hot_y; /* The "tip" of the cursor */
|
||||
Uint8 *data; /* B/W cursor data */
|
||||
Uint8 *mask; /* B/W cursor mask */
|
||||
Uint8 *save[2]; /* Place to save cursor area */
|
||||
WMcursor *wm_cursor; /* Window-manager cursor */
|
||||
} SDL_Cursor;
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* Retrieve the current state of the 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
|
||||
* current mouse cursor position. You can pass NULL for either x or y.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
|
||||
|
||||
/*
|
||||
* Retrieve the current state of the 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 *x, int *y);
|
||||
|
||||
/*
|
||||
* Set the position of the mouse cursor (generates a mouse motion event)
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
|
||||
|
||||
/*
|
||||
* Create a cursor using the specified 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.
|
||||
*
|
||||
* Cursors created with this function must be freed with SDL_FreeCursor().
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
|
||||
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
|
||||
|
||||
/*
|
||||
* Set the currently active cursor to the specified one.
|
||||
* If the cursor is currently visible, the change will be immediately
|
||||
* represented on the display.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
|
||||
|
||||
/*
|
||||
* Returns the currently active cursor.
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
|
||||
|
||||
/*
|
||||
* Deallocates a cursor created with SDL_CreateCursor().
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
|
||||
|
||||
/*
|
||||
* Toggle whether or not the cursor is shown on the screen.
|
||||
* The cursor start off displayed, but can be turned off.
|
||||
* SDL_ShowCursor() returns 1 if the cursor was being displayed
|
||||
* before the call, or 0 if it was not. You can query the current
|
||||
* state by passing a 'toggle' value of -1.
|
||||
*/
|
||||
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
|
||||
Button 4: Mouse wheel up (may also be a real button)
|
||||
Button 5: Mouse wheel down (may also be a real 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_WHEELUP 4
|
||||
#define SDL_BUTTON_WHEELDOWN 5
|
||||
#define SDL_BUTTON_X1 6
|
||||
#define SDL_BUTTON_X2 7
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mouse_h */
|
162
Externals/SDL/Include_1.2/SDL_mutex.h
vendored
Normal file
162
Externals/SDL/Include_1.2/SDL_mutex.h
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
|
||||
/* Functions to provide thread synchronization primitives
|
||||
|
||||
These are independent of the other SDL 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
|
||||
extern "C" {
|
||||
#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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mutex_h */
|
6551
Externals/SDL/Include_1.2/SDL_opengl.h
vendored
Normal file
6551
Externals/SDL/Include_1.2/SDL_opengl.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
100
Externals/SDL/Include_1.2/SDL_platform.h
vendored
Normal file
100
Externals/SDL/Include_1.2/SDL_platform.h
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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__)
|
||||
#undef __MACOSX__
|
||||
#define __MACOSX__ 1
|
||||
#elif defined(macintosh)
|
||||
#undef __MACOS__
|
||||
#define __MACOS__ 1
|
||||
#endif
|
||||
#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
|
||||
|
||||
#endif /* _SDL_platform_h */
|
50
Externals/SDL/Include_1.2/SDL_quit.h
vendored
Normal file
50
Externals/SDL/Include_1.2/SDL_quit.h
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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 */
|
144
Externals/SDL/Include_1.2/SDL_rwops.h
vendored
Normal file
144
Externals/SDL/Include_1.2/SDL_rwops.h
vendored
Normal file
@ -0,0 +1,144 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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
|
||||
extern "C" {
|
||||
#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:
|
||||
SEEK_SET, SEEK_CUR, SEEK_END
|
||||
Returns the final offset in the data source.
|
||||
*/
|
||||
int (SDLCALL *seek)(struct SDL_RWops *context, int 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 -1 if the read failed.
|
||||
*/
|
||||
int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
|
||||
|
||||
/* Write exactly 'num' objects each of size 'objsize' from the area
|
||||
pointed at by 'ptr' to data source.
|
||||
Returns 'num', or -1 if the write failed.
|
||||
*/
|
||||
int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
|
||||
|
||||
/* Close and free an allocated SDL_FSops structure */
|
||||
int (SDLCALL *close)(struct SDL_RWops *context);
|
||||
|
||||
Uint32 type;
|
||||
union {
|
||||
#if defined(__WIN32__) && !defined(__SYMBIAN32__)
|
||||
struct {
|
||||
int append;
|
||||
void *h;
|
||||
struct {
|
||||
void *data;
|
||||
int size;
|
||||
int left;
|
||||
} buffer;
|
||||
} win32io;
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
struct {
|
||||
int 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, int 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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_rwops_h */
|
596
Externals/SDL/Include_1.2/SDL_stdinc.h
vendored
Normal file
596
Externals/SDL/Include_1.2/SDL_stdinc.h
vendored
Normal file
@ -0,0 +1,596 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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 <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#if defined(STDC_HEADERS)
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# if defined(HAVE_STDLIB_H)
|
||||
# include <stdlib.h>
|
||||
# elif defined(HAVE_MALLOC_H)
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
# if defined(HAVE_STDDEF_H)
|
||||
# include <stddef.h>
|
||||
# endif
|
||||
# if defined(HAVE_STDARG_H)
|
||||
# include <stdarg.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#if defined(HAVE_INTTYPES_H)
|
||||
# include <inttypes.h>
|
||||
#elif defined(HAVE_STDINT_H)
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_CTYPE_H
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
#ifdef HAVE_ICONV_H
|
||||
# include <iconv.h>
|
||||
#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 int8_t Sint8;
|
||||
typedef uint8_t Uint8;
|
||||
typedef int16_t Sint16;
|
||||
typedef uint16_t Uint16;
|
||||
typedef int32_t Sint32;
|
||||
typedef uint32_t Uint32;
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
typedef int64_t Sint64;
|
||||
#ifndef SYMBIAN32_GCCE
|
||||
typedef uint64_t Uint64;
|
||||
#endif
|
||||
#else
|
||||
/* This is really just a hack to prevent the compiler from complaining */
|
||||
typedef struct {
|
||||
Uint32 hi;
|
||||
Uint32 lo;
|
||||
} Uint64, Sint64;
|
||||
#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]
|
||||
|
||||
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);
|
||||
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
|
||||
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
||||
|
||||
/* 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
|
||||
|
||||
typedef enum {
|
||||
DUMMY_ENUM_VALUE
|
||||
} SDL_DUMMY_ENUM;
|
||||
|
||||
#ifndef __NDS__
|
||||
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
|
||||
#endif
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#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 <alloca.h>
|
||||
# elif defined(__GNUC__)
|
||||
# define alloca __builtin_alloca
|
||||
# elif defined(_MSC_VER)
|
||||
# include <malloc.h>
|
||||
# define alloca _alloca
|
||||
# elif defined(__WATCOMC__)
|
||||
# include <malloc.h>
|
||||
# elif defined(__BORLANDC__)
|
||||
# include <malloc.h>
|
||||
# elif defined(__DMC__)
|
||||
# include <stdlib.h>
|
||||
# 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
|
||||
|
||||
#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" \
|
||||
: "=&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_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
|
||||
|
||||
/* 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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_stdinc_h */
|
214
Externals/SDL/Include_1.2/SDL_syswm.h
vendored
Normal file
214
Externals/SDL/Include_1.2/SDL_syswm.h
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 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_version.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#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;
|
||||
typedef struct SDL_SysWMinfo 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 <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#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.
|
||||
*/
|
||||
typedef 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,
|
||||
but not the gfxdisplay 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 */
|
||||
|
||||
/* Introduced in SDL 1.2.12 */
|
||||
Display *gfxdisplay; /* The X11 display to which rendering is done */
|
||||
} x11;
|
||||
} info;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_NANOX)
|
||||
#include <microwin/nano-X.h>
|
||||
|
||||
/* The generic custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version ;
|
||||
GR_WINDOW_ID window ; /* The display window */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
/* 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 */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
HWND window; /* The Win32 display window */
|
||||
HGLRC hglrc; /* The OpenGL context, if any */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#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 */
|
||||
typedef 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 */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
|
||||
#include <sys/neutrino.h>
|
||||
#include <Ph.h>
|
||||
|
||||
/* The QNX custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* The QNX custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int data;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#else
|
||||
|
||||
/* The generic custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* The generic custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int data;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#endif /* video driver type */
|
||||
|
||||
#endif /* SDL_PROTOTYPES_ONLY */
|
||||
|
||||
/* Function prototypes */
|
||||
/*
|
||||
* This function gives you custom hooks into the window manager information.
|
||||
* It fills the structure pointed to by 'info' with custom information and
|
||||
* returns 1 if the function is implemented. If it's not implemented, or
|
||||
* the version member of the 'info' structure is invalid, it returns 0.
|
||||
*
|
||||
* You typically use this function like this:
|
||||
* SDL_SysWMInfo info;
|
||||
* SDL_VERSION(&info.version);
|
||||
* if ( SDL_GetWMInfo(&info) ) { ... }
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_syswm_h */
|
119
Externals/SDL/Include_1.2/SDL_thread.h
vendored
Normal file
119
Externals/SDL/Include_1.2/SDL_thread.h
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
|
||||
/* Header for the SDL thread management routines
|
||||
|
||||
These are independent of the other SDL 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
|
||||
extern "C" {
|
||||
#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__)) && !defined(__SYMBIAN32__)
|
||||
/*
|
||||
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 <process.h> /* 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 *fn)(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);
|
||||
|
||||
/* Forcefully kill a thread without worrying about its state */
|
||||
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_thread_h */
|
115
Externals/SDL/Include_1.2/SDL_timer.h
vendored
Normal file
115
Externals/SDL/Include_1.2/SDL_timer.h
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
|
||||
/* 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
|
||||
extern "C" {
|
||||
#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 <megastep@lokigames.com>
|
||||
*/
|
||||
|
||||
/* 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
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_timer_h */
|
24
Externals/SDL/Include_1.2/SDL_types.h
vendored
Normal file
24
Externals/SDL/Include_1.2/SDL_types.h
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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"
|
85
Externals/SDL/Include_1.2/SDL_version.h
vendored
Normal file
85
Externals/SDL/Include_1.2/SDL_version.h
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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 header defines the current SDL version */
|
||||
|
||||
#ifndef _SDL_version_h
|
||||
#define _SDL_version_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
||||
*/
|
||||
#define SDL_MAJOR_VERSION 1
|
||||
#define SDL_MINOR_VERSION 2
|
||||
#define SDL_PATCHLEVEL 13
|
||||
|
||||
typedef struct SDL_version {
|
||||
Uint8 major;
|
||||
Uint8 minor;
|
||||
Uint8 patch;
|
||||
} SDL_version;
|
||||
|
||||
/* This macro can be used to fill a version structure with the compile-time
|
||||
* version of the SDL library.
|
||||
*/
|
||||
#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))
|
||||
|
||||
/* This function gets the version of the dynamically linked SDL library.
|
||||
it should NOT be used to fill a version structure, instead you should
|
||||
use the SDL_Version() macro.
|
||||
*/
|
||||
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_version_h */
|
891
Externals/SDL/Include_1.2/SDL_video.h
vendored
Normal file
891
Externals/SDL/Include_1.2/SDL_video.h
vendored
Normal file
@ -0,0 +1,891 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/* Header file for access to the SDL raw framebuffer window */
|
||||
|
||||
#ifndef _SDL_video_h
|
||||
#define _SDL_video_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Transparency definitions: These define alpha as the opacity of a surface */
|
||||
#define SDL_ALPHA_OPAQUE 255
|
||||
#define SDL_ALPHA_TRANSPARENT 0
|
||||
|
||||
/* Useful data types */
|
||||
typedef struct SDL_Rect {
|
||||
Sint16 x, y;
|
||||
Uint16 w, h;
|
||||
} SDL_Rect;
|
||||
|
||||
typedef struct SDL_Color {
|
||||
Uint8 r;
|
||||
Uint8 g;
|
||||
Uint8 b;
|
||||
Uint8 unused;
|
||||
} SDL_Color;
|
||||
#define SDL_Colour SDL_Color
|
||||
|
||||
typedef struct SDL_Palette {
|
||||
int ncolors;
|
||||
SDL_Color *colors;
|
||||
} SDL_Palette;
|
||||
|
||||
/* Everything in the pixel format structure is read-only */
|
||||
typedef struct SDL_PixelFormat {
|
||||
SDL_Palette *palette;
|
||||
Uint8 BitsPerPixel;
|
||||
Uint8 BytesPerPixel;
|
||||
Uint8 Rloss;
|
||||
Uint8 Gloss;
|
||||
Uint8 Bloss;
|
||||
Uint8 Aloss;
|
||||
Uint8 Rshift;
|
||||
Uint8 Gshift;
|
||||
Uint8 Bshift;
|
||||
Uint8 Ashift;
|
||||
Uint32 Rmask;
|
||||
Uint32 Gmask;
|
||||
Uint32 Bmask;
|
||||
Uint32 Amask;
|
||||
|
||||
/* RGB color key information */
|
||||
Uint32 colorkey;
|
||||
/* Alpha value information (per-surface alpha) */
|
||||
Uint8 alpha;
|
||||
} SDL_PixelFormat;
|
||||
|
||||
/* This structure should be treated as read-only, except for 'pixels',
|
||||
which, if not NULL, contains the raw pixel data for the surface.
|
||||
*/
|
||||
typedef struct SDL_Surface {
|
||||
Uint32 flags; /* Read-only */
|
||||
SDL_PixelFormat *format; /* Read-only */
|
||||
int w, h; /* Read-only */
|
||||
Uint16 pitch; /* Read-only */
|
||||
void *pixels; /* Read-write */
|
||||
int offset; /* Private */
|
||||
|
||||
/* Hardware-specific surface info */
|
||||
struct private_hwdata *hwdata;
|
||||
|
||||
/* clipping information */
|
||||
SDL_Rect clip_rect; /* Read-only */
|
||||
Uint32 unused1; /* for binary compatibility */
|
||||
|
||||
/* Allow recursive locks */
|
||||
Uint32 locked; /* Private */
|
||||
|
||||
/* info for fast blit mapping to other surfaces */
|
||||
struct SDL_BlitMap *map; /* Private */
|
||||
|
||||
/* format version, bumped at every change to invalidate blit maps */
|
||||
unsigned int format_version; /* Private */
|
||||
|
||||
/* Reference count -- used when freeing surface */
|
||||
int refcount; /* Read-mostly */
|
||||
} SDL_Surface;
|
||||
|
||||
/* These are the currently supported flags for the SDL_surface */
|
||||
/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
|
||||
#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
|
||||
#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
|
||||
#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
|
||||
/* Available for SDL_SetVideoMode() */
|
||||
#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
|
||||
#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
|
||||
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
|
||||
#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
|
||||
#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */
|
||||
#define SDL_OPENGLBLIT 0x0000000A /* Create an OpenGL rendering context and use it for blitting */
|
||||
#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */
|
||||
#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */
|
||||
/* Used internally (read-only) */
|
||||
#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
|
||||
#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
|
||||
#define SDL_RLEACCELOK 0x00002000 /* Private flag */
|
||||
#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
|
||||
#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
|
||||
#define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
|
||||
|
||||
/* Evaluates to true if the surface needs to be locked before access */
|
||||
#define SDL_MUSTLOCK(surface) \
|
||||
(surface->offset || \
|
||||
((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
|
||||
|
||||
/* typedef for private surface blitting functions */
|
||||
typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
|
||||
struct SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
|
||||
/* Useful for determining the video hardware capabilities */
|
||||
typedef struct SDL_VideoInfo {
|
||||
Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */
|
||||
Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */
|
||||
Uint32 UnusedBits1 :6;
|
||||
Uint32 UnusedBits2 :1;
|
||||
Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */
|
||||
Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */
|
||||
Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */
|
||||
Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */
|
||||
Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */
|
||||
Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */
|
||||
Uint32 blit_fill :1; /* Flag: Accelerated color fill */
|
||||
Uint32 UnusedBits3 :16;
|
||||
Uint32 video_mem; /* The total amount of video memory (in K) */
|
||||
SDL_PixelFormat *vfmt; /* Value: The format of the video surface */
|
||||
int current_w; /* Value: The current video mode width */
|
||||
int current_h; /* Value: The current video mode height */
|
||||
} 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
|
||||
*/
|
||||
#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) */
|
||||
|
||||
/* 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 */
|
||||
|
||||
/* Hardware-specific surface info */
|
||||
struct private_yuvhwfuncs *hwfuncs;
|
||||
struct private_yuvhwdata *hwdata;
|
||||
|
||||
/* Special flags */
|
||||
Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */
|
||||
Uint32 UnusedBits :31;
|
||||
} SDL_Overlay;
|
||||
|
||||
|
||||
/* Public enumeration for setting the OpenGL window 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_SWAP_CONTROL
|
||||
} SDL_GLattr;
|
||||
|
||||
/* flags for SDL_SetPalette() */
|
||||
#define SDL_LOGPAL 0x01
|
||||
#define SDL_PHYSPAL 0x02
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* These functions are used internally, and should not be used unless you
|
||||
* have a specific need to specify the video driver you want to use.
|
||||
* You should normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*
|
||||
* SDL_VideoInit() initializes the video subsystem -- sets up a connection
|
||||
* to the window manager, etc, and determines the current video mode and
|
||||
* pixel format, but does not initialize a window or graphics mode.
|
||||
* Note that event handling is activated by this routine.
|
||||
*
|
||||
* If you use both sound and video in your application, you need to call
|
||||
* SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
|
||||
* you won't be able to set full-screen display modes.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
|
||||
extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
|
||||
|
||||
/* This function fills the given character buffer with the name of the
|
||||
* video driver, and returns a pointer to it if the video driver has
|
||||
* been initialized. It returns NULL if no driver has been initialized.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
|
||||
|
||||
/*
|
||||
* This function returns a pointer to the current display surface.
|
||||
* If SDL is doing format conversion on the display surface, this
|
||||
* function returns the publicly visible surface, not the real video
|
||||
* surface.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
|
||||
|
||||
/*
|
||||
* This function returns a read-only pointer to information about the
|
||||
* video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
|
||||
* member of the returned structure will contain the pixel format of the
|
||||
* "best" video mode.
|
||||
*/
|
||||
extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
|
||||
|
||||
/*
|
||||
* Check to see if a particular video mode is supported.
|
||||
* It returns 0 if the requested mode is not supported under any bit depth,
|
||||
* or returns the bits-per-pixel of the closest available mode with the
|
||||
* given width and height. If this bits-per-pixel is different from the
|
||||
* one used when setting the video mode, SDL_SetVideoMode() will succeed,
|
||||
* but will emulate the requested bits-per-pixel with a shadow surface.
|
||||
*
|
||||
* The arguments to SDL_VideoModeOK() are the same ones you would pass to
|
||||
* SDL_SetVideoMode()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
|
||||
|
||||
/*
|
||||
* Return a pointer to an array of available screen dimensions for the
|
||||
* given format and video flags, sorted largest to smallest. Returns
|
||||
* NULL if there are no dimensions available for a particular format,
|
||||
* or (SDL_Rect **)-1 if any dimension is okay for the given format.
|
||||
*
|
||||
* If 'format' is NULL, the mode list will be for the format given
|
||||
* by SDL_GetVideoInfo()->vfmt
|
||||
*/
|
||||
extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
|
||||
|
||||
/*
|
||||
* Set up a video mode with the specified width, height and bits-per-pixel.
|
||||
*
|
||||
* If 'bpp' is 0, it is treated as the current display bits per pixel.
|
||||
*
|
||||
* If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
|
||||
* requested bits-per-pixel, but will return whatever video pixel format is
|
||||
* available. The default is to emulate the requested pixel format if it
|
||||
* is not natively available.
|
||||
*
|
||||
* If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
|
||||
* video memory, if possible, and you may have to call SDL_LockSurface()
|
||||
* in order to access the raw framebuffer. Otherwise, the video surface
|
||||
* will be created in system memory.
|
||||
*
|
||||
* If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
|
||||
* updates asynchronously, but you must always lock before accessing pixels.
|
||||
* SDL will wait for updates to complete before returning from the lock.
|
||||
*
|
||||
* If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
|
||||
* that the colors set by SDL_SetColors() will be the colors you get.
|
||||
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
|
||||
* of the colors exactly the way they are requested, and you should look
|
||||
* at the video surface structure to determine the actual palette.
|
||||
* If SDL cannot guarantee that the colors you request can be set,
|
||||
* i.e. if the colormap is shared, then the video surface may be created
|
||||
* under emulation in system memory, overriding the SDL_HWSURFACE flag.
|
||||
*
|
||||
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
|
||||
* a fullscreen video mode. The default is to create a windowed mode
|
||||
* if the current graphics system has a window manager.
|
||||
* If the SDL library is able to set a fullscreen video mode, this flag
|
||||
* will be set in the surface that is returned.
|
||||
*
|
||||
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
|
||||
* two surfaces in video memory and swap between them when you call
|
||||
* SDL_Flip(). This is usually slower than the normal single-buffering
|
||||
* scheme, but prevents "tearing" artifacts caused by modifying video
|
||||
* memory while the monitor is refreshing. It should only be used by
|
||||
* applications that redraw the entire screen on every update.
|
||||
*
|
||||
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
|
||||
* window manager, if any, to resize the window at runtime. When this
|
||||
* occurs, SDL will send a SDL_VIDEORESIZE event to you application,
|
||||
* and you must respond to the event by re-calling SDL_SetVideoMode()
|
||||
* with the requested size (or another size that suits the application).
|
||||
*
|
||||
* If SDL_NOFRAME is set in 'flags', the SDL library will create a window
|
||||
* without any title bar or frame decoration. Fullscreen video modes have
|
||||
* this flag set automatically.
|
||||
*
|
||||
* This function returns the video framebuffer surface, or NULL if it fails.
|
||||
*
|
||||
* If you rely on functionality provided by certain video flags, check the
|
||||
* flags of the returned surface to make sure that functionality is available.
|
||||
* SDL will fall back to reduced functionality if the exact flags you wanted
|
||||
* are not available.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
|
||||
(int width, int height, int bpp, Uint32 flags);
|
||||
|
||||
/*
|
||||
* Makes sure the given list of rectangles is updated on the given screen.
|
||||
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
|
||||
* screen.
|
||||
* These functions should not be called while 'screen' is locked.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateRects
|
||||
(SDL_Surface *screen, int numrects, SDL_Rect *rects);
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateRect
|
||||
(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
|
||||
|
||||
/*
|
||||
* On hardware that supports double-buffering, this function sets up a flip
|
||||
* and returns. The hardware will wait for vertical retrace, and then swap
|
||||
* video buffers before the next video surface blit or lock will return.
|
||||
* On hardware that doesn not support double-buffering, this is equivalent
|
||||
* to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
|
||||
* The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
|
||||
* setting the video mode for this function to perform hardware flipping.
|
||||
* This function returns 0 if successful, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
|
||||
|
||||
/*
|
||||
* Set the gamma correction for each of the color channels.
|
||||
* The gamma values range (approximately) between 0.1 and 10.0
|
||||
*
|
||||
* If this function isn't supported directly by the hardware, it will
|
||||
* be emulated using gamma ramps, if available. If successful, this
|
||||
* function returns 0, otherwise it returns -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You may pass NULL for any of the channels to leave it unchanged.
|
||||
* If the call succeeds, it will return 0. If the display driver or
|
||||
* hardware does not support gamma translation, or otherwise fails,
|
||||
* this function will return -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
|
||||
|
||||
/*
|
||||
* Retrieve the current values of the gamma translation tables.
|
||||
*
|
||||
* You must pass in valid pointers to arrays of 256 16-bit quantities.
|
||||
* Any of the pointers may be NULL to ignore that channel.
|
||||
* If the call succeeds, it will return 0. If the display driver or
|
||||
* hardware does not support gamma translation, or otherwise fails,
|
||||
* this function will return -1.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
|
||||
|
||||
/*
|
||||
* Sets a portion of the colormap for the given 8-bit surface. If 'surface'
|
||||
* is not a palettized surface, this function does nothing, returning 0.
|
||||
* If all of the colors were set as passed to SDL_SetColors(), it will
|
||||
* return 1. If not all the color entries were set exactly as given,
|
||||
* it will return 0, and you should look at the surface palette to
|
||||
* determine the actual color palette.
|
||||
*
|
||||
* When 'surface' is the surface associated with the current display, the
|
||||
* display colormap will be updated with the requested colors. If
|
||||
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
|
||||
* will always return 1, and the palette is guaranteed to be set the way
|
||||
* you desire, even if the window colormap has to be warped or run under
|
||||
* emulation.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
|
||||
SDL_Color *colors, int firstcolor, int ncolors);
|
||||
|
||||
/*
|
||||
* Sets a portion of the colormap for a given 8-bit surface.
|
||||
* 'flags' is one or both of:
|
||||
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped
|
||||
* to/from the surface,
|
||||
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on
|
||||
* the screen
|
||||
* Only screens have physical palettes. Separate change of physical/logical
|
||||
* palettes is only possible if the screen has SDL_HWPALETTE set.
|
||||
*
|
||||
* The return value is 1 if all colours could be set as requested, and 0
|
||||
* otherwise.
|
||||
*
|
||||
* SDL_SetColors() is equivalent to calling this function with
|
||||
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
|
||||
SDL_Color *colors, int firstcolor,
|
||||
int ncolors);
|
||||
|
||||
/*
|
||||
* Maps an RGB triple to an opaque pixel value for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
|
||||
(const SDL_PixelFormat * const format,
|
||||
const Uint8 r, const Uint8 g, const Uint8 b);
|
||||
|
||||
/*
|
||||
* Maps an RGBA quadruple to a pixel value for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
|
||||
(const SDL_PixelFormat * const format,
|
||||
const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a);
|
||||
|
||||
/*
|
||||
* Maps a pixel value into the RGB components for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt,
|
||||
Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
|
||||
/*
|
||||
* Maps a pixel value into the RGBA components for a given pixel format
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
|
||||
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
|
||||
/*
|
||||
* 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' tell what kind of surface to create.
|
||||
* SDL_SWSURFACE means that the surface should be created in system memory.
|
||||
* SDL_HWSURFACE means that the surface should be created in video memory,
|
||||
* with the same format as the display surface. This is useful for surfaces
|
||||
* that will not change much, to take advantage of hardware acceleration
|
||||
* when being blitted to the display surface.
|
||||
* SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
|
||||
* this surface, but you must always lock it before accessing the pixels.
|
||||
* SDL will wait for current blits to finish before returning from the lock.
|
||||
* SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
|
||||
* If the hardware supports acceleration of colorkey blits between
|
||||
* two surfaces in video memory, SDL will try to place the surface in
|
||||
* video memory. If this isn't possible or if there is no hardware
|
||||
* acceleration available, the surface will be placed in system memory.
|
||||
* SDL_SRCALPHA means that the surface will be used for alpha blits and
|
||||
* if the hardware supports hardware acceleration of alpha blits between
|
||||
* two surfaces in video memory, to place the surface in video memory
|
||||
* if possible, otherwise it will be placed in system memory.
|
||||
* If the surface is created in video memory, blits will be _much_ faster,
|
||||
* but the surface format must be identical to the video surface format,
|
||||
* and the only way to access the pixels member of the surface is to use
|
||||
* the SDL_LockSurface() and SDL_UnlockSurface() calls.
|
||||
* If the requested surface actually resides in video memory, SDL_HWSURFACE
|
||||
* will be set in the flags member of the returned surface. If for some
|
||||
* reason the surface could not be placed in video memory, it will not have
|
||||
* the SDL_HWSURFACE flag set, and will be created in system memory instead.
|
||||
*/
|
||||
#define SDL_AllocSurface SDL_CreateRGBSurface
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
|
||||
(Uint32 flags, int width, int height, int depth,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
int width, int height, int depth, int pitch,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* 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. In particular, if the
|
||||
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
|
||||
* will not need to lock the display surface before accessing it.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
|
||||
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().
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
|
||||
|
||||
/* Convenience macro -- load a surface from a file */
|
||||
#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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
||||
(SDL_Surface *surface, SDL_RWops *dst, int freedst);
|
||||
|
||||
/* Convenience macro -- save a surface to a file */
|
||||
#define SDL_SaveBMP(surface, file) \
|
||||
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
||||
|
||||
/*
|
||||
* Sets the color key (transparent pixel) in a blittable surface.
|
||||
* If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
|
||||
* 'key' will be the transparent pixel in the source image of a blit.
|
||||
* SDL_RLEACCEL requests RLE acceleration for the surface if present,
|
||||
* and removes RLE acceleration if absent.
|
||||
* If 'flag' is 0, this function clears any current color key.
|
||||
* This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetColorKey
|
||||
(SDL_Surface *surface, Uint32 flag, Uint32 key);
|
||||
|
||||
/*
|
||||
* This function sets the alpha value for the entire surface, as opposed to
|
||||
* using the alpha component of each pixel. This value measures the range
|
||||
* of transparency of the surface, 0 being completely transparent to 255
|
||||
* being completely opaque. An 'alpha' value of 255 causes blits to be
|
||||
* opaque, the source pixels copied to the destination (the default). Note
|
||||
* that per-surface alpha can be combined with colorkey transparency.
|
||||
*
|
||||
* If 'flag' is 0, alpha blending is disabled for the surface.
|
||||
* If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
|
||||
* OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
|
||||
* surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
|
||||
*
|
||||
* The 'alpha' parameter is ignored for surfaces that have an alpha channel.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
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().
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
|
||||
(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
/* 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()
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
||||
(SDL_Surface *src, SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillRect
|
||||
(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
|
||||
|
||||
/*
|
||||
* This function takes a surface and copies it to a new surface of the
|
||||
* pixel format and colors of the video framebuffer, suitable for fast
|
||||
* blitting onto the display surface. It calls SDL_ConvertSurface()
|
||||
*
|
||||
* If you want to take advantage of hardware colorkey or alpha blit
|
||||
* acceleration, you should set the colorkey and alpha value before
|
||||
* calling this function.
|
||||
*
|
||||
* If the conversion fails or runs out of memory, it returns NULL
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* This function takes a surface and copies it to a new surface of the
|
||||
* pixel format and colors of the video framebuffer (if possible),
|
||||
* suitable for fast alpha blitting onto the display surface.
|
||||
* The new surface will always have an alpha channel.
|
||||
*
|
||||
* If you want to take advantage of hardware colorkey or alpha blit
|
||||
* acceleration, you should set the colorkey and alpha value before
|
||||
* calling this function.
|
||||
*
|
||||
* If the conversion fails or runs out of memory, it returns NULL
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* YUV video surface overlay functions */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This function creates a video output overlay
|
||||
Calling the returned surface an overlay is something of a misnomer because
|
||||
the contents of the display surface underneath the area where the overlay
|
||||
is shown is undefined - it may be overwritten with the converted YUV data.
|
||||
*/
|
||||
extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
|
||||
Uint32 format, SDL_Surface *display);
|
||||
|
||||
/* Lock an overlay for direct access, and unlock it when you are done */
|
||||
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
|
||||
|
||||
/* Blit a video overlay to the display surface.
|
||||
The contents of the video surface underneath the blit destination are
|
||||
not defined.
|
||||
The width and height of the destination rectangle may be different from
|
||||
that of the overlay, but currently only 2x scaling is supported.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
|
||||
|
||||
/* Free a video overlay */
|
||||
extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* OpenGL support functions. */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Dynamically load an OpenGL library, or the default one if path is NULL
|
||||
*
|
||||
* 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().
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
||||
|
||||
/*
|
||||
* Get the address of a GL function
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
|
||||
|
||||
/*
|
||||
* Set an attribute of the OpenGL subsystem before intialization.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
|
||||
|
||||
/*
|
||||
* Get an attribute of the OpenGL subsystem from the windowing
|
||||
* interface, such as glX. This is of course different from getting
|
||||
* the values from SDL's internal OpenGL subsystem, which only
|
||||
* stores the values you request before initialization.
|
||||
*
|
||||
* Developers should track the values they pass into SDL_GL_SetAttribute
|
||||
* themselves if they want to retrieve these values.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
|
||||
|
||||
/*
|
||||
* Swap the OpenGL buffers, if double-buffering is supported.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
|
||||
|
||||
/*
|
||||
* Internal functions that should not be called unless you have read
|
||||
* and understood the source code for these functions.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
|
||||
extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
|
||||
extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* These functions allow interaction with the window manager, if any. */
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Sets/Gets the title and icon text of the display window (UTF-8 encoded)
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
|
||||
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
|
||||
|
||||
/*
|
||||
* Sets the icon for the display window.
|
||||
* This function must be called before the first call to SDL_SetVideoMode().
|
||||
* It takes an icon surface, and a mask in MSB format.
|
||||
* If 'mask' is NULL, the entire icon surface will be used as the icon.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
|
||||
|
||||
/*
|
||||
* This function iconifies the window, and returns 1 if it succeeded.
|
||||
* If the function succeeds, it generates an SDL_APPACTIVE loss event.
|
||||
* This function is a noop and returns 0 in non-windowed environments.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
|
||||
|
||||
/*
|
||||
* Toggle fullscreen mode without changing the contents of the screen.
|
||||
* If the display surface does not require locking before accessing
|
||||
* the pixel information, then the memory pointers will not change.
|
||||
*
|
||||
* If this function was able to toggle fullscreen mode (change from
|
||||
* running in a window to fullscreen, or vice-versa), it will return 1.
|
||||
* If it is not implemented, or fails, it returns 0.
|
||||
*
|
||||
* The next call to SDL_SetVideoMode() will set the mode fullscreen
|
||||
* attribute based on the flags parameter - if SDL_FULLSCREEN is not
|
||||
* set, then the display will be windowed by default where supported.
|
||||
*
|
||||
* This is currently only implemented in the X11 video driver.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
|
||||
|
||||
/*
|
||||
* This function allows you to set and query the input grab state of
|
||||
* the application. It returns the new input grab state.
|
||||
*/
|
||||
typedef enum {
|
||||
SDL_GRAB_QUERY = -1,
|
||||
SDL_GRAB_OFF = 0,
|
||||
SDL_GRAB_ON = 1,
|
||||
SDL_GRAB_FULLSCREEN /* Used internally */
|
||||
} SDL_GrabMode;
|
||||
/*
|
||||
* Grabbing means that the mouse is confined to the application window,
|
||||
* and nearly all keyboard input is passed directly to the application,
|
||||
* and not interpreted by a window manager, if any.
|
||||
*/
|
||||
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
|
||||
|
||||
/* Not in public API at the moment - do not use! */
|
||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_video_h */
|
156
Externals/SDL/Include_1.2/begin_code.h
vendored
Normal file
156
Externals/SDL/Include_1.2/begin_code.h
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2004 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 */
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
#ifndef EKA2
|
||||
#undef DECLSPEC
|
||||
#define DECLSPEC
|
||||
#elif !defined(__WINS__)
|
||||
#undef DECLSPEC
|
||||
#define DECLSPEC __declspec(dllexport)
|
||||
#endif /* !EKA2 */
|
||||
#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)
|
||||
#elif (defined(__MWERKS__) && defined(__MACOS__))
|
||||
#pragma options align=mac68k4byte
|
||||
#pragma enumsalwaysint on
|
||||
#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) || defined(__EABI__)
|
||||
#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 */
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2004 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
@ -19,17 +19,23 @@
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_THREADS_DISABLED
|
||||
/* This file reverses the effects of begin_code.h and should be included
|
||||
after you finish any function and structure declarations in your headers
|
||||
*/
|
||||
|
||||
typedef int SYS_ThreadHandle;
|
||||
|
||||
#else
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
typedef pthread_t SYS_ThreadHandle;
|
||||
#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
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
#if (defined(__MWERKS__) && defined(__MACOS__))
|
||||
#pragma options align=reset
|
||||
#pragma enumsalwaysint reset
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* Compiler needs structure packing set */
|
||||
|
1141
Externals/SDL/VisualC/SDL/SDL_VS2008.vcproj
vendored
1141
Externals/SDL/VisualC/SDL/SDL_VS2008.vcproj
vendored
File diff suppressed because it is too large
Load Diff
165
Externals/SDL/include/SDL.h
vendored
165
Externals/SDL/include/SDL.h
vendored
@ -1,165 +0,0 @@
|
||||
/*
|
||||
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: */
|
216
Externals/SDL/include/SDL_atomic.h
vendored
216
Externals/SDL/include/SDL_atomic.h
vendored
@ -1,216 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2006 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_atomic.h
|
||||
*
|
||||
* Atomic operations.
|
||||
*
|
||||
* These operations may, or may not, actually be implemented using
|
||||
* processor specific atomic operations. When possible they are
|
||||
* implemented as true processor specific atomic operations. When that
|
||||
* is not possible the are implemented using locks that *do* use the
|
||||
* available atomic operations.
|
||||
*
|
||||
* At the very minimum spin locks must be implemented. Without spin
|
||||
* locks it is not possible (AFAICT) to emulate the rest of the atomic
|
||||
* operations.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_atomic_h_
|
||||
#define _SDL_atomic_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* \name SDL AtomicLock
|
||||
*
|
||||
* The spin lock functions and type are required and can not be
|
||||
* emulated because they are used in the emulation code.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
typedef volatile Uint32 SDL_SpinLock;
|
||||
|
||||
/**
|
||||
* \brief Lock a spin lock by setting it to a none zero value.
|
||||
*
|
||||
* \param lock Points to the lock.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* \brief Unlock a spin lock by setting it to 0. Always returns immediately
|
||||
*
|
||||
* \param lock Points to the lock.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||
|
||||
/*@}*//*SDL AtomicLock*/
|
||||
|
||||
/**
|
||||
* \name 32 bit atomic operations
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \brief Check to see if \c *ptr == 0 and set it to 1.
|
||||
*
|
||||
* \return SDL_True if the value pointed to by \c ptr was zero and
|
||||
* SDL_False if it was not zero
|
||||
*
|
||||
* \param ptr Points to the value to be tested and set.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Set the value pointed to by \c ptr to be zero.
|
||||
*
|
||||
* \param ptr Address of the value to be set to zero
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicClear32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Fetch the current value of \c *ptr and then increment that
|
||||
* value in place.
|
||||
*
|
||||
* \return The value before it was incremented.
|
||||
*
|
||||
* \param ptr Address of the value to fetch and increment
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Fetch \c *ptr and then decrement the value in place.
|
||||
*
|
||||
* \return The value before it was decremented.
|
||||
*
|
||||
* \param ptr Address of the value to fetch and drement
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Fetch the current value at \c ptr and then add \c value to \c *ptr.
|
||||
*
|
||||
* \return \c *ptr before the addition took place.
|
||||
*
|
||||
* \param ptr The address of data we are changing.
|
||||
* \param value The value to add to \c *ptr.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/**
|
||||
* \brief Fetch \c *ptr and then subtract \c value from it.
|
||||
*
|
||||
* \return \c *ptr before the subtraction took place.
|
||||
*
|
||||
* \param ptr The address of the data being changed.
|
||||
* \param value The value to subtract from \c *ptr.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/**
|
||||
* \brief Add one to the data pointed to by \c ptr and return that value.
|
||||
*
|
||||
* \return The incremented value.
|
||||
*
|
||||
* \param ptr The address of the data to increment.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Subtract one from data pointed to by \c ptr and return the new value.
|
||||
*
|
||||
* \return The decremented value.
|
||||
*
|
||||
* \param ptr The address of the data to decrement.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Add \c value to the data pointed to by \c ptr and return result.
|
||||
*
|
||||
* \return The sum of \c *ptr and \c value.
|
||||
*
|
||||
* \param ptr The address of the data to be modified.
|
||||
* \param value The value to be added.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/**
|
||||
* \brief Subtract \c value from the data pointed to by \c ptr and return the result.
|
||||
*
|
||||
* \return The difference between \c *ptr and \c value.
|
||||
*
|
||||
* \param ptr The address of the data to be modified.
|
||||
* \param value The value to be subtracted.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/*@}*//*32 bit atomic operations*/
|
||||
|
||||
/**
|
||||
* \name 64 bit atomic operations
|
||||
*/
|
||||
/*@{*/
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicClear64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value);
|
||||
#endif /* SDL_HAS_64BIT_TYPE */
|
||||
|
||||
/*@}*//*64 bit atomic operations*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_atomic_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
505
Externals/SDL/include/SDL_audio.h
vendored
505
Externals/SDL/include/SDL_audio.h
vendored
@ -1,505 +0,0 @@
|
||||
/*
|
||||
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: */
|
1123
Externals/SDL/include/SDL_haptic.h
vendored
1123
Externals/SDL/include/SDL_haptic.h
vendored
File diff suppressed because it is too large
Load Diff
182
Externals/SDL/include/SDL_keyboard.h
vendored
182
Externals/SDL/include/SDL_keyboard.h
vendored
@ -1,182 +0,0 @@
|
||||
/*
|
||||
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("<RETURN> 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: */
|
252
Externals/SDL/include/SDL_mouse.h
vendored
252
Externals/SDL/include/SDL_mouse.h
vendored
@ -1,252 +0,0 @@
|
||||
/*
|
||||
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:
|
||||
* <table>
|
||||
* <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
|
||||
* <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
|
||||
* <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
|
||||
* <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
|
||||
* <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
|
||||
if not. </td></tr>
|
||||
* </table>
|
||||
*
|
||||
* \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: */
|
80
Externals/SDL/include/SDL_power.h
vendored
80
Externals/SDL/include/SDL_power.h
vendored
@ -1,80 +0,0 @@
|
||||
/*
|
||||
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_power_h
|
||||
#define _SDL_power_h
|
||||
|
||||
/**
|
||||
* \file SDL_power.h
|
||||
*
|
||||
* Header for the SDL power management routines.
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
/**
|
||||
* \brief The basic state for the system's power supply.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
|
||||
SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
|
||||
SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
|
||||
SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
|
||||
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
|
||||
} SDL_PowerState;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the current power supply details.
|
||||
*
|
||||
* \param secs Seconds of battery life left. You can pass a NULL here if
|
||||
* you don't care. Will return -1 if we can't determine a
|
||||
* value, or we're not running on a battery.
|
||||
*
|
||||
* \param pct Percentage of battery life left, between 0 and 100. You can
|
||||
* pass a NULL here if you don't care. Will return -1 if we
|
||||
* can't determine a value, or we're not running on a battery.
|
||||
*
|
||||
* \return The state of the battery (if any).
|
||||
*/
|
||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_power_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
1
Externals/SDL/include/SDL_revision.h
vendored
1
Externals/SDL/include/SDL_revision.h
vendored
@ -1 +0,0 @@
|
||||
#define SDL_REVISION 0
|
576
Externals/SDL/include/SDL_surface.h
vendored
576
Externals/SDL/include/SDL_surface.h
vendored
@ -1,576 +0,0 @@
|
||||
/*
|
||||
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_surface.h
|
||||
*
|
||||
* Header file for ::SDL_surface definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_surface_h
|
||||
#define _SDL_surface_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_pixels.h"
|
||||
#include "SDL_rect.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
|
||||
|
||||
/**
|
||||
* \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.
|
||||
*/
|
||||
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
||||
|
||||
/**
|
||||
* \brief A collection of pixels used in software blitting.
|
||||
*
|
||||
* \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
|
||||
{
|
||||
Uint32 flags; /**< Read-only */
|
||||
SDL_PixelFormat *format; /**< Read-only */
|
||||
int w, h; /**< Read-only */
|
||||
int pitch; /**< Read-only */
|
||||
void *pixels; /**< Read-write */
|
||||
|
||||
/** Application data associated with the surfade */
|
||||
void *userdata; /**< Read-write */
|
||||
|
||||
/** information needed for surfaces requiring locks */
|
||||
int locked; /**< Read-only */
|
||||
void *lock_data; /**< Read-only */
|
||||
|
||||
/** clipping information */
|
||||
SDL_Rect clip_rect; /**< Read-only */
|
||||
|
||||
/** info for fast blit mapping to other surfaces */
|
||||
struct SDL_BlitMap *map; /**< Private */
|
||||
|
||||
/** format version, bumped at every change to invalidate blit maps */
|
||||
unsigned int format_version; /**< Private */
|
||||
|
||||
/** Reference count -- used when freeing surface */
|
||||
int refcount; /**< Read-mostly */
|
||||
} SDL_Surface;
|
||||
|
||||
/**
|
||||
* \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.
|
||||
*
|
||||
* \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,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
int pitch,
|
||||
Uint32 Rmask,
|
||||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
Uint32 Amask);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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 \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);
|
||||
|
||||
/**
|
||||
* 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 \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);
|
||||
|
||||
/**
|
||||
* Save a surface to a file.
|
||||
*
|
||||
* Convenience macro.
|
||||
*/
|
||||
#define SDL_SaveBMP(surface, file) \
|
||||
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* \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.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* \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 \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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* 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 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.
|
||||
*/
|
||||
#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()
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
||||
(SDL_Surface * src, SDL_Rect * srcrect,
|
||||
SDL_Surface * dst, 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.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
|
||||
const SDL_Rect * srcrect,
|
||||
SDL_Surface * dst,
|
||||
const SDL_Rect * dstrect);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_surface_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
262
Externals/SDL/include/SDL_syswm.h
vendored
262
Externals/SDL/include/SDL_syswm.h
vendored
@ -1,262 +0,0 @@
|
||||
/*
|
||||
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 <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#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 <windows.h>
|
||||
|
||||
/**
|
||||
* 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 <sys/neutrino.h>
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
#include <gf/gf.h>
|
||||
#endif /* SDL_VIDEO_OPENGL_ES */
|
||||
#include <Ph.h>
|
||||
|
||||
/**
|
||||
* 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: */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user