SDL: Preparation for upgrade

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1925 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-01-19 05:40:46 +00:00
parent 14b7f6d0fd
commit f220f5f132
42 changed files with 12529 additions and 12831 deletions

View File

@ -1,94 +1,94 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Main include header for the SDL library */ /* Main include header for the SDL library */
#ifndef _SDL_H #ifndef _SDL_H
#define _SDL_H #define _SDL_H
#include "SDL_main.h" #include "SDL_main.h"
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_cpuinfo.h" #include "SDL_cpuinfo.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_events.h" #include "SDL_events.h"
#include "SDL_loadso.h" #include "SDL_loadso.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_rwops.h" #include "SDL_rwops.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_video.h" #include "SDL_video.h"
#include "SDL_version.h" #include "SDL_version.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* As of version 0.5, SDL is loaded dynamically into the application */ /* 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 /* These are the flags which may be passed to SDL_Init() -- you should
specify the subsystems which you will be using in your application. specify the subsystems which you will be using in your application.
*/ */
#define SDL_INIT_TIMER 0x00000001 #define SDL_INIT_TIMER 0x00000001
#define SDL_INIT_AUDIO 0x00000010 #define SDL_INIT_AUDIO 0x00000010
#define SDL_INIT_VIDEO 0x00000020 #define SDL_INIT_VIDEO 0x00000020
#define SDL_INIT_CDROM 0x00000100 #define SDL_INIT_CDROM 0x00000100
#define SDL_INIT_JOYSTICK 0x00000200 #define SDL_INIT_JOYSTICK 0x00000200
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */ #define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */ #define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF #define SDL_INIT_EVERYTHING 0x0000FFFF
/* This function loads the SDL dynamically linked library and initializes /* This function loads the SDL dynamically linked library and initializes
* the subsystems specified by 'flags' (and those satisfying dependencies) * the subsystems specified by 'flags' (and those satisfying dependencies)
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV) * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
*/ */
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
/* This function initializes specific SDL subsystems */ /* This function initializes specific SDL subsystems */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/* This function cleans up specific SDL subsystems */ /* This function cleans up specific SDL subsystems */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
/* This function returns mask of the specified subsystems which have /* This function returns mask of the specified subsystems which have
been initialized. been initialized.
If 'flags' is 0, it returns a mask of all initialized subsystems. If 'flags' is 0, it returns a mask of all initialized subsystems.
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/* This function cleans up all initialized subsystems and unloads the /* This function cleans up all initialized subsystems and unloads the
* dynamically linked library. You should call it upon all exit conditions. * dynamically linked library. You should call it upon all exit conditions.
*/ */
extern DECLSPEC void SDLCALL SDL_Quit(void); extern DECLSPEC void SDLCALL SDL_Quit(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_H */ #endif /* _SDL_H */

View File

@ -1,58 +1,58 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL application focus event handling */ /* Include file for SDL application focus event handling */
#ifndef _SDL_active_h #ifndef _SDL_active_h
#define _SDL_active_h #define _SDL_active_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* The available application states */ /* The available application states */
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */ #define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */ #define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
#define SDL_APPACTIVE 0x04 /* The application is active */ #define SDL_APPACTIVE 0x04 /* The application is active */
/* Function prototypes */ /* Function prototypes */
/* /*
* This function returns the current state of the application, which is a * This function returns the current state of the application, which is a
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
* see your application, otherwise it has been iconified or disabled. * see your application, otherwise it has been iconified or disabled.
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_active_h */ #endif /* _SDL_active_h */

View File

@ -1,253 +1,253 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Access to the raw audio mixing buffer for the SDL library */ /* Access to the raw audio mixing buffer for the SDL library */
#ifndef _SDL_audio_h #ifndef _SDL_audio_h
#define _SDL_audio_h #define _SDL_audio_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_rwops.h" #include "SDL_rwops.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* The calculated values in this structure are calculated by SDL_OpenAudio() */ /* The calculated values in this structure are calculated by SDL_OpenAudio() */
typedef struct SDL_AudioSpec { typedef struct SDL_AudioSpec {
int freq; /* DSP frequency -- samples per second */ int freq; /* DSP frequency -- samples per second */
Uint16 format; /* Audio data format */ Uint16 format; /* Audio data format */
Uint8 channels; /* Number of channels: 1 mono, 2 stereo */ Uint8 channels; /* Number of channels: 1 mono, 2 stereo */
Uint8 silence; /* Audio buffer silence value (calculated) */ Uint8 silence; /* Audio buffer silence value (calculated) */
Uint16 samples; /* Audio buffer size in samples (power of 2) */ Uint16 samples; /* Audio buffer size in samples (power of 2) */
Uint16 padding; /* Necessary for some compile environments */ Uint16 padding; /* Necessary for some compile environments */
Uint32 size; /* Audio buffer size in bytes (calculated) */ Uint32 size; /* Audio buffer size in bytes (calculated) */
/* This function is called when the audio device needs more data. /* This function is called when the audio device needs more data.
'stream' is a pointer to the audio data buffer 'stream' is a pointer to the audio data buffer
'len' is the length of that buffer in bytes. 'len' is the length of that buffer in bytes.
Once the callback returns, the buffer will no longer be valid. Once the callback returns, the buffer will no longer be valid.
Stereo samples are stored in a LRLRLR ordering. Stereo samples are stored in a LRLRLR ordering.
*/ */
void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
void *userdata; void *userdata;
} SDL_AudioSpec; } SDL_AudioSpec;
/* Audio format flags (defaults to LSB byte order) */ /* Audio format flags (defaults to LSB byte order) */
#define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */ #define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */
#define AUDIO_S8 0x8008 /* Signed 8-bit samples */ #define AUDIO_S8 0x8008 /* Signed 8-bit samples */
#define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */ #define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */
#define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */ #define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */
#define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */ #define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */
#define AUDIO_S16MSB 0x9010 /* 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_U16 AUDIO_U16LSB
#define AUDIO_S16 AUDIO_S16LSB #define AUDIO_S16 AUDIO_S16LSB
/* Native audio byte ordering */ /* Native audio byte ordering */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN #if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_U16SYS AUDIO_U16LSB #define AUDIO_U16SYS AUDIO_U16LSB
#define AUDIO_S16SYS AUDIO_S16LSB #define AUDIO_S16SYS AUDIO_S16LSB
#else #else
#define AUDIO_U16SYS AUDIO_U16MSB #define AUDIO_U16SYS AUDIO_U16MSB
#define AUDIO_S16SYS AUDIO_S16MSB #define AUDIO_S16SYS AUDIO_S16MSB
#endif #endif
/* A structure to hold a set of audio conversion filters and buffers */ /* A structure to hold a set of audio conversion filters and buffers */
typedef struct SDL_AudioCVT { typedef struct SDL_AudioCVT {
int needed; /* Set to 1 if conversion possible */ int needed; /* Set to 1 if conversion possible */
Uint16 src_format; /* Source audio format */ Uint16 src_format; /* Source audio format */
Uint16 dst_format; /* Target audio format */ Uint16 dst_format; /* Target audio format */
double rate_incr; /* Rate conversion increment */ double rate_incr; /* Rate conversion increment */
Uint8 *buf; /* Buffer to hold entire audio data */ Uint8 *buf; /* Buffer to hold entire audio data */
int len; /* Length of original audio buffer */ int len; /* Length of original audio buffer */
int len_cvt; /* Length of converted audio buffer */ int len_cvt; /* Length of converted audio buffer */
int len_mult; /* buffer must be len*len_mult big */ int len_mult; /* buffer must be len*len_mult big */
double len_ratio; /* Given len, final size is len*len_ratio */ double len_ratio; /* Given len, final size is len*len_ratio */
void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
int filter_index; /* Current audio conversion function */ int filter_index; /* Current audio conversion function */
} SDL_AudioCVT; } SDL_AudioCVT;
/* Function prototypes */ /* Function prototypes */
/* These functions are used internally, and should not be used unless you /* 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. * have a specific need to specify the audio driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem(). * You should normally use SDL_Init() or SDL_InitSubSystem().
*/ */
extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
extern DECLSPEC void SDLCALL SDL_AudioQuit(void); extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
/* This function fills the given character buffer with the name of the /* 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 * 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. * been initialized. It returns NULL if no driver has been initialized.
*/ */
extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
/* /*
* This function opens the audio device with the desired parameters, and * This function opens the audio device with the desired parameters, and
* returns 0 if successful, placing the actual hardware parameters in the * returns 0 if successful, placing the actual hardware parameters in the
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
* data passed to the callback function will be guaranteed to be in the * data passed to the callback function will be guaranteed to be in the
* requested format, and will be automatically converted to the hardware * requested format, and will be automatically converted to the hardware
* audio format if necessary. This function returns -1 if it failed * audio format if necessary. This function returns -1 if it failed
* to open the audio device, or couldn't set up the audio thread. * to open the audio device, or couldn't set up the audio thread.
* *
* When filling in the desired audio spec structure, * When filling in the desired audio spec structure,
* 'desired->freq' should be the desired audio frequency in samples-per-second. * 'desired->freq' should be the desired audio frequency in samples-per-second.
* 'desired->format' should be the desired audio format. * 'desired->format' should be the desired audio format.
* 'desired->samples' is the desired size of the audio buffer, in samples. * '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 * 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 * driver to a value more suitable for the hardware. Good values seem to
* range between 512 and 8096 inclusive, depending on the application and * range between 512 and 8096 inclusive, depending on the application and
* CPU speed. Smaller values yield faster response time, but can lead * CPU speed. Smaller values yield faster response time, but can lead
* to underflow if the application is doing heavy processing and cannot * to underflow if the application is doing heavy processing and cannot
* fill the audio buffer in time. A stereo sample consists of both right * fill the audio buffer in time. A stereo sample consists of both right
* and left channels in LR ordering. * and left channels in LR ordering.
* Note that the number of samples is directly related to time by the * Note that the number of samples is directly related to time by the
* following formula: ms = (samples*1000)/freq * following formula: ms = (samples*1000)/freq
* 'desired->size' is the size in bytes of the audio buffer, and is * 'desired->size' is the size in bytes of the audio buffer, and is
* calculated by SDL_OpenAudio(). * calculated by SDL_OpenAudio().
* 'desired->silence' is the value used to set the buffer to silence, * 'desired->silence' is the value used to set the buffer to silence,
* and is calculated by SDL_OpenAudio(). * and is calculated by SDL_OpenAudio().
* 'desired->callback' should be set to a function that will be called * '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 * 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. * 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 * This function usually runs in a separate thread, and so you should
* protect data structures that it accesses by calling SDL_LockAudio() * protect data structures that it accesses by calling SDL_LockAudio()
* and SDL_UnlockAudio() in your code. * and SDL_UnlockAudio() in your code.
* 'desired->userdata' is passed as the first parameter to your callback * 'desired->userdata' is passed as the first parameter to your callback
* function. * function.
* *
* The audio device starts out playing silence when it's opened, and should * 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 * 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 * for your audio callback function to be called. Since the audio driver
* may modify the requested size of the audio buffer, you should allocate * may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device. * any local mixing buffers after you open the audio device.
*/ */
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
/* /*
* Get the current audio state: * Get the current audio state:
*/ */
typedef enum { typedef enum {
SDL_AUDIO_STOPPED = 0, SDL_AUDIO_STOPPED = 0,
SDL_AUDIO_PLAYING, SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED SDL_AUDIO_PAUSED
} SDL_audiostatus; } SDL_audiostatus;
extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
/* /*
* This function pauses and unpauses the audio callback processing. * This function pauses and unpauses the audio callback processing.
* It should be called with a parameter of 0 after opening the audio * 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 * device to start playing sound. This is so you can safely initialize
* data for your callback function after opening the audio device. * data for your callback function after opening the audio device.
* Silence will be written to the audio device during the pause. * 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_PauseAudio(int pause_on);
/* /*
* This function loads a WAVE from the data source, automatically freeing * 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, * that source if 'freesrc' is non-zero. For example, to load a WAVE file,
* you could do: * you could do:
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
* *
* If this function succeeds, it returns the given SDL_AudioSpec, * If this function succeeds, it returns the given SDL_AudioSpec,
* filled with the audio data format of the wave data, and sets * filled with the audio data format of the wave data, and sets
* 'audio_buf' to a malloc()'d buffer containing the audio data, * 'audio_buf' to a malloc()'d buffer containing the audio data,
* and sets 'audio_len' to the length of that audio buffer, in bytes. * 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 * You need to free the audio buffer with SDL_FreeWAV() when you are
* done with it. * done with it.
* *
* This function returns NULL and sets the SDL error message if the * This function returns NULL and sets the SDL error message if the
* wave file cannot be opened, uses an unknown data format, or is * wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported. * 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); 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 */ /* Compatibility convenience function -- loads a WAV from a file */
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, 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() * This function frees data previously allocated with SDL_LoadWAV_RW()
*/ */
extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
/* /*
* This function takes a source format and rate and a destination format * This function takes a source format and rate and a destination format
* and rate, and initializes the 'cvt' structure with information needed * and rate, and initializes the 'cvt' structure with information needed
* by SDL_ConvertAudio() to convert a buffer of audio data from one format * by SDL_ConvertAudio() to convert a buffer of audio data from one format
* to the other. * to the other.
* This function returns 0, or -1 if there was an error. * This function returns 0, or -1 if there was an error.
*/ */
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 src_format, Uint8 src_channels, int src_rate,
Uint16 dst_format, Uint8 dst_channels, int dst_rate); Uint16 dst_format, Uint8 dst_channels, int dst_rate);
/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), /* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
* created an audio buffer cvt->buf, and filled it with cvt->len bytes of * 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 * audio data in the source format, this function will convert it in-place
* to the desired format. * to the desired format.
* The data conversion may expand the size of the audio data, so the buffer * 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 * cvt->buf should be allocated after the cvt structure is initialized by
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
*/ */
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
/* /*
* This takes two audio buffers of the playing audio format and mixes * This takes two audio buffers of the playing audio format and mixes
* them, performing addition, volume adjustment, and overflow clipping. * them, performing addition, volume adjustment, and overflow clipping.
* The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME * 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. * for full audio volume. Note this does not change hardware volume.
* This is provided for convenience -- you can mix your own audio data. * This is provided for convenience -- you can mix your own audio data.
*/ */
#define SDL_MIX_MAXVOLUME 128 #define SDL_MIX_MAXVOLUME 128
extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); 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. * The lock manipulated by these functions protects the callback function.
* During a LockAudio/UnlockAudio pair, you can be guaranteed that the * During a LockAudio/UnlockAudio pair, you can be guaranteed that the
* callback function is not running. Do not call these from the callback * callback function is not running. Do not call these from the callback
* function or you will cause deadlock. * function or you will cause deadlock.
*/ */
extern DECLSPEC void SDLCALL SDL_LockAudio(void); extern DECLSPEC void SDLCALL SDL_LockAudio(void);
extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
/* /*
* This function shuts down audio processing and closes the audio device. * This function shuts down audio processing and closes the audio device.
*/ */
extern DECLSPEC void SDLCALL SDL_CloseAudio(void); extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_audio_h */ #endif /* _SDL_audio_h */

View File

@ -1,24 +1,24 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* DEPRECATED */ /* DEPRECATED */
#include "SDL_endian.h" #include "SDL_endian.h"

View File

@ -1,171 +1,171 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* This is the CD-audio control API for Simple DirectMedia Layer */ /* This is the CD-audio control API for Simple DirectMedia Layer */
#ifndef _SDL_cdrom_h #ifndef _SDL_cdrom_h
#define _SDL_cdrom_h #define _SDL_cdrom_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* In order to use these functions, SDL_Init() must have been called /* 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 with the SDL_INIT_CDROM flag. This causes SDL to scan the system
for CD-ROM drives, and load appropriate drivers. for CD-ROM drives, and load appropriate drivers.
*/ */
/* The maximum number of CD-ROM tracks on a disk */ /* The maximum number of CD-ROM tracks on a disk */
#define SDL_MAX_TRACKS 99 #define SDL_MAX_TRACKS 99
/* The types of CD-ROM track possible */ /* The types of CD-ROM track possible */
#define SDL_AUDIO_TRACK 0x00 #define SDL_AUDIO_TRACK 0x00
#define SDL_DATA_TRACK 0x04 #define SDL_DATA_TRACK 0x04
/* The possible states which a CD-ROM drive can be in. */ /* The possible states which a CD-ROM drive can be in. */
typedef enum { typedef enum {
CD_TRAYEMPTY, CD_TRAYEMPTY,
CD_STOPPED, CD_STOPPED,
CD_PLAYING, CD_PLAYING,
CD_PAUSED, CD_PAUSED,
CD_ERROR = -1 CD_ERROR = -1
} CDstatus; } CDstatus;
/* Given a status, returns true if there's a disk in the drive */ /* Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)(status) > 0) #define CD_INDRIVE(status) ((int)(status) > 0)
typedef struct SDL_CDtrack { typedef struct SDL_CDtrack {
Uint8 id; /* Track number */ Uint8 id; /* Track number */
Uint8 type; /* Data or audio track */ Uint8 type; /* Data or audio track */
Uint16 unused; Uint16 unused;
Uint32 length; /* Length, in frames, of this track */ Uint32 length; /* Length, in frames, of this track */
Uint32 offset; /* Offset, in frames, from start of disk */ Uint32 offset; /* Offset, in frames, from start of disk */
} SDL_CDtrack; } SDL_CDtrack;
/* This structure is only current as of the last call to SDL_CDStatus() */ /* This structure is only current as of the last call to SDL_CDStatus() */
typedef struct SDL_CD { typedef struct SDL_CD {
int id; /* Private drive identifier */ int id; /* Private drive identifier */
CDstatus status; /* Current drive status */ CDstatus status; /* Current drive status */
/* The rest of this structure is only valid if there's a CD in drive */ /* The rest of this structure is only valid if there's a CD in drive */
int numtracks; /* Number of tracks on disk */ int numtracks; /* Number of tracks on disk */
int cur_track; /* Current track position */ int cur_track; /* Current track position */
int cur_frame; /* Current frame offset within current track */ int cur_frame; /* Current frame offset within current track */
SDL_CDtrack track[SDL_MAX_TRACKS+1]; SDL_CDtrack track[SDL_MAX_TRACKS+1];
} SDL_CD; } SDL_CD;
/* Conversion functions from frames to Minute/Second/Frames and vice versa */ /* Conversion functions from frames to Minute/Second/Frames and vice versa */
#define CD_FPS 75 #define CD_FPS 75
#define FRAMES_TO_MSF(f, M,S,F) { \ #define FRAMES_TO_MSF(f, M,S,F) { \
int value = f; \ int value = f; \
*(F) = value%CD_FPS; \ *(F) = value%CD_FPS; \
value /= CD_FPS; \ value /= CD_FPS; \
*(S) = value%60; \ *(S) = value%60; \
value /= 60; \ value /= 60; \
*(M) = value; \ *(M) = value; \
} }
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) #define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
/* CD-audio API functions: */ /* CD-audio API functions: */
/* Returns the number of CD-ROM drives on the system, or -1 if /* 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. SDL_Init() has not been called with the SDL_INIT_CDROM flag.
*/ */
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
/* Returns a human-readable, system-dependent identifier for the CD-ROM. /* Returns a human-readable, system-dependent identifier for the CD-ROM.
Example: Example:
"/dev/cdrom" "/dev/cdrom"
"E:" "E:"
"/dev/disk/ide/1/master" "/dev/disk/ide/1/master"
*/ */
extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
/* Opens a CD-ROM drive for access. It returns a drive handle on success, /* 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 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 becomes the default CD used when other CD functions are passed a NULL
CD-ROM handle. CD-ROM handle.
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
*/ */
extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
/* This function returns the current status of the given 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 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. play position of the CD will be stored in the SDL_CD structure.
*/ */
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' /* 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 tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
until the end of the CD. This function will skip data tracks. until the end of the CD. This function will skip data tracks.
This function should only be called after calling SDL_CDStatus() to This function should only be called after calling SDL_CDStatus() to
get track information about the CD. get track information about the CD.
For example: For example:
// Play entire CD: // Play entire CD:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
// Play last track: // Play last track:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
} }
// Play first and second track and 10 seconds of third track: // Play first and second track and 10 seconds of third track:
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
This function returns 0, or -1 if there was an error. This function returns 0, or -1 if there was an error.
*/ */
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
int start_track, int start_frame, int ntracks, int nframes); int start_track, int start_frame, int ntracks, int nframes);
/* Play the given CD starting at 'start' frame for 'length' frames. /* Play the given CD starting at 'start' frame for 'length' frames.
It returns 0, or -1 if there was an error. It returns 0, or -1 if there was an error.
*/ */
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
/* Pause play -- returns 0, or -1 on error */ /* Pause play -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
/* Resume play -- returns 0, or -1 on error */ /* Resume play -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
/* Stop play -- returns 0, or -1 on error */ /* Stop play -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
/* Eject CD-ROM -- returns 0, or -1 on error */ /* Eject CD-ROM -- returns 0, or -1 on error */
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
/* Closes the handle for the CD-ROM drive */ /* Closes the handle for the CD-ROM drive */
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_video_h */ #endif /* _SDL_video_h */

View File

@ -1,45 +1,45 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_h #ifndef _SDL_config_h
#define _SDL_config_h #define _SDL_config_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* Add any platform that doesn't build using the configure system */ /* Add any platform that doesn't build using the configure system */
#if defined(__DREAMCAST__) #if defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h" #include "SDL_config_dreamcast.h"
#elif defined(__MACOS__) #elif defined(__MACOS__)
#include "SDL_config_macos.h" #include "SDL_config_macos.h"
#elif defined(__MACOSX__) #elif defined(__MACOSX__)
#include "SDL_config_macosx.h" #include "SDL_config_macosx.h"
#elif defined(__SYMBIAN32__) #elif defined(__SYMBIAN32__)
#include "SDL_config_symbian.h" /* must be before win32! */ #include "SDL_config_symbian.h" /* must be before win32! */
#elif defined(__WIN32__) #elif defined(__WIN32__)
#include "SDL_config_win32.h" #include "SDL_config_win32.h"
#elif defined(__OS2__) #elif defined(__OS2__)
#include "SDL_config_os2.h" #include "SDL_config_os2.h"
#else #else
#include "SDL_config_minimal.h" #include "SDL_config_minimal.h"
#endif /* platform config */ #endif /* platform config */
#endif /* _SDL_config_h */ #endif /* _SDL_config_h */

View File

@ -1,306 +1,306 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_h #ifndef _SDL_config_h
#define _SDL_config_h #define _SDL_config_h
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */ /* General platform specific identifiers */
#include "SDL_platform.h" #include "SDL_platform.h"
/* Make sure that this isn't included by Visual C++ */ /* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER #ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h #error You should copy include/SDL_config.h.default to include/SDL_config.h
#endif #endif
/* C language features */ /* C language features */
#undef const #undef const
#undef inline #undef inline
#undef volatile #undef volatile
/* C datatypes */ /* C datatypes */
#undef size_t #undef size_t
#undef int8_t #undef int8_t
#undef uint8_t #undef uint8_t
#undef int16_t #undef int16_t
#undef uint16_t #undef uint16_t
#undef int32_t #undef int32_t
#undef uint32_t #undef uint32_t
#undef int64_t #undef int64_t
#undef uint64_t #undef uint64_t
#undef uintptr_t #undef uintptr_t
#undef SDL_HAS_64BIT_TYPE #undef SDL_HAS_64BIT_TYPE
/* Endianness */ /* Endianness */
#undef SDL_BYTEORDER #undef SDL_BYTEORDER
/* Comment this if you want to build without any C library requirements */ /* Comment this if you want to build without any C library requirements */
#undef HAVE_LIBC #undef HAVE_LIBC
#if HAVE_LIBC #if HAVE_LIBC
/* Useful headers */ /* Useful headers */
#undef HAVE_ALLOCA_H #undef HAVE_ALLOCA_H
#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_TYPES_H
#undef HAVE_STDIO_H #undef HAVE_STDIO_H
#undef STDC_HEADERS #undef STDC_HEADERS
#undef HAVE_STDLIB_H #undef HAVE_STDLIB_H
#undef HAVE_STDARG_H #undef HAVE_STDARG_H
#undef HAVE_MALLOC_H #undef HAVE_MALLOC_H
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
#undef HAVE_STRING_H #undef HAVE_STRING_H
#undef HAVE_STRINGS_H #undef HAVE_STRINGS_H
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
#undef HAVE_STDINT_H #undef HAVE_STDINT_H
#undef HAVE_CTYPE_H #undef HAVE_CTYPE_H
#undef HAVE_MATH_H #undef HAVE_MATH_H
#undef HAVE_ICONV_H #undef HAVE_ICONV_H
#undef HAVE_SIGNAL_H #undef HAVE_SIGNAL_H
#undef HAVE_ALTIVEC_H #undef HAVE_ALTIVEC_H
/* C library functions */ /* C library functions */
#undef HAVE_MALLOC #undef HAVE_MALLOC
#undef HAVE_CALLOC #undef HAVE_CALLOC
#undef HAVE_REALLOC #undef HAVE_REALLOC
#undef HAVE_FREE #undef HAVE_FREE
#undef HAVE_ALLOCA #undef HAVE_ALLOCA
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ #ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
#undef HAVE_GETENV #undef HAVE_GETENV
#undef HAVE_PUTENV #undef HAVE_PUTENV
#undef HAVE_UNSETENV #undef HAVE_UNSETENV
#endif #endif
#undef HAVE_QSORT #undef HAVE_QSORT
#undef HAVE_ABS #undef HAVE_ABS
#undef HAVE_BCOPY #undef HAVE_BCOPY
#undef HAVE_MEMSET #undef HAVE_MEMSET
#undef HAVE_MEMCPY #undef HAVE_MEMCPY
#undef HAVE_MEMMOVE #undef HAVE_MEMMOVE
#undef HAVE_MEMCMP #undef HAVE_MEMCMP
#undef HAVE_STRLEN #undef HAVE_STRLEN
#undef HAVE_STRLCPY #undef HAVE_STRLCPY
#undef HAVE_STRLCAT #undef HAVE_STRLCAT
#undef HAVE_STRDUP #undef HAVE_STRDUP
#undef HAVE__STRREV #undef HAVE__STRREV
#undef HAVE__STRUPR #undef HAVE__STRUPR
#undef HAVE__STRLWR #undef HAVE__STRLWR
#undef HAVE_INDEX #undef HAVE_INDEX
#undef HAVE_RINDEX #undef HAVE_RINDEX
#undef HAVE_STRCHR #undef HAVE_STRCHR
#undef HAVE_STRRCHR #undef HAVE_STRRCHR
#undef HAVE_STRSTR #undef HAVE_STRSTR
#undef HAVE_ITOA #undef HAVE_ITOA
#undef HAVE__LTOA #undef HAVE__LTOA
#undef HAVE__UITOA #undef HAVE__UITOA
#undef HAVE__ULTOA #undef HAVE__ULTOA
#undef HAVE_STRTOL #undef HAVE_STRTOL
#undef HAVE_STRTOUL #undef HAVE_STRTOUL
#undef HAVE__I64TOA #undef HAVE__I64TOA
#undef HAVE__UI64TOA #undef HAVE__UI64TOA
#undef HAVE_STRTOLL #undef HAVE_STRTOLL
#undef HAVE_STRTOULL #undef HAVE_STRTOULL
#undef HAVE_STRTOD #undef HAVE_STRTOD
#undef HAVE_ATOI #undef HAVE_ATOI
#undef HAVE_ATOF #undef HAVE_ATOF
#undef HAVE_STRCMP #undef HAVE_STRCMP
#undef HAVE_STRNCMP #undef HAVE_STRNCMP
#undef HAVE__STRICMP #undef HAVE__STRICMP
#undef HAVE_STRCASECMP #undef HAVE_STRCASECMP
#undef HAVE__STRNICMP #undef HAVE__STRNICMP
#undef HAVE_STRNCASECMP #undef HAVE_STRNCASECMP
#undef HAVE_SSCANF #undef HAVE_SSCANF
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF #undef HAVE_VSNPRINTF
#undef HAVE_ICONV #undef HAVE_ICONV
#undef HAVE_SIGACTION #undef HAVE_SIGACTION
#undef HAVE_SETJMP #undef HAVE_SETJMP
#undef HAVE_NANOSLEEP #undef HAVE_NANOSLEEP
#undef HAVE_CLOCK_GETTIME #undef HAVE_CLOCK_GETTIME
#undef HAVE_DLVSYM #undef HAVE_DLVSYM
#undef HAVE_GETPAGESIZE #undef HAVE_GETPAGESIZE
#undef HAVE_MPROTECT #undef HAVE_MPROTECT
#else #else
/* We may need some replacement for stdarg.h here */ /* We may need some replacement for stdarg.h here */
#include <stdarg.h> #include <stdarg.h>
#endif /* HAVE_LIBC */ #endif /* HAVE_LIBC */
/* Allow disabling of core subsystems */ /* Allow disabling of core subsystems */
#undef SDL_AUDIO_DISABLED #undef SDL_AUDIO_DISABLED
#undef SDL_CDROM_DISABLED #undef SDL_CDROM_DISABLED
#undef SDL_CPUINFO_DISABLED #undef SDL_CPUINFO_DISABLED
#undef SDL_EVENTS_DISABLED #undef SDL_EVENTS_DISABLED
#undef SDL_FILE_DISABLED #undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED #undef SDL_JOYSTICK_DISABLED
#undef SDL_LOADSO_DISABLED #undef SDL_LOADSO_DISABLED
#undef SDL_THREADS_DISABLED #undef SDL_THREADS_DISABLED
#undef SDL_TIMERS_DISABLED #undef SDL_TIMERS_DISABLED
#undef SDL_VIDEO_DISABLED #undef SDL_VIDEO_DISABLED
/* Enable various audio drivers */ /* Enable various audio drivers */
#undef SDL_AUDIO_DRIVER_ALSA #undef SDL_AUDIO_DRIVER_ALSA
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#undef SDL_AUDIO_DRIVER_ARTS #undef SDL_AUDIO_DRIVER_ARTS
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#undef SDL_AUDIO_DRIVER_BAUDIO #undef SDL_AUDIO_DRIVER_BAUDIO
#undef SDL_AUDIO_DRIVER_BSD #undef SDL_AUDIO_DRIVER_BSD
#undef SDL_AUDIO_DRIVER_COREAUDIO #undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DART #undef SDL_AUDIO_DRIVER_DART
#undef SDL_AUDIO_DRIVER_DC #undef SDL_AUDIO_DRIVER_DC
#undef SDL_AUDIO_DRIVER_DISK #undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DUMMY #undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_DMEDIA #undef SDL_AUDIO_DRIVER_DMEDIA
#undef SDL_AUDIO_DRIVER_DSOUND #undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_PULSE #undef SDL_AUDIO_DRIVER_PULSE
#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC #undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
#undef SDL_AUDIO_DRIVER_ESD #undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_MINT #undef SDL_AUDIO_DRIVER_MINT
#undef SDL_AUDIO_DRIVER_MMEAUDIO #undef SDL_AUDIO_DRIVER_MMEAUDIO
#undef SDL_AUDIO_DRIVER_NAS #undef SDL_AUDIO_DRIVER_NAS
#undef SDL_AUDIO_DRIVER_OSS #undef SDL_AUDIO_DRIVER_OSS
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
#undef SDL_AUDIO_DRIVER_PAUD #undef SDL_AUDIO_DRIVER_PAUD
#undef SDL_AUDIO_DRIVER_QNXNTO #undef SDL_AUDIO_DRIVER_QNXNTO
#undef SDL_AUDIO_DRIVER_SNDMGR #undef SDL_AUDIO_DRIVER_SNDMGR
#undef SDL_AUDIO_DRIVER_SUNAUDIO #undef SDL_AUDIO_DRIVER_SUNAUDIO
#undef SDL_AUDIO_DRIVER_WAVEOUT #undef SDL_AUDIO_DRIVER_WAVEOUT
/* Enable various cdrom drivers */ /* Enable various cdrom drivers */
#undef SDL_CDROM_AIX #undef SDL_CDROM_AIX
#undef SDL_CDROM_BEOS #undef SDL_CDROM_BEOS
#undef SDL_CDROM_BSDI #undef SDL_CDROM_BSDI
#undef SDL_CDROM_DC #undef SDL_CDROM_DC
#undef SDL_CDROM_DUMMY #undef SDL_CDROM_DUMMY
#undef SDL_CDROM_FREEBSD #undef SDL_CDROM_FREEBSD
#undef SDL_CDROM_LINUX #undef SDL_CDROM_LINUX
#undef SDL_CDROM_MACOS #undef SDL_CDROM_MACOS
#undef SDL_CDROM_MACOSX #undef SDL_CDROM_MACOSX
#undef SDL_CDROM_MINT #undef SDL_CDROM_MINT
#undef SDL_CDROM_OPENBSD #undef SDL_CDROM_OPENBSD
#undef SDL_CDROM_OS2 #undef SDL_CDROM_OS2
#undef SDL_CDROM_OSF #undef SDL_CDROM_OSF
#undef SDL_CDROM_QNX #undef SDL_CDROM_QNX
#undef SDL_CDROM_WIN32 #undef SDL_CDROM_WIN32
/* Enable various input drivers */ /* Enable various input drivers */
#undef SDL_INPUT_LINUXEV #undef SDL_INPUT_LINUXEV
#undef SDL_INPUT_TSLIB #undef SDL_INPUT_TSLIB
#undef SDL_JOYSTICK_BEOS #undef SDL_JOYSTICK_BEOS
#undef SDL_JOYSTICK_DC #undef SDL_JOYSTICK_DC
#undef SDL_JOYSTICK_DUMMY #undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT #undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_LINUX #undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_MACOS #undef SDL_JOYSTICK_MACOS
#undef SDL_JOYSTICK_MINT #undef SDL_JOYSTICK_MINT
#undef SDL_JOYSTICK_OS2 #undef SDL_JOYSTICK_OS2
#undef SDL_JOYSTICK_RISCOS #undef SDL_JOYSTICK_RISCOS
#undef SDL_JOYSTICK_WINMM #undef SDL_JOYSTICK_WINMM
#undef SDL_JOYSTICK_USBHID #undef SDL_JOYSTICK_USBHID
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#undef SDL_LOADSO_BEOS #undef SDL_LOADSO_BEOS
#undef SDL_LOADSO_DLCOMPAT #undef SDL_LOADSO_DLCOMPAT
#undef SDL_LOADSO_DLOPEN #undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY #undef SDL_LOADSO_DUMMY
#undef SDL_LOADSO_LDG #undef SDL_LOADSO_LDG
#undef SDL_LOADSO_MACOS #undef SDL_LOADSO_MACOS
#undef SDL_LOADSO_OS2 #undef SDL_LOADSO_OS2
#undef SDL_LOADSO_WIN32 #undef SDL_LOADSO_WIN32
/* Enable various threading systems */ /* Enable various threading systems */
#undef SDL_THREAD_BEOS #undef SDL_THREAD_BEOS
#undef SDL_THREAD_DC #undef SDL_THREAD_DC
#undef SDL_THREAD_OS2 #undef SDL_THREAD_OS2
#undef SDL_THREAD_PTH #undef SDL_THREAD_PTH
#undef SDL_THREAD_PTHREAD #undef SDL_THREAD_PTHREAD
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
#undef SDL_THREAD_SPROC #undef SDL_THREAD_SPROC
#undef SDL_THREAD_WIN32 #undef SDL_THREAD_WIN32
/* Enable various timer systems */ /* Enable various timer systems */
#undef SDL_TIMER_BEOS #undef SDL_TIMER_BEOS
#undef SDL_TIMER_DC #undef SDL_TIMER_DC
#undef SDL_TIMER_DUMMY #undef SDL_TIMER_DUMMY
#undef SDL_TIMER_MACOS #undef SDL_TIMER_MACOS
#undef SDL_TIMER_MINT #undef SDL_TIMER_MINT
#undef SDL_TIMER_OS2 #undef SDL_TIMER_OS2
#undef SDL_TIMER_RISCOS #undef SDL_TIMER_RISCOS
#undef SDL_TIMER_UNIX #undef SDL_TIMER_UNIX
#undef SDL_TIMER_WIN32 #undef SDL_TIMER_WIN32
#undef SDL_TIMER_WINCE #undef SDL_TIMER_WINCE
/* Enable various video drivers */ /* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_AALIB #undef SDL_VIDEO_DRIVER_AALIB
#undef SDL_VIDEO_DRIVER_BWINDOW #undef SDL_VIDEO_DRIVER_BWINDOW
#undef SDL_VIDEO_DRIVER_DC #undef SDL_VIDEO_DRIVER_DC
#undef SDL_VIDEO_DRIVER_DDRAW #undef SDL_VIDEO_DRIVER_DDRAW
#undef SDL_VIDEO_DRIVER_DGA #undef SDL_VIDEO_DRIVER_DGA
#undef SDL_VIDEO_DRIVER_DIRECTFB #undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET #undef SDL_VIDEO_DRIVER_DRAWSPROCKET
#undef SDL_VIDEO_DRIVER_DUMMY #undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_FBCON #undef SDL_VIDEO_DRIVER_FBCON
#undef SDL_VIDEO_DRIVER_GAPI #undef SDL_VIDEO_DRIVER_GAPI
#undef SDL_VIDEO_DRIVER_GEM #undef SDL_VIDEO_DRIVER_GEM
#undef SDL_VIDEO_DRIVER_GGI #undef SDL_VIDEO_DRIVER_GGI
#undef SDL_VIDEO_DRIVER_IPOD #undef SDL_VIDEO_DRIVER_IPOD
#undef SDL_VIDEO_DRIVER_NANOX #undef SDL_VIDEO_DRIVER_NANOX
#undef SDL_VIDEO_DRIVER_OS2FS #undef SDL_VIDEO_DRIVER_OS2FS
#undef SDL_VIDEO_DRIVER_PHOTON #undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_PICOGUI #undef SDL_VIDEO_DRIVER_PICOGUI
#undef SDL_VIDEO_DRIVER_PS2GS #undef SDL_VIDEO_DRIVER_PS2GS
#undef SDL_VIDEO_DRIVER_QTOPIA #undef SDL_VIDEO_DRIVER_QTOPIA
#undef SDL_VIDEO_DRIVER_QUARTZ #undef SDL_VIDEO_DRIVER_QUARTZ
#undef SDL_VIDEO_DRIVER_RISCOS #undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_DRIVER_SVGALIB #undef SDL_VIDEO_DRIVER_SVGALIB
#undef SDL_VIDEO_DRIVER_TOOLBOX #undef SDL_VIDEO_DRIVER_TOOLBOX
#undef SDL_VIDEO_DRIVER_VGL #undef SDL_VIDEO_DRIVER_VGL
#undef SDL_VIDEO_DRIVER_WINDIB #undef SDL_VIDEO_DRIVER_WINDIB
#undef SDL_VIDEO_DRIVER_WSCONS #undef SDL_VIDEO_DRIVER_WSCONS
#undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE #undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
#undef SDL_VIDEO_DRIVER_X11_DPMS #undef SDL_VIDEO_DRIVER_X11_DPMS
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
#undef SDL_VIDEO_DRIVER_X11_VIDMODE #undef SDL_VIDEO_DRIVER_X11_VIDMODE
#undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_XME #undef SDL_VIDEO_DRIVER_X11_XME
#undef SDL_VIDEO_DRIVER_X11_XRANDR #undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_XV #undef SDL_VIDEO_DRIVER_X11_XV
#undef SDL_VIDEO_DRIVER_XBIOS #undef SDL_VIDEO_DRIVER_XBIOS
/* Enable OpenGL support */ /* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL #undef SDL_VIDEO_OPENGL
#undef SDL_VIDEO_OPENGL_GLX #undef SDL_VIDEO_OPENGL_GLX
#undef SDL_VIDEO_OPENGL_WGL #undef SDL_VIDEO_OPENGL_WGL
#undef SDL_VIDEO_OPENGL_OSMESA #undef SDL_VIDEO_OPENGL_OSMESA
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
/* Enable assembly routines */ /* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES #undef SDL_ASSEMBLY_ROUTINES
#undef SDL_HERMES_BLITTERS #undef SDL_HERMES_BLITTERS
#undef SDL_ALTIVEC_BLITTERS #undef SDL_ALTIVEC_BLITTERS
#endif /* _SDL_config_h */ #endif /* _SDL_config_h */

View File

@ -1,106 +1,106 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_dreamcast_h #ifndef _SDL_config_dreamcast_h
#define _SDL_config_dreamcast_h #define _SDL_config_dreamcast_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef signed short int16_t; typedef signed short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef signed int int32_t; typedef signed int int32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef signed long long int64_t; typedef signed long long int64_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t; typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
/* Useful headers */ /* Useful headers */
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
#define HAVE_FREE 1 #define HAVE_FREE 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_GETENV 1 #define HAVE_GETENV 1
#define HAVE_PUTENV 1 #define HAVE_PUTENV 1
#define HAVE_QSORT 1 #define HAVE_QSORT 1
#define HAVE_ABS 1 #define HAVE_ABS 1
#define HAVE_BCOPY 1 #define HAVE_BCOPY 1
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1 #define HAVE_MEMCMP 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
#define HAVE_INDEX 1 #define HAVE_INDEX 1
#define HAVE_RINDEX 1 #define HAVE_RINDEX 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
#define HAVE_STRCMP 1 #define HAVE_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE_STRICMP 1 #define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1 #define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DC 1 #define SDL_AUDIO_DRIVER_DC 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */ /* Enable various cdrom drivers */
#define SDL_CDROM_DC 1 #define SDL_CDROM_DC 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_DC 1 #define SDL_JOYSTICK_DC 1
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1 #define SDL_LOADSO_DUMMY 1
/* Enable various threading systems */ /* Enable various threading systems */
#define SDL_THREAD_DC 1 #define SDL_THREAD_DC 1
/* Enable various timer systems */ /* Enable various timer systems */
#define SDL_TIMER_DC 1 #define SDL_TIMER_DC 1
/* Enable various video drivers */ /* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DC 1 #define SDL_VIDEO_DRIVER_DC 1
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_dreamcast_h */ #endif /* _SDL_config_dreamcast_h */

View File

@ -1,112 +1,112 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_macos_h #ifndef _SDL_config_macos_h
#define _SDL_config_macos_h #define _SDL_config_macos_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
#include <MacTypes.h> #include <MacTypes.h>
typedef SInt8 int8_t; typedef SInt8 int8_t;
typedef UInt8 uint8_t; typedef UInt8 uint8_t;
typedef SInt16 int16_t; typedef SInt16 int16_t;
typedef UInt16 uint16_t; typedef UInt16 uint16_t;
typedef SInt32 int32_t; typedef SInt32 int32_t;
typedef UInt32 uint32_t; typedef UInt32 uint32_t;
typedef SInt64 int64_t; typedef SInt64 int64_t;
typedef UInt64 uint64_t; typedef UInt64 uint64_t;
typedef unsigned long uintptr_t; typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
/* Useful headers */ /* Useful headers */
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
#define HAVE_FREE 1 #define HAVE_FREE 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_ABS 1 #define HAVE_ABS 1
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1 #define HAVE_MEMCMP 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_ITOA 1 #define HAVE_ITOA 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
#define HAVE_STRCMP 1 #define HAVE_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_SNDMGR 1 #define SDL_AUDIO_DRIVER_SNDMGR 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */ /* Enable various cdrom drivers */
#if TARGET_API_MAC_CARBON #if TARGET_API_MAC_CARBON
#define SDL_CDROM_DUMMY 1 #define SDL_CDROM_DUMMY 1
#else #else
#define SDL_CDROM_MACOS 1 #define SDL_CDROM_MACOS 1
#endif #endif
/* Enable various input drivers */ /* Enable various input drivers */
#if TARGET_API_MAC_CARBON #if TARGET_API_MAC_CARBON
#define SDL_JOYSTICK_DUMMY 1 #define SDL_JOYSTICK_DUMMY 1
#else #else
#define SDL_JOYSTICK_MACOS 1 #define SDL_JOYSTICK_MACOS 1
#endif #endif
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#define SDL_LOADSO_MACOS 1 #define SDL_LOADSO_MACOS 1
/* Enable various threading systems */ /* Enable various threading systems */
#define SDL_THREADS_DISABLED 1 #define SDL_THREADS_DISABLED 1
/* Enable various timer systems */ /* Enable various timer systems */
#define SDL_TIMER_MACOS 1 #define SDL_TIMER_MACOS 1
/* Enable various video drivers */ /* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 #define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
#define SDL_VIDEO_DRIVER_TOOLBOX 1 #define SDL_VIDEO_DRIVER_TOOLBOX 1
/* Enable OpenGL support */ /* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1 #define SDL_VIDEO_OPENGL 1
#endif /* _SDL_config_macos_h */ #endif /* _SDL_config_macos_h */

View File

@ -1,135 +1,135 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_macosx_h #ifndef _SDL_config_macosx_h
#define _SDL_config_macosx_h #define _SDL_config_macosx_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ /* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
/* Useful headers */ /* Useful headers */
/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ /* 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__)) ) #if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
#define HAVE_ALLOCA_H 1 #define HAVE_ALLOCA_H 1
#endif #endif
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
#define HAVE_FREE 1 #define HAVE_FREE 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_GETENV 1 #define HAVE_GETENV 1
#define HAVE_PUTENV 1 #define HAVE_PUTENV 1
#define HAVE_UNSETENV 1 #define HAVE_UNSETENV 1
#define HAVE_QSORT 1 #define HAVE_QSORT 1
#define HAVE_ABS 1 #define HAVE_ABS 1
#define HAVE_BCOPY 1 #define HAVE_BCOPY 1
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1 #define HAVE_MEMCMP 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1 #define HAVE_STRTOULL 1
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
#define HAVE_STRCMP 1 #define HAVE_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1 #define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1 #define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1 #define HAVE_NANOSLEEP 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1 #define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_SNDMGR 1 #define SDL_AUDIO_DRIVER_SNDMGR 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */ /* Enable various cdrom drivers */
#define SDL_CDROM_MACOSX 1 #define SDL_CDROM_MACOSX 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_IOKIT 1 #define SDL_JOYSTICK_IOKIT 1
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#ifdef __ppc__ #ifdef __ppc__
/* For Mac OS X 10.2 compatibility */ /* For Mac OS X 10.2 compatibility */
#define SDL_LOADSO_DLCOMPAT 1 #define SDL_LOADSO_DLCOMPAT 1
#else #else
#define SDL_LOADSO_DLOPEN 1 #define SDL_LOADSO_DLOPEN 1
#endif #endif
/* Enable various threading systems */ /* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1 #define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */ /* Enable various timer systems */
#define SDL_TIMER_UNIX 1 #define SDL_TIMER_UNIX 1
/* Enable various video drivers */ /* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) #if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
#define SDL_VIDEO_DRIVER_TOOLBOX 1 #define SDL_VIDEO_DRIVER_TOOLBOX 1
#else #else
#define SDL_VIDEO_DRIVER_QUARTZ 1 #define SDL_VIDEO_DRIVER_QUARTZ 1
#endif #endif
/* Enable OpenGL support */ /* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1 #define SDL_VIDEO_OPENGL 1
/* Enable assembly routines */ /* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1 #define SDL_ASSEMBLY_ROUTINES 1
#ifdef __ppc__ #ifdef __ppc__
#define SDL_ALTIVEC_BLITTERS 1 #define SDL_ALTIVEC_BLITTERS 1
#endif #endif
#endif /* _SDL_config_macosx_h */ #endif /* _SDL_config_macosx_h */

View File

@ -1,62 +1,62 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_minimal_h #ifndef _SDL_config_minimal_h
#define _SDL_config_minimal_h #define _SDL_config_minimal_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This is the minimal configuration that can be used to build SDL */ /* This is the minimal configuration that can be used to build SDL */
#include <stdarg.h> #include <stdarg.h>
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef signed short int16_t; typedef signed short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef signed int int32_t; typedef signed int int32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned int size_t; typedef unsigned int size_t;
typedef unsigned long uintptr_t; typedef unsigned long uintptr_t;
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
#define SDL_CDROM_DISABLED 1 #define SDL_CDROM_DISABLED 1
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
#define SDL_JOYSTICK_DISABLED 1 #define SDL_JOYSTICK_DISABLED 1
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1 #define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */ /* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1 #define SDL_THREADS_DISABLED 1
/* Enable the stub timer support (src/timer/dummy/\*.c) */ /* Enable the stub timer support (src/timer/dummy/\*.c) */
#define SDL_TIMERS_DISABLED 1 #define SDL_TIMERS_DISABLED 1
/* Enable the dummy video driver (src/video/dummy/\*.c) */ /* Enable the dummy video driver (src/video/dummy/\*.c) */
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_minimal_h */ #endif /* _SDL_config_minimal_h */

View File

@ -1,115 +1,115 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_nds_h #ifndef _SDL_config_nds_h
#define _SDL_config_nds_h #define _SDL_config_nds_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */ /* General platform specific identifiers */
#include "SDL_platform.h" #include "SDL_platform.h"
/* C datatypes */ /* C datatypes */
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
/* Endianness */ /* Endianness */
#define SDL_BYTEORDER 1234 #define SDL_BYTEORDER 1234
/* Useful headers */ /* Useful headers */
#define HAVE_ALLOCA_H 1 #define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1 #define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1 #define HAVE_MALLOC_H 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_ICONV_H 1 #define HAVE_ICONV_H 1
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
#define HAVE_FREE 1 #define HAVE_FREE 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_GETENV 1 #define HAVE_GETENV 1
#define HAVE_PUTENV 1 #define HAVE_PUTENV 1
#define HAVE_UNSETENV 1 #define HAVE_UNSETENV 1
#define HAVE_QSORT 1 #define HAVE_QSORT 1
#define HAVE_ABS 1 #define HAVE_ABS 1
#define HAVE_BCOPY 1 #define HAVE_BCOPY 1
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1 #define HAVE_STRTOULL 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
#define HAVE_STRCMP 1 #define HAVE_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1 #define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1 #define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_NDS 1 #define SDL_AUDIO_DRIVER_NDS 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
#define SDL_CDROM_DISABLED 1 #define SDL_CDROM_DISABLED 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_NDS 1 #define SDL_JOYSTICK_NDS 1
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1 #define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */ /* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1 #define SDL_THREADS_DISABLED 1
/* Enable various timer systems */ /* Enable various timer systems */
#define SDL_TIMER_NDS 1 #define SDL_TIMER_NDS 1
/* Enable various video drivers */ /* Enable various video drivers */
#define SDL_VIDEO_DRIVER_NDS 1 #define SDL_VIDEO_DRIVER_NDS 1
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_nds_h */ #endif /* _SDL_config_nds_h */

View File

@ -1,141 +1,141 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_os2_h #ifndef _SDL_config_os2_h
#define _SDL_config_os2_h #define _SDL_config_os2_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef signed short int16_t; typedef signed short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef signed int int32_t; typedef signed int int32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned int size_t; typedef unsigned int size_t;
typedef unsigned long uintptr_t; typedef unsigned long uintptr_t;
typedef signed long long int64_t; typedef signed long long int64_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
/* Use Watcom's LIBC */ /* Use Watcom's LIBC */
#define HAVE_LIBC 1 #define HAVE_LIBC 1
/* Useful headers */ /* Useful headers */
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1 #define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1 #define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1 #define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1 #define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
#define HAVE_FREE 1 #define HAVE_FREE 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_GETENV 1 #define HAVE_GETENV 1
#define HAVE_PUTENV 1 #define HAVE_PUTENV 1
#define HAVE_UNSETENV 1 #define HAVE_UNSETENV 1
#define HAVE_QSORT 1 #define HAVE_QSORT 1
#define HAVE_ABS 1 #define HAVE_ABS 1
#define HAVE_BCOPY 1 #define HAVE_BCOPY 1
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1 #define HAVE_MEMCMP 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE_STRLCPY 1 #define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1 #define HAVE_STRLCAT 1
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
#define HAVE__STRREV 1 #define HAVE__STRREV 1
#define HAVE__STRUPR 1 #define HAVE__STRUPR 1
#define HAVE__STRLWR 1 #define HAVE__STRLWR 1
#define HAVE_INDEX 1 #define HAVE_INDEX 1
#define HAVE_RINDEX 1 #define HAVE_RINDEX 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_ITOA 1 #define HAVE_ITOA 1
#define HAVE__LTOA 1 #define HAVE__LTOA 1
#define HAVE__UITOA 1 #define HAVE__UITOA 1
#define HAVE__ULTOA 1 #define HAVE__ULTOA 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE__I64TOA 1 #define HAVE__I64TOA 1
#define HAVE__UI64TOA 1 #define HAVE__UI64TOA 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
#define HAVE_STRCMP 1 #define HAVE_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE_STRICMP 1 #define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1 #define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1 #define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
#define HAVE_SETJMP 1 #define HAVE_SETJMP 1
#define HAVE_CLOCK_GETTIME 1 #define HAVE_CLOCK_GETTIME 1
/* Enable various audio drivers */ /* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DART 1 #define SDL_AUDIO_DRIVER_DART 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */ /* Enable various cdrom drivers */
#define SDL_CDROM_OS2 1 #define SDL_CDROM_OS2 1
/* Enable various input drivers */ /* Enable various input drivers */
#define SDL_JOYSTICK_OS2 1 #define SDL_JOYSTICK_OS2 1
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#define SDL_LOADSO_OS2 1 #define SDL_LOADSO_OS2 1
/* Enable various threading systems */ /* Enable various threading systems */
#define SDL_THREAD_OS2 1 #define SDL_THREAD_OS2 1
/* Enable various timer systems */ /* Enable various timer systems */
#define SDL_TIMER_OS2 1 #define SDL_TIMER_OS2 1
/* Enable various video drivers */ /* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_OS2FS 1 #define SDL_VIDEO_DRIVER_OS2FS 1
/* Enable OpenGL support */ /* Enable OpenGL support */
/* Nothing here yet for OS/2... :( */ /* Nothing here yet for OS/2... :( */
/* Enable assembly routines where available */ /* Enable assembly routines where available */
#define SDL_ASSEMBLY_ROUTINES 1 #define SDL_ASSEMBLY_ROUTINES 1
#endif /* _SDL_config_os2_h */ #endif /* _SDL_config_os2_h */

View File

@ -1,180 +1,180 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_config_win32_h #ifndef _SDL_config_win32_h
#define _SDL_config_win32_h #define _SDL_config_win32_h
#include "SDL_platform.h" #include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */ /* This is a set of defines to configure the SDL features */
#if defined(__GNUC__) || defined(__DMC__) #if defined(__GNUC__) || defined(__DMC__)
#define HAVE_STDINT_H 1 #define HAVE_STDINT_H 1
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
typedef signed __int8 int8_t; typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t; typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t; typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t; typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
#ifndef _UINTPTR_T_DEFINED #ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64 #ifdef _WIN64
typedef unsigned __int64 uintptr_t; typedef unsigned __int64 uintptr_t;
#else #else
typedef unsigned int uintptr_t; typedef unsigned int uintptr_t;
#endif #endif
#define _UINTPTR_T_DEFINED #define _UINTPTR_T_DEFINED
#endif #endif
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ /* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) #if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD #define DWORD_PTR DWORD
#endif #endif
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) #if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG #define LONG_PTR LONG
#endif #endif
#else /* !__GNUC__ && !_MSC_VER */ #else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef signed short int16_t; typedef signed short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef signed int int32_t; typedef signed int int32_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef signed long long int64_t; typedef signed long long int64_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
#ifndef _SIZE_T_DEFINED_ #ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_ #define _SIZE_T_DEFINED_
typedef unsigned int size_t; typedef unsigned int size_t;
#endif #endif
typedef unsigned int uintptr_t; typedef unsigned int uintptr_t;
#endif /* __GNUC__ || _MSC_VER */ #endif /* __GNUC__ || _MSC_VER */
#define SDL_HAS_64BIT_TYPE 1 #define SDL_HAS_64BIT_TYPE 1
/* Enabled for SDL 1.2 (binary compatibility) */ /* Enabled for SDL 1.2 (binary compatibility) */
#define HAVE_LIBC 1 #define HAVE_LIBC 1
#ifdef HAVE_LIBC #ifdef HAVE_LIBC
/* Useful headers */ /* Useful headers */
#define HAVE_STDIO_H 1 #define HAVE_STDIO_H 1
#define STDC_HEADERS 1 #define STDC_HEADERS 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1 #define HAVE_MATH_H 1
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
#define HAVE_SIGNAL_H 1 #define HAVE_SIGNAL_H 1
#endif #endif
/* C library functions */ /* C library functions */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
#define HAVE_CALLOC 1 #define HAVE_CALLOC 1
#define HAVE_REALLOC 1 #define HAVE_REALLOC 1
#define HAVE_FREE 1 #define HAVE_FREE 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_QSORT 1 #define HAVE_QSORT 1
#define HAVE_ABS 1 #define HAVE_ABS 1
#define HAVE_MEMSET 1 #define HAVE_MEMSET 1
#define HAVE_MEMCPY 1 #define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1 #define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1 #define HAVE_MEMCMP 1
#define HAVE_STRLEN 1 #define HAVE_STRLEN 1
#define HAVE__STRREV 1 #define HAVE__STRREV 1
#define HAVE__STRUPR 1 #define HAVE__STRUPR 1
#define HAVE__STRLWR 1 #define HAVE__STRLWR 1
#define HAVE_STRCHR 1 #define HAVE_STRCHR 1
#define HAVE_STRRCHR 1 #define HAVE_STRRCHR 1
#define HAVE_STRSTR 1 #define HAVE_STRSTR 1
#define HAVE_ITOA 1 #define HAVE_ITOA 1
#define HAVE__LTOA 1 #define HAVE__LTOA 1
#define HAVE__ULTOA 1 #define HAVE__ULTOA 1
#define HAVE_STRTOL 1 #define HAVE_STRTOL 1
#define HAVE_STRTOUL 1 #define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1 #define HAVE_STRTOLL 1
#define HAVE_STRTOD 1 #define HAVE_STRTOD 1
#define HAVE_ATOI 1 #define HAVE_ATOI 1
#define HAVE_ATOF 1 #define HAVE_ATOF 1
#define HAVE_STRCMP 1 #define HAVE_STRCMP 1
#define HAVE_STRNCMP 1 #define HAVE_STRNCMP 1
#define HAVE__STRICMP 1 #define HAVE__STRICMP 1
#define HAVE__STRNICMP 1 #define HAVE__STRNICMP 1
#define HAVE_SSCANF 1 #define HAVE_SSCANF 1
#else #else
#define HAVE_STDARG_H 1 #define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1 #define HAVE_STDDEF_H 1
#endif #endif
/* Enable various audio drivers */ /* Enable various audio drivers */
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1 #define SDL_AUDIO_DRIVER_DSOUND 1
#endif #endif
#define SDL_AUDIO_DRIVER_WAVEOUT 1 #define SDL_AUDIO_DRIVER_WAVEOUT 1
#define SDL_AUDIO_DRIVER_DISK 1 #define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1 #define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */ /* Enable various cdrom drivers */
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
#define SDL_CDROM_DISABLED 1 #define SDL_CDROM_DISABLED 1
#else #else
#define SDL_CDROM_WIN32 1 #define SDL_CDROM_WIN32 1
#endif #endif
/* Enable various input drivers */ /* Enable various input drivers */
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1 #define SDL_JOYSTICK_DISABLED 1
#else #else
#define SDL_JOYSTICK_WINMM 1 #define SDL_JOYSTICK_WINMM 1
#endif #endif
/* Enable various shared object loading systems */ /* Enable various shared object loading systems */
#define SDL_LOADSO_WIN32 1 #define SDL_LOADSO_WIN32 1
/* Enable various threading systems */ /* Enable various threading systems */
#define SDL_THREAD_WIN32 1 #define SDL_THREAD_WIN32 1
/* Enable various timer systems */ /* Enable various timer systems */
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
#define SDL_TIMER_WINCE 1 #define SDL_TIMER_WINCE 1
#else #else
#define SDL_TIMER_WIN32 1 #define SDL_TIMER_WIN32 1
#endif #endif
/* Enable various video drivers */ /* Enable various video drivers */
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
#define SDL_VIDEO_DRIVER_GAPI 1 #define SDL_VIDEO_DRIVER_GAPI 1
#endif #endif
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
#define SDL_VIDEO_DRIVER_DDRAW 1 #define SDL_VIDEO_DRIVER_DDRAW 1
#endif #endif
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WINDIB 1 #define SDL_VIDEO_DRIVER_WINDIB 1
/* Enable OpenGL support */ /* Enable OpenGL support */
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
#define SDL_VIDEO_OPENGL 1 #define SDL_VIDEO_OPENGL 1
#define SDL_VIDEO_OPENGL_WGL 1 #define SDL_VIDEO_OPENGL_WGL 1
#endif #endif
/* Enable assembly routines (Win64 doesn't have inline asm) */ /* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64 #ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1 #define SDL_ASSEMBLY_ROUTINES 1
#endif #endif
#endif /* _SDL_config_win32_h */ #endif /* _SDL_config_win32_h */

View File

@ -1,22 +1,22 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */

View File

@ -1,75 +1,75 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* CPU feature detection for SDL */ /* CPU feature detection for SDL */
#ifndef _SDL_cpuinfo_h #ifndef _SDL_cpuinfo_h
#define _SDL_cpuinfo_h #define _SDL_cpuinfo_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* This function returns true if the CPU has the RDTSC instruction /* This function returns true if the CPU has the RDTSC instruction
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
/* This function returns true if the CPU has MMX features /* This function returns true if the CPU has MMX features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
/* This function returns true if the CPU has MMX Ext. features /* This function returns true if the CPU has MMX Ext. features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
/* This function returns true if the CPU has 3DNow features /* This function returns true if the CPU has 3DNow features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
/* This function returns true if the CPU has 3DNow! Ext. features /* This function returns true if the CPU has 3DNow! Ext. features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
/* This function returns true if the CPU has SSE features /* This function returns true if the CPU has SSE features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
/* This function returns true if the CPU has SSE2 features /* This function returns true if the CPU has SSE2 features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
/* This function returns true if the CPU has AltiVec features /* This function returns true if the CPU has AltiVec features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_cpuinfo_h */ #endif /* _SDL_cpuinfo_h */

View File

@ -1,194 +1,194 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Functions for reading and writing endian-specific values */ /* Functions for reading and writing endian-specific values */
#ifndef _SDL_endian_h #ifndef _SDL_endian_h
#define _SDL_endian_h #define _SDL_endian_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
/* The two types of endianness */ /* The two types of endianness */
#define SDL_LIL_ENDIAN 1234 #define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321 #define SDL_BIG_ENDIAN 4321
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#if defined(__hppa__) || \ #if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \ (defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__) defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN #define SDL_BYTEORDER SDL_BIG_ENDIAN
#else #else
#define SDL_BYTEORDER SDL_LIL_ENDIAN #define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif #endif
#endif /* !SDL_BYTEORDER */ #endif /* !SDL_BYTEORDER */
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Use inline functions for compilers that support them, and static /* Use inline functions for compilers that support them, and static
functions for those that do not. Because these functions become functions for those that do not. Because these functions become
static for compilers that do not support inline functions, this static for compilers that do not support inline functions, this
header should only be included in files that actually use them. header should only be included in files that actually use them.
*/ */
#if defined(__GNUC__) && defined(__i386__) && \ #if defined(__GNUC__) && defined(__i386__) && \
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
static __inline__ Uint16 SDL_Swap16(Uint16 x) static __inline__ Uint16 SDL_Swap16(Uint16 x)
{ {
__asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
return x; return x;
} }
#elif defined(__GNUC__) && defined(__x86_64__) #elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint16 SDL_Swap16(Uint16 x) static __inline__ Uint16 SDL_Swap16(Uint16 x)
{ {
__asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
return x; return x;
} }
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint16 SDL_Swap16(Uint16 x) static __inline__ Uint16 SDL_Swap16(Uint16 x)
{ {
Uint16 result; Uint16 result;
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
return result; return result;
} }
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
static __inline__ Uint16 SDL_Swap16(Uint16 x) static __inline__ Uint16 SDL_Swap16(Uint16 x)
{ {
__asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
return x; return x;
} }
#else #else
static __inline__ Uint16 SDL_Swap16(Uint16 x) { static __inline__ Uint16 SDL_Swap16(Uint16 x) {
return((x<<8)|(x>>8)); return((x<<8)|(x>>8));
} }
#endif #endif
#if defined(__GNUC__) && defined(__i386__) && \ #if defined(__GNUC__) && defined(__i386__) && \
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
static __inline__ Uint32 SDL_Swap32(Uint32 x) static __inline__ Uint32 SDL_Swap32(Uint32 x)
{ {
__asm__("bswap %0" : "=r" (x) : "0" (x)); __asm__("bswap %0" : "=r" (x) : "0" (x));
return x; return x;
} }
#elif defined(__GNUC__) && defined(__x86_64__) #elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint32 SDL_Swap32(Uint32 x) static __inline__ Uint32 SDL_Swap32(Uint32 x)
{ {
__asm__("bswapl %0" : "=r" (x) : "0" (x)); __asm__("bswapl %0" : "=r" (x) : "0" (x));
return x; return x;
} }
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static __inline__ Uint32 SDL_Swap32(Uint32 x) static __inline__ Uint32 SDL_Swap32(Uint32 x)
{ {
Uint32 result; Uint32 result;
__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); __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,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
return result; return result;
} }
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
static __inline__ Uint32 SDL_Swap32(Uint32 x) static __inline__ Uint32 SDL_Swap32(Uint32 x)
{ {
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
return x; return x;
} }
#else #else
static __inline__ Uint32 SDL_Swap32(Uint32 x) { static __inline__ Uint32 SDL_Swap32(Uint32 x) {
return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
} }
#endif #endif
#ifdef SDL_HAS_64BIT_TYPE #ifdef SDL_HAS_64BIT_TYPE
#if defined(__GNUC__) && defined(__i386__) && \ #if defined(__GNUC__) && defined(__i386__) && \
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
static __inline__ Uint64 SDL_Swap64(Uint64 x) static __inline__ Uint64 SDL_Swap64(Uint64 x)
{ {
union { union {
struct { Uint32 a,b; } s; struct { Uint32 a,b; } s;
Uint64 u; Uint64 u;
} v; } v;
v.u = x; v.u = x;
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b) : "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b)); : "0" (v.s.a), "1" (v.s.b));
return v.u; return v.u;
} }
#elif defined(__GNUC__) && defined(__x86_64__) #elif defined(__GNUC__) && defined(__x86_64__)
static __inline__ Uint64 SDL_Swap64(Uint64 x) static __inline__ Uint64 SDL_Swap64(Uint64 x)
{ {
__asm__("bswapq %0" : "=r" (x) : "0" (x)); __asm__("bswapq %0" : "=r" (x) : "0" (x));
return x; return x;
} }
#else #else
static __inline__ Uint64 SDL_Swap64(Uint64 x) static __inline__ Uint64 SDL_Swap64(Uint64 x)
{ {
Uint32 hi, lo; Uint32 hi, lo;
/* Separate into high and low 32-bit values and swap them */ /* Separate into high and low 32-bit values and swap them */
lo = (Uint32)(x&0xFFFFFFFF); lo = (Uint32)(x&0xFFFFFFFF);
x >>= 32; x >>= 32;
hi = (Uint32)(x&0xFFFFFFFF); hi = (Uint32)(x&0xFFFFFFFF);
x = SDL_Swap32(lo); x = SDL_Swap32(lo);
x <<= 32; x <<= 32;
x |= SDL_Swap32(hi); x |= SDL_Swap32(hi);
return(x); return(x);
} }
#endif #endif
#else #else
/* This is mainly to keep compilers from complaining in SDL code. /* This is mainly to keep compilers from complaining in SDL code.
If there is no real 64-bit datatype, then compilers will complain about 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. the fake 64-bit datatype that SDL provides when it compiles user code.
*/ */
#define SDL_Swap64(X) (X) #define SDL_Swap64(X) (X)
#endif /* SDL_HAS_64BIT_TYPE */ #endif /* SDL_HAS_64BIT_TYPE */
/* Byteswap item from the specified endianness to the native endianness */ /* Byteswap item from the specified endianness to the native endianness */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN #if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SDL_SwapLE16(X) (X) #define SDL_SwapLE16(X) (X)
#define SDL_SwapLE32(X) (X) #define SDL_SwapLE32(X) (X)
#define SDL_SwapLE64(X) (X) #define SDL_SwapLE64(X) (X)
#define SDL_SwapBE16(X) SDL_Swap16(X) #define SDL_SwapBE16(X) SDL_Swap16(X)
#define SDL_SwapBE32(X) SDL_Swap32(X) #define SDL_SwapBE32(X) SDL_Swap32(X)
#define SDL_SwapBE64(X) SDL_Swap64(X) #define SDL_SwapBE64(X) SDL_Swap64(X)
#else #else
#define SDL_SwapLE16(X) SDL_Swap16(X) #define SDL_SwapLE16(X) SDL_Swap16(X)
#define SDL_SwapLE32(X) SDL_Swap32(X) #define SDL_SwapLE32(X) SDL_Swap32(X)
#define SDL_SwapLE64(X) SDL_Swap64(X) #define SDL_SwapLE64(X) SDL_Swap64(X)
#define SDL_SwapBE16(X) (X) #define SDL_SwapBE16(X) (X)
#define SDL_SwapBE32(X) (X) #define SDL_SwapBE32(X) (X)
#define SDL_SwapBE64(X) (X) #define SDL_SwapBE64(X) (X)
#endif #endif
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_endian_h */ #endif /* _SDL_endian_h */

View File

@ -1,61 +1,61 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Simple error message routines for SDL */ /* Simple error message routines for SDL */
#ifndef _SDL_error_h #ifndef _SDL_error_h
#define _SDL_error_h #define _SDL_error_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Public functions */ /* Public functions */
extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
extern DECLSPEC char * SDLCALL SDL_GetError(void); extern DECLSPEC char * SDLCALL SDL_GetError(void);
extern DECLSPEC void SDLCALL SDL_ClearError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void);
/* Private error message function - used internally */ /* Private error message function - used internally */
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
typedef enum { typedef enum {
SDL_ENOMEM, SDL_ENOMEM,
SDL_EFREAD, SDL_EFREAD,
SDL_EFWRITE, SDL_EFWRITE,
SDL_EFSEEK, SDL_EFSEEK,
SDL_UNSUPPORTED, SDL_UNSUPPORTED,
SDL_LASTERROR SDL_LASTERROR
} SDL_errorcode; } SDL_errorcode;
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_error_h */ #endif /* _SDL_error_h */

View File

@ -1,337 +1,337 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL event handling */ /* Include file for SDL event handling */
#ifndef _SDL_events_h #ifndef _SDL_events_h
#define _SDL_events_h #define _SDL_events_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_active.h" #include "SDL_active.h"
#include "SDL_keyboard.h" #include "SDL_keyboard.h"
#include "SDL_mouse.h" #include "SDL_mouse.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_quit.h" #include "SDL_quit.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* General keyboard/mouse state definitions */ /* General keyboard/mouse state definitions */
#define SDL_RELEASED 0 #define SDL_RELEASED 0
#define SDL_PRESSED 1 #define SDL_PRESSED 1
/* Event enumerations */ /* Event enumerations */
typedef enum { typedef enum {
SDL_NOEVENT = 0, /* Unused (do not remove) */ SDL_NOEVENT = 0, /* Unused (do not remove) */
SDL_ACTIVEEVENT, /* Application loses/gains visibility */ SDL_ACTIVEEVENT, /* Application loses/gains visibility */
SDL_KEYDOWN, /* Keys pressed */ SDL_KEYDOWN, /* Keys pressed */
SDL_KEYUP, /* Keys released */ SDL_KEYUP, /* Keys released */
SDL_MOUSEMOTION, /* Mouse moved */ SDL_MOUSEMOTION, /* Mouse moved */
SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */ SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */
SDL_MOUSEBUTTONUP, /* Mouse button released */ SDL_MOUSEBUTTONUP, /* Mouse button released */
SDL_JOYAXISMOTION, /* Joystick axis motion */ SDL_JOYAXISMOTION, /* Joystick axis motion */
SDL_JOYBALLMOTION, /* Joystick trackball motion */ SDL_JOYBALLMOTION, /* Joystick trackball motion */
SDL_JOYHATMOTION, /* Joystick hat position change */ SDL_JOYHATMOTION, /* Joystick hat position change */
SDL_JOYBUTTONDOWN, /* Joystick button pressed */ SDL_JOYBUTTONDOWN, /* Joystick button pressed */
SDL_JOYBUTTONUP, /* Joystick button released */ SDL_JOYBUTTONUP, /* Joystick button released */
SDL_QUIT, /* User-requested quit */ SDL_QUIT, /* User-requested quit */
SDL_SYSWMEVENT, /* System specific event */ SDL_SYSWMEVENT, /* System specific event */
SDL_EVENT_RESERVEDA, /* Reserved for future use.. */ SDL_EVENT_RESERVEDA, /* Reserved for future use.. */
SDL_EVENT_RESERVEDB, /* Reserved for future use.. */ SDL_EVENT_RESERVEDB, /* Reserved for future use.. */
SDL_VIDEORESIZE, /* User resized video mode */ SDL_VIDEORESIZE, /* User resized video mode */
SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */ SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */
SDL_EVENT_RESERVED2, /* Reserved for future use.. */ SDL_EVENT_RESERVED2, /* Reserved for future use.. */
SDL_EVENT_RESERVED3, /* Reserved for future use.. */ SDL_EVENT_RESERVED3, /* Reserved for future use.. */
SDL_EVENT_RESERVED4, /* Reserved for future use.. */ SDL_EVENT_RESERVED4, /* Reserved for future use.. */
SDL_EVENT_RESERVED5, /* Reserved for future use.. */ SDL_EVENT_RESERVED5, /* Reserved for future use.. */
SDL_EVENT_RESERVED6, /* Reserved for future use.. */ SDL_EVENT_RESERVED6, /* Reserved for future use.. */
SDL_EVENT_RESERVED7, /* Reserved for future use.. */ SDL_EVENT_RESERVED7, /* Reserved for future use.. */
/* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
SDL_USEREVENT = 24, SDL_USEREVENT = 24,
/* This last event is only for bounding internal arrays /* This last event is only for bounding internal arrays
It is the number of bits in the event mask datatype -- Uint32 It is the number of bits in the event mask datatype -- Uint32
*/ */
SDL_NUMEVENTS = 32 SDL_NUMEVENTS = 32
} SDL_EventType; } SDL_EventType;
/* Predefined event masks */ /* Predefined event masks */
#define SDL_EVENTMASK(X) (1<<(X)) #define SDL_EVENTMASK(X) (1<<(X))
typedef enum { typedef enum {
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
SDL_EVENTMASK(SDL_KEYUP), SDL_EVENTMASK(SDL_KEYUP),
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
SDL_EVENTMASK(SDL_MOUSEBUTTONUP), SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
SDL_EVENTMASK(SDL_JOYBALLMOTION)| SDL_EVENTMASK(SDL_JOYBALLMOTION)|
SDL_EVENTMASK(SDL_JOYHATMOTION)| SDL_EVENTMASK(SDL_JOYHATMOTION)|
SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
SDL_EVENTMASK(SDL_JOYBUTTONUP), SDL_EVENTMASK(SDL_JOYBUTTONUP),
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
} SDL_EventMask ; } SDL_EventMask ;
#define SDL_ALLEVENTS 0xFFFFFFFF #define SDL_ALLEVENTS 0xFFFFFFFF
/* Application visibility event structure */ /* Application visibility event structure */
typedef struct SDL_ActiveEvent { typedef struct SDL_ActiveEvent {
Uint8 type; /* SDL_ACTIVEEVENT */ Uint8 type; /* SDL_ACTIVEEVENT */
Uint8 gain; /* Whether given states were gained or lost (1/0) */ Uint8 gain; /* Whether given states were gained or lost (1/0) */
Uint8 state; /* A mask of the focus states */ Uint8 state; /* A mask of the focus states */
} SDL_ActiveEvent; } SDL_ActiveEvent;
/* Keyboard event structure */ /* Keyboard event structure */
typedef struct SDL_KeyboardEvent { typedef struct SDL_KeyboardEvent {
Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */ Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */
Uint8 which; /* The keyboard device index */ Uint8 which; /* The keyboard device index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
SDL_keysym keysym; SDL_keysym keysym;
} SDL_KeyboardEvent; } SDL_KeyboardEvent;
/* Mouse motion event structure */ /* Mouse motion event structure */
typedef struct SDL_MouseMotionEvent { typedef struct SDL_MouseMotionEvent {
Uint8 type; /* SDL_MOUSEMOTION */ Uint8 type; /* SDL_MOUSEMOTION */
Uint8 which; /* The mouse device index */ Uint8 which; /* The mouse device index */
Uint8 state; /* The current button state */ Uint8 state; /* The current button state */
Uint16 x, y; /* The X/Y coordinates of the mouse */ Uint16 x, y; /* The X/Y coordinates of the mouse */
Sint16 xrel; /* The relative motion in the X direction */ Sint16 xrel; /* The relative motion in the X direction */
Sint16 yrel; /* The relative motion in the Y direction */ Sint16 yrel; /* The relative motion in the Y direction */
} SDL_MouseMotionEvent; } SDL_MouseMotionEvent;
/* Mouse button event structure */ /* Mouse button event structure */
typedef struct SDL_MouseButtonEvent { typedef struct SDL_MouseButtonEvent {
Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
Uint8 which; /* The mouse device index */ Uint8 which; /* The mouse device index */
Uint8 button; /* The mouse button index */ Uint8 button; /* The mouse button index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
Uint16 x, y; /* The X/Y coordinates of the mouse at press time */ Uint16 x, y; /* The X/Y coordinates of the mouse at press time */
} SDL_MouseButtonEvent; } SDL_MouseButtonEvent;
/* Joystick axis motion event structure */ /* Joystick axis motion event structure */
typedef struct SDL_JoyAxisEvent { typedef struct SDL_JoyAxisEvent {
Uint8 type; /* SDL_JOYAXISMOTION */ Uint8 type; /* SDL_JOYAXISMOTION */
Uint8 which; /* The joystick device index */ Uint8 which; /* The joystick device index */
Uint8 axis; /* The joystick axis index */ Uint8 axis; /* The joystick axis index */
Sint16 value; /* The axis value (range: -32768 to 32767) */ Sint16 value; /* The axis value (range: -32768 to 32767) */
} SDL_JoyAxisEvent; } SDL_JoyAxisEvent;
/* Joystick trackball motion event structure */ /* Joystick trackball motion event structure */
typedef struct SDL_JoyBallEvent { typedef struct SDL_JoyBallEvent {
Uint8 type; /* SDL_JOYBALLMOTION */ Uint8 type; /* SDL_JOYBALLMOTION */
Uint8 which; /* The joystick device index */ Uint8 which; /* The joystick device index */
Uint8 ball; /* The joystick trackball index */ Uint8 ball; /* The joystick trackball index */
Sint16 xrel; /* The relative motion in the X direction */ Sint16 xrel; /* The relative motion in the X direction */
Sint16 yrel; /* The relative motion in the Y direction */ Sint16 yrel; /* The relative motion in the Y direction */
} SDL_JoyBallEvent; } SDL_JoyBallEvent;
/* Joystick hat position change event structure */ /* Joystick hat position change event structure */
typedef struct SDL_JoyHatEvent { typedef struct SDL_JoyHatEvent {
Uint8 type; /* SDL_JOYHATMOTION */ Uint8 type; /* SDL_JOYHATMOTION */
Uint8 which; /* The joystick device index */ Uint8 which; /* The joystick device index */
Uint8 hat; /* The joystick hat index */ Uint8 hat; /* The joystick hat index */
Uint8 value; /* The hat position value: Uint8 value; /* The hat position value:
SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
Note that zero means the POV is centered. Note that zero means the POV is centered.
*/ */
} SDL_JoyHatEvent; } SDL_JoyHatEvent;
/* Joystick button event structure */ /* Joystick button event structure */
typedef struct SDL_JoyButtonEvent { typedef struct SDL_JoyButtonEvent {
Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
Uint8 which; /* The joystick device index */ Uint8 which; /* The joystick device index */
Uint8 button; /* The joystick button index */ Uint8 button; /* The joystick button index */
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
} SDL_JoyButtonEvent; } SDL_JoyButtonEvent;
/* The "window resized" event /* The "window resized" event
When you get this event, you are responsible for setting a new video When you get this event, you are responsible for setting a new video
mode with the new width and height. mode with the new width and height.
*/ */
typedef struct SDL_ResizeEvent { typedef struct SDL_ResizeEvent {
Uint8 type; /* SDL_VIDEORESIZE */ Uint8 type; /* SDL_VIDEORESIZE */
int w; /* New width */ int w; /* New width */
int h; /* New height */ int h; /* New height */
} SDL_ResizeEvent; } SDL_ResizeEvent;
/* The "screen redraw" event */ /* The "screen redraw" event */
typedef struct SDL_ExposeEvent { typedef struct SDL_ExposeEvent {
Uint8 type; /* SDL_VIDEOEXPOSE */ Uint8 type; /* SDL_VIDEOEXPOSE */
} SDL_ExposeEvent; } SDL_ExposeEvent;
/* The "quit requested" event */ /* The "quit requested" event */
typedef struct SDL_QuitEvent { typedef struct SDL_QuitEvent {
Uint8 type; /* SDL_QUIT */ Uint8 type; /* SDL_QUIT */
} SDL_QuitEvent; } SDL_QuitEvent;
/* A user-defined event type */ /* A user-defined event type */
typedef struct SDL_UserEvent { typedef struct SDL_UserEvent {
Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */ Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */
int code; /* User defined event code */ int code; /* User defined event code */
void *data1; /* User defined data pointer */ void *data1; /* User defined data pointer */
void *data2; /* User defined data pointer */ void *data2; /* User defined data pointer */
} SDL_UserEvent; } SDL_UserEvent;
/* If you want to use this event, you should include SDL_syswm.h */ /* If you want to use this event, you should include SDL_syswm.h */
struct SDL_SysWMmsg; struct SDL_SysWMmsg;
typedef struct SDL_SysWMmsg SDL_SysWMmsg; typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct SDL_SysWMEvent { typedef struct SDL_SysWMEvent {
Uint8 type; Uint8 type;
SDL_SysWMmsg *msg; SDL_SysWMmsg *msg;
} SDL_SysWMEvent; } SDL_SysWMEvent;
/* General event structure */ /* General event structure */
typedef union SDL_Event { typedef union SDL_Event {
Uint8 type; Uint8 type;
SDL_ActiveEvent active; SDL_ActiveEvent active;
SDL_KeyboardEvent key; SDL_KeyboardEvent key;
SDL_MouseMotionEvent motion; SDL_MouseMotionEvent motion;
SDL_MouseButtonEvent button; SDL_MouseButtonEvent button;
SDL_JoyAxisEvent jaxis; SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball; SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat; SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton; SDL_JoyButtonEvent jbutton;
SDL_ResizeEvent resize; SDL_ResizeEvent resize;
SDL_ExposeEvent expose; SDL_ExposeEvent expose;
SDL_QuitEvent quit; SDL_QuitEvent quit;
SDL_UserEvent user; SDL_UserEvent user;
SDL_SysWMEvent syswm; SDL_SysWMEvent syswm;
} SDL_Event; } SDL_Event;
/* Function prototypes */ /* Function prototypes */
/* Pumps the event loop, gathering events from the input devices. /* Pumps the event loop, gathering events from the input devices.
This function updates the event queue and internal input device state. This function updates the event queue and internal input device state.
This should only be run in the thread that sets the video mode. This should only be run in the thread that sets the video mode.
*/ */
extern DECLSPEC void SDLCALL SDL_PumpEvents(void); extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
/* Checks the event queue for messages and optionally returns them. /* Checks the event queue for messages and optionally returns them.
If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
the back of the event queue. the back of the event queue.
If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
of the event queue, matching 'mask', will be returned and will not of the event queue, matching 'mask', will be returned and will not
be removed from the queue. be removed from the queue.
If 'action' is SDL_GETEVENT, up to 'numevents' events at the front If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
of the event queue, matching 'mask', will be returned and will be of the event queue, matching 'mask', will be returned and will be
removed from the queue. removed from the queue.
This function returns the number of events actually stored, or -1 This function returns the number of events actually stored, or -1
if there was an error. This function is thread-safe. if there was an error. This function is thread-safe.
*/ */
typedef enum { typedef enum {
SDL_ADDEVENT, SDL_ADDEVENT,
SDL_PEEKEVENT, SDL_PEEKEVENT,
SDL_GETEVENT SDL_GETEVENT
} SDL_eventaction; } SDL_eventaction;
/* */ /* */
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
SDL_eventaction action, Uint32 mask); SDL_eventaction action, Uint32 mask);
/* Polls for currently pending events, and returns 1 if there are any pending /* 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 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. event is removed from the queue and stored in that area.
*/ */
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
/* Waits indefinitely for the next available event, returning 1, or 0 if there /* 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 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. event is removed from the queue and stored in that area.
*/ */
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
/* Add an event to the event queue. /* Add an event to the event queue.
This function returns 0 on success, or -1 if the event queue was full This function returns 0 on success, or -1 if the event queue was full
or there was some other error. or there was some other error.
*/ */
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
/* /*
This function sets up a filter to process all events before they This function sets up a filter to process all events before they
change internal state and are posted to the internal event queue. change internal state and are posted to the internal event queue.
The filter is protypted as: The filter is protypted as:
*/ */
typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); 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 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 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 internal state will still be updated. This allows selective filtering of
dynamically arriving events. dynamically arriving events.
WARNING: Be very careful of what you do in the event filter function, as WARNING: Be very careful of what you do in the event filter function, as
it may run in a different thread! it may run in a different thread!
There is one caveat when dealing with the SDL_QUITEVENT event type. The 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 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 application window. If the event filter returns 1, then the window will
be closed, otherwise the window will remain open if possible. be closed, otherwise the window will remain open if possible.
If the quit event is generated by an interrupt signal, it will bypass the 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. internal queue and be delivered to the application at the next event poll.
*/ */
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
/* /*
Return the current event filter - can be used to "chain" filters. Return the current event filter - can be used to "chain" filters.
If there is no event filter set, this function returns NULL. If there is no event filter set, this function returns NULL.
*/ */
extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
/* /*
This function allows you to set the state of processing certain events. 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 If 'state' is set to SDL_IGNORE, that event will be automatically dropped
from the event queue and will not event be filtered. 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_ENABLE, that event will be processed normally.
If 'state' is set to SDL_QUERY, SDL_EventState() will return the If 'state' is set to SDL_QUERY, SDL_EventState() will return the
current processing state of the specified event. current processing state of the specified event.
*/ */
#define SDL_QUERY -1 #define SDL_QUERY -1
#define SDL_IGNORE 0 #define SDL_IGNORE 0
#define SDL_DISABLE 0 #define SDL_DISABLE 0
#define SDL_ENABLE 1 #define SDL_ENABLE 1
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_events_h */ #endif /* _SDL_events_h */

View File

@ -1,24 +1,24 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* DEPRECATED */ /* DEPRECATED */
#include "SDL_stdinc.h" #include "SDL_stdinc.h"

View File

@ -1,167 +1,167 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL joystick event handling */ /* Include file for SDL joystick event handling */
#ifndef _SDL_joystick_h #ifndef _SDL_joystick_h
#define _SDL_joystick_h #define _SDL_joystick_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* In order to use these functions, SDL_Init() must have been called /* 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 with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
for joysticks, and load appropriate drivers. for joysticks, and load appropriate drivers.
*/ */
/* The joystick structure used to identify an SDL joystick */ /* The joystick structure used to identify an SDL joystick */
struct _SDL_Joystick; struct _SDL_Joystick;
typedef struct _SDL_Joystick SDL_Joystick; typedef struct _SDL_Joystick SDL_Joystick;
/* Function prototypes */ /* Function prototypes */
/* /*
* Count the number of joysticks attached to the system * Count the number of joysticks attached to the system
*/ */
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
/* /*
* Get the implementation dependent name of a joystick. * Get the implementation dependent name of a joystick.
* This can be called before any joysticks are opened. * This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL. * If no name can be found, this function returns NULL.
*/ */
extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
/* /*
* Open a joystick for use - the index passed as an argument refers to * 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 * the N'th joystick on the system. This index is the value which will
* identify this joystick in future joystick events. * identify this joystick in future joystick events.
* *
* This function returns a joystick identifier, or NULL if an error occurred. * This function returns a joystick identifier, or NULL if an error occurred.
*/ */
extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
/* /*
* Returns 1 if the joystick has been opened, or 0 if it has not. * Returns 1 if the joystick has been opened, or 0 if it has not.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
/* /*
* Get the device index of an opened joystick. * Get the device index of an opened joystick.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
/* /*
* Get the number of general axis controls on a joystick * Get the number of general axis controls on a joystick
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
/* /*
* Get the number of trackballs on a joystick * Get the number of trackballs on a joystick
* Joystick trackballs have only relative motion events associated * Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled. * with them and their state cannot be polled.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
/* /*
* Get the number of POV hats on a joystick * Get the number of POV hats on a joystick
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
/* /*
* Get the number of buttons on a joystick * Get the number of buttons on a joystick
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
/* /*
* Update the current state of the open joysticks. * Update the current state of the open joysticks.
* This is called automatically by the event loop if any joystick * This is called automatically by the event loop if any joystick
* events are enabled. * events are enabled.
*/ */
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
/* /*
* Enable/disable joystick event polling. * Enable/disable joystick event polling.
* If joystick events are disabled, you must call SDL_JoystickUpdate() * If joystick events are disabled, you must call SDL_JoystickUpdate()
* yourself and check the state of the joystick when you want joystick * yourself and check the state of the joystick when you want joystick
* information. * information.
* The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
/* /*
* Get the current state of an axis control on a joystick * Get the current state of an axis control on a joystick
* The state is a value ranging from -32768 to 32767. * The state is a value ranging from -32768 to 32767.
* The axis indices start at index 0. * The axis indices start at index 0.
*/ */
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
/* /*
* Get the current state of a POV hat on a joystick * Get the current state of a POV hat on a joystick
* The return value is one of the following positions: * The return value is one of the following positions:
*/ */
#define SDL_HAT_CENTERED 0x00 #define SDL_HAT_CENTERED 0x00
#define SDL_HAT_UP 0x01 #define SDL_HAT_UP 0x01
#define SDL_HAT_RIGHT 0x02 #define SDL_HAT_RIGHT 0x02
#define SDL_HAT_DOWN 0x04 #define SDL_HAT_DOWN 0x04
#define SDL_HAT_LEFT 0x08 #define SDL_HAT_LEFT 0x08
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) #define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) #define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
/* /*
* The hat indices start at index 0. * The hat indices start at index 0.
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
/* /*
* Get the ball axis change since the last poll * Get the ball axis change since the last poll
* This returns 0, or -1 if you passed it invalid parameters. * This returns 0, or -1 if you passed it invalid parameters.
* The ball indices start at index 0. * The ball indices start at index 0.
*/ */
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); 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 * Get the current state of a button on a joystick
* The button indices start at index 0. * The button indices start at index 0.
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
/* /*
* Close a joystick previously opened with SDL_JoystickOpen() * Close a joystick previously opened with SDL_JoystickOpen()
*/ */
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_joystick_h */ #endif /* _SDL_joystick_h */

View File

@ -1,121 +1,121 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL keyboard event handling */ /* Include file for SDL keyboard event handling */
#ifndef _SDL_keyboard_h #ifndef _SDL_keyboard_h
#define _SDL_keyboard_h #define _SDL_keyboard_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_keysym.h" #include "SDL_keysym.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Keysym structure /* Keysym structure
- The scancode is hardware dependent, and should not be used by general - The scancode is hardware dependent, and should not be used by general
applications. If no hardware scancode is available, it will be 0. applications. If no hardware scancode is available, it will be 0.
- The 'unicode' translated character is only available when character - The 'unicode' translated character is only available when character
translation is enabled by the SDL_EnableUNICODE() API. If non-zero, translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
this is a UNICODE character corresponding to the keypress. If the 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 high 9 bits of the character are 0, then this maps to the equivalent
ASCII character: ASCII character:
char ch; char ch;
if ( (keysym.unicode & 0xFF80) == 0 ) { if ( (keysym.unicode & 0xFF80) == 0 ) {
ch = keysym.unicode & 0x7F; ch = keysym.unicode & 0x7F;
} else { } else {
An international character.. An international character..
} }
*/ */
typedef struct SDL_keysym { typedef struct SDL_keysym {
Uint8 scancode; /* hardware specific scancode */ Uint8 scancode; /* hardware specific scancode */
SDLKey sym; /* SDL virtual keysym */ SDLKey sym; /* SDL virtual keysym */
SDLMod mod; /* current key modifiers */ SDLMod mod; /* current key modifiers */
Uint16 unicode; /* translated character */ Uint16 unicode; /* translated character */
} SDL_keysym; } SDL_keysym;
/* This is the mask which refers to all hotkey bindings */ /* This is the mask which refers to all hotkey bindings */
#define SDL_ALL_HOTKEYS 0xFFFFFFFF #define SDL_ALL_HOTKEYS 0xFFFFFFFF
/* Function prototypes */ /* Function prototypes */
/* /*
* Enable/Disable UNICODE translation of keyboard input. * Enable/Disable UNICODE translation of keyboard input.
* This translation has some overhead, so translation defaults off. * This translation has some overhead, so translation defaults off.
* If 'enable' is 1, translation is enabled. * If 'enable' is 1, translation is enabled.
* If 'enable' is 0, translation is disabled. * If 'enable' is 0, translation is disabled.
* If 'enable' is -1, the translation state is not changed. * If 'enable' is -1, the translation state is not changed.
* It returns the previous state of keyboard translation. * It returns the previous state of keyboard translation.
*/ */
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
/* /*
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off. * Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
* 'delay' is the initial delay in ms between the time when a key is * 'delay' is the initial delay in ms between the time when a key is
* pressed, and keyboard repeat begins. * pressed, and keyboard repeat begins.
* 'interval' is the time in ms between keyboard repeat events. * 'interval' is the time in ms between keyboard repeat events.
*/ */
#define SDL_DEFAULT_REPEAT_DELAY 500 #define SDL_DEFAULT_REPEAT_DELAY 500
#define SDL_DEFAULT_REPEAT_INTERVAL 30 #define SDL_DEFAULT_REPEAT_INTERVAL 30
/* /*
* If 'delay' is set to 0, keyboard repeat is disabled. * If 'delay' is set to 0, keyboard repeat is disabled.
*/ */
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
/* /*
* Get a snapshot of the current state of the keyboard. * Get a snapshot of the current state of the keyboard.
* Returns an array of keystates, indexed by the SDLK_* syms. * Returns an array of keystates, indexed by the SDLK_* syms.
* Used: * Used:
* Uint8 *keystate = SDL_GetKeyState(NULL); * Uint8 *keystate = SDL_GetKeyState(NULL);
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed. * if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
*/ */
extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
/* /*
* Get the current key modifier state * Get the current key modifier state
*/ */
extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
/* /*
* Set the current key modifier state * Set the current key modifier state
* This does not change the keyboard state, only the key modifier flags. * This does not change the keyboard state, only the key modifier flags.
*/ */
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
/* /*
* Get the name of an SDL virtual keysym * Get the name of an SDL virtual keysym
*/ */
extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_keyboard_h */ #endif /* _SDL_keyboard_h */

View File

@ -1,311 +1,311 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_keysym_h #ifndef _SDL_keysym_h
#define _SDL_keysym_h #define _SDL_keysym_h
/* What we really want is a mapping of every raw key on the keyboard. /* What we really want is a mapping of every raw key on the keyboard.
To support international keyboards, we use the range 0xA1 - 0xFF To support international keyboards, we use the range 0xA1 - 0xFF
as international virtual keycodes. We'll follow in the footsteps of X11... as international virtual keycodes. We'll follow in the footsteps of X11...
The names of the keys The names of the keys
*/ */
typedef enum { typedef enum {
/* The keyboard syms have been cleverly chosen to map to ASCII */ /* The keyboard syms have been cleverly chosen to map to ASCII */
SDLK_UNKNOWN = 0, SDLK_UNKNOWN = 0,
SDLK_FIRST = 0, SDLK_FIRST = 0,
SDLK_BACKSPACE = 8, SDLK_BACKSPACE = 8,
SDLK_TAB = 9, SDLK_TAB = 9,
SDLK_CLEAR = 12, SDLK_CLEAR = 12,
SDLK_RETURN = 13, SDLK_RETURN = 13,
SDLK_PAUSE = 19, SDLK_PAUSE = 19,
SDLK_ESCAPE = 27, SDLK_ESCAPE = 27,
SDLK_SPACE = 32, SDLK_SPACE = 32,
SDLK_EXCLAIM = 33, SDLK_EXCLAIM = 33,
SDLK_QUOTEDBL = 34, SDLK_QUOTEDBL = 34,
SDLK_HASH = 35, SDLK_HASH = 35,
SDLK_DOLLAR = 36, SDLK_DOLLAR = 36,
SDLK_AMPERSAND = 38, SDLK_AMPERSAND = 38,
SDLK_QUOTE = 39, SDLK_QUOTE = 39,
SDLK_LEFTPAREN = 40, SDLK_LEFTPAREN = 40,
SDLK_RIGHTPAREN = 41, SDLK_RIGHTPAREN = 41,
SDLK_ASTERISK = 42, SDLK_ASTERISK = 42,
SDLK_PLUS = 43, SDLK_PLUS = 43,
SDLK_COMMA = 44, SDLK_COMMA = 44,
SDLK_MINUS = 45, SDLK_MINUS = 45,
SDLK_PERIOD = 46, SDLK_PERIOD = 46,
SDLK_SLASH = 47, SDLK_SLASH = 47,
SDLK_0 = 48, SDLK_0 = 48,
SDLK_1 = 49, SDLK_1 = 49,
SDLK_2 = 50, SDLK_2 = 50,
SDLK_3 = 51, SDLK_3 = 51,
SDLK_4 = 52, SDLK_4 = 52,
SDLK_5 = 53, SDLK_5 = 53,
SDLK_6 = 54, SDLK_6 = 54,
SDLK_7 = 55, SDLK_7 = 55,
SDLK_8 = 56, SDLK_8 = 56,
SDLK_9 = 57, SDLK_9 = 57,
SDLK_COLON = 58, SDLK_COLON = 58,
SDLK_SEMICOLON = 59, SDLK_SEMICOLON = 59,
SDLK_LESS = 60, SDLK_LESS = 60,
SDLK_EQUALS = 61, SDLK_EQUALS = 61,
SDLK_GREATER = 62, SDLK_GREATER = 62,
SDLK_QUESTION = 63, SDLK_QUESTION = 63,
SDLK_AT = 64, SDLK_AT = 64,
/* /*
Skip uppercase letters Skip uppercase letters
*/ */
SDLK_LEFTBRACKET = 91, SDLK_LEFTBRACKET = 91,
SDLK_BACKSLASH = 92, SDLK_BACKSLASH = 92,
SDLK_RIGHTBRACKET = 93, SDLK_RIGHTBRACKET = 93,
SDLK_CARET = 94, SDLK_CARET = 94,
SDLK_UNDERSCORE = 95, SDLK_UNDERSCORE = 95,
SDLK_BACKQUOTE = 96, SDLK_BACKQUOTE = 96,
SDLK_a = 97, SDLK_a = 97,
SDLK_b = 98, SDLK_b = 98,
SDLK_c = 99, SDLK_c = 99,
SDLK_d = 100, SDLK_d = 100,
SDLK_e = 101, SDLK_e = 101,
SDLK_f = 102, SDLK_f = 102,
SDLK_g = 103, SDLK_g = 103,
SDLK_h = 104, SDLK_h = 104,
SDLK_i = 105, SDLK_i = 105,
SDLK_j = 106, SDLK_j = 106,
SDLK_k = 107, SDLK_k = 107,
SDLK_l = 108, SDLK_l = 108,
SDLK_m = 109, SDLK_m = 109,
SDLK_n = 110, SDLK_n = 110,
SDLK_o = 111, SDLK_o = 111,
SDLK_p = 112, SDLK_p = 112,
SDLK_q = 113, SDLK_q = 113,
SDLK_r = 114, SDLK_r = 114,
SDLK_s = 115, SDLK_s = 115,
SDLK_t = 116, SDLK_t = 116,
SDLK_u = 117, SDLK_u = 117,
SDLK_v = 118, SDLK_v = 118,
SDLK_w = 119, SDLK_w = 119,
SDLK_x = 120, SDLK_x = 120,
SDLK_y = 121, SDLK_y = 121,
SDLK_z = 122, SDLK_z = 122,
SDLK_DELETE = 127, SDLK_DELETE = 127,
/* End of ASCII mapped keysyms */ /* End of ASCII mapped keysyms */
/* International keyboard syms */ /* International keyboard syms */
SDLK_WORLD_0 = 160, /* 0xA0 */ SDLK_WORLD_0 = 160, /* 0xA0 */
SDLK_WORLD_1 = 161, SDLK_WORLD_1 = 161,
SDLK_WORLD_2 = 162, SDLK_WORLD_2 = 162,
SDLK_WORLD_3 = 163, SDLK_WORLD_3 = 163,
SDLK_WORLD_4 = 164, SDLK_WORLD_4 = 164,
SDLK_WORLD_5 = 165, SDLK_WORLD_5 = 165,
SDLK_WORLD_6 = 166, SDLK_WORLD_6 = 166,
SDLK_WORLD_7 = 167, SDLK_WORLD_7 = 167,
SDLK_WORLD_8 = 168, SDLK_WORLD_8 = 168,
SDLK_WORLD_9 = 169, SDLK_WORLD_9 = 169,
SDLK_WORLD_10 = 170, SDLK_WORLD_10 = 170,
SDLK_WORLD_11 = 171, SDLK_WORLD_11 = 171,
SDLK_WORLD_12 = 172, SDLK_WORLD_12 = 172,
SDLK_WORLD_13 = 173, SDLK_WORLD_13 = 173,
SDLK_WORLD_14 = 174, SDLK_WORLD_14 = 174,
SDLK_WORLD_15 = 175, SDLK_WORLD_15 = 175,
SDLK_WORLD_16 = 176, SDLK_WORLD_16 = 176,
SDLK_WORLD_17 = 177, SDLK_WORLD_17 = 177,
SDLK_WORLD_18 = 178, SDLK_WORLD_18 = 178,
SDLK_WORLD_19 = 179, SDLK_WORLD_19 = 179,
SDLK_WORLD_20 = 180, SDLK_WORLD_20 = 180,
SDLK_WORLD_21 = 181, SDLK_WORLD_21 = 181,
SDLK_WORLD_22 = 182, SDLK_WORLD_22 = 182,
SDLK_WORLD_23 = 183, SDLK_WORLD_23 = 183,
SDLK_WORLD_24 = 184, SDLK_WORLD_24 = 184,
SDLK_WORLD_25 = 185, SDLK_WORLD_25 = 185,
SDLK_WORLD_26 = 186, SDLK_WORLD_26 = 186,
SDLK_WORLD_27 = 187, SDLK_WORLD_27 = 187,
SDLK_WORLD_28 = 188, SDLK_WORLD_28 = 188,
SDLK_WORLD_29 = 189, SDLK_WORLD_29 = 189,
SDLK_WORLD_30 = 190, SDLK_WORLD_30 = 190,
SDLK_WORLD_31 = 191, SDLK_WORLD_31 = 191,
SDLK_WORLD_32 = 192, SDLK_WORLD_32 = 192,
SDLK_WORLD_33 = 193, SDLK_WORLD_33 = 193,
SDLK_WORLD_34 = 194, SDLK_WORLD_34 = 194,
SDLK_WORLD_35 = 195, SDLK_WORLD_35 = 195,
SDLK_WORLD_36 = 196, SDLK_WORLD_36 = 196,
SDLK_WORLD_37 = 197, SDLK_WORLD_37 = 197,
SDLK_WORLD_38 = 198, SDLK_WORLD_38 = 198,
SDLK_WORLD_39 = 199, SDLK_WORLD_39 = 199,
SDLK_WORLD_40 = 200, SDLK_WORLD_40 = 200,
SDLK_WORLD_41 = 201, SDLK_WORLD_41 = 201,
SDLK_WORLD_42 = 202, SDLK_WORLD_42 = 202,
SDLK_WORLD_43 = 203, SDLK_WORLD_43 = 203,
SDLK_WORLD_44 = 204, SDLK_WORLD_44 = 204,
SDLK_WORLD_45 = 205, SDLK_WORLD_45 = 205,
SDLK_WORLD_46 = 206, SDLK_WORLD_46 = 206,
SDLK_WORLD_47 = 207, SDLK_WORLD_47 = 207,
SDLK_WORLD_48 = 208, SDLK_WORLD_48 = 208,
SDLK_WORLD_49 = 209, SDLK_WORLD_49 = 209,
SDLK_WORLD_50 = 210, SDLK_WORLD_50 = 210,
SDLK_WORLD_51 = 211, SDLK_WORLD_51 = 211,
SDLK_WORLD_52 = 212, SDLK_WORLD_52 = 212,
SDLK_WORLD_53 = 213, SDLK_WORLD_53 = 213,
SDLK_WORLD_54 = 214, SDLK_WORLD_54 = 214,
SDLK_WORLD_55 = 215, SDLK_WORLD_55 = 215,
SDLK_WORLD_56 = 216, SDLK_WORLD_56 = 216,
SDLK_WORLD_57 = 217, SDLK_WORLD_57 = 217,
SDLK_WORLD_58 = 218, SDLK_WORLD_58 = 218,
SDLK_WORLD_59 = 219, SDLK_WORLD_59 = 219,
SDLK_WORLD_60 = 220, SDLK_WORLD_60 = 220,
SDLK_WORLD_61 = 221, SDLK_WORLD_61 = 221,
SDLK_WORLD_62 = 222, SDLK_WORLD_62 = 222,
SDLK_WORLD_63 = 223, SDLK_WORLD_63 = 223,
SDLK_WORLD_64 = 224, SDLK_WORLD_64 = 224,
SDLK_WORLD_65 = 225, SDLK_WORLD_65 = 225,
SDLK_WORLD_66 = 226, SDLK_WORLD_66 = 226,
SDLK_WORLD_67 = 227, SDLK_WORLD_67 = 227,
SDLK_WORLD_68 = 228, SDLK_WORLD_68 = 228,
SDLK_WORLD_69 = 229, SDLK_WORLD_69 = 229,
SDLK_WORLD_70 = 230, SDLK_WORLD_70 = 230,
SDLK_WORLD_71 = 231, SDLK_WORLD_71 = 231,
SDLK_WORLD_72 = 232, SDLK_WORLD_72 = 232,
SDLK_WORLD_73 = 233, SDLK_WORLD_73 = 233,
SDLK_WORLD_74 = 234, SDLK_WORLD_74 = 234,
SDLK_WORLD_75 = 235, SDLK_WORLD_75 = 235,
SDLK_WORLD_76 = 236, SDLK_WORLD_76 = 236,
SDLK_WORLD_77 = 237, SDLK_WORLD_77 = 237,
SDLK_WORLD_78 = 238, SDLK_WORLD_78 = 238,
SDLK_WORLD_79 = 239, SDLK_WORLD_79 = 239,
SDLK_WORLD_80 = 240, SDLK_WORLD_80 = 240,
SDLK_WORLD_81 = 241, SDLK_WORLD_81 = 241,
SDLK_WORLD_82 = 242, SDLK_WORLD_82 = 242,
SDLK_WORLD_83 = 243, SDLK_WORLD_83 = 243,
SDLK_WORLD_84 = 244, SDLK_WORLD_84 = 244,
SDLK_WORLD_85 = 245, SDLK_WORLD_85 = 245,
SDLK_WORLD_86 = 246, SDLK_WORLD_86 = 246,
SDLK_WORLD_87 = 247, SDLK_WORLD_87 = 247,
SDLK_WORLD_88 = 248, SDLK_WORLD_88 = 248,
SDLK_WORLD_89 = 249, SDLK_WORLD_89 = 249,
SDLK_WORLD_90 = 250, SDLK_WORLD_90 = 250,
SDLK_WORLD_91 = 251, SDLK_WORLD_91 = 251,
SDLK_WORLD_92 = 252, SDLK_WORLD_92 = 252,
SDLK_WORLD_93 = 253, SDLK_WORLD_93 = 253,
SDLK_WORLD_94 = 254, SDLK_WORLD_94 = 254,
SDLK_WORLD_95 = 255, /* 0xFF */ SDLK_WORLD_95 = 255, /* 0xFF */
/* Numeric keypad */ /* Numeric keypad */
SDLK_KP0 = 256, SDLK_KP0 = 256,
SDLK_KP1 = 257, SDLK_KP1 = 257,
SDLK_KP2 = 258, SDLK_KP2 = 258,
SDLK_KP3 = 259, SDLK_KP3 = 259,
SDLK_KP4 = 260, SDLK_KP4 = 260,
SDLK_KP5 = 261, SDLK_KP5 = 261,
SDLK_KP6 = 262, SDLK_KP6 = 262,
SDLK_KP7 = 263, SDLK_KP7 = 263,
SDLK_KP8 = 264, SDLK_KP8 = 264,
SDLK_KP9 = 265, SDLK_KP9 = 265,
SDLK_KP_PERIOD = 266, SDLK_KP_PERIOD = 266,
SDLK_KP_DIVIDE = 267, SDLK_KP_DIVIDE = 267,
SDLK_KP_MULTIPLY = 268, SDLK_KP_MULTIPLY = 268,
SDLK_KP_MINUS = 269, SDLK_KP_MINUS = 269,
SDLK_KP_PLUS = 270, SDLK_KP_PLUS = 270,
SDLK_KP_ENTER = 271, SDLK_KP_ENTER = 271,
SDLK_KP_EQUALS = 272, SDLK_KP_EQUALS = 272,
/* Arrows + Home/End pad */ /* Arrows + Home/End pad */
SDLK_UP = 273, SDLK_UP = 273,
SDLK_DOWN = 274, SDLK_DOWN = 274,
SDLK_RIGHT = 275, SDLK_RIGHT = 275,
SDLK_LEFT = 276, SDLK_LEFT = 276,
SDLK_INSERT = 277, SDLK_INSERT = 277,
SDLK_HOME = 278, SDLK_HOME = 278,
SDLK_END = 279, SDLK_END = 279,
SDLK_PAGEUP = 280, SDLK_PAGEUP = 280,
SDLK_PAGEDOWN = 281, SDLK_PAGEDOWN = 281,
/* Function keys */ /* Function keys */
SDLK_F1 = 282, SDLK_F1 = 282,
SDLK_F2 = 283, SDLK_F2 = 283,
SDLK_F3 = 284, SDLK_F3 = 284,
SDLK_F4 = 285, SDLK_F4 = 285,
SDLK_F5 = 286, SDLK_F5 = 286,
SDLK_F6 = 287, SDLK_F6 = 287,
SDLK_F7 = 288, SDLK_F7 = 288,
SDLK_F8 = 289, SDLK_F8 = 289,
SDLK_F9 = 290, SDLK_F9 = 290,
SDLK_F10 = 291, SDLK_F10 = 291,
SDLK_F11 = 292, SDLK_F11 = 292,
SDLK_F12 = 293, SDLK_F12 = 293,
SDLK_F13 = 294, SDLK_F13 = 294,
SDLK_F14 = 295, SDLK_F14 = 295,
SDLK_F15 = 296, SDLK_F15 = 296,
/* Key state modifier keys */ /* Key state modifier keys */
SDLK_NUMLOCK = 300, SDLK_NUMLOCK = 300,
SDLK_CAPSLOCK = 301, SDLK_CAPSLOCK = 301,
SDLK_SCROLLOCK = 302, SDLK_SCROLLOCK = 302,
SDLK_RSHIFT = 303, SDLK_RSHIFT = 303,
SDLK_LSHIFT = 304, SDLK_LSHIFT = 304,
SDLK_RCTRL = 305, SDLK_RCTRL = 305,
SDLK_LCTRL = 306, SDLK_LCTRL = 306,
SDLK_RALT = 307, SDLK_RALT = 307,
SDLK_LALT = 308, SDLK_LALT = 308,
SDLK_RMETA = 309, SDLK_RMETA = 309,
SDLK_LMETA = 310, SDLK_LMETA = 310,
SDLK_LSUPER = 311, /* Left "Windows" key */ SDLK_LSUPER = 311, /* Left "Windows" key */
SDLK_RSUPER = 312, /* Right "Windows" key */ SDLK_RSUPER = 312, /* Right "Windows" key */
SDLK_MODE = 313, /* "Alt Gr" key */ SDLK_MODE = 313, /* "Alt Gr" key */
SDLK_COMPOSE = 314, /* Multi-key compose key */ SDLK_COMPOSE = 314, /* Multi-key compose key */
/* Miscellaneous function keys */ /* Miscellaneous function keys */
SDLK_HELP = 315, SDLK_HELP = 315,
SDLK_PRINT = 316, SDLK_PRINT = 316,
SDLK_SYSREQ = 317, SDLK_SYSREQ = 317,
SDLK_BREAK = 318, SDLK_BREAK = 318,
SDLK_MENU = 319, SDLK_MENU = 319,
SDLK_POWER = 320, /* Power Macintosh power key */ SDLK_POWER = 320, /* Power Macintosh power key */
SDLK_EURO = 321, /* Some european keyboards */ SDLK_EURO = 321, /* Some european keyboards */
SDLK_UNDO = 322, /* Atari keyboard has Undo */ SDLK_UNDO = 322, /* Atari keyboard has Undo */
/* Add any other keys here */ /* Add any other keys here */
SDLK_LAST SDLK_LAST
} SDLKey; } SDLKey;
/* Enumeration of valid key mods (possibly OR'd together) */ /* Enumeration of valid key mods (possibly OR'd together) */
typedef enum { typedef enum {
KMOD_NONE = 0x0000, KMOD_NONE = 0x0000,
KMOD_LSHIFT= 0x0001, KMOD_LSHIFT= 0x0001,
KMOD_RSHIFT= 0x0002, KMOD_RSHIFT= 0x0002,
KMOD_LCTRL = 0x0040, KMOD_LCTRL = 0x0040,
KMOD_RCTRL = 0x0080, KMOD_RCTRL = 0x0080,
KMOD_LALT = 0x0100, KMOD_LALT = 0x0100,
KMOD_RALT = 0x0200, KMOD_RALT = 0x0200,
KMOD_LMETA = 0x0400, KMOD_LMETA = 0x0400,
KMOD_RMETA = 0x0800, KMOD_RMETA = 0x0800,
KMOD_NUM = 0x1000, KMOD_NUM = 0x1000,
KMOD_CAPS = 0x2000, KMOD_CAPS = 0x2000,
KMOD_MODE = 0x4000, KMOD_MODE = 0x4000,
KMOD_RESERVED = 0x8000 KMOD_RESERVED = 0x8000
} SDLMod; } SDLMod;
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) #define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) #define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
#define KMOD_ALT (KMOD_LALT|KMOD_RALT) #define KMOD_ALT (KMOD_LALT|KMOD_RALT)
#define KMOD_META (KMOD_LMETA|KMOD_RMETA) #define KMOD_META (KMOD_LMETA|KMOD_RMETA)
#endif /* _SDL_keysym_h */ #endif /* _SDL_keysym_h */

View File

@ -1,74 +1,74 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */ /* System dependent library loading routines */
/* Some things to keep in mind: /* Some things to keep in mind:
- These functions only work on C function names. Other languages may - These functions only work on C function names. Other languages may
have name mangling and intrinsic language support that varies from have name mangling and intrinsic language support that varies from
compiler to compiler. compiler to compiler.
- Make sure you declare your function pointers with the same calling - Make sure you declare your function pointers with the same calling
convention as the actual library function. Your code will crash convention as the actual library function. Your code will crash
mysteriously if you do not do this. mysteriously if you do not do this.
- Avoid namespace collisions. If you load a symbol from the library, - Avoid namespace collisions. If you load a symbol from the library,
it is not defined whether or not it goes into the global symbol it is not defined whether or not it goes into the global symbol
namespace for the application. If it does and it conflicts with namespace for the application. If it does and it conflicts with
symbols in your code or other shared libraries, you will not get symbols in your code or other shared libraries, you will not get
the results you expect. :) the results you expect. :)
*/ */
#ifndef _SDL_loadso_h #ifndef _SDL_loadso_h
#define _SDL_loadso_h #define _SDL_loadso_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* This function dynamically loads a shared object and returns a pointer /* This function dynamically loads a shared object and returns a pointer
* to the object handle (or NULL if there was an error). * to the object handle (or NULL if there was an error).
* The 'sofile' parameter is a system dependent name of the object file. * The 'sofile' parameter is a system dependent name of the object file.
*/ */
extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
/* Given an object handle, this function looks up the address of the /* Given an object handle, this function looks up the address of the
* named function in the shared object and returns it. This address * named function in the shared object and returns it. This address
* is no longer valid after calling SDL_UnloadObject(). * is no longer valid after calling SDL_UnloadObject().
*/ */
extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
/* Unload a shared object from memory */ /* Unload a shared object from memory */
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_loadso_h */ #endif /* _SDL_loadso_h */

View File

@ -1,98 +1,98 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_main_h #ifndef _SDL_main_h
#define _SDL_main_h #define _SDL_main_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */ /* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
#if defined(__WIN32__) || \ #if defined(__WIN32__) || \
(defined(__MWERKS__) && !defined(__BEOS__)) || \ (defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(__MACOS__) || defined(__MACOSX__) || \ defined(__MACOS__) || defined(__MACOSX__) || \
defined(__SYMBIAN32__) || defined(QWS) defined(__SYMBIAN32__) || defined(QWS)
#ifdef __cplusplus #ifdef __cplusplus
#define C_LINKAGE "C" #define C_LINKAGE "C"
#else #else
#define C_LINKAGE #define C_LINKAGE
#endif /* __cplusplus */ #endif /* __cplusplus */
/* The application's main() function must be called with C linkage, /* The application's main() function must be called with C linkage,
and should be declared like this: and should be declared like this:
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
} }
*/ */
#define main SDL_main #define main SDL_main
/* The prototype for the application's main() function */ /* The prototype for the application's main() function */
extern C_LINKAGE int SDL_main(int argc, char *argv[]); extern C_LINKAGE int SDL_main(int argc, char *argv[]);
/* From the SDL library code -- needed for registering the app on Win32 */ /* From the SDL library code -- needed for registering the app on Win32 */
#ifdef __WIN32__ #ifdef __WIN32__
#include "begin_code.h" #include "begin_code.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* This should be called from your WinMain() function, if any */ /* This should be called from your WinMain() function, if any */
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
/* This can also be called, but is no longer necessary */ /* This can also be called, but is no longer necessary */
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); 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) */ /* This can also be called, but is no longer necessary (SDL_Quit calls it) */
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif #endif
/* From the SDL library code -- needed for registering QuickDraw on MacOS */ /* From the SDL library code -- needed for registering QuickDraw on MacOS */
#if defined(__MACOS__) #if defined(__MACOS__)
#include "begin_code.h" #include "begin_code.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Forward declaration so we don't need to include QuickDraw.h */ /* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals; struct QDGlobals;
/* This should be called from your main() function, if any */ /* This should be called from your main() function, if any */
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif #endif
#endif /* Need to redefine main()? */ #endif /* Need to redefine main()? */
#endif /* _SDL_main_h */ #endif /* _SDL_main_h */

View File

@ -1,140 +1,140 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL mouse event handling */ /* Include file for SDL mouse event handling */
#ifndef _SDL_mouse_h #ifndef _SDL_mouse_h
#define _SDL_mouse_h #define _SDL_mouse_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_video.h" #include "SDL_video.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct WMcursor WMcursor; /* Implementation dependent */ typedef struct WMcursor WMcursor; /* Implementation dependent */
typedef struct SDL_Cursor { typedef struct SDL_Cursor {
SDL_Rect area; /* The area of the mouse cursor */ SDL_Rect area; /* The area of the mouse cursor */
Sint16 hot_x, hot_y; /* The "tip" of the cursor */ Sint16 hot_x, hot_y; /* The "tip" of the cursor */
Uint8 *data; /* B/W cursor data */ Uint8 *data; /* B/W cursor data */
Uint8 *mask; /* B/W cursor mask */ Uint8 *mask; /* B/W cursor mask */
Uint8 *save[2]; /* Place to save cursor area */ Uint8 *save[2]; /* Place to save cursor area */
WMcursor *wm_cursor; /* Window-manager cursor */ WMcursor *wm_cursor; /* Window-manager cursor */
} SDL_Cursor; } SDL_Cursor;
/* Function prototypes */ /* Function prototypes */
/* /*
* Retrieve the current state of the mouse. * Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can * 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 * 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. * current mouse cursor position. You can pass NULL for either x or y.
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
/* /*
* Retrieve the current state of the mouse. * Retrieve the current state of the mouse.
* The current button state is returned as a button bitmask, which can * 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 * 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(). * mouse deltas since the last call to SDL_GetRelativeMouseState().
*/ */
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
/* /*
* Set the position of the mouse cursor (generates a mouse motion event) * Set the position of the mouse cursor (generates a mouse motion event)
*/ */
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
/* /*
* Create a cursor using the specified data and mask (in MSB format). * Create a cursor using the specified data and mask (in MSB format).
* The cursor width must be a multiple of 8 bits. * The cursor width must be a multiple of 8 bits.
* *
* The cursor is created in black and white according to the following: * The cursor is created in black and white according to the following:
* data mask resulting pixel on screen * data mask resulting pixel on screen
* 0 1 White * 0 1 White
* 1 1 Black * 1 1 Black
* 0 0 Transparent * 0 0 Transparent
* 1 0 Inverted color if possible, black if not. * 1 0 Inverted color if possible, black if not.
* *
* Cursors created with this function must be freed with SDL_FreeCursor(). * Cursors created with this function must be freed with SDL_FreeCursor().
*/ */
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
/* /*
* Set the currently active cursor to the specified one. * Set the currently active cursor to the specified one.
* If the cursor is currently visible, the change will be immediately * If the cursor is currently visible, the change will be immediately
* represented on the display. * represented on the display.
*/ */
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
/* /*
* Returns the currently active cursor. * Returns the currently active cursor.
*/ */
extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
/* /*
* Deallocates a cursor created with SDL_CreateCursor(). * Deallocates a cursor created with SDL_CreateCursor().
*/ */
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
/* /*
* Toggle whether or not the cursor is shown on the screen. * Toggle whether or not the cursor is shown on the screen.
* The cursor start off displayed, but can be turned off. * The cursor start off displayed, but can be turned off.
* SDL_ShowCursor() returns 1 if the cursor was being displayed * SDL_ShowCursor() returns 1 if the cursor was being displayed
* before the call, or 0 if it was not. You can query the current * before the call, or 0 if it was not. You can query the current
* state by passing a 'toggle' value of -1. * state by passing a 'toggle' value of -1.
*/ */
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
/* Used as a mask when testing buttons in buttonstate /* Used as a mask when testing buttons in buttonstate
Button 1: Left mouse button Button 1: Left mouse button
Button 2: Middle mouse button Button 2: Middle mouse button
Button 3: Right mouse button Button 3: Right mouse button
Button 4: Mouse wheel up (may also be a real button) Button 4: Mouse wheel up (may also be a real button)
Button 5: Mouse wheel down (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(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 1 #define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2 #define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3 #define SDL_BUTTON_RIGHT 3
#define SDL_BUTTON_WHEELUP 4 #define SDL_BUTTON_WHEELUP 4
#define SDL_BUTTON_WHEELDOWN 5 #define SDL_BUTTON_WHEELDOWN 5
#define SDL_BUTTON_X1 6 #define SDL_BUTTON_X1 6
#define SDL_BUTTON_X2 7 #define SDL_BUTTON_X2 7
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) #define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_mouse_h */ #endif /* _SDL_mouse_h */

View File

@ -1,162 +1,162 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_mutex_h #ifndef _SDL_mutex_h
#define _SDL_mutex_h #define _SDL_mutex_h
/* Functions to provide thread synchronization primitives /* Functions to provide thread synchronization primitives
These are independent of the other SDL routines. These are independent of the other SDL routines.
*/ */
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Synchronization functions which can time out return this value /* Synchronization functions which can time out return this value
if they time out. if they time out.
*/ */
#define SDL_MUTEX_TIMEDOUT 1 #define SDL_MUTEX_TIMEDOUT 1
/* This is the timeout value which corresponds to never time out */ /* This is the timeout value which corresponds to never time out */
#define SDL_MUTEX_MAXWAIT (~(Uint32)0) #define SDL_MUTEX_MAXWAIT (~(Uint32)0)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Mutex functions */ /* Mutex functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The SDL mutex structure, defined in SDL_mutex.c */ /* The SDL mutex structure, defined in SDL_mutex.c */
struct SDL_mutex; struct SDL_mutex;
typedef struct SDL_mutex SDL_mutex; typedef struct SDL_mutex SDL_mutex;
/* Create a mutex, initialized unlocked */ /* Create a mutex, initialized unlocked */
extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
/* Lock the mutex (Returns 0, or -1 on error) */ /* Lock the mutex (Returns 0, or -1 on error) */
#define SDL_LockMutex(m) SDL_mutexP(m) #define SDL_LockMutex(m) SDL_mutexP(m)
extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
/* Unlock the mutex (Returns 0, or -1 on error) /* Unlock the mutex (Returns 0, or -1 on error)
It is an error to unlock a mutex that has not been locked by It is an error to unlock a mutex that has not been locked by
the current thread, and doing so results in undefined behavior. the current thread, and doing so results in undefined behavior.
*/ */
#define SDL_UnlockMutex(m) SDL_mutexV(m) #define SDL_UnlockMutex(m) SDL_mutexV(m)
extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
/* Destroy a mutex */ /* Destroy a mutex */
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Semaphore functions */ /* Semaphore functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The SDL semaphore structure, defined in SDL_sem.c */ /* The SDL semaphore structure, defined in SDL_sem.c */
struct SDL_semaphore; struct SDL_semaphore;
typedef struct SDL_semaphore SDL_sem; typedef struct SDL_semaphore SDL_sem;
/* Create a semaphore, initialized with value, returns NULL on failure. */ /* Create a semaphore, initialized with value, returns NULL on failure. */
extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
/* Destroy a semaphore */ /* Destroy a semaphore */
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
/* This function suspends the calling thread until the semaphore pointed /* This function suspends the calling thread until the semaphore pointed
* to by sem has a positive count. It then atomically decreases the semaphore * to by sem has a positive count. It then atomically decreases the semaphore
* count. * count.
*/ */
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds, /* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
*/ */
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if /* 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 wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
the allotted time, and -1 on error. the allotted time, and -1 on error.
On some platforms this function is implemented by looping with a delay On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible. of 1 ms, and so should be avoided if possible.
*/ */
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
/* Atomically increases the semaphore's count (not blocking), returns 0, /* Atomically increases the semaphore's count (not blocking), returns 0,
or -1 on error. or -1 on error.
*/ */
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
/* Returns the current count of the semaphore */ /* Returns the current count of the semaphore */
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Condition variable functions */ /* Condition variable functions */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* The SDL condition variable structure, defined in SDL_cond.c */ /* The SDL condition variable structure, defined in SDL_cond.c */
struct SDL_cond; struct SDL_cond;
typedef struct SDL_cond SDL_cond; typedef struct SDL_cond SDL_cond;
/* Create a condition variable */ /* Create a condition variable */
extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
/* Destroy a condition variable */ /* Destroy a condition variable */
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
/* Restart one of the threads that are waiting on the condition variable, /* Restart one of the threads that are waiting on the condition variable,
returns 0 or -1 on error. returns 0 or -1 on error.
*/ */
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
/* Restart all threads that are waiting on the condition variable, /* Restart all threads that are waiting on the condition variable,
returns 0 or -1 on error. returns 0 or -1 on error.
*/ */
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
/* Wait on the condition variable, unlocking the provided mutex. /* Wait on the condition variable, unlocking the provided mutex.
The mutex must be locked before entering this function! The mutex must be locked before entering this function!
The mutex is re-locked once the condition variable is signaled. The mutex is re-locked once the condition variable is signaled.
Returns 0 when it is signaled, or -1 on error. Returns 0 when it is signaled, or -1 on error.
*/ */
extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
/* Waits for at most 'ms' milliseconds, and returns 0 if the condition /* Waits for at most 'ms' milliseconds, and returns 0 if the condition
variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
signaled in the allotted time, and -1 on error. signaled in the allotted time, and -1 on error.
On some platforms this function is implemented by looping with a delay On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible. of 1 ms, and so should be avoided if possible.
*/ */
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_mutex_h */ #endif /* _SDL_mutex_h */

View File

@ -1,11 +1,11 @@
#ifndef _SDLname_h_ #ifndef _SDLname_h_
#define _SDLname_h_ #define _SDLname_h_
#if defined(__STDC__) || defined(__cplusplus) #if defined(__STDC__) || defined(__cplusplus)
#define NeedFunctionPrototypes 1 #define NeedFunctionPrototypes 1
#endif #endif
#define SDL_NAME(X) SDL_##X #define SDL_NAME(X) SDL_##X
#endif /* _SDLname_h_ */ #endif /* _SDLname_h_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,100 +1,100 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Try to get a standard set of platform defines */ /* Try to get a standard set of platform defines */
#ifndef _SDL_platform_h #ifndef _SDL_platform_h
#define _SDL_platform_h #define _SDL_platform_h
#if defined(_AIX) #if defined(_AIX)
#undef __AIX__ #undef __AIX__
#define __AIX__ 1 #define __AIX__ 1
#endif #endif
#if defined(__BEOS__) #if defined(__BEOS__)
#undef __BEOS__ #undef __BEOS__
#define __BEOS__ 1 #define __BEOS__ 1
#endif #endif
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
#undef __BSDI__ #undef __BSDI__
#define __BSDI__ 1 #define __BSDI__ 1
#endif #endif
#if defined(_arch_dreamcast) #if defined(_arch_dreamcast)
#undef __DREAMCAST__ #undef __DREAMCAST__
#define __DREAMCAST__ 1 #define __DREAMCAST__ 1
#endif #endif
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
#undef __FREEBSD__ #undef __FREEBSD__
#define __FREEBSD__ 1 #define __FREEBSD__ 1
#endif #endif
#if defined(hpux) || defined(__hpux) || defined(__hpux__) #if defined(hpux) || defined(__hpux) || defined(__hpux__)
#undef __HPUX__ #undef __HPUX__
#define __HPUX__ 1 #define __HPUX__ 1
#endif #endif
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
#undef __IRIX__ #undef __IRIX__
#define __IRIX__ 1 #define __IRIX__ 1
#endif #endif
#if defined(linux) || defined(__linux) || defined(__linux__) #if defined(linux) || defined(__linux) || defined(__linux__)
#undef __LINUX__ #undef __LINUX__
#define __LINUX__ 1 #define __LINUX__ 1
#endif #endif
#if defined(__APPLE__) #if defined(__APPLE__)
#undef __MACOSX__ #undef __MACOSX__
#define __MACOSX__ 1 #define __MACOSX__ 1
#elif defined(macintosh) #elif defined(macintosh)
#undef __MACOS__ #undef __MACOS__
#define __MACOS__ 1 #define __MACOS__ 1
#endif #endif
#if defined(__NetBSD__) #if defined(__NetBSD__)
#undef __NETBSD__ #undef __NETBSD__
#define __NETBSD__ 1 #define __NETBSD__ 1
#endif #endif
#if defined(__OpenBSD__) #if defined(__OpenBSD__)
#undef __OPENBSD__ #undef __OPENBSD__
#define __OPENBSD__ 1 #define __OPENBSD__ 1
#endif #endif
#if defined(__OS2__) #if defined(__OS2__)
#undef __OS2__ #undef __OS2__
#define __OS2__ 1 #define __OS2__ 1
#endif #endif
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
#undef __OSF__ #undef __OSF__
#define __OSF__ 1 #define __OSF__ 1
#endif #endif
#if defined(__QNXNTO__) #if defined(__QNXNTO__)
#undef __QNXNTO__ #undef __QNXNTO__
#define __QNXNTO__ 1 #define __QNXNTO__ 1
#endif #endif
#if defined(riscos) || defined(__riscos) || defined(__riscos__) #if defined(riscos) || defined(__riscos) || defined(__riscos__)
#undef __RISCOS__ #undef __RISCOS__
#define __RISCOS__ 1 #define __RISCOS__ 1
#endif #endif
#if defined(__SVR4) #if defined(__SVR4)
#undef __SOLARIS__ #undef __SOLARIS__
#define __SOLARIS__ 1 #define __SOLARIS__ 1
#endif #endif
#if defined(WIN32) || defined(_WIN32) #if defined(WIN32) || defined(_WIN32)
#undef __WIN32__ #undef __WIN32__
#define __WIN32__ 1 #define __WIN32__ 1
#endif #endif
#endif /* _SDL_platform_h */ #endif /* _SDL_platform_h */

View File

@ -1,50 +1,50 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL quit event handling */ /* Include file for SDL quit event handling */
#ifndef _SDL_quit_h #ifndef _SDL_quit_h
#define _SDL_quit_h #define _SDL_quit_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
/* /*
An SDL_QUITEVENT is generated when the user tries to close the application 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. 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 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 is allowed to close. When the window is closed, screen updates will
complete, but have no effect. complete, but have no effect.
SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
and SIGTERM (system termination request), if handlers do not already and SIGTERM (system termination request), if handlers do not already
exist, that generate SDL_QUITEVENT events as well. There is no way exist, that generate SDL_QUITEVENT events as well. There is no way
to determine the cause of an SDL_QUITEVENT, but setting a signal to determine the cause of an SDL_QUITEVENT, but setting a signal
handler in your application will override the default generation of handler in your application will override the default generation of
quit events for that signal. quit events for that signal.
*/ */
/* There are no functions directly affecting the quit event */ /* There are no functions directly affecting the quit event */
#define SDL_QuitRequested() \ #define SDL_QuitRequested() \
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
#endif /* _SDL_quit_h */ #endif /* _SDL_quit_h */

View File

@ -1,144 +1,144 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* This file provides a general interface for SDL to read and write /* This file provides a general interface for SDL to read and write
data sources. It can easily be extended to files, memory, etc. data sources. It can easily be extended to files, memory, etc.
*/ */
#ifndef _SDL_rwops_h #ifndef _SDL_rwops_h
#define _SDL_rwops_h #define _SDL_rwops_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* This is the read/write operation structure -- very basic */ /* This is the read/write operation structure -- very basic */
typedef struct SDL_RWops { typedef struct SDL_RWops {
/* Seek to 'offset' relative to whence, one of stdio's whence values: /* Seek to 'offset' relative to whence, one of stdio's whence values:
SEEK_SET, SEEK_CUR, SEEK_END SEEK_SET, SEEK_CUR, SEEK_END
Returns the final offset in the data source. Returns the final offset in the data source.
*/ */
int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
/* Read up to 'num' objects each of size 'objsize' from the data /* Read up to 'num' objects each of size 'objsize' from the data
source to the area pointed at by 'ptr'. source to the area pointed at by 'ptr'.
Returns the number of objects read, or -1 if the read failed. 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); int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
/* Write exactly 'num' objects each of size 'objsize' from the area /* Write exactly 'num' objects each of size 'objsize' from the area
pointed at by 'ptr' to data source. pointed at by 'ptr' to data source.
Returns 'num', or -1 if the write failed. Returns 'num', or -1 if the write failed.
*/ */
int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
/* Close and free an allocated SDL_FSops structure */ /* Close and free an allocated SDL_FSops structure */
int (SDLCALL *close)(struct SDL_RWops *context); int (SDLCALL *close)(struct SDL_RWops *context);
Uint32 type; Uint32 type;
union { union {
#if defined(__WIN32__) && !defined(__SYMBIAN32__) #if defined(__WIN32__) && !defined(__SYMBIAN32__)
struct { struct {
int append; int append;
void *h; void *h;
struct { struct {
void *data; void *data;
int size; int size;
int left; int left;
} buffer; } buffer;
} win32io; } win32io;
#endif #endif
#ifdef HAVE_STDIO_H #ifdef HAVE_STDIO_H
struct { struct {
int autoclose; int autoclose;
FILE *fp; FILE *fp;
} stdio; } stdio;
#endif #endif
struct { struct {
Uint8 *base; Uint8 *base;
Uint8 *here; Uint8 *here;
Uint8 *stop; Uint8 *stop;
} mem; } mem;
struct { struct {
void *data1; void *data1;
} unknown; } unknown;
} hidden; } hidden;
} SDL_RWops; } SDL_RWops;
/* Functions to create SDL_RWops structures from various data sources */ /* Functions to create SDL_RWops structures from various data sources */
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
#ifdef HAVE_STDIO_H #ifdef HAVE_STDIO_H
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
#endif #endif
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); 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_RWFromConstMem(const void *mem, int size);
extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
#define RW_SEEK_SET 0 /* Seek from the beginning of data */ #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_CUR 1 /* Seek relative to current read point */
#define RW_SEEK_END 2 /* Seek relative to the end of data */ #define RW_SEEK_END 2 /* Seek relative to the end of data */
/* Macros to easily read and write from an SDL_RWops structure */ /* Macros to easily read and write from an SDL_RWops structure */
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) #define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) #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_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_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx) #define SDL_RWclose(ctx) (ctx)->close(ctx)
/* Read an item of the specified endianness and return in native format */ /* 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_ReadLE16(SDL_RWops *src);
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(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_ReadLE32(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(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_ReadLE64(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
/* Write an item of native format to the specified endianness */ /* 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_WriteLE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteBE16(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_WriteLE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteBE32(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_WriteLE64(SDL_RWops *dst, Uint64 value);
extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_rwops_h */ #endif /* _SDL_rwops_h */

View File

@ -1,214 +1,214 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Include file for SDL custom system window manager hooks */ /* Include file for SDL custom system window manager hooks */
#ifndef _SDL_syswm_h #ifndef _SDL_syswm_h
#define _SDL_syswm_h #define _SDL_syswm_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_version.h" #include "SDL_version.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Your application has access to a special type of event 'SDL_SYSWMEVENT', /* Your application has access to a special type of event 'SDL_SYSWMEVENT',
which contains window-manager specific information and arrives whenever which contains window-manager specific information and arrives whenever
an unhandled window event occurs. This event is ignored by default, but an unhandled window event occurs. This event is ignored by default, but
you can enable it with SDL_EventState() you can enable it with SDL_EventState()
*/ */
#ifdef SDL_PROTOTYPES_ONLY #ifdef SDL_PROTOTYPES_ONLY
struct SDL_SysWMinfo; struct SDL_SysWMinfo;
typedef struct SDL_SysWMinfo SDL_SysWMinfo; typedef struct SDL_SysWMinfo SDL_SysWMinfo;
#else #else
/* This is the structure for custom window manager events */ /* This is the structure for custom window manager events */
#if defined(SDL_VIDEO_DRIVER_X11) #if defined(SDL_VIDEO_DRIVER_X11)
#if defined(__APPLE__) && defined(__MACH__) #if defined(__APPLE__) && defined(__MACH__)
/* conflicts with Quickdraw.h */ /* conflicts with Quickdraw.h */
#define Cursor X11Cursor #define Cursor X11Cursor
#endif #endif
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#if defined(__APPLE__) && defined(__MACH__) #if defined(__APPLE__) && defined(__MACH__)
/* matches the re-define above */ /* matches the re-define above */
#undef Cursor #undef Cursor
#endif #endif
/* These are the various supported subsystems under UNIX */ /* These are the various supported subsystems under UNIX */
typedef enum { typedef enum {
SDL_SYSWM_X11 SDL_SYSWM_X11
} SDL_SYSWM_TYPE; } SDL_SYSWM_TYPE;
/* The UNIX custom event structure */ /* The UNIX custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
SDL_version version; SDL_version version;
SDL_SYSWM_TYPE subsystem; SDL_SYSWM_TYPE subsystem;
union { union {
XEvent xevent; XEvent xevent;
} event; } event;
}; };
/* The UNIX custom window manager information structure. /* The UNIX custom window manager information structure.
When this structure is returned, it holds information about which When this structure is returned, it holds information about which
low level system it is using, and will be one of SDL_SYSWM_TYPE. low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/ */
typedef struct SDL_SysWMinfo { typedef struct SDL_SysWMinfo {
SDL_version version; SDL_version version;
SDL_SYSWM_TYPE subsystem; SDL_SYSWM_TYPE subsystem;
union { union {
struct { struct {
Display *display; /* The X11 display */ Display *display; /* The X11 display */
Window window; /* The X11 display window */ Window window; /* The X11 display window */
/* These locking functions should be called around /* These locking functions should be called around
any X11 functions using the display variable, any X11 functions using the display variable,
but not the gfxdisplay variable. but not the gfxdisplay variable.
They lock the event thread, so should not be They lock the event thread, so should not be
called around event functions or from event filters. called around event functions or from event filters.
*/ */
void (*lock_func)(void); void (*lock_func)(void);
void (*unlock_func)(void); void (*unlock_func)(void);
/* Introduced in SDL 1.0.2 */ /* Introduced in SDL 1.0.2 */
Window fswindow; /* The X11 fullscreen window */ Window fswindow; /* The X11 fullscreen window */
Window wmwindow; /* The X11 managed input window */ Window wmwindow; /* The X11 managed input window */
/* Introduced in SDL 1.2.12 */ /* Introduced in SDL 1.2.12 */
Display *gfxdisplay; /* The X11 display to which rendering is done */ Display *gfxdisplay; /* The X11 display to which rendering is done */
} x11; } x11;
} info; } info;
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_NANOX) #elif defined(SDL_VIDEO_DRIVER_NANOX)
#include <microwin/nano-X.h> #include <microwin/nano-X.h>
/* The generic custom event structure */ /* The generic custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
SDL_version version; SDL_version version;
int data; int data;
}; };
/* The windows custom window manager information structure */ /* The windows custom window manager information structure */
typedef struct SDL_SysWMinfo { typedef struct SDL_SysWMinfo {
SDL_version version ; SDL_version version ;
GR_WINDOW_ID window ; /* The display window */ GR_WINDOW_ID window ; /* The display window */
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) #elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
/* The windows custom event structure */ /* The windows custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
SDL_version version; SDL_version version;
HWND hwnd; /* The window for the message */ HWND hwnd; /* The window for the message */
UINT msg; /* The type of message */ UINT msg; /* The type of message */
WPARAM wParam; /* WORD message parameter */ WPARAM wParam; /* WORD message parameter */
LPARAM lParam; /* LONG message parameter */ LPARAM lParam; /* LONG message parameter */
}; };
/* The windows custom window manager information structure */ /* The windows custom window manager information structure */
typedef struct SDL_SysWMinfo { typedef struct SDL_SysWMinfo {
SDL_version version; SDL_version version;
HWND window; /* The Win32 display window */ HWND window; /* The Win32 display window */
HGLRC hglrc; /* The OpenGL context, if any */ HGLRC hglrc; /* The OpenGL context, if any */
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_RISCOS) #elif defined(SDL_VIDEO_DRIVER_RISCOS)
/* RISC OS custom event structure */ /* RISC OS custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
SDL_version version; SDL_version version;
int eventCode; /* The window for the message */ int eventCode; /* The window for the message */
int pollBlock[64]; int pollBlock[64];
}; };
/* The RISC OS custom window manager information structure */ /* The RISC OS custom window manager information structure */
typedef struct SDL_SysWMinfo { typedef struct SDL_SysWMinfo {
SDL_version version; SDL_version version;
int wimpVersion; /* Wimp version running under */ int wimpVersion; /* Wimp version running under */
int taskHandle; /* The RISC OS task handle */ int taskHandle; /* The RISC OS task handle */
int window; /* The RISC OS display window */ int window; /* The RISC OS display window */
} SDL_SysWMinfo; } SDL_SysWMinfo;
#elif defined(SDL_VIDEO_DRIVER_PHOTON) #elif defined(SDL_VIDEO_DRIVER_PHOTON)
#include <sys/neutrino.h> #include <sys/neutrino.h>
#include <Ph.h> #include <Ph.h>
/* The QNX custom event structure */ /* The QNX custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
SDL_version version; SDL_version version;
int data; int data;
}; };
/* The QNX custom window manager information structure */ /* The QNX custom window manager information structure */
typedef struct SDL_SysWMinfo { typedef struct SDL_SysWMinfo {
SDL_version version; SDL_version version;
int data; int data;
} SDL_SysWMinfo; } SDL_SysWMinfo;
#else #else
/* The generic custom event structure */ /* The generic custom event structure */
struct SDL_SysWMmsg { struct SDL_SysWMmsg {
SDL_version version; SDL_version version;
int data; int data;
}; };
/* The generic custom window manager information structure */ /* The generic custom window manager information structure */
typedef struct SDL_SysWMinfo { typedef struct SDL_SysWMinfo {
SDL_version version; SDL_version version;
int data; int data;
} SDL_SysWMinfo; } SDL_SysWMinfo;
#endif /* video driver type */ #endif /* video driver type */
#endif /* SDL_PROTOTYPES_ONLY */ #endif /* SDL_PROTOTYPES_ONLY */
/* Function prototypes */ /* Function prototypes */
/* /*
* This function gives you custom hooks into the window manager information. * This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and * 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 * 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. * the version member of the 'info' structure is invalid, it returns 0.
* *
* You typically use this function like this: * You typically use this function like this:
* SDL_SysWMInfo info; * SDL_SysWMInfo info;
* SDL_VERSION(&info.version); * SDL_VERSION(&info.version);
* if ( SDL_GetWMInfo(&info) ) { ... } * if ( SDL_GetWMInfo(&info) ) { ... }
*/ */
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_syswm_h */ #endif /* _SDL_syswm_h */

View File

@ -1,119 +1,119 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_thread_h #ifndef _SDL_thread_h
#define _SDL_thread_h #define _SDL_thread_h
/* Header for the SDL thread management routines /* Header for the SDL thread management routines
These are independent of the other SDL routines. These are independent of the other SDL routines.
*/ */
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
/* Thread synchronization primitives */ /* Thread synchronization primitives */
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* The SDL thread structure, defined in SDL_thread.c */ /* The SDL thread structure, defined in SDL_thread.c */
struct SDL_Thread; struct SDL_Thread;
typedef struct SDL_Thread SDL_Thread; typedef struct SDL_Thread SDL_Thread;
/* Create a thread */ /* Create a thread */
#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) #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 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() 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 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! be initialized for those threads, and not the RTL of the calling application!
To solve this, we make a little hack here. To solve this, we make a little hack here.
We'll always use the caller's _beginthread() and _endthread() APIs to 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, 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 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. the application, then the RTL of the application will be used.
So, in short: So, in short:
Always use the _beginthread() and _endthread() of the calling runtime library! Always use the _beginthread() and _endthread() of the calling runtime library!
*/ */
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
#include <process.h> /* This has _beginthread() and _endthread() defined! */ #include <process.h> /* This has _beginthread() and _endthread() defined! */
#endif #endif
#ifdef __OS2__ #ifdef __OS2__
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
typedef void (*pfnSDL_CurrentEndThread)(void); typedef void (*pfnSDL_CurrentEndThread)(void);
#elif __GNUC__ #elif __GNUC__
typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg, unsigned (__stdcall *func)(void *), void *arg,
unsigned, unsigned *threadID); unsigned, unsigned *threadID);
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
#else #else
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *func)(void *), void *arg, unsigned (__stdcall *func)(void *), void *arg,
unsigned, unsigned *threadID); unsigned, unsigned *threadID);
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
#endif #endif
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
#ifdef __OS2__ #ifdef __OS2__
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
#elif defined(_WIN32_WCE) #elif defined(_WIN32_WCE)
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
#else #else
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) #define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
#endif #endif
#else #else
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
#endif #endif
/* Get the 32-bit thread identifier for the current thread */ /* Get the 32-bit thread identifier for the current thread */
extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
/* Get the 32-bit thread identifier for the specified thread, /* Get the 32-bit thread identifier for the specified thread,
equivalent to SDL_ThreadID() if the specified thread is NULL. equivalent to SDL_ThreadID() if the specified thread is NULL.
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
/* Wait for a thread to finish. /* Wait for a thread to finish.
The return code for the thread function is placed in the area The return code for the thread function is placed in the area
pointed to by 'status', if 'status' is not NULL. pointed to by 'status', if 'status' is not NULL.
*/ */
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
/* Forcefully kill a thread without worrying about its state */ /* Forcefully kill a thread without worrying about its state */
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_thread_h */ #endif /* _SDL_thread_h */

View File

@ -1,115 +1,115 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
#ifndef _SDL_timer_h #ifndef _SDL_timer_h
#define _SDL_timer_h #define _SDL_timer_h
/* Header for the SDL time management routines */ /* Header for the SDL time management routines */
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* This is the OS scheduler timeslice, in milliseconds */ /* This is the OS scheduler timeslice, in milliseconds */
#define SDL_TIMESLICE 10 #define SDL_TIMESLICE 10
/* This is the maximum resolution of the SDL timer on all platforms */ /* This is the maximum resolution of the SDL timer on all platforms */
#define TIMER_RESOLUTION 10 /* Experimentally determined */ #define TIMER_RESOLUTION 10 /* Experimentally determined */
/* Get the number of milliseconds since the SDL library initialization. /* Get the number of milliseconds since the SDL library initialization.
* Note that this value wraps if the program runs for more than ~49 days. * Note that this value wraps if the program runs for more than ~49 days.
*/ */
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
/* Wait a specified number of milliseconds before returning */ /* Wait a specified number of milliseconds before returning */
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
/* Function prototype for the timer callback function */ /* Function prototype for the timer callback function */
typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
/* Set a callback to run after the specified number of milliseconds has /* Set a callback to run after the specified number of milliseconds has
* elapsed. The callback function is passed the current timer interval * elapsed. The callback function is passed the current timer interval
* and returns the next timer interval. If the returned value is the * and returns the next timer interval. If the returned value is the
* same as the one passed in, the periodic alarm continues, otherwise a * same as the one passed in, the periodic alarm continues, otherwise a
* new alarm is scheduled. If the callback returns 0, the periodic alarm * new alarm is scheduled. If the callback returns 0, the periodic alarm
* is cancelled. * is cancelled.
* *
* To cancel a currently running timer, call SDL_SetTimer(0, NULL); * To cancel a currently running timer, call SDL_SetTimer(0, NULL);
* *
* The timer callback function may run in a different thread than your * The timer callback function may run in a different thread than your
* main code, and so shouldn't call any functions from within itself. * 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 * 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 * 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 * 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 * a frame update at 30 frames per second (every 33 ms), you might set a
* timer for 30 ms: * timer for 30 ms:
* SDL_SetTimer((33/10)*10, flag_update); * SDL_SetTimer((33/10)*10, flag_update);
* *
* If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). * 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 * 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 * in the same program, as it is implemented using setitimer(). You also
* should not use this function in multi-threaded applications as signals * should not use this function in multi-threaded applications as signals
* to multi-threaded apps have undefined behavior in some implementations. * to multi-threaded apps have undefined behavior in some implementations.
* *
* This function returns 0 if successful, or -1 if there was an error. * This function returns 0 if successful, or -1 if there was an error.
*/ */
extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
/* New timer API, supports multiple timers /* New timer API, supports multiple timers
* Written by Stephane Peter <megastep@lokigames.com> * Written by Stephane Peter <megastep@lokigames.com>
*/ */
/* Function prototype for the new timer callback function. /* Function prototype for the new timer callback function.
* The callback function is passed the current timer interval and returns * 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 * 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 * passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled. * scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/ */
typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
/* Definition of the timer ID type */ /* Definition of the timer ID type */
typedef struct _SDL_TimerID *SDL_TimerID; typedef struct _SDL_TimerID *SDL_TimerID;
/* Add a new timer to the pool of timers already running. /* Add a new timer to the pool of timers already running.
Returns a timer ID, or NULL when an error occurs. Returns a timer ID, or NULL when an error occurs.
*/ */
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
/* Remove one of the multiple timers knowing its ID. /* Remove one of the multiple timers knowing its ID.
* Returns a boolean value indicating success. * Returns a boolean value indicating success.
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_timer_h */ #endif /* _SDL_timer_h */

View File

@ -1,24 +1,24 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* DEPRECATED */ /* DEPRECATED */
#include "SDL_stdinc.h" #include "SDL_stdinc.h"

View File

@ -1,85 +1,85 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. 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, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* This header defines the current SDL version */ /* This header defines the current SDL version */
#ifndef _SDL_version_h #ifndef _SDL_version_h
#define _SDL_version_h #define _SDL_version_h
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#include "begin_code.h" #include "begin_code.h"
/* Set up for C function definitions, even when using C++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/ */
#define SDL_MAJOR_VERSION 1 #define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2 #define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL 13 #define SDL_PATCHLEVEL 13
typedef struct SDL_version { typedef struct SDL_version {
Uint8 major; Uint8 major;
Uint8 minor; Uint8 minor;
Uint8 patch; Uint8 patch;
} SDL_version; } SDL_version;
/* This macro can be used to fill a version structure with the compile-time /* This macro can be used to fill a version structure with the compile-time
* version of the SDL library. * version of the SDL library.
*/ */
#define SDL_VERSION(X) \ #define SDL_VERSION(X) \
{ \ { \
(X)->major = SDL_MAJOR_VERSION; \ (X)->major = SDL_MAJOR_VERSION; \
(X)->minor = SDL_MINOR_VERSION; \ (X)->minor = SDL_MINOR_VERSION; \
(X)->patch = SDL_PATCHLEVEL; \ (X)->patch = SDL_PATCHLEVEL; \
} }
/* This macro turns the version numbers into a numeric value: /* This macro turns the version numbers into a numeric value:
(1,2,3) -> (1203) (1,2,3) -> (1203)
This assumes that there will never be more than 100 patchlevels This assumes that there will never be more than 100 patchlevels
*/ */
#define SDL_VERSIONNUM(X, Y, Z) \ #define SDL_VERSIONNUM(X, Y, Z) \
((X)*1000 + (Y)*100 + (Z)) ((X)*1000 + (Y)*100 + (Z))
/* This is the version number macro for the current SDL version */ /* This is the version number macro for the current SDL version */
#define SDL_COMPILEDVERSION \ #define SDL_COMPILEDVERSION \
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 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 */ /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
#define SDL_VERSION_ATLEAST(X, Y, Z) \ #define SDL_VERSION_ATLEAST(X, Y, Z) \
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
/* This function gets the version of the dynamically linked SDL library. /* This function gets the version of the dynamically linked SDL library.
it should NOT be used to fill a version structure, instead you should it should NOT be used to fill a version structure, instead you should
use the SDL_Version() macro. use the SDL_Version() macro.
*/ */
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* _SDL_version_h */ #endif /* _SDL_version_h */

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +1,41 @@
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga Copyright (C) 1997-2004 Sam Lantinga
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga Sam Lantinga
slouken@libsdl.org slouken@libsdl.org
*/ */
/* This file reverses the effects of begin_code.h and should be included /* This file reverses the effects of begin_code.h and should be included
after you finish any function and structure declarations in your headers after you finish any function and structure declarations in your headers
*/ */
#undef _begin_code_h #undef _begin_code_h
/* Reset structure packing at previous byte alignment */ /* Reset structure packing at previous byte alignment */
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma nopackwarning #pragma nopackwarning
#endif #endif
#if (defined(__MWERKS__) && defined(__MACOS__)) #if (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=reset #pragma options align=reset
#pragma enumsalwaysint reset #pragma enumsalwaysint reset
#else #else
#pragma pack(pop) #pragma pack(pop)
#endif #endif
#endif /* Compiler needs structure packing set */ #endif /* Compiler needs structure packing set */

View File

@ -1,146 +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
*/
/*
Symbian version Markus Mertama
*/
#ifndef _SDL_CONFIG_SYMBIAN_H
#define _SDL_CONFIG_SYMBIAN_H
#include "SDL_platform.h"
/* This is the minimal configuration that can be used to build SDL */
#include <stdarg.h>
#include <stddef.h>
#ifdef __GCCE__
#define SYMBIAN32_GCCE
#endif
#ifndef _SIZE_T_DEFINED
typedef unsigned int size_t;
#endif
#ifndef _INTPTR_T_DECLARED
typedef unsigned int uintptr_t;
#endif
#ifndef _INT8_T_DECLARED
typedef signed char int8_t;
#endif
#ifndef _UINT8_T_DECLARED
typedef unsigned char uint8_t;
#endif
#ifndef _INT16_T_DECLARED
typedef signed short int16_t;
#endif
#ifndef _UINT16_T_DECLARED
typedef unsigned short uint16_t;
#endif
#ifndef _INT32_T_DECLARED
typedef signed int int32_t;
#endif
#ifndef _UINT32_T_DECLARED
typedef unsigned int uint32_t;
#endif
#ifndef _INT64_T_DECLARED
typedef signed long long int64_t;
#endif
#ifndef _UINT64_T_DECLARED
typedef unsigned long long uint64_t;
#endif
#define SDL_AUDIO_DRIVER_EPOCAUDIO 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
#define SDL_THREAD_SYMBIAN 1
#define SDL_VIDEO_DRIVER_EPOC 1
#define SDL_VIDEO_OPENGL 0
#define SDL_HAS_64BIT_TYPE 1
#define HAVE_LIBC 1
#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_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__STRUPR 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 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_STDARG_H 1
#define HAVE_STDDEF_H 1
#endif /* _SDL_CONFIG_SYMBIAN_H */

View File

@ -1,156 +0,0 @@
/*
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 */