Moved to SDL 1.3, it compiles but DOES NOT WORK, audio is disabled
This commit is contained in:
@@ -409,8 +409,8 @@ void Settings::getNewKeyFromUser() {
|
||||
const PlayerKeys Settings::getPlayerKeys(unsigned int player) const {
|
||||
assert( player < playerKeys.size() );
|
||||
PlayerKeys pk;
|
||||
for(int i=SDLK_FIRST; i <= SDLK_LAST; ++i) {
|
||||
pk[ (SDLKey)i ] = PE_UNKNOWN;
|
||||
for( std::map< SDLKey, std::string > :: const_iterator i = keyName.begin(); i != keyName.end(); ++i ) {
|
||||
pk[ i->first ] = PE_UNKNOWN;
|
||||
}
|
||||
std::map< PlayerEvent, SDLKey >::const_iterator pkiter;
|
||||
for(pkiter = playerKeys[player].begin(); pkiter != playerKeys[player].end(); ++pkiter) {
|
||||
|
||||
@@ -17,22 +17,34 @@ LOCAL_CFLAGS := -I$(LOCAL_PATH)/include \
|
||||
SDL_SRCS := \
|
||||
src/*.c \
|
||||
src/audio/*.c \
|
||||
src/cdrom/*.c \
|
||||
src/cpuinfo/*.c \
|
||||
src/events/*.c \
|
||||
src/file/*.c \
|
||||
src/haptic/*.c \
|
||||
src/joystick/*.c \
|
||||
src/stdlib/*.c \
|
||||
src/thread/*.c \
|
||||
src/timer/*.c \
|
||||
src/video/*.c \
|
||||
src/audio/android/*.c \
|
||||
src/video/android/*.c \
|
||||
src/joystick/dummy/*.c \
|
||||
src/cdrom/dummy/*.c \
|
||||
src/main/*.c \
|
||||
src/power/*.c \
|
||||
src/thread/pthread/*.c \
|
||||
src/timer/unix/*.c \
|
||||
src/loadso/dummy/*.c \
|
||||
src/audio/android/*.c \
|
||||
src/audio/dummy/*.c \
|
||||
src/video/android/*.c \
|
||||
src/joystick/dummy/*.c \
|
||||
src/haptic/dummy/*.c \
|
||||
src/loadso/dlopen/*.c \
|
||||
src/atomic/dummy/*.c \
|
||||
|
||||
# TODO: use libcutils for atomic operations, but it's not included in NDK
|
||||
|
||||
# src/atomic/linux/*.c \
|
||||
# src/power/linux/*.c \
|
||||
# src/joystick/android/*.c \
|
||||
# src/haptic/android/*.c \
|
||||
# src/libm/*.c \
|
||||
|
||||
LOCAL_CPP_EXTENSION := .cpp
|
||||
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Building SDL with Borland's C++ compilers</title>
|
||||
|
||||
<meta name="author"
|
||||
content="David Snopek and updated by Dominique Louis.">
|
||||
</head>
|
||||
<body>
|
||||
<xevol @newtonave.net=""> </xevol>
|
||||
<h1>Building SDL with Borland's C++ compilers. </h1>
|
||||
<b> by <a href="mailto:xevol@users.sourceforge.net"> David Snopek</a></b>
|
||||
and updated by <b><a href="mailto:Dominique@SavageSoftware.com.au">Dominique
|
||||
Louis</a></b> ( Last updated : 30th June 2003 ).<br>
|
||||
<br>
|
||||
These instructions cover how to compile SDL and its included test
|
||||
programs using either Borland <a href="#bcbwin">C++ Builder 5, 6 for Windows</a>,
|
||||
<a href="#k3">C++ Builder for Linux ( AKA Kylix 3 )</a> or the free <a
|
||||
href="#bccc">Borland C++ command-line compiler</a>. <br>
|
||||
|
||||
<h3> <b> Extract the files </b> </h3>
|
||||
|
||||
<p> Unzip the Borland.zip archive into <b>this</b> directory. Do not unzip
|
||||
it into any other directory because the makefiles ( *.mak ) and project
|
||||
files ( *.bpr ) use relative paths to refer to the SDL sources. This should
|
||||
create a directory named "Borland" inside of the top level SDL source directory.
|
||||
</p>
|
||||
|
||||
<h3> <b><a name="bcbwin"></a> Using Borland C++ Builder 5, 6 for Windows </b>
|
||||
</h3>
|
||||
|
||||
<p> Inside of the "Borland" directory there is a "bcb6" directory that contains
|
||||
a number of Builder project files. Double-click on the "libSDL.bpg" file
|
||||
icon. Once Builder has started click on the "<u>P</u>rojects" menu on
|
||||
the menu-bar and go down to "B<u>u</u>ild All Projects" option. <br>
|
||||
This will proceed to build SDL ( with Borland's calling convention ),
|
||||
SDLmain, and all the <a href="#tests">test programs</a>. Currently, all
|
||||
the <a href="#tests">test programs</a> are dynamically linked to Sam Lantinga's
|
||||
SDL.dll.</p>
|
||||
|
||||
<p><b>NOTE :</b> Borland's "lib" format and Microsoft's "lib" format are incompatible.
|
||||
<br>
|
||||
If you wish to dynamically link to the SDL library supplied by Sam Lantinga
|
||||
in each release, I have created the correct *.libs for SDL 1.2.4 and they
|
||||
exist in the "/lib" directory.<br>
|
||||
If you would like to create the *.lib files yourself, you will need to
|
||||
make use of Borland's "implib.exe" utility.<br>
|
||||
</p>
|
||||
|
||||
<p><tt>IMPLIB</tt> works like this: </p>
|
||||
|
||||
<pre> IMPLIB (destination lib name) (source dll)<br></pre>
|
||||
|
||||
<p> For example,</p>
|
||||
|
||||
<pre> IMPLIB SDL.lib SDL.dll<br></pre>
|
||||
|
||||
<p>This assumes that SDL.dll was compiled with Visual C++ or similar.<br>
|
||||
</p>
|
||||
|
||||
<p>To learn more about the difference between Borland's and Microsoft's *.lib
|
||||
format please read the article <a
|
||||
href="http://www.bcbdev.com/articles/vcdll.htm">here</a>.<br>
|
||||
</p>
|
||||
|
||||
<p> <b><br>
|
||||
NOTE :</b> The C++ Builder for Windows project format, is not compatible
|
||||
with the Kylix 3 project format, hence the reason why they are in separate
|
||||
directories.</p>
|
||||
|
||||
<h3> <b><a name="bccc"></a> Using the free Borland C++ command-line compiler
|
||||
</b> </h3>
|
||||
|
||||
<p> The free Borland compiler can be downloaded at no charge from <a
|
||||
href="http://www.borland.com/bcppbuilder/freecompiler/"> the Borland website
|
||||
</a>. Make sure that it is installed and properly configured. </p>
|
||||
|
||||
<p> Open an MS-DOS Prompt. Change to the "Borland\freebcc" directory under
|
||||
the SDL source directory. Type "make -f SDL.mak" to build SDL and "make
|
||||
-f SDLmain.mak". There are also makefiles for all of the <a
|
||||
href="#tests">test programs</a>, if you wish to build them. All .exes and
|
||||
DLLs are created in the "test" SDL directory. Ify ou would like to create
|
||||
the DLL and all the test applications, I have thrown together a basic batchfile
|
||||
called "makeall.bat" which should create everything in the right order. </p>
|
||||
|
||||
<h3> <b> Output files </b> </h3>
|
||||
No matter which compiler you used, three important files should have
|
||||
been produced:
|
||||
<ul>
|
||||
<li> SDL.dll ( Borland format ) </li>
|
||||
<li> SDL.lib ( Borland format ) </li>
|
||||
<li> SDLmain.lib ( Borland format ) </li>
|
||||
|
||||
</ul>
|
||||
Both of the *.lib files will need to be added to all the projects
|
||||
that use SDL and SDL.dll must be placed some where the Windows dynamic
|
||||
linker can find it (either in your project directory or on the system
|
||||
path, C:\WINDOWS\SYSTEM).
|
||||
<h3> <b><a name="k3"></a> Using Borland C++ Builder for Linux ( AKA Kylix
|
||||
3 ) </b> </h3>
|
||||
|
||||
<p> Inside of the "Borland" directory there is a "k3" directory that contains
|
||||
a number of Builder project files. Double-click on the "libSDL.bpg" file
|
||||
icon. Once Builder has started click on the "<u>P</u>rojects" menu on
|
||||
the menu-bar and go down to "B<u>u</u>ild All Projects" option. This will
|
||||
proceed to build all the <a href="#tests">test programs</a>. <br>
|
||||
Linux users do not need *.lib files as the Shared Object is linked right
|
||||
into the project ( very neat actually, Windows should do this sort of thing
|
||||
as it is a lot easier for the developer ). <br>
|
||||
<b>NOTE :</b> The C++ Builder for Windows project format, is not
|
||||
compatible with the Kylix 3 project format, hence the reason why they are
|
||||
in separate directories.</p>
|
||||
|
||||
<p> On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib
|
||||
directory as libSDL_*.so and the Mesa OpenGL shared objects are located
|
||||
in /usr/X11R6/lib as libGL*.so<br>
|
||||
<br>
|
||||
So if your setup is different you may need to change the project file
|
||||
so that they re-link to the ones on your system.<br>
|
||||
<br>
|
||||
On Mandrake 8.1 the headers files are located at /usr/include/SDL/.
|
||||
So if you you have not installed the development RPMs ( usually named libSDL-devel*
|
||||
) for SDL ( not included ) you may have to change the include directory
|
||||
within some of the projects.<br>
|
||||
</p>
|
||||
|
||||
<h3> Known Problems</h3>
|
||||
The only known problem is that I ( Dominique Louis ), was unable to
|
||||
create the projects that rebuilt the SDL shared objects under Linux, due
|
||||
to time constraints and my lack of intimate knowledge of Linux.
|
||||
<h3><a name="tests"><b> Test programs </b> </a></h3>
|
||||
Some of the test programs require included media files ( *.wav; *.bmp
|
||||
etc ). All the test programs are now created in the "test" directory, where
|
||||
the media files are ( usually ) so they should be ready to go. <br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,72 +5,51 @@ Thanks to everyone who made this possible, including:
|
||||
* Cliff Matthews, for giving me a reason to start this project. :)
|
||||
-- Executor rocks! *grin*
|
||||
|
||||
* Scott Call, for making a home for SDL on the 'Net... Thanks! :)
|
||||
|
||||
* The Linux Fund, C Magazine, Educational Technology Resources Inc.,
|
||||
Gareth Noyce, Jesse Pavel, Keith Kitchin, Jeremy Horvath, Thomas Nicholson,
|
||||
Hans-Peter Gygax, the Eternal Lands Development Team, Lars Brubaker,
|
||||
and Phoenix Kokido for financial contributions
|
||||
|
||||
* Edgar "bobbens" Simo for his force feedback API development during the
|
||||
Google Summer of Code 2008
|
||||
|
||||
* Aaron Wishnick for his work on audio resampling and pitch shifting during
|
||||
the Google Summer of Code 2008
|
||||
|
||||
* Holmes Futrell for port of SDL to the iPhone and iPod Touch during the
|
||||
Google Summer of Code 2008
|
||||
|
||||
* Darren Alton for port of SDL to the Nintendo DS during the Google Summer
|
||||
of Code 2008
|
||||
|
||||
* Szymon "Wilku" Wilczek for adding support for multiple mice and tablets
|
||||
during the Google Summer of Code 2008
|
||||
|
||||
* Marty Leisner, Andrew, Will, Edgar Simo, Donny Viszneki, Andrea Mazzoleni,
|
||||
Dmytro Bogovych, and Couriersud for helping find SDL 1.3 bugs in the great
|
||||
SDL Bug Hunt of January 2009!
|
||||
|
||||
* Donny Viszneki for helping fix SDL 1.3 bugs in the great SDL Bug Hunt of
|
||||
January 2009!
|
||||
|
||||
* Luke Benstead for OpenGL 3.0 support
|
||||
|
||||
* Gaëtan de Menten for writing the PHP and SQL behind the SDL website
|
||||
|
||||
* Tim Jones for the new look of the SDL website
|
||||
|
||||
* Marco Kraus for setting up SDL merchandise
|
||||
|
||||
* Martin Donlon for his work on the SDL Documentation Project
|
||||
|
||||
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
|
||||
|
||||
* IBM R&D Lab for their PS3 SPE video acceleration code
|
||||
|
||||
* Mattias Engdegård, for help with the Solaris port and lots of other help
|
||||
|
||||
* Max Watson, Matt Slot, and Kyle for help with the MacOS Classic port
|
||||
|
||||
* Stan Shebs, for the initial Mac OS X port
|
||||
|
||||
* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port
|
||||
|
||||
* Patrick Trainor, Jim Boucher, and Mike Gorchak for the QNX Neutrino port
|
||||
* David Carré, for the Pandora port
|
||||
|
||||
* Carsten Griwodz for the AIX port
|
||||
|
||||
* Gabriele Greco, for the Amiga port
|
||||
|
||||
* Patrice Mandin, for the Atari port
|
||||
|
||||
* Hannu Viitala for the EPOC port
|
||||
|
||||
* Marcus Mertama for the S60 port.
|
||||
|
||||
* Peter Valchev for nagging me about the OpenBSD port until I got it right. :)
|
||||
|
||||
* Kent B Mein, for a place to do the IRIX port
|
||||
|
||||
* Ash, for a place to do the OSF/1 Alpha port
|
||||
|
||||
* David Sowsy, for help with the BeOS port
|
||||
|
||||
* Eugenia Loli, for endless work on porting SDL games to BeOS
|
||||
|
||||
* Jon Taylor for the GGI front-end
|
||||
|
||||
* Paulus Esterhazy, for the Visual C++ testing and libraries
|
||||
|
||||
* Brenda Tantzen, for Metrowerks CodeWarrior on MacOS
|
||||
|
||||
* Chris Nentwich, for the Hermes assembly blitters
|
||||
|
||||
* Michael Vance and Jim Kutter for the X11 OpenGL support
|
||||
|
||||
* Stephane Peter, for the AAlib front-end and multi-threaded timer idea.
|
||||
* Couriersud for the DirectFB driver
|
||||
|
||||
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation
|
||||
|
||||
* Peter Wiklund, for the 1998 winning SDL logo,
|
||||
and Arto Hamara, Steven Wong, and Kent Mein for other logo entries.
|
||||
|
||||
* Arne Claus, for the 2004 winning SDL logo,
|
||||
and Shandy Brown, Jac, Alex Lyman, Mikkel Gjoel, #Guy, Jonas Hartmann,
|
||||
Daniel Liljeberg, Ronald Sowa, DocD, Pekka Jaervinen, Patrick Avella,
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
To compile and install SDL:
|
||||
|
||||
0. If you have downloaded this from the website, skip to the next step.
|
||||
If you have checked this out from subversion, you'll need to run
|
||||
./autogen.sh to build the configure script.
|
||||
|
||||
1. Run './configure; make; make install'
|
||||
|
||||
If you are compiling for Windows using gcc, read the FAQ at:
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
#GL=1
|
||||
|
||||
CC = sh-elf-gcc
|
||||
AR = sh-elf-ar
|
||||
|
||||
ifdef GL
|
||||
DEFS += -DSDL_VIDEO_OPENGL=1
|
||||
TARGET = libSDL_gl.a
|
||||
else
|
||||
TARGET = libSDL.a
|
||||
endif
|
||||
|
||||
CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude
|
||||
|
||||
SRCS = \
|
||||
src/audio/dc/SDL_dcaudio.c \
|
||||
src/audio/dc/aica.c \
|
||||
src/audio/dummy/SDL_dummyaudio.c \
|
||||
src/audio/SDL_audio.c \
|
||||
src/audio/SDL_audiocvt.c \
|
||||
src/audio/SDL_audiodev.c \
|
||||
src/audio/SDL_mixer.c \
|
||||
src/audio/SDL_wave.c \
|
||||
src/cdrom/dc/SDL_syscdrom.c \
|
||||
src/cdrom/SDL_cdrom.c \
|
||||
src/events/SDL_active.c \
|
||||
src/events/SDL_events.c \
|
||||
src/events/SDL_expose.c \
|
||||
src/events/SDL_keyboard.c \
|
||||
src/events/SDL_mouse.c \
|
||||
src/events/SDL_quit.c \
|
||||
src/events/SDL_resize.c \
|
||||
src/file/SDL_rwops.c \
|
||||
src/joystick/dc/SDL_sysjoystick.c \
|
||||
src/joystick/SDL_joystick.c \
|
||||
src/loadso/dummy/SDL_sysloadso.c \
|
||||
src/SDL.c \
|
||||
src/SDL_error.c \
|
||||
src/SDL_fatal.c \
|
||||
src/stdlib/SDL_getenv.c \
|
||||
src/stdlib/SDL_iconv.c \
|
||||
src/stdlib/SDL_malloc.c \
|
||||
src/stdlib/SDL_qsort.c \
|
||||
src/stdlib/SDL_stdlib.c \
|
||||
src/stdlib/SDL_string.c \
|
||||
src/thread/dc/SDL_syscond.c \
|
||||
src/thread/dc/SDL_sysmutex.c \
|
||||
src/thread/dc/SDL_syssem.c \
|
||||
src/thread/dc/SDL_systhread.c \
|
||||
src/thread/SDL_thread.c \
|
||||
src/timer/dc/SDL_systimer.c \
|
||||
src/timer/SDL_timer.c \
|
||||
src/video/dc/SDL_dcevents.c \
|
||||
src/video/dc/SDL_dcvideo.c \
|
||||
src/video/dummy/SDL_nullevents.c \
|
||||
src/video/dummy/SDL_nullmouse.c \
|
||||
src/video/dummy/SDL_nullvideo.c \
|
||||
src/video/SDL_blit.c \
|
||||
src/video/SDL_blit_0.c \
|
||||
src/video/SDL_blit_1.c \
|
||||
src/video/SDL_blit_A.c \
|
||||
src/video/SDL_blit_N.c \
|
||||
src/video/SDL_bmp.c \
|
||||
src/video/SDL_cursor.c \
|
||||
src/video/SDL_gamma.c \
|
||||
src/video/SDL_pixels.c \
|
||||
src/video/SDL_RLEaccel.c \
|
||||
src/video/SDL_stretch.c \
|
||||
src/video/SDL_surface.c \
|
||||
src/video/SDL_video.c \
|
||||
src/video/SDL_yuv.c \
|
||||
src/video/SDL_yuv_sw.c \
|
||||
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
TEST = \
|
||||
test/checkkeys.c \
|
||||
test/graywin.c \
|
||||
test/loopwave.c \
|
||||
test/testalpha.c \
|
||||
test/testbitmap.c \
|
||||
test/testcdrom.c \
|
||||
test/testerror.c \
|
||||
test/testgamma.c \
|
||||
test/testgl.c \
|
||||
test/testhread.c \
|
||||
test/testjoystick.c \
|
||||
test/testkeys.c \
|
||||
test/testlock.c \
|
||||
test/testoverlay.c \
|
||||
test/testpalette.c \
|
||||
test/testsem.c \
|
||||
test/testsprite.c \
|
||||
test/testtimer.c \
|
||||
test/testtypes.c \
|
||||
test/testver.c \
|
||||
test/testvidinfo.c \
|
||||
test/testwin.c \
|
||||
test/testwm.c \
|
||||
test/threadwin.c \
|
||||
test/torturethread.c \
|
||||
|
||||
$(TARGET): copy_config \
|
||||
$(OBJS)
|
||||
$(AR) rcs $(TARGET) $(OBJS)
|
||||
|
||||
copy_config:
|
||||
@cp include/SDL_config.h.default include/SDL_config.h
|
||||
|
||||
clean:
|
||||
rm -f include/SDL_config.h $(OBJS)
|
||||
@@ -1,183 +0,0 @@
|
||||
# Makefile to build and install the SDL library
|
||||
|
||||
top_builddir = .
|
||||
srcdir = @srcdir@
|
||||
objects = build
|
||||
depend = build-deps
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
mandir = @mandir@
|
||||
auxdir = @ac_aux_dir@
|
||||
distpath = $(srcdir)/..
|
||||
distdir = SDL-@SDL_VERSION@
|
||||
distfile = $(distdir).tar.gz
|
||||
|
||||
@SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
CC = @CC@
|
||||
INCLUDE = @INCLUDE@
|
||||
CFLAGS = @BUILD_CFLAGS@
|
||||
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
||||
LDFLAGS = @BUILD_LDFLAGS@
|
||||
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
INSTALL = @INSTALL@
|
||||
NASM = @NASM@ @NASMFLAGS@
|
||||
AR = @AR@
|
||||
RANLIB = @RANLIB@
|
||||
WINDRES = @WINDRES@
|
||||
|
||||
TARGET = libSDL.la
|
||||
SOURCES = @SOURCES@
|
||||
OBJECTS = @OBJECTS@
|
||||
|
||||
SDLMAIN_TARGET = libSDLmain.a
|
||||
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
|
||||
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
|
||||
|
||||
DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode.tar.gz
|
||||
|
||||
HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
|
||||
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_RELEASE = @LT_RELEASE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
|
||||
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
|
||||
|
||||
$(srcdir)/configure: $(srcdir)/configure.in
|
||||
@echo "Warning, configure.in is out of date"
|
||||
#(cd $(srcdir) && sh autogen.sh && sh configure)
|
||||
@sleep 3
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in
|
||||
$(SHELL) config.status $@
|
||||
|
||||
$(objects):
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $@
|
||||
|
||||
.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
|
||||
depend:
|
||||
@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \
|
||||
$(SHELL) $(auxdir)/makedep.sh
|
||||
@for src in $(SDLMAIN_SOURCES); do \
|
||||
obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
|
||||
echo "\$$(objects)/$$obj: $$src" >>$(depend); \
|
||||
echo " \$$(CC) \$$(CFLAGS) \$$(EXTRA_CFLAGS) -c $$src -o \$$@" >>$(depend); \
|
||||
done
|
||||
|
||||
include $(depend)
|
||||
|
||||
$(objects)/$(TARGET): $(OBJECTS)
|
||||
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
|
||||
|
||||
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
|
||||
$(AR) cru $@ $(SDLMAIN_OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
install: all install-bin install-hdrs install-lib install-data install-man
|
||||
install-bin:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config
|
||||
install-hdrs:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL
|
||||
for file in $(HDRS); do \
|
||||
$(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
|
||||
done
|
||||
$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h
|
||||
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
|
||||
$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
install-data:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
|
||||
$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
|
||||
$(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig
|
||||
install-man:
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(mandir)/man3
|
||||
for src in $(srcdir)/docs/man3/*.3; do \
|
||||
file=`echo $$src | sed -e 's|^.*/||'`; \
|
||||
$(INSTALL) -m 644 $$src $(DESTDIR)$(mandir)/man3/$$file; \
|
||||
done
|
||||
|
||||
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man
|
||||
uninstall-bin:
|
||||
rm -f $(DESTDIR)$(bindir)/sdl-config
|
||||
uninstall-hdrs:
|
||||
for file in $(HDRS); do \
|
||||
rm -f $(DESTDIR)$(includedir)/SDL/$$file; \
|
||||
done
|
||||
rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h
|
||||
-rmdir $(DESTDIR)$(includedir)/SDL
|
||||
uninstall-lib:
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
|
||||
rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
|
||||
uninstall-data:
|
||||
rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4
|
||||
rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc
|
||||
uninstall-man:
|
||||
for src in $(srcdir)/docs/man3/*.3; do \
|
||||
file=`echo $$src | sed -e 's|^.*/||'`; \
|
||||
rm -f $(DESTDIR)$(mandir)/man3/$$file; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -rf $(objects)
|
||||
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile include/SDL_config.h sdl-config
|
||||
rm -f SDL.qpg
|
||||
rm -f config.status config.cache config.log libtool $(depend)
|
||||
rm -rf $(srcdir)/autom4te*
|
||||
rm -rf $(srcdir)/test/autom4te*
|
||||
find $(srcdir) \( \
|
||||
-name '*~' -o \
|
||||
-name '*.bak' -o \
|
||||
-name '*.old' -o \
|
||||
-name '*.rej' -o \
|
||||
-name '*.orig' -o \
|
||||
-name '.#*' \) \
|
||||
-exec rm -f {} \;
|
||||
cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
|
||||
if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
|
||||
|
||||
dist $(distfile):
|
||||
$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
|
||||
tar cf - $(DIST) | (cd $(distdir); tar xf -)
|
||||
cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
rm -rf $(distdir)/test/autom4te*
|
||||
find $(distdir) \( \
|
||||
-name '*~' -o \
|
||||
-name '*.bak' -o \
|
||||
-name '*.old' -o \
|
||||
-name '*.rej' -o \
|
||||
-name '*.orig' -o \
|
||||
-name '.#*' \) \
|
||||
-exec rm -f {} \;
|
||||
if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
|
||||
tar cvf - $(distdir) | gzip --best >$(distfile)
|
||||
rm -rf $(distdir)
|
||||
|
||||
rpm: $(distfile)
|
||||
rpmbuild -ta $?
|
||||
|
||||
# Create a SVN snapshot that people can run update on
|
||||
snapshot:
|
||||
svn co http://svn.libsdl.org/branches/SDL-1.2
|
||||
(cd SDL-1.2 && ./autogen.sh && rm -rf autom4te.cache)
|
||||
cp SDL-1.2/include/SDL_config.h.default SDL-1.2/include/SDL_config.h
|
||||
tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2
|
||||
rm -f $(HOME)/SDL-1.2.zip
|
||||
zip -r $(HOME)/SDL-1.2.zip SDL-1.2
|
||||
rm -rf SDL-1.2
|
||||
@@ -1,42 +0,0 @@
|
||||
# Makefile to build the SDL library
|
||||
|
||||
INCLUDE = -I./include
|
||||
CFLAGS = -g -O2 $(INCLUDE)
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
|
||||
CONFIG_H = include/SDL_config.h
|
||||
TARGET = libSDL.a
|
||||
SOURCES = \
|
||||
src/*.c \
|
||||
src/audio/*.c \
|
||||
src/cdrom/*.c \
|
||||
src/cpuinfo/*.c \
|
||||
src/events/*.c \
|
||||
src/file/*.c \
|
||||
src/joystick/*.c \
|
||||
src/stdlib/*.c \
|
||||
src/thread/*.c \
|
||||
src/timer/*.c \
|
||||
src/video/*.c \
|
||||
src/audio/oss/*.c \
|
||||
src/video/fbcon/*.c \
|
||||
src/joystick/dummy/*.c \
|
||||
src/cdrom/dummy/*.c \
|
||||
src/thread/pthread/*.c \
|
||||
src/timer/unix/*.c \
|
||||
src/loadso/dummy/*.c \
|
||||
|
||||
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(CONFIG_H) $(OBJECTS)
|
||||
$(AR) crv $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
$(CONFIG_H):
|
||||
cp $(CONFIG_H).default $(CONFIG_H)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJECTS)
|
||||
172
alienblaster/project/jni/sdl/NOTES
Normal file
172
alienblaster/project/jni/sdl/NOTES
Normal file
@@ -0,0 +1,172 @@
|
||||
|
||||
Sam - Mon Aug 6 23:02:37 PDT 2007
|
||||
------
|
||||
Add color modulation to blitting
|
||||
Blit convert format X -> format Y (needed for texture upload)
|
||||
Blit copy / blend / modulate format X -> format X (needed for software renderer)
|
||||
|
||||
Create full software renderer for framebuffer interfaces.
|
||||
|
||||
Create texture for surface, keep surface around as pixel source, allow
|
||||
copying / blending / modulating from surface to display (automatically
|
||||
generate texture?)
|
||||
|
||||
At that point, should anyone be using anything besides textures for display?
|
||||
|
||||
IRC - Mon Aug 6 23:50:44 PDT 2007
|
||||
-----
|
||||
[11:07pm] icculus: so we're clear, "textures" replace "surfaces" from 1.2 when you want to get stuff to the screen? So you have a definitely point where it stops being pixels in memory and starts being an object on the graphics card?
|
||||
[11:07pm] icculus: Upload once, blit many
|
||||
[11:07pm] icculus: something like that?
|
||||
[11:07pm] slouken: That's the idea, yes
|
||||
[11:07pm] icculus: ok, just making sure
|
||||
[11:08pm] slouken: Many drivers retain the "texture" as a surface and blit to opaque bits which then get copied into a framebuffer.
|
||||
[11:08pm] slouken: retain -> would retain
|
||||
[11:08pm] icculus: yeah, I figured
|
||||
[11:08pm] slouken: That's why the features for surface blitting need to match the features for texture display.
|
||||
[11:08pm] icculus: But it gives an abstraction where the app has to make a conscious action: the upload is slow, but then the blit is fast.
|
||||
[11:09pm] icculus: This couldn't just map to LockSurface, though?
|
||||
[11:09pm] slouken: Yes, exactly. I wasn't sure whether to make that clear, e.g. can you display any surface, and automatically generate a texture (if necessary)?
|
||||
[11:09pm] slouken: If not, it simplifies the framebuffer case.
|
||||
[11:10pm] slouken: But even the framebuffer case will probably still want to convert the bits to the optimal format.
|
||||
[11:10pm] slouken: And at that point, the non-optimal bits can be thrown away.
|
||||
[11:11pm] slouken: e.g. SDL_DisplayFormat()
|
||||
[11:10pm] icculus: oh, that's a good point.
|
||||
[11:10pm] icculus: hmm
|
||||
[11:11pm] icculus: yeah, okay
|
||||
[11:11pm] icculus: I was thinking about if the separation is really necessary, or if LockSurface would imply a texture creation (and you just have much more strict locking requirements than most 1.2 targets had)
|
||||
[11:11pm] slouken: That's also why I separated the conversion blits from the copy / blend / modulate blits.
|
||||
[11:12pm] icculus: But I like that the app has to be conscious of when that's happening
|
||||
[11:12pm] slouken: Yeah, I was really leaning towards making it implicit, but the memory savings is pretty significant for artwork.
|
||||
[11:12pm] icculus: SDL_compat can wrap the difference for people that can't get their head around it.
|
||||
[11:13pm] icculus: At the performance cost, that can be a totally external layer that manages it like 1.2's locking.
|
||||
[11:13pm] slouken: Well, SDL_compat is entirely software on top of a single texture that represents the screen.
|
||||
[11:14pm] slouken: Yeah, that's the way it's implemented right now.
|
||||
[11:14pm] slouken: a HWSURFACE is one that is backed by a texture, and lock/unlock is used to synchronize the bits.
|
||||
[11:14pm] slouken: I'm not sure if that's worth keeping though, if SDL_compat is software only.
|
||||
[11:15pm] slouken: It would minimize code migration though.
|
||||
[11:15pm] icculus: yeah
|
||||
[11:15pm] icculus: I expect SDL_compat to be a complete cesspool
|
||||
[11:15pm] icculus: just a black box that no one touches or looks at more than necessary
|
||||
[11:15pm] slouken: more or less, but it's actually pretty clean right now... I think as a side effect of the new API being pretty clean.
|
||||
[11:15pm] slouken: I'm just unsure how much to use texture vs HWSURFACE
|
||||
[11:16pm] icculus: Besides, you'd be surprised how quickly you can get people to move if you flag functions as deprecated so that GCC bitches when you use them.
|
||||
[11:16pm] slouken:
|
||||
[11:16pm] icculus: how much to use texture vs HWSURFACE in 1.3, or in SDL_compat?
|
||||
[11:16pm] slouken: in 1.3
|
||||
[11:17pm] icculus: Pick one or the other, I would say.
|
||||
[11:17pm] icculus: I don't think it's good to confuse people with both terms
|
||||
[11:17pm] slouken: yeah
|
||||
[11:17pm] icculus: Everything is software until it's a texture.
|
||||
[11:17pm] slouken: I'm just not sure which
|
||||
[11:17pm] slouken: that's certainly cleanest.
|
||||
[11:18pm] slouken: and what's currently implemented
|
||||
[11:18pm] slouken: Let's think through the migration process...
|
||||
[11:18pm] icculus: Plus dropping the term HWSURFACE gets the point across that a) this isn't 1.2 and b) this is probably going to a 3D api that you should be using anyhow.
|
||||
[11:18pm] • slouken nods
|
||||
[11:18pm] icculus: I mean, "texture" is what every API calls these things
|
||||
[11:18pm] slouken: Yep
|
||||
[11:19pm] slouken: So let's work through a migration case...
|
||||
[11:19pm] icculus: ok
|
||||
[11:19pm] slouken: FooBall loads a big background and a bunch of sprites. They are png, loaded into SDL_Surface with SDL_image, then converted with SDL_DisplayFormat()
|
||||
[11:20pm] slouken: Then the background is blitted every frame and the sprites are blended on top.
|
||||
[11:20pm] slouken: In the compat case:
|
||||
[11:21pm] slouken: SDL_SetVideoMode() creates a single lockable texture for the display. DisplayFormat() converts the bits into the optimal format, all blitting is done in software, and SDL_UpdateRects() pushes the bits into the texture and the texture is rendered.
|
||||
[11:21pm] slouken: In the 1.3 case:
|
||||
[11:22pm] slouken: The background and sprites are converted to textures using SDL_CreateTextureFromSurface(), and the appropriate blending flags are set. Each frame copies the textures into place and then the display is presented.
|
||||
[11:23pm] slouken: compat is software only, 1.3 can be 3D accelerated.
|
||||
[11:23pm] icculus: wait, why does all blitting have to be done in software in the SDL_compat case?
|
||||
[11:23pm] icculus: I don't understand why SDL_compat can't move things between surfaces and textures at Lock/Unlock time
|
||||
[11:24pm] slouken: Because by default the screen isn't created with HWSURFACE, since apps expect to be able to munge the bits. Therefore, the blits to it have to be done locally.
|
||||
[11:24pm] icculus: And all the surfaces are flagged HWSURFACE, so ->pixels is NULL until locked.
|
||||
[11:24pm] icculus: oh
|
||||
[11:24pm] icculus: It wasn't possible to have a HWSURFACE screen?
|
||||
[11:25pm] slouken: Yes, it was, just nobody did it because alpha blending needs to read from video memory, and poking pixels across the bus is slow.
|
||||
[11:25pm] slouken: Even in 1.3, the Xlib case needs to be software renderer if you want to do any alpha blending.
|
||||
[11:26pm] icculus: But arguably there's no reason that can't all be HWSURFACE (that is, they need to get moved to a texture, even if that's still a software renderer on the backend)
|
||||
[11:26pm] icculus: That sounds like it's only a problem when an app touches SDL_GetVideoSurface()->pixels without checking if they should lock it.
|
||||
[11:26pm] icculus: Which might be quite common
|
||||
[11:27pm] slouken: Yep, in 1.2 the app was able to specify it, and most explicitly don't because it's either not available or bad for alpha blending and direct pixel poking.
|
||||
[11:27pm] icculus: hmm.
|
||||
[11:28pm] slouken: You see why I've been going round and round for months on this?
|
||||
[11:28pm] icculus: Well, we're talking about a compatibility layer; if it's going to crash without LockSurface() on the screen, make them lock it. If that makes it slow, so be it.
|
||||
[11:29pm] icculus: The options are make small changes and take a performance hit, or make bigger changes and get a big performance win.
|
||||
[11:29pm] icculus: (if touching the framebuffer directly, that is)
|
||||
[11:29pm] slouken: Well, at that point it's a compatibility layer, why not just leave it software? (devil's advocate here)
|
||||
[11:29pm] icculus: That's a good point.
|
||||
[11:30pm] slouken: Unless we leave everything surfaces to get the best of both worlds...
|
||||
[11:30pm] • slouken gets dizzy
|
||||
[11:30pm] icculus: From a technical elegance viewpoint, I can see a good mapping between HWSURFACE and textures, but realistically, you want to motivate people to move away from old APIs.
|
||||
[11:31pm] slouken: Yeah probably. There's a certain attraction to retaining the SDL_Surface usage even for hardware surfaces, simply because of code reuse. You don't have to have separate code for your software composition and your rendering. You also get to keep your old image loading code, etc.
|
||||
[11:31pm] icculus: man, this really is a pain in the ass, I see what you mean.
|
||||
[11:32pm] slouken: Yeah.
|
||||
[11:32pm] icculus: hmm, let me think on this awhile.
|
||||
[11:32pm] slouken: On the other hand, separating the Texture API for rendering is clearer and allows extension in the future.
|
||||
[11:32pm] slouken: We could potentially allow you to create a software renderer pointed at an SDL surface....
|
||||
[11:32pm] slouken: Hmmm
|
||||
[11:33pm] icculus: well, that's what you have now for something like Doom
|
||||
[11:33pm] icculus: you render to a shadow surface, and throw a hail-mary with SDL_Flip()
|
||||
[11:34pm] slouken: Yep. I mean a 1.3 "renderer" with an SDL_Surface or another texture as the target.
|
||||
[11:34pm] icculus: More or less, that doesn't change. The only important thing there is not generating a new texture every time, but being able to discard what's currently in it for a fresh upload.
|
||||
[11:34pm] slouken: Yep
|
||||
[11:34pm] icculus: oh, I see
|
||||
[11:35pm] icculus: render-to-surface
|
||||
[11:35pm] slouken: lol
|
||||
[11:35pm] slouken: yeah
|
||||
[11:36pm] slouken: So... where to draw the line with surface vs texture...
|
||||
[11:37pm] icculus: I don't know, I would think that basically you want to get out of surfaces as fast as possible
|
||||
[11:37pm] icculus: (disregarding SDL_compat for the moment)
|
||||
[11:37pm] slouken: Yeah, I think so.
|
||||
[11:37pm] slouken: Load the bits up, throw them into a texture, and go
|
||||
[11:37pm] icculus: And basically all you really need for that is an "upload" function.
|
||||
[11:38pm] slouken: Yep
|
||||
[11:38pm] icculus: I'd even be inclined to not allow "Locking," so there's no readback.
|
||||
[11:38pm] icculus: well, I'm sure that would cause a fight
|
||||
[11:38pm] • slouken thinks
|
||||
[11:40pm] slouken: Let me see where I use SDL_LockTexture() right now.
|
||||
[11:42pm] slouken: The only time that's useful is to avoid a buffer copy when you're already writing the bits in the correct format.
|
||||
[11:42pm] slouken: e.g. lock -> software render into bits -> unlock (upload)
|
||||
[11:43pm] slouken: that may already be taken care of by the upload though.
|
||||
[11:43pm] slouken: e.g. software render into bits -> upload
|
||||
[11:44pm] slouken: Oh yeah, there's probably a memory copy of the bits though, so it's: upload = copy into cached bits, copy cached bits to video memory as needed. In that case if you lock to get access to the cached bits directly that's a win.
|
||||
[11:44pm] icculus: ah, okay
|
||||
[11:47pm] icculus: I don't know, my head hurts.
|
||||
[11:47pm] slouken: Yeah, mine too.
|
||||
[11:47pm] slouken: I was pretty happy with the current setup until I noticed that it's really hard to write a framebuffer driver right now.
|
||||
[11:49pm] slouken: I think maybe if I clean that up and separate conversion blit and copy / blend / modulate blit, then it may work pretty cleanly.
|
||||
[11:49pm] icculus: yeah
|
||||
|
||||
[11:54pm] slouken: So recapping... SDL_Surface is only used for loading and app composition.
|
||||
[11:55pm] slouken: SDL surface blitting is enhanced to maintain parity with the renderer features, since it's used as the core of the software renderer.
|
||||
[11:56pm] slouken: The software renderer is adapted to be a standalone module targeting either an SDL_Surface or an SDL_Texture.
|
||||
[11:56pm] slouken: SDL_HWSURFACE goes away
|
||||
[11:57pm] slouken: Anything I'm missing?
|
||||
[11:58pm] icculus: no, sounds good
|
||||
[11:58pm] slouken: This means we have the new 1.3 texture API pretty much as it stands.
|
||||
[11:59pm] slouken: Right?
|
||||
[11:59pm] icculus: yeah, I think so
|
||||
|
||||
[12:00am] slouken: I was trying to see if it was possible to make a pluggable blit API, but I was going insane with trying to figure out how to make it fast.
|
||||
[12:01am] slouken: If it were software only I could just say, write your own and register it here, but you'd have to maintain parity with the OpenGL and Direct3D renderers as well.
|
||||
[12:01am] slouken: At that point you might as well be working in surfaces and uploading to texture.
|
||||
[12:02am] icculus: yeah
|
||||
|
||||
TODO
|
||||
----
|
||||
Change textures to static/streaming. Static textures are not lockable,
|
||||
streaming textures are lockable and may have system memory pixels available.
|
||||
SDL_compat will use a streaming video texture, and will never be HWSURFACE,
|
||||
but may be PREALLOC, if system memory pixels are available.
|
||||
*** DONE Thu Aug 16 14:18:42 PDT 2007
|
||||
|
||||
The software renderer will be abstracted so the surface management can be
|
||||
used by any renderer that provides functions to copy surfaces to the window.
|
||||
|
||||
Blitters...
|
||||
----
|
||||
Copy blit and fill rect are optimized with MMX and SSE now.
|
||||
|
||||
Here are the pieces we still need:
|
||||
- Merging SDL texture capabilities into the SDL surface system
|
||||
- Generic fallback blitter architecture
|
||||
- Custom fast path blitters
|
||||
@@ -12,11 +12,10 @@ This is the Simple DirectMedia Layer, a general API that provides low
|
||||
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
|
||||
and 2D framebuffer across multiple platforms.
|
||||
|
||||
The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS,
|
||||
MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX,
|
||||
and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64,
|
||||
RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially
|
||||
supported.
|
||||
The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
|
||||
Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
|
||||
The code contains support for AIX, OSF/Tru64, RISC OS, and SymbianOS,
|
||||
but these are not officially supported.
|
||||
|
||||
SDL is written in C, but works with C++ natively, and has bindings to
|
||||
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
The AmigaOS code has been removed from SDL, since it had been broken for a
|
||||
long time and had a few bits of fairly invasive code #ifdef'd into the
|
||||
SDL core.
|
||||
|
||||
However, there is an OS4 version of SDL here:
|
||||
http://www.rcdrummond.net/amiga/index.html
|
||||
|
||||
And a MorphOS version here:
|
||||
http://www.lehtoranta.net/powersdl/
|
||||
|
||||
--ryan.
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
SDL on BeOS R5
|
||||
==============
|
||||
|
||||
You can build SDL on BeOS like any other GNU style package.
|
||||
e.g. ./configure && make && make install
|
||||
By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.}
|
||||
|
||||
Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib,
|
||||
so it can be found by the dynamic linker.
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
SDL is no longer hosted in a CVS repository. Please see README.SVN for
|
||||
information on accessing our Subversion repository.
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
SDL for Dreamcast (beta2)
|
||||
|
||||
BERO
|
||||
berobero@users.sourceforge.net
|
||||
|
||||
http://www.geocities.co.jp/Playtown/2004/
|
||||
|
||||
this work with kos-newlib
|
||||
http://sourceforge.net/projects/dcquake/
|
||||
|
||||
compile
|
||||
- source environ.sh (from the KOS distribution)
|
||||
- make -f Makefile.dc
|
||||
|
||||
compile with gl support
|
||||
- install latest libgl from http://sourceforge.net/projects/dcquake/
|
||||
- uncomment GL=1 in Makefile.dc
|
||||
- make -f Makefile.dc clean
|
||||
- make -f Makefile.dc
|
||||
|
||||
install
|
||||
- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment
|
||||
|
||||
changelog:
|
||||
|
||||
beta2
|
||||
- OpenGL support
|
||||
- Hardware page flip support
|
||||
|
||||
beta
|
||||
- thread, timer don't tested so much.
|
||||
- not support OpenGL
|
||||
23
alienblaster/project/jni/sdl/README.HG
Normal file
23
alienblaster/project/jni/sdl/README.HG
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
The latest development version of SDL is available via Mercurial.
|
||||
Mercurial allows you to get up-to-the-minute fixes and enhancements;
|
||||
as a developer works on a source tree, you can use "hg" to mirror that
|
||||
source tree instead of waiting for an official release. Please look
|
||||
at the Mercurial website ( http://mercurial.selenic.com/ ) for more
|
||||
information on using hg, where you can also download software for
|
||||
Mac OS X, Windows, and Unix systems.
|
||||
|
||||
hg clone http://hg.libsdl.org/SDL
|
||||
|
||||
If you are building SDL with an IDE, you will need to copy the file
|
||||
include/SDL_config.h.default to include/SDL_config.h before building.
|
||||
|
||||
If you are building SDL via configure, you will need to run autogen.sh
|
||||
before running configure.
|
||||
|
||||
There is a web interface to the subversion repository at:
|
||||
http://hg.libsdl.org/SDL/
|
||||
|
||||
There is an RSS feed available at that URL, for those that want to
|
||||
track commits in real time.
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with MacOS 7,8,9 on PPC
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using the Apple MPW environment:
|
||||
http://developer.apple.com/tools/mpw-tools/
|
||||
|
||||
CodeWarrior projects are available in the CWprojects directory.
|
||||
|
||||
==============================================================================
|
||||
I. Building the Simple DirectMedia Layer libraries:
|
||||
(This step isn't necessary if you have the SDL binary distribution)
|
||||
|
||||
First, unpack the MPWmake.sea.hqx archive and move SDL.make into the
|
||||
SDL directory.
|
||||
|
||||
Start MPW
|
||||
|
||||
Set the current directory within MPW to the SDL toplevel directory.
|
||||
|
||||
Build "SDL" (Type Command-B and enter "SDL" in the dialog)
|
||||
|
||||
If everything compiles successfully, you now have the PPC libraries
|
||||
"SDL" and "SDLmain.o" in the 'lib' subdirectory.
|
||||
|
||||
==============================================================================
|
||||
II. Building the Simple DirectMedia Layer test programs:
|
||||
|
||||
First, unpack the MPWmake.sea.hqx archive, move the new rsrc directory to
|
||||
the main SDL directory, and move the makefiles in the new test subdirectory
|
||||
to the SDL 'test' subdirectory.
|
||||
|
||||
Start MPW
|
||||
|
||||
Set the current directory within MPW to the SDL 'test' subdirectory.
|
||||
|
||||
Build the programs that have an associated MPW makefile (file ending
|
||||
with .make), including "testwin", "testalpha", and "graywin".
|
||||
|
||||
Copy the SDL library file into the test directory, and run!
|
||||
|
||||
==============================================================================
|
||||
III. Building the Simple DirectMedia Layer demo programs:
|
||||
|
||||
Copy one of the test program Makefiles to the demo directory
|
||||
and modify it to match the sources in the demo.
|
||||
|
||||
==============================================================================
|
||||
IV. Enjoy! :)
|
||||
|
||||
If you have a project you'd like me to know about, or want to ask questions,
|
||||
go ahead and join the SDL developer's mailing list by sending e-mail to:
|
||||
|
||||
sdl-request@libsdl.org
|
||||
|
||||
and put "subscribe" into the subject of the message. Or alternatively you
|
||||
can use the web interface:
|
||||
|
||||
http://www.libsdl.org/mailman/listinfo/sdl
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Mac OS X
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using Apple's Mac OS X (pronounced
|
||||
"ten").
|
||||
|
||||
From the developer's point of view, OS X is a sort of hybrid Mac and
|
||||
Unix system, and you have the option of using either traditional
|
||||
command line tools or Apple's IDE Xcode.
|
||||
|
||||
To build SDL using the command line, use the standard configure and make
|
||||
process:
|
||||
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
You can also build SDL as a Universal library (a single binary for both
|
||||
PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using
|
||||
the fatbuild.sh script in build-scripts:
|
||||
sh build-scripts/fatbuild.sh
|
||||
sudo build-scripts/fatbuild.sh install
|
||||
This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4
|
||||
ABI compatibility on Intel architectures. For best compatibility you
|
||||
should compile your application the same way. A script which wraps
|
||||
gcc to make this easy is provided in test/gcc-fat.sh
|
||||
|
||||
To use the library once it's built, you essential have two possibilities:
|
||||
use the traditional autoconf/automake/make method, or use Xcode.
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with a traditional Makefile
|
||||
==============================================================================
|
||||
|
||||
An existing autoconf/automake build system for your SDL app has good chances
|
||||
to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary
|
||||
that you can distribute to users, you need to put the generated binary into a
|
||||
so called "bundle", which basically is a fancy folder with a name like
|
||||
"MyCoolGame.app".
|
||||
|
||||
To get this build automatically, add something like the following rule to
|
||||
your Makefile.am:
|
||||
|
||||
bundle_contents = APP_NAME.app/Contents
|
||||
APP_NAME_bundle: EXE_NAME
|
||||
mkdir -p $(bundle_contents)/MacOS
|
||||
mkdir -p $(bundle_contents)/Resources
|
||||
echo "APPL????" > $(bundle_contents)/PkgInfo
|
||||
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
|
||||
|
||||
You should replace EXE_NAME with the name of the executable. APP_NAME is what
|
||||
will be visible to the user in the Finder. Usually it will be the same
|
||||
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
|
||||
usually is "TestGame". You might also want to use @PACKAGE@ to use the package
|
||||
name as specified in your configure.in file.
|
||||
|
||||
If your project builds more than one application, you will have to do a bit
|
||||
more. For each of your target applications, you need a seperate rule.
|
||||
|
||||
If you want the created bundles to be installed, you may want to add this
|
||||
rule to your Makefile.am:
|
||||
|
||||
install-exec-hook: APP_NAME_bundle
|
||||
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
|
||||
mkdir -p $(DESTDIR)$(prefix)/Applications/
|
||||
cp -r $< /$(DESTDIR)$(prefix)Applications/
|
||||
|
||||
This rule takes the Bundle created by the rule from step 3 and installs them
|
||||
into $(DESTDIR)$(prefix)/Applications/.
|
||||
|
||||
Again, if you want to install multiple applications, you will have to augment
|
||||
the make rule accordingly.
|
||||
|
||||
|
||||
But beware! That is only part of the story! With the above, you end up with
|
||||
a bare bone .app bundle, which is double clickable from the Finder. But
|
||||
there are some more things you should do before shipping yor product...
|
||||
|
||||
1) The bundle right now probably is dynamically linked against SDL. That
|
||||
means that when you copy it to another computer, *it will not run*,
|
||||
unless you also install SDL on that other computer. A good solution
|
||||
for this dilemma is to static link against SDL. On OS X, you can
|
||||
achieve that by linkinag against the libraries listed by
|
||||
sdl-config --static-libs
|
||||
instead of those listed by
|
||||
sdl-config --libs
|
||||
Depending on how exactly SDL is integrated into your build systems, the
|
||||
way to achieve that varies, so I won't describe it here in detail
|
||||
2) Add an 'Info.plist' to your application. That is a special XML file which
|
||||
contains some meta-information about your application (like some copyright
|
||||
information, the version of your app, the name of an optional icon file,
|
||||
and other things). Part of that information is displayed by the Finder
|
||||
when you click on the .app, or if you look at the "Get Info" window.
|
||||
More information about Info.plist files can be found on Apple's homepage.
|
||||
|
||||
|
||||
As a final remark, let me add that I use some of the techniques (and some
|
||||
variations of them) in Exult and ScummVM; both are available in source on
|
||||
the net, so feel free to take a peek at them for inspiration!
|
||||
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Xcode
|
||||
==============================================================================
|
||||
|
||||
These instructions are for using Apple's Xcode IDE to build SDL applications.
|
||||
|
||||
- First steps
|
||||
|
||||
The first thing to do is to unpack the Xcode.tar.gz archive in the
|
||||
top level SDL directory (where the Xcode.tar.gz archive resides).
|
||||
Because Stuffit Expander will unpack the archive into a subdirectory,
|
||||
you should unpack the archive manually from the command line:
|
||||
cd [path_to_SDL_source]
|
||||
tar zxf Xcode.tar.gz
|
||||
This will create a new folder called Xcode, which you can browse
|
||||
normally from the Finder.
|
||||
|
||||
- Building the Framework
|
||||
|
||||
The SDL Library is packaged as a framework bundle, an organized
|
||||
relocatable folder heirarchy of executible code, interface headers,
|
||||
and additional resources. For practical purposes, you can think of a
|
||||
framework as a more user and system-friendly shared library, whose library
|
||||
file behaves more or less like a standard UNIX shared library.
|
||||
|
||||
To build the framework, simply open the framework project and build it.
|
||||
By default, the framework bundle "SDL.framework" is installed in
|
||||
/Library/Frameworks. Therefore, the testers and project stationary expect
|
||||
it to be located there. However, it will function the same in any of the
|
||||
following locations:
|
||||
|
||||
~/Library/Frameworks
|
||||
/Local/Library/Frameworks
|
||||
/System/Library/Frameworks
|
||||
|
||||
- Build Options
|
||||
There are two "Build Styles" (See the "Targets" tab) for SDL.
|
||||
"Deployment" should be used if you aren't tweaking the SDL library.
|
||||
"Development" should be used to debug SDL apps or the library itself.
|
||||
|
||||
- Building the Testers
|
||||
Open the SDLTest project and build away!
|
||||
|
||||
- Using the Project Stationary
|
||||
Copy the stationary to the indicated folders to access it from
|
||||
the "New Project" and "Add target" menus. What could be easier?
|
||||
|
||||
- Setting up a new project by hand
|
||||
Some of you won't want to use the Stationary so I'll give some tips:
|
||||
* Create a new "Cocoa Application"
|
||||
* Add src/main/macosx/SDLMain.m , .h and .nib to your project
|
||||
* Remove "main.c" from your project
|
||||
* Remove "MainMenu.nib" from your project
|
||||
* Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
|
||||
* Add "$(HOME)/Library/Frameworks" to the frameworks search path
|
||||
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
|
||||
* Set the "Main Nib File" under "Application Settings" to "SDLMain.nib"
|
||||
* Add your files
|
||||
* Clean and build
|
||||
|
||||
- Building from command line
|
||||
Use pbxbuild in the same directory as your .pbproj file
|
||||
|
||||
- Running your app
|
||||
You can send command line args to your app by either invoking it from
|
||||
the command line (in *.app/Contents/MacOS) or by entering them in the
|
||||
"Executibles" panel of the target settings.
|
||||
|
||||
- Implementation Notes
|
||||
Some things that may be of interest about how it all works...
|
||||
* Working directory
|
||||
As defined in the SDL_main.m file, the working directory of your SDL app
|
||||
is by default set to its parent. You may wish to change this to better
|
||||
suit your needs.
|
||||
* You have a Cocoa App!
|
||||
Your SDL app is essentially a Cocoa application. When your app
|
||||
starts up and the libraries finish loading, a Cocoa procedure is called,
|
||||
which sets up the working directory and calls your main() method.
|
||||
You are free to modify your Cocoa app with generally no consequence
|
||||
to SDL. You cannot, however, easily change the SDL window itself.
|
||||
Functionality may be added in the future to help this.
|
||||
|
||||
|
||||
Known bugs are listed in the file "BUGS"
|
||||
@@ -1,250 +0,0 @@
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer on Atari
|
||||
==============================================================================
|
||||
|
||||
|
||||
If you want to build SDL from sources to create SDL programs on Atari:
|
||||
see sections I - II.
|
||||
|
||||
If you want to create SDL programs on Atari using SDL binary build,
|
||||
download it from my web site (URL at end of this file).
|
||||
|
||||
If you want to configure a program using SDL on Atari,
|
||||
see sections IV - VI.
|
||||
|
||||
|
||||
==============================================================================
|
||||
I. Building the Simple DirectMedia Layer libraries:
|
||||
(This step isn't necessary if you have the SDL binary distribution)
|
||||
|
||||
Do the classic configure, with --disable-shared --enable-static and:
|
||||
|
||||
Tos version (should run everywhere):
|
||||
--disable-threads
|
||||
Tos does not support threads.
|
||||
|
||||
MiNT version (maybe Magic, only for multitasking OS):
|
||||
--disable-pthreads --enable-pth
|
||||
Mint and Magic may supports threads, so audio can be used with current
|
||||
devices, like Sun audio, or disk-writing support. Like Tos, interrupt
|
||||
audio without threads is more suited for Atari machines.
|
||||
|
||||
Then you can make ; make install it.
|
||||
|
||||
==============================================================================
|
||||
II. Building the Simple DirectMedia Layer test programs:
|
||||
|
||||
Do the classic configure, then make.
|
||||
|
||||
Run them !
|
||||
|
||||
==============================================================================
|
||||
III. Enjoy! :)
|
||||
|
||||
If you have a project you'd like me to know about, or want to ask questions,
|
||||
go ahead and join the SDL developer's mailing list by sending e-mail to:
|
||||
|
||||
sdl-request@libsdl.org
|
||||
|
||||
and put "subscribe" into the subject of the message. Or alternatively you
|
||||
can use the web interface:
|
||||
|
||||
http://www.libsdl.org/mailman/listinfo/sdl
|
||||
|
||||
==============================================================================
|
||||
IV. What is supported:
|
||||
|
||||
Keyboard (GEMDOS, BIOS, GEM, Ikbd)
|
||||
Mouse (XBIOS, GEM, Ikbd, /dev/mouse (non working atm, disabled))
|
||||
Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen))
|
||||
Timer (VBL vector, GNU pth library)
|
||||
Joysticks and joypads (Ikbd, Hardware)
|
||||
Audio (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled)
|
||||
Threads (Multitasking OS only via GNU pth library)
|
||||
Shared object loader (using LDG library from http://ldg.atari.org/)
|
||||
Audio CD (MetaDOS)
|
||||
OpenGL (using Mesa offscreen rendering driver)
|
||||
|
||||
- Dependent driver combinations:
|
||||
Video Kbd Mouse Timer Joysticks
|
||||
xbios ikbd ikbd vbl(2) ikbd
|
||||
xbios gemdos xbios vbl(2) xbios
|
||||
xbios bios xbios vbl(2) xbios
|
||||
gem gem gem(1) vbl(2) xbios
|
||||
|
||||
Audio O/S Misc
|
||||
dma8 All Uses MFP Timer A interrupt
|
||||
xbios TOS Uses MFP Timer A interrupt
|
||||
xbios MiNT Uses MFP Timer A interrupt
|
||||
xbios Magic Uses MFP Timer A interrupt
|
||||
stfa All Uses MFP interrupt
|
||||
mcsn TOS Uses MFP Timer A interrupt
|
||||
mcsn MiNT Uses MiNT thread
|
||||
mcsn Magic Disabled
|
||||
gsxb All Uses GSXB callback
|
||||
|
||||
Joypad driver always uses hardware access.
|
||||
OpenGL driver always uses OSMesa.
|
||||
|
||||
(1) GEM does not report relative mouse motion, so xbios mouse driver is used
|
||||
to report this type event.
|
||||
A preliminary driver for /dev/mouse device driver is present, but is disabled
|
||||
till it can be used with other applications simultaneously.
|
||||
|
||||
(2) If you build SDL with threads using the GNU pth library, timers are
|
||||
supported via the pth library.
|
||||
|
||||
==============================================================================
|
||||
V. Environment variables:
|
||||
|
||||
SDL_VIDEODRIVER:
|
||||
Set to 'xbios' to force xbios video driver
|
||||
Set to 'gem' to force gem video driver
|
||||
|
||||
SDL_VIDEO_GL_DRIVER:
|
||||
Set to filename to load as OpenGL library, if you use SDL_GL_LoadLibrary()
|
||||
|
||||
SDL_AUDIODRIVER:
|
||||
Set to 'mint_gsxb' to force Atari GSXB audio driver
|
||||
Set to 'mint_mcsn' to force Atari MCSN audio driver
|
||||
Set to 'mint_stfa' to force Atari STFA audio driver
|
||||
Set to 'mint_xbios' to force Atari Xbios audio driver
|
||||
Set to 'mint_dma8' to force Atari 8 bits DMA audio driver
|
||||
Set to 'audio' to force Sun /dev/audio audio driver
|
||||
Set to 'disk' to force disk-writing audio driver
|
||||
|
||||
SDL_ATARI_EVENTSDRIVER
|
||||
Set to 'ikbd' to force IKBD 6301 keyboard driver
|
||||
Set to 'gemdos' to force gemdos keyboard driver
|
||||
Set to 'bios' to force bios keyboard driver
|
||||
|
||||
SDL_JOYSTICK_ATARI:
|
||||
Use any of these strings in the environment variable to enable or
|
||||
disable a joystick:
|
||||
|
||||
'ikbd-joy1-[on|off]' for IKBD joystick on port 1 (hardware access)
|
||||
'xbios-joy1-[on|off]' for IKBD joystick on port 1 (xbios access)
|
||||
'porta-pad-[on|off]' for joypad and/or teamtap on port A
|
||||
'porta-joy0-[on|off]' for joystick 0 on port A
|
||||
'porta-joy1-[on|off]' for joystick 1 on port A
|
||||
'porta-lp-[on|off]' for lightpen on port A
|
||||
'porta-anpad-[on|off]' for analog paddle on port A
|
||||
'portb-pad-[on|off]' for joypad and/or teamtap on port B
|
||||
'portb-joy0-[on|off]' for joystick 0 on port B
|
||||
'portb-joy1-[on|off]' for joystick 1 on port B
|
||||
'portb-anpad-[on|off]' for analog paddle on port B
|
||||
|
||||
Default configuration is:
|
||||
'ikbd-joy1-on' (if IKBD events driver enabled)
|
||||
'xbios-joy1-on' (if gemdos/bios/gem events driver enabled)
|
||||
'porta-pad-on portb-pad-on' (if available on the machine)
|
||||
|
||||
port[a|b]-[pad|joy?|lp|anpad]-* strings are mutually exclusives.
|
||||
On such a port, you can only use a joypad OR 1 or 2 joysticks OR
|
||||
a lightpen OR an analog paddle. You must disable joypad before
|
||||
setting another controller.
|
||||
|
||||
The second joystick port on IKBD is used by the mouse, so not usable.
|
||||
Another problem with the IKBD: mouse buttons and joystick fire buttons
|
||||
are wired together at the hardware level, it means:
|
||||
port 0 port 0 port 1
|
||||
mouse left button = joystick fire 0 = joystick fire 1
|
||||
mouse right button = joystick fire 1 = joystick fire 0
|
||||
|
||||
Descriptions of joysticks/joypads:
|
||||
- Joypads: 1 hat, 17 buttons (Atari Jaguar console-like).
|
||||
- Joysticks: 1 hat, 1 button.
|
||||
- Lightpen, analog paddles: 2 axis, 2 buttons. The 2 buttons are those
|
||||
affected to 1 button joysticks on the same port.
|
||||
|
||||
==============================================================================
|
||||
VI. More informations about drivers:
|
||||
|
||||
OpenGL:
|
||||
The default is to use the Mesa offscreen driver (osmesa.ldg). If you want
|
||||
to use an older OpenGL implementation, like mesa_gl.ldg or tiny_gl.ldg,
|
||||
your program must use SDL_GL_LoadLibrary() to do so, and retrieve the
|
||||
needed function pointers with SDL_LoadFunction(). In all cases, the OpenGL
|
||||
context is taken care of by SDL itself, you just have to use gl* functions.
|
||||
|
||||
However, there is one OpenGL call that has a different prototype in the old
|
||||
implementations: glOrtho(). In the old implementations, it has 6 float as
|
||||
parameters, in the standard one, it has 6 double parameters. If you want
|
||||
to compile testdyngl, or any other SDL program that loads its OpenGL
|
||||
library, you must change the glOrtho() prototype used in this program. In
|
||||
osmesa.ldg, you can retrieve a glOrtho() with double parameters, by
|
||||
searching for the function "glOrtho6d".
|
||||
|
||||
Xbios video:
|
||||
Video chip is detected using the _VDO cookie.
|
||||
Screen enhancers are not supported, but could be if you know how to
|
||||
use them.
|
||||
|
||||
ST, STE, Mega ST, Mega STE:
|
||||
320x200x4 bits, shades of grey, available only for the purpose
|
||||
of testing SDL.
|
||||
TT:
|
||||
320x480x8 and 320x240x8 (software double-lined mode).
|
||||
Falcon:
|
||||
All modes supported by the current monitor (RVB or VGA).
|
||||
BlowUp and Centscreen extended modes, ScreenBlaster 3 current mode.
|
||||
Milan:
|
||||
Experimental support
|
||||
Clones and any machine with monochrome monitor:
|
||||
Not supported.
|
||||
|
||||
Gem video:
|
||||
Automatically used if xbios not available.
|
||||
|
||||
All machines:
|
||||
Only the current resolution, if 8 bits or higher depth.
|
||||
|
||||
IKBD keyboard, mouse and joystick driver:
|
||||
Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon.
|
||||
|
||||
Hades has an IKBD, but xbios is not available for video, so IKBD
|
||||
driver is disabled.
|
||||
|
||||
Gemdos and bios keyboard driver:
|
||||
Available on all machines.
|
||||
|
||||
Mouse and joystick xbios driver:
|
||||
Available on all machines (I think).
|
||||
|
||||
Joypad driver:
|
||||
Available if _MCH cookie is STE or Falcon. Supports teamtap.
|
||||
|
||||
PTH timer driver:
|
||||
Available with multitasking OS.
|
||||
|
||||
VBL timer driver:
|
||||
Available on all machines (I think).
|
||||
|
||||
Audio drivers:
|
||||
Cookies _SND, MCSN, STFA and GSXB used to detect supported audio
|
||||
capabilities.
|
||||
|
||||
STE, Mega STE, TT:
|
||||
8 bits DMA (hardware access)
|
||||
STFA, MCSN or GSXB driver if installed
|
||||
Falcon:
|
||||
8 bits DMA (hardware access)
|
||||
Xbios functions
|
||||
STFA, MCSN or GSXB driver if installed
|
||||
Other machines:
|
||||
STFA, MCSN or GSXB driver if installed
|
||||
|
||||
STFA driver:
|
||||
http://removers.free.fr/softs/stfa.html
|
||||
GSXB driver:
|
||||
http://assemsoft.atari.org/gsxb/
|
||||
MacSound driver:
|
||||
http://jf.omnis.ch/software/tos/
|
||||
MagicSound driver (MCSN,GSXB compatible):
|
||||
http://perso.wanadoo.fr/didierm/
|
||||
X-Sound driver (GSXB compatible):
|
||||
http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html
|
||||
|
||||
--
|
||||
Patrice Mandin <patmandin@gmail.com>
|
||||
http://pmandin.atari.org/
|
||||
@@ -1,22 +0,0 @@
|
||||
The SDL port to the Nintendo DS
|
||||
|
||||
This port uses the devKitPro toolchain, available from:
|
||||
http://www.devkitpro.org
|
||||
|
||||
Precompiled tools for cross-compiling on Linux are available from:
|
||||
http://www.libsdl.org/extras/nds/devkitPro-20070503-linux.tar.gz
|
||||
|
||||
todo:
|
||||
add ds console specific features/optimizations
|
||||
mouse/keyboard support
|
||||
dual screen support
|
||||
|
||||
build with:
|
||||
cp include/SDL_config_nds.h include/SDL_config.h
|
||||
make -f Makefile.ds
|
||||
|
||||
included is an arm9/arm7 template to allow for sound streaming support.
|
||||
|
||||
Enjoy, fix the source and share :)
|
||||
Troy Davis(GPF)
|
||||
http://gpf.dcemu.co.uk/
|
||||
@@ -1,97 +0,0 @@
|
||||
=================================================================
|
||||
Patch version 0.9 of SDL(Simple DirectMedia Layer) for Nano-X API
|
||||
=================================================================
|
||||
|
||||
Authors: Hsieh-Fu Tsai, clare@setabox.com
|
||||
Greg Haerr, greg@censoft.com
|
||||
|
||||
This patch is against SDL version 1.2.4.
|
||||
It enhances previous patch 0.8 by providing direct framebuffer
|
||||
access as well as dynamic hardware pixel type support, not
|
||||
requiring a compile-time option setting for different framebuffer
|
||||
modes.
|
||||
Tested against Microwindows version 0.89pre9.
|
||||
|
||||
Older Microwindows versions
|
||||
===========================
|
||||
If running on a version older than Microwindows 0.89pre9,
|
||||
the following items might need to be patched in Microwindows.
|
||||
|
||||
1. Patch src/nanox/client.c::GrClose()
|
||||
It fixes the client side GrClose(). In the original version,
|
||||
GrOpen() can only be called once. When the GrOpen() is called at
|
||||
the second time, the program will terminate. In order to prevent
|
||||
this situation, we need to insert "nxSocket = -1" after
|
||||
"close(nxSocket)" in GrClose(). If you do not have this problem,
|
||||
you may skip this step.
|
||||
|
||||
2. Patch src/nanox/clientfb.c to return absolute x,y coordinates
|
||||
when using GrGetWindowFBInfo(). Copy the version 0.89pre9
|
||||
of src/nanox/clientfb.c to your system, or configure
|
||||
using --disable-nanox-direct-fb.
|
||||
|
||||
=============
|
||||
Quick Install
|
||||
=============
|
||||
|
||||
1. ./configure --disable-video-x11 --disable-video-fbcon \
|
||||
--enable-video-nanox \
|
||||
--with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]
|
||||
2. make clean
|
||||
3. make
|
||||
4. make install (as root)
|
||||
|
||||
============
|
||||
Nitty-gritty
|
||||
============
|
||||
|
||||
--enable-nanox-direct-fb Use direct framebuffer access
|
||||
--enable-nanox-debug Show debug messages
|
||||
--enable-nanox-share-memory Use shared-memory to speed up
|
||||
|
||||
When running multi-threaded applications using SDL, such
|
||||
as SMPEG, set THREADSAFE=Y in Microwindows' config file,
|
||||
to enable GrXXX() system call critical section support.
|
||||
|
||||
=============================================
|
||||
Some programs can be used to test this patch.
|
||||
=============================================
|
||||
|
||||
1. http://www.cs.berkeley.edu/~weimer/atris (a tetris-like game)
|
||||
2. http://www.libsdl.org/projects/newvox/
|
||||
3. http://www.libsdl.org/projects/xflame/
|
||||
4. http://www.libsdl.org/projects/optimum/
|
||||
5. http://www.gnugeneration.com/software/loop/
|
||||
6: http://www.lokigames.com/development/smpeg.php3 (SMPEG version 0.4.4)
|
||||
|
||||
=========
|
||||
Todo List
|
||||
=========
|
||||
|
||||
1. Create hardware surface
|
||||
2. Create YUVOverlay on hardware
|
||||
3. Use OpenGL
|
||||
4. Gamma correction
|
||||
5. Hide/Change mouse pointer
|
||||
6. Better window movement control with direct fb access
|
||||
7. Palette handling in 8bpp could be improved
|
||||
|
||||
=====================
|
||||
Supporting Institutes
|
||||
=====================
|
||||
|
||||
Many thanks to go to Setabox Co., Ltd. and CML (Communication and
|
||||
Multimedia Laboratory, http://www.cmlab.csie.ntu.edu.tw/) in the
|
||||
Department of Computer Science and Information Engineering of
|
||||
National Taiwan University for supporting this porting project.
|
||||
|
||||
Century Embedded Technologies (http://embedded.censoft.com)
|
||||
for this patch.
|
||||
|
||||
===================
|
||||
Contact Information
|
||||
===================
|
||||
|
||||
Welcome to give me any suggestion and to report bugs.
|
||||
My e-mail address : clare@setabox.com or niky@cmlab.csie.ntu.edu.tw
|
||||
or greg@censoft.com
|
||||
@@ -1,281 +0,0 @@
|
||||
|
||||
===========
|
||||
SDL on OS/2
|
||||
===========
|
||||
|
||||
Last updated on May. 17, 2006.
|
||||
|
||||
|
||||
1. How to compile?
|
||||
------------------
|
||||
|
||||
To compile this, you'll need the followings installed:
|
||||
- The OS/2 Developer's Toolkit
|
||||
- The OpenWatcom compiler
|
||||
(http://www.openwatcom.org)
|
||||
|
||||
First of all, you have to unzip the Watcom-OS2.zip file. This will result in a
|
||||
file called "makefile" and a file called "setvars.cmd" in this folder (and some
|
||||
more files...).
|
||||
|
||||
Please edit the second, fourth and fifth lines of setvars.cmd file
|
||||
to set the folders where the toolkit, the OW compiler and the FSLib are.
|
||||
You won't need NASM yet (The Netwide Assembler), you can leave that line.
|
||||
Run setvars.cmd, and you should get a shell in which you can
|
||||
compile SDL.
|
||||
|
||||
Check the "makefile" file. There is a line in there which determines if the
|
||||
resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version
|
||||
is full of printf()'s, so if something goes wrong, its output can help a lot
|
||||
for debugging.
|
||||
|
||||
Then run "wmake".
|
||||
This should create the SDL12.DLL and the corresponding SDL12.LIB file here.
|
||||
|
||||
To test applications, it's a good idea to use the 'debug' build of SDL, and
|
||||
redirect the standard output and standard error output to files, to see what
|
||||
happens internally in SDL.
|
||||
(like: testsprite >stdout.txt 2>stderr.txt)
|
||||
|
||||
To rebuild SDL, use the following commands in this folder:
|
||||
wmake clean
|
||||
wmake
|
||||
|
||||
|
||||
|
||||
2. How to compile the testapps?
|
||||
-------------------------------
|
||||
|
||||
Once you have SDL12.DLL compiled, navigate into the 'test' folder, copy in
|
||||
there the newly built SDL12.DLL, and copy in there FSLib.DLL.
|
||||
|
||||
Then run "wmake" in there to compile some of the testapps.
|
||||
|
||||
|
||||
|
||||
3. What is missing?
|
||||
-------------------
|
||||
|
||||
The following things are missing from this SDL implementation:
|
||||
- MMX, SSE and 3DNOW! optimized video blitters?
|
||||
- HW Video surfaces
|
||||
- OpenGL support
|
||||
|
||||
|
||||
|
||||
4. Special Keys / Full-Screen support
|
||||
-------------------------------------
|
||||
|
||||
There are two special hot-keys implemented:
|
||||
- Alt+Home switches between fullscreen and windowed mode
|
||||
- Alt+End simulates closing the window (can be used as a Panic key)
|
||||
Only the LEFT Alt key will work.
|
||||
|
||||
|
||||
|
||||
5. Joysticks on SDL/2
|
||||
---------------------
|
||||
|
||||
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
|
||||
and the like). Therefore, if you use a non-standard joystick, you should
|
||||
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
|
||||
file or CONFIG.SYS, so SDL applications can provide full capability to your
|
||||
device. The syntax is:
|
||||
|
||||
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
|
||||
|
||||
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
|
||||
the line should be:
|
||||
|
||||
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
|
||||
|
||||
If you want to add spaces in your joystick name, just surround it with
|
||||
quotes or double-quotes:
|
||||
|
||||
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
|
||||
|
||||
or
|
||||
|
||||
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
|
||||
|
||||
Notive However that Balls and Hats are not supported under OS/2, and the
|
||||
value will be ignored... but it is wise to define these correctly because
|
||||
in the future those can be supported.
|
||||
Also the number of buttons is limited to 2 when using two joysticks,
|
||||
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
|
||||
and 8 when using a joystick with 2 axes. Notice however these are limitations
|
||||
of the Joystick Port hardware, not OS/2.
|
||||
|
||||
|
||||
|
||||
6. Proportional windows
|
||||
-----------------------
|
||||
|
||||
For some SDL applications it can be handy to have proportional windows, so
|
||||
the windows will keep their aspect ratio when resized.
|
||||
This can be achieved in two ways:
|
||||
|
||||
- Before starting the given SDL application, set the
|
||||
SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.:
|
||||
|
||||
SET SDL_USE_PROPORTIONAL_WINDOW=1
|
||||
dosbox.exe
|
||||
|
||||
- If you have a HOME environment variable set, then SDL will look for a file
|
||||
in there called ".sdl.proportionals". If that file contains the name of the
|
||||
currently running SDL executable, then that process will have proportional
|
||||
windows automatically.
|
||||
|
||||
Please note that this file is created automatically with default values
|
||||
at the first run.
|
||||
|
||||
|
||||
|
||||
7. Audio in SDL applications
|
||||
----------------------------
|
||||
|
||||
Audio effects are one of the most important features in games. Creating audio
|
||||
effects in sync with the game and without hickups and pauses in the audio are
|
||||
very important things.
|
||||
|
||||
However there are multithreaded SDL applications that have tight loops as their
|
||||
main logic loop. This kills performance in OS/2, and takes too much CPU from
|
||||
other threads in the same process, for example from the thread to create the
|
||||
sound effects.
|
||||
|
||||
For this reason, the OS/2 port of SDL can be instructed to run the audio thread
|
||||
in high priority, which makes sure that there will be enough time for the
|
||||
processing of the audio data.
|
||||
|
||||
At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well
|
||||
written and well behaving SDL applications should work well in this mode.
|
||||
For other applications, you can tell SDL/2 to run the audio thread at
|
||||
TimeCritical priority by setting an env.variable before starting the SDL app:
|
||||
|
||||
SET SDL_USE_TIMECRITICAL_AUDIO=1
|
||||
|
||||
Please note that this is a bit risky, because if the SDL application runs a
|
||||
tight infinite loop in this thread, this will make the whole system
|
||||
unresponsive, so use it with care, and only for applications that need it!
|
||||
|
||||
|
||||
|
||||
8. Next steps...
|
||||
----------------
|
||||
|
||||
Things to do:
|
||||
- Implement missing stuffs (look for 'TODO' string in source code!)
|
||||
- Finish video driver (the 'wincommon' can be a good example for missing
|
||||
things like application icon and so on...)
|
||||
- Enable MMX/SSE/SSE2 acceleration functions
|
||||
- Rewrite CDROM support using DOS Ioctl for better support.
|
||||
|
||||
|
||||
|
||||
9. Contacts
|
||||
-----------
|
||||
|
||||
You can contact the developers for bugs:
|
||||
|
||||
Area Developer email
|
||||
General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu
|
||||
CDROM and Joystick Caetano daniel@caetano.eng.br
|
||||
|
||||
Notice however that SDL/2 is 'in development' stage so ... if you want to help,
|
||||
please, be our guest and contact us!
|
||||
|
||||
|
||||
|
||||
10. Changelog of the OS/2 port
|
||||
------------------------------
|
||||
|
||||
Version 1.2.10 - 2006-05-17 - Doodle
|
||||
- Small modifications for v1.2.10 release
|
||||
- Changed DLL name to include version info (currently SDL12.dll)
|
||||
|
||||
Version 1.2 - 2006-05-01 - Doodle
|
||||
- Modified makefile system to have only one makefile
|
||||
- Included FSLib headers, DLL and LIB file
|
||||
|
||||
Version 1.2 - 2006-02-26 - Doodle
|
||||
- Updated the official SDL version with the OS/2 specific changes.
|
||||
- Added support for real unicode keycode conversion.
|
||||
|
||||
Version 1.2.7 - 2006-01-20 - Doodle
|
||||
- Added support for selectively using timecritical priority for
|
||||
audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable.
|
||||
(e.g.:
|
||||
SET SDL_USE_TIMECRITICAL_AUDIO=1
|
||||
dosbox.exe
|
||||
)
|
||||
|
||||
Version 1.2.7 - 2005-12-22 - Doodle
|
||||
- Added support for proportional SDL windows.
|
||||
There are two ways to have proportional (aspect-keeping) windows for
|
||||
a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW
|
||||
environment variable to something before starting the application
|
||||
(e.g.:
|
||||
SET SDL_USE_PROPORTIONAL_WINDOW=1
|
||||
dosbox.exe
|
||||
)
|
||||
or, if you have the HOME environment variable set, then SDL12.DLL will
|
||||
create a file in that directory called .sdl.proportionals, and you can
|
||||
put there the name of executable files that will be automatically made
|
||||
proportional.
|
||||
|
||||
Version 1.2.7 - 2005-10-14 - Doodle
|
||||
- Enabled Exception handler code in FSLib to be able to restore original
|
||||
desktop video mode in case the application crashes.
|
||||
- Added the missing FSLib_Uninitialize() call into SDL.
|
||||
(The lack of it did not cause problems, but it's cleaner this way.)
|
||||
- Fixed a mouse problem in Fullscreen mode where any mouse click
|
||||
re-centered the mouse.
|
||||
|
||||
Version 1.2.7 - 2005-10-09 - Doodle
|
||||
- Implemented window icon support
|
||||
|
||||
Version 1.2.7 - 2005-10-03 - Doodle
|
||||
- Reworked semaphore support again
|
||||
- Tuned thread priorities
|
||||
|
||||
Version 1.2.7 - 2005-10-02 - Doodle
|
||||
- Added support for custom mouse pointers
|
||||
- Fixed WM_CLOSE processing: give a chance to SDL app to ask user...
|
||||
- Added support for MMX-accelerated audio mixers
|
||||
- Other small fixes
|
||||
|
||||
Version 1.2.7 - 2005-09-12 - Doodle
|
||||
- Small fixes for DosBox incorporated into public release
|
||||
- Fixed semaphore support (SDL_syssem.c)
|
||||
- Fixed FSLib to have good clipping in scaled window mode,
|
||||
and to prevent occasional desktop freezes.
|
||||
|
||||
Version 1.2.7 - 2004-09-08a - Caetano
|
||||
- Improved joystick support (general verifications about hardware).
|
||||
- Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks.
|
||||
- Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick.
|
||||
- Improved Joystick test to handle every type of joystick and display only relevant information.
|
||||
- Merged with Doodle 2004-09-08
|
||||
- Little tid up in README.OS2
|
||||
- Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2
|
||||
|
||||
Version 1.2.7 - 2004-09-07 - Caetano
|
||||
- Merged with changes in headers for GCC compiling.
|
||||
- Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1.
|
||||
- Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so...
|
||||
- Modified makefile in test to compile "testjoystick". Anyway, it's useless, since it seems to cause a lot of trouble in OS/2 (because os video routines, not Joystick support).
|
||||
- Created separated Joystick test program to test only joystick functions.
|
||||
- Improved joystick auto-centering.
|
||||
- Improved the coordinate correction routine to use two scale factors for each axis.
|
||||
|
||||
Version 1.2.7 - 2004-07-05 - Caetano
|
||||
- Corrected the time returned by status in CDROM support (it was incorrect)
|
||||
- Added the testcdrom.c and corrected the linking directive (it was causing an error)
|
||||
|
||||
Version 1.2.7 - 2004-07-02a - Caetano
|
||||
- Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment)
|
||||
- Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c)
|
||||
- Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support
|
||||
- Added the "extra" SDL_types.h forgotten in 2004-07-02 version.
|
||||
|
||||
<End-Of-File>
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
SDL on Sony Playstation3
|
||||
------------------------
|
||||
|
||||
Installation:
|
||||
First, you have to install the Cell SDK
|
||||
- Download the Cell SDK installer RPM and ISO images to
|
||||
a temporary directory such as /tmp/cellsdk.
|
||||
- Mount the image: mount -o loop CellSDK-Devel-Fedora_3.1.0.0.0.iso /tmp/cellsdk
|
||||
- Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm
|
||||
- Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install
|
||||
|
||||
You need to install the SPU-libs before installing SDL
|
||||
- Go to SDL-1.2/src/video/ps3/spulibs/
|
||||
- Run make && make install
|
||||
|
||||
Finally, install SDL
|
||||
- Go to SDL-1.2/ and build SDL like any other GNU style package.
|
||||
e.g.
|
||||
- Build the configure-script with ./autogen.sh
|
||||
- Configure SDL for your needs: ./configure --enable-video-ps3 ...
|
||||
- Build and install it: make && make install
|
||||
|
||||
|
||||
Todo:
|
||||
- mouse/keyboard/controller support
|
||||
|
||||
Have fun!
|
||||
Dirk Herrendoerfer <d.herrendoerfer [at] de [dot ibm [dot] com>
|
||||
@@ -1,50 +0,0 @@
|
||||
========================
|
||||
Using SDL with PicoGUI
|
||||
========================
|
||||
|
||||
- Originally contributed by Micah Dowty <micahjd@users.sourceforge.net>
|
||||
|
||||
PicoGUI is a scalable GUI system with a unique architecture, primarily focused
|
||||
on scalability to various embedded systems. You can find more information
|
||||
including a FAQ at http://picogui.org
|
||||
|
||||
To use the patch:
|
||||
|
||||
1. When compiling, add the "--enable-video-picogui" switch to ./configure
|
||||
|
||||
2. When running your program, ensure that the picogui driver for SDL
|
||||
is in use by setting the SDL_VIDEODRIVER environment variable
|
||||
to "picogui".
|
||||
|
||||
3. The program must also be linked to the C client library for PicoGUI
|
||||
(libpgui.so). If the program is being compiled with a patched SDL
|
||||
installed this should be done automatically. If you want to use an
|
||||
existing binary with PicoGUI, you can set the LD_PRELOAD environment
|
||||
variable to the path of your libpgui.so file.
|
||||
|
||||
Capabilities:
|
||||
|
||||
So far only basic functionality is provided on true color (linear16/24/32)
|
||||
devices. Accessing a memory mapped bitmap, updating the display, and handling
|
||||
mouse/keyboard input. This functionality has been tested with several
|
||||
applications, including mplayer, Xine, sldroids, and Abuse.
|
||||
|
||||
TODO list:
|
||||
|
||||
- YUV overlays will be helpful for watching video on set top boxes or other
|
||||
embedded devices that have some graphics acceleration hardware
|
||||
|
||||
- Account for rotated bitmap storage in pgserver
|
||||
|
||||
- Support for hiding or changing the cursor
|
||||
|
||||
- The display should be centered when the SDL application is smaller
|
||||
than the PicoGUI panel
|
||||
|
||||
- Fullscreen or any other special modes
|
||||
|
||||
- Support for indexed and grayscale modes
|
||||
|
||||
- Probably much more...
|
||||
|
||||
--- The End ---
|
||||
@@ -37,6 +37,7 @@ There are two basic ways of building SDL at the moment:
|
||||
src/timer/*.c
|
||||
src/video/*.c
|
||||
src/audio/disk/*.c
|
||||
src/audio/dummy/*.c
|
||||
src/video/dummy/*.c
|
||||
src/joystick/dummy/*.c
|
||||
src/cdrom/dummy/*.c
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
README.QNX by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
|
||||
Last changed at 24 Apr 2004.
|
||||
|
||||
======================================================================
|
||||
Table of Contents:
|
||||
|
||||
1. OpenGL.
|
||||
2. Wheel and multi-button mouses.
|
||||
3. CDROM handling issues.
|
||||
4. Hardware video overlays.
|
||||
5. Shared library building.
|
||||
6. Some building issues.
|
||||
7. Environment variables.
|
||||
|
||||
======================================================================
|
||||
1. OpenGL:
|
||||
|
||||
OpenGL works well and is stable, but fullscreen mode has not been
|
||||
heavily tested yet.
|
||||
If you have QNX RtP version 6.1.0 or above you must download the
|
||||
Photon3D runtime from http://developers.qnx.com or install it from the
|
||||
public repository or from the public CD, available with QNX. OS versi-
|
||||
ons below 6.1.0 are not supported.
|
||||
When creating an OpenGL context, software renderer mode is artifi-
|
||||
cially selected (QSSL made acceleration only for Voodoo boards in
|
||||
fullscreen mode, sorry but I don't have this board to test OpenGL -
|
||||
maybe it works or maybe not :)). If you want acceleration - you can
|
||||
remove one line in the source code: find the file SDL_ph_image.c and
|
||||
remove the following
|
||||
|
||||
OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
|
||||
|
||||
line in the ph_SetupOpenGLContext() function or change the argument to
|
||||
PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW.
|
||||
|
||||
======================================================================
|
||||
2. Wheel and multi-button mouses:
|
||||
|
||||
Photon emits keyboard events (key up and down) when the mouse
|
||||
wheel is moved. The key_scan field appears valid, and it contains zero.
|
||||
That is a basic method of detecting mouse wheel events under Photon.
|
||||
It looks like a hack, but it works for me :) on various PC configura-
|
||||
tions.
|
||||
|
||||
I've tested it on:
|
||||
|
||||
1. Genius Optical NetScroll/+ PS/2 (1 wheel)
|
||||
2. A4Tech Optical GreatEye WheelMouse PS/2, model: WOP-35. (2 wheels
|
||||
+ 2 additional buttons). The wheel for vertical scrolling works as
|
||||
usual, but the second wheel for horizontal scrolling emits two se-
|
||||
quential events up or down, so it can provide faster scrolling than
|
||||
the first wheel. Additional buttons don't emit any events, but it
|
||||
looks like they're handled by photon in an unusual way - like click
|
||||
to front, but works not with any window, looks like a fun bug-o-fe-
|
||||
ature :).
|
||||
|
||||
======================================================================
|
||||
3. CDROM handling issues:
|
||||
|
||||
Access to CDROM can only be provided with 'root' privileges. I
|
||||
can't do anything about that, /dev/cd0 has brw------- permissions and
|
||||
root:root rights.
|
||||
|
||||
======================================================================
|
||||
4. Hardware video overlays:
|
||||
|
||||
Overlays can flicker during window movement, resizing, etc. It
|
||||
happens because the photon driver updates the real window contents be-
|
||||
hind the overlay, then draws the temporary chroma key color over the
|
||||
window contents. It can be done without using the chroma key but that
|
||||
causes the overlay to always be on top. So flickering during window
|
||||
movement is preferred instead.
|
||||
Double buffering code is temporarily disabled in the photon driver
|
||||
code, because on my GF2-MX it can accidentally cause a buffer switch,
|
||||
which causes the old frame to show. S3 Savage4 has the same problem,
|
||||
but ATI Rage 128 doesn't. I think it can be fixed later. Current code
|
||||
works very well, so maybe double buffering is not needed right now.
|
||||
Something strange happens when you try to move the window with the
|
||||
overlay beyond the left border of the screen. The overlay tries to
|
||||
stay at position x=0, but when attempting to move it a bit more it
|
||||
jumps to position x=-60 (on GF2-MX, on ATI Rage128 this value a bit
|
||||
smaller). It's really strange, looks like the overlay doesn't like
|
||||
negative coordinates.
|
||||
|
||||
=======================================================================
|
||||
5. Shared library building:
|
||||
|
||||
A shared library can be built, but before running the autogen.sh
|
||||
script you must manually delete the libtool.m4 stuff from the acinclu-
|
||||
de.m4 file (it comes after the ESD detection code up to the end of the
|
||||
file), because the libtool stuff in the acinclude.m4 file was very old
|
||||
in SDL distribution before the version 1.2.7 and doesn't knew anything
|
||||
about QNX. SDL 1.2.7 distribution contains the new libtool.m4 script,
|
||||
but anyway it is broken :), Just remove it, then run "libtoolize
|
||||
--force --copy", delete the file aclocal.m4 if it is exists and after
|
||||
that run the autogen.sh script. SDL 1.2.8 contains fixed libtool.m4,
|
||||
ltmain.sh and config.sub files, so you can just run the autogen.sh
|
||||
script.
|
||||
|
||||
======================================================================
|
||||
6. Some building issues:
|
||||
|
||||
Feel free to not use the --disable-shared configure option if you'
|
||||
ve read the above comment about 'Shared library building'. Otherwise
|
||||
this option is strongly recommended, as without it the sdl-config
|
||||
script will be broken.
|
||||
|
||||
Run the configure script without x11 support, e.g.:
|
||||
|
||||
a) for OpenGL support:
|
||||
./configure --prefix=/usr \
|
||||
--disable-video-x11 \
|
||||
--disable-shared
|
||||
|
||||
b) without OpenGL support:
|
||||
./configure --prefix=/usr \
|
||||
--disable-video-x11 \
|
||||
--disable-shared \
|
||||
--disable-video-opengl
|
||||
|
||||
And of course dont forget to specify --disable-debug, which is on
|
||||
by default, to disable debug and enable the expensive optimizations.
|
||||
|
||||
In the test directory also run the ./configure script without
|
||||
x11 support, e.g.:
|
||||
|
||||
./configure --with-sdl-prefix=/usr \
|
||||
--with-sdl-exec-prefix=/usr \
|
||||
--prefix=/usr --without-x
|
||||
|
||||
======================================================================
|
||||
7. Environment variables:
|
||||
|
||||
Please note that the photon driver is sensible to the following
|
||||
environmental variables:
|
||||
|
||||
* SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls
|
||||
the refresh rate in all fullscreen modes. Be carefull !!! Photon
|
||||
drivers usually do not checking the maximum refresh rate, which video
|
||||
adapter or monitor supports.
|
||||
|
||||
* SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y
|
||||
coordinates are bigger than the current desktop resolution, then win-
|
||||
dow positioning across virtual consoles is activated. If X and Y are
|
||||
smaller than the desktop resolution then window positioning in the
|
||||
current console is activated. The word "center" can be used instead of
|
||||
coordinates, it produces the same behavior as SDL_VIDEO_CENTERED
|
||||
environmental variable.
|
||||
|
||||
* SDL_VIDEO_CENTERED - if this environmental variable exists then the
|
||||
window centering is perfomed in the current virtual console.
|
||||
|
||||
Notes: The SDL_VIDEO_CENTERED enviromental variable has greater pri-
|
||||
ority than the SDL_VIDEO_WINDOW_POS in case if both variables are sup-
|
||||
plied to the application.
|
||||
@@ -1,84 +0,0 @@
|
||||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Qtopia/OPIE
|
||||
==============================================================================
|
||||
|
||||
==============================================================================
|
||||
I. Setting up the Qtopia development environment.
|
||||
|
||||
This document will not explain how to setup the Qtopia development
|
||||
environment. That is outside the scope of the document. You can read
|
||||
more on this subject in this excellent howto:
|
||||
|
||||
http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html
|
||||
|
||||
==============================================================================
|
||||
II. Building the Simple DirectMedia Layer libraries using the arm
|
||||
cross-compiler
|
||||
|
||||
This is somewhat tricky since the name of the compiler binaries
|
||||
differ from the standard. Also you should disable features not
|
||||
needed. The command below works for me. Note that it's all one
|
||||
line. You can also set the NM, LD etc environment variables
|
||||
separately.
|
||||
|
||||
NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu
|
||||
|
||||
One thing to note is that the above configure will include joystick
|
||||
support, even though you can't have joysticks on the Zaurus. The
|
||||
reason for this is to avoid link / compile / runtime errors with
|
||||
applications that have joystick support.
|
||||
|
||||
==============================================================================
|
||||
III. Building the Simple DirectMedia Layer test programs:
|
||||
|
||||
After installing, making sure the correct sdl-config is in your
|
||||
path, run configure like this:
|
||||
|
||||
NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu
|
||||
|
||||
==============================================================================
|
||||
IV. Application porting notes
|
||||
|
||||
One thing I have noticed is that applications sometimes don't exit
|
||||
correctly. Their icon remains in the taskbar and they tend to
|
||||
relaunch themselves automatically. I believe this problem doesn't
|
||||
occur if you exit your application using the exit() method. However,
|
||||
if you end main() with 'return 0;' or so, this seems to happen.
|
||||
|
||||
Also note that when running in landscape mode - i.e requesting a
|
||||
window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH
|
||||
and HEIGHT normally is 240 and 320 - the image is blitted so that
|
||||
the hardware buttons are on the left side of the display. This might
|
||||
not always be desirable but such is the code today.
|
||||
|
||||
|
||||
==============================================================================
|
||||
V. Enjoy! :)
|
||||
|
||||
If you have a project you'd like me to know about, or want to ask questions,
|
||||
go ahead and join the SDL developer's mailing list by sending e-mail to:
|
||||
|
||||
sdl-request@libsdl.org
|
||||
|
||||
and put "subscribe" into the subject of the message. Or alternatively you
|
||||
can use the web interface:
|
||||
|
||||
http://www.libsdl.org/mailman/listinfo/sdl
|
||||
|
||||
==============================================================================
|
||||
VI. What is supported:
|
||||
|
||||
Keyboard (Sharp Zaurus)
|
||||
Hardware buttons
|
||||
Stylus input (mouse)
|
||||
Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT
|
||||
size window) and in landscape mode (up to HEIGHTxWIDTH).
|
||||
|
||||
All other SDL functionality works like a normal Linux system (threads,
|
||||
audio etc).
|
||||
|
||||
--
|
||||
David Hedbor <david@hedbor.org>
|
||||
http://david.hedbor.org/ http://eongames.com/
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
Readme for RISC OS port of SDL
|
||||
==============================
|
||||
|
||||
This document last updated on 2nd Februrary 2006
|
||||
|
||||
This is a RISC OS port of the Simple Direct Media Layer (SDL) by Alan Buckley with contributions from Peter Naulls.
|
||||
|
||||
Details of the SDL can be found at http://www.libsdl.org.
|
||||
|
||||
The source code including the RISC OS version can be obtained from:
|
||||
|
||||
http://www.libsdl.org.
|
||||
|
||||
Pre built libraries and many games and applications compiled for RISC OS using this library can be downloaded from The Unix Porting Project at http://www.riscos.info/unix/.
|
||||
|
||||
This is released under the LGPL see the file COPYING for details.
|
||||
|
||||
|
||||
Compiling applications under RISC OS
|
||||
====================================
|
||||
|
||||
Add -ISDL: for the C compiler flags if you include the files in the SDL directory. e.g. #include "SDL/SDL.h"
|
||||
Add -ISDL:SDL for the C compiler flags if you include the files directly. e.g. #include "SDL/SDL.h"
|
||||
|
||||
Add -LSDL: -lSDL to the link stage of compilation.
|
||||
|
||||
For example, to compile the testbitmap.c sample you could use:
|
||||
|
||||
gcc -ISDL:SDL -LSDL: -lSDL testbitmap.c -otestbitmap
|
||||
|
||||
|
||||
RISC OS port of SDL runtime information
|
||||
=======================================
|
||||
|
||||
Runtime requirements
|
||||
--------------------
|
||||
|
||||
This library currently needs a minimum of RISC OS 3.6. The source code for the library (and a lot of the programs built with it) also need long file names.
|
||||
|
||||
To use the audio you also need 16 bit sound and to have installed the DigitalRender module by Andreas Dehmel version 0.51 available from his
|
||||
web site: http://home.t-online.de/~zarquon
|
||||
This is loaded when needed by UnixLib.
|
||||
|
||||
Note: As most programs ported from other OSes use high resolution graphics and a memory back buffer a machine with a StrongARM processor and 1 or 2MB of VRAM (or a better machine) is recomended.
|
||||
|
||||
|
||||
RISC OS runtime parameters
|
||||
--------------------------
|
||||
|
||||
Several environmental variables have been defined to make porting programs easier (i.e. By setting these variable you do not need to have source code differences between OSes).
|
||||
|
||||
They are all defined on an application basis.
|
||||
|
||||
The <appname> used below is found as follows:
|
||||
1. Use the name of the program unless it is !RunImage
|
||||
2. Check the folder specification for the folder !RunImage is run from. If it is a folder name use that name, otherwise if it is an environmental variable of the form <XXX$Dir> use the value of XXX.
|
||||
|
||||
The variables are:
|
||||
|
||||
SDL$<appname>$TaskName
|
||||
|
||||
The name of the task for RISC OS. If omitted then <appname> is used for the task name,
|
||||
|
||||
SDL$<appname>$BackBuffer
|
||||
|
||||
Set to 1 to use a system memory back buffer for the screen in full screen mode. Some programs on other systems assume their is always a back buffer even though the SDL specification specifies this is not the case. The current RISC OS implementation uses direct writes to the screen if a hardware fullscreen is requested.
|
||||
|
||||
Set to 2 to use an ARM code full word copy. This is faster than the standard back buffer, but uses aligned words only so it is possible (but unlikely) for it to corrupt the screen for 8bpp and 16bpp modes.
|
||||
|
||||
Set to 3 to use a RISC OS sprite as the back buffer. This is usually the slowest for most SDL applications, however it may be useful in the future as Sprite acceleration is added to various hardware that runs RISC OS.
|
||||
|
||||
SDL$<appname>$CloseAction - set the action for the close icon. Again as programs don't match the specification you can set this to 0 to remove the close icon from the main window for applications where this does not affect the program.
|
||||
|
||||
|
||||
RISC OS SDL port API notes
|
||||
==========================
|
||||
|
||||
Current level of implementation
|
||||
-------------------------------
|
||||
|
||||
The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL.
|
||||
|
||||
video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL.
|
||||
Window Manager - Mostly done. SetIcon/IconifyWindow not implemented.
|
||||
Events - Mostly done. Resize and some joystick events missing.
|
||||
Joystick - Currently assumes a single joystick with 4 buttons.
|
||||
Audio - Done
|
||||
CDROM - Not implemented.
|
||||
Threads - Done
|
||||
Timers - Done
|
||||
|
||||
Thread support can be removed by defining DISABLE_THREADS and recompiling the library.
|
||||
|
||||
SDL API notes
|
||||
-------------
|
||||
|
||||
This section contains additional notes on some specific commands.
|
||||
|
||||
SDL_SetVideoMode
|
||||
On RISC OS a fullscreen mode directly accesses the screen. This can be modified by the environmental variable (SDL$<appname>$BackBuffer) or by using the SDL_SWSURFACE flag to write to an offscreen buffer that is updated using SDL_UpdateRects.
|
||||
Open GL is not supported so SDL_OPENGL and SDL_OPENGLBLIT flags fail.
|
||||
SDL_RESIZEABLE and SDL_NOFRAME flags are not supported.
|
||||
|
||||
SDL_SetColors
|
||||
In a wimp mode the screen colours are not changed for a hardware palette instead the RISC OS sprite colour mapping is used to get the best matching colours.
|
||||
|
||||
SDL_CreateCursor
|
||||
Inverted colour is not supported.
|
||||
|
||||
SDL_WM_ToggleFullScreen
|
||||
Currently this won't work if the application starts up in Fullscreen mode.
|
||||
Toggling to fullscreen will only work if the monitor is set up to support the exact screen size requested.
|
||||
|
||||
SDL_EnableUNICODE
|
||||
Unicode translation used here is only really accurate for 7 bit characters.
|
||||
|
||||
SDL_NumJoysticks/JoystickName etc.
|
||||
Hardcoded to expect only 1 joystick with 4 buttons if the Joystick module is loaded.
|
||||
|
||||
SDL_GetTicks
|
||||
Timer used has only a centisecond accuracy. This applies to other time related functions.
|
||||
|
||||
SDL_Delay
|
||||
Modified to poll keyboard/mouse during the delay on the event thread.
|
||||
|
||||
|
||||
Notes on current implementation
|
||||
-------------------------------
|
||||
|
||||
Keyboard and mouse are polled so if too long a time is spent between a call to SDL_PumpEvents, functions that use it, or SDL_Delay events can be missed.
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
The latest development version of SDL is available via Subversion.
|
||||
Subversion allows you to get up-to-the-minute fixes and enhancements;
|
||||
as a developer works on a source tree, you can use svn to mirror that
|
||||
source tree instead of waiting for an official release. Please look
|
||||
at the Subversion website ( http://subversion.tigris.org/ ) for more
|
||||
information on using svn, where you can also download software for
|
||||
MacOS, Windows, and Unix systems.
|
||||
|
||||
svn checkout http://svn.libsdl.org/branches/SDL-1.2
|
||||
|
||||
If you are building SDL with an IDE, you will need to copy the file
|
||||
include/SDL_config.h.default to include/SDL_config.h before building.
|
||||
|
||||
If you are building SDL via configure, you will need to run autogen.sh
|
||||
before running configure.
|
||||
|
||||
There is a web interface to the subversion repository at:
|
||||
http://www.libsdl.org/cgi/viewvc.cgi
|
||||
|
||||
There is an RSS feed available at that URL, for those that want to
|
||||
track commits in real time.
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with S60 3.x / Symbian 9.x
|
||||
==============================================================================
|
||||
|
||||
These instuctions are for people developing for S60 3.x. S60 3.x
|
||||
uses Symbian OS so you need S60 SDK.
|
||||
|
||||
extract "symbian.zip" into this folder.
|
||||
|
||||
go to symbian folder
|
||||
|
||||
bldmake bldfiles
|
||||
abld build
|
||||
|
||||
That produces WINSCW and ARMV5 versions of sdl.dll runtime library
|
||||
and sdl.lib for development.
|
||||
The sdlexe.dll/sdlexe.lib and sdlmain.lib are for easy SDL S60
|
||||
integration, please see http://www.mbnet.fi/~mertama/sdl.html
|
||||
for further info.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
|
||||
Using SDL under Windows with the OpenWatcom compiler
|
||||
====================================================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
I have done the port under Windows XP Home with SP2 installed. Windows
|
||||
2000 should also be working. I'm not so sure about ancient Windows NT,
|
||||
since only DirectX 3 is available there. Building should be possible,
|
||||
but running the compiled applications will probalbly fail with
|
||||
SDL_VIDEODRIVER=directx. The windib driver should work, though.
|
||||
|
||||
To compile and use the SDL with Open Watcom you will need the following:
|
||||
- Open Watcom compiler. I used version 1.5. The environment variables
|
||||
PATH, WATCOM and INCLUDE need to be set appropriately - please consult
|
||||
the OpenWatcom documentation and instructions given during the
|
||||
installation of the compiler.
|
||||
My setup looks like this in owvars.bat:
|
||||
set WATCOM=C:\watcom
|
||||
set INCLUDE=%WATCOM%\h;%WATCOM%\h\nt
|
||||
set PATH=%PATH%;%WATCOM%\binnt;%WATCOM%\binw
|
||||
- A fairly recent DirectX SDK. The original unmodified DX8 SDK works, as
|
||||
well as the minimal DirectX 7 SDK from the Allegro download site
|
||||
(<http://alleg.sourceforge.net/files/dx70_min.zip>).
|
||||
- The SDL sources from Subversion
|
||||
- The file Watcom-Win32.zip (now available in Subversion)
|
||||
|
||||
|
||||
Building the Library
|
||||
--------------------
|
||||
|
||||
1) In the SDL base directory extract the archive Watcom-Win32.zip. This
|
||||
creates a subdirectory named 'watcom'.
|
||||
2) The makefile expects the environment variable DXDIR to be set to the
|
||||
base directory of a DirectX SDK. I have tried a stock DX8 SDK from
|
||||
Microsoft as well as the minimal DirectX 7 SDK from the Allegro
|
||||
download site.
|
||||
You can also edit the makefile directly and hard code your path to
|
||||
the SDK on your system.
|
||||
I have this in my setup:
|
||||
set DXDIR=D:\devel\DX8_SDK
|
||||
3) Enter the watcom directory and run
|
||||
wmake sdl
|
||||
4) All tests from the test directory are working and can be built by
|
||||
running
|
||||
wmake tests
|
||||
|
||||
Notes:
|
||||
|
||||
The makefile offers some options to tweak the way the library is built.
|
||||
You have at your disposal the option to build a static (default)
|
||||
library, or a DLL (with tgt=dll). You can also choose whether to build
|
||||
a Release (default) or a Debug version (with build=debug) of the tests
|
||||
and library. Please consult the usage comment at the top of the
|
||||
makefile for usage instructions.
|
||||
|
||||
If you specify a test target (i.e. 'wmake tests' for all tests, or
|
||||
selected targets like 'wmake testgl testvidinfo testoverlay2'), the
|
||||
tests are always freshly compiled and linked. This is done to
|
||||
minimise hassle when switching between library versions (static vs.
|
||||
DLL), because they require subtly different options.
|
||||
Also, the test executables are put directly into the test directory,
|
||||
so they can find their data files. The clean target of the makefile
|
||||
removes the test executables and the SDL.dll file from the test
|
||||
directory.
|
||||
|
||||
To use the library in your own projects with Open Watcom, you can use
|
||||
the way the tests are built as base of your own build environment.
|
||||
|
||||
The library can also be built with the stack calling convention of the
|
||||
compiler (-6s instead of -6r).
|
||||
|
||||
|
||||
Test applications
|
||||
-----------------
|
||||
|
||||
I've tried to make all tests work. The following table gives an overview
|
||||
of the current status.
|
||||
|
||||
Testname Status
|
||||
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
checkkeys +
|
||||
graywin +
|
||||
loopwave +
|
||||
testalpha +
|
||||
testbitmap +
|
||||
testdyngl +
|
||||
testerror +
|
||||
testfile +
|
||||
testgamma +
|
||||
testgl +
|
||||
testhread +
|
||||
testiconv - (all failed)
|
||||
testkeys +
|
||||
testlock +
|
||||
testoverlay + (needs 'set SDL_VIDEODRIVER=directx')
|
||||
testoverlay2 + (needs 'set SDL_VIDEODRIVER=directx')
|
||||
testpalette +
|
||||
testplatform +
|
||||
testsem +
|
||||
testsprite +
|
||||
testtimer +
|
||||
testver +
|
||||
testvidinfo +
|
||||
testwin ? (fading doesn't seem right)
|
||||
testwm +
|
||||
torturethread +
|
||||
testcdrom +
|
||||
testjoystick not tested
|
||||
threadwin +
|
||||
testcursor +
|
||||
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
There is room for further improvement:
|
||||
- Test joystick functionality.
|
||||
- Investigate fading issue in 'testwin' test.
|
||||
- Fix the UTF-8 support.
|
||||
- Adapt the makefile/object file list to support more target systems
|
||||
- Use "#pragma aux" syntax for the CPU info functions.
|
||||
|
||||
|
||||
Questions and Comments
|
||||
----------------------
|
||||
|
||||
Please direct any questions or comments to me: <mailto:macpete@gmx.de>
|
||||
|
||||
Happy Coding!
|
||||
|
||||
Marc Peter
|
||||
@@ -1,55 +0,0 @@
|
||||
|
||||
Project files for embedded Visual C++ 3.0, 4.0 and
|
||||
Visual Studio 2005 can be found in VisualCE.zip
|
||||
|
||||
SDL supports GAPI and WinDib output for Windows CE.
|
||||
|
||||
GAPI driver supports:
|
||||
|
||||
- all possible WinCE devices (Pocket PC, Smartphones, HPC)
|
||||
with different orientations of video memory and resolutions.
|
||||
- 4, 8 and 16 bpp devices
|
||||
- special handling of 8bpp on 8bpp devices
|
||||
- VGA mode, you can even switch between VGA and GAPI in runtime
|
||||
(between 240x320 and 480x640 for example). On VGA devices you can
|
||||
use either GAPI or VGA.
|
||||
- Landscape mode and automatic rotation of buttons and stylus coordinates.
|
||||
To enable landscape mode make width of video screen bigger than height.
|
||||
For example:
|
||||
SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN)
|
||||
- WM2005
|
||||
- SDL_ListModes
|
||||
|
||||
NOTE:
|
||||
There are several SDL features not available in the WinCE port of SDL.
|
||||
|
||||
- DirectX is not yet available
|
||||
- Semaphores are not available
|
||||
- Joystick support is not available
|
||||
- CD-ROM control is not available
|
||||
|
||||
In addition, there are several features that run in "degraded" mode:
|
||||
|
||||
Preprocessor Symbol Effect
|
||||
=================== =================================
|
||||
|
||||
SDL_systimer.c:
|
||||
USE_GETTICKCOUNT Less accurate values for SDL time functions
|
||||
USE_SETTIMER Use only a single marginally accurate timer
|
||||
|
||||
SDL_syswm.c:
|
||||
DISABLE_ICON_SUPPORT Can't set the runtime window icon
|
||||
|
||||
SDL_sysmouse.c:
|
||||
USE_STATIC_CURSOR Only the arrow cursor is available
|
||||
|
||||
SDL_sysevents.c:
|
||||
NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus
|
||||
|
||||
SDL_dibevents.c:
|
||||
NO_GETKEYBOARDSTATE Very limited keycode translation
|
||||
|
||||
SDL_dibvideo.c:
|
||||
NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp
|
||||
NO_CHANGEDISPLAYSETTINGS No fullscreen support
|
||||
NO_GAMMA_SUPPORT Gamma correction not available
|
||||
@@ -1,107 +0,0 @@
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with OpenBSD/wscons
|
||||
==============================================================================
|
||||
|
||||
The wscons SDL driver can be used to run SDL programs on OpenBSD
|
||||
without running X. So far, the driver only runs on the Sharp Zaurus,
|
||||
but the driver is written to be easily extended for other machines.
|
||||
The main missing pieces are blitting routines for anything but 16 bit
|
||||
displays, and keycode maps for other keyboards. Also, there is no
|
||||
support for hardware palettes.
|
||||
|
||||
There is currently no mouse support.
|
||||
|
||||
To compile SDL with support for wscons, use the
|
||||
"--enable-video-wscons" option when running configure. I used the
|
||||
following command line:
|
||||
|
||||
./configure --disable-oss --disable-ltdl --enable-pthread-sem \
|
||||
--disable-esd --disable-arts --disable-video-aalib \
|
||||
--enable-openbsdaudio --enable-video-wscons \
|
||||
--prefix=/usr/local --sysconfdir=/etc
|
||||
|
||||
|
||||
Setting the console device to use
|
||||
=================================
|
||||
|
||||
When starting an SDL program on a wscons console, the driver uses the
|
||||
current virtual terminal (usually /dev/ttyC0). To force the driver to
|
||||
use a specific terminal device, set the environment variable
|
||||
SDL_WSCONSDEV:
|
||||
|
||||
bash$ SDL_WSCONSDEV=/dev/ttyC1 ./some-sdl-program
|
||||
|
||||
This is especially useful when starting an SDL program from a remote
|
||||
login prompt (which is great for development). If you do this, and
|
||||
want to use keyboard input, you should avoid having some other program
|
||||
reading from the used virtual console (i.e., do not have a getty
|
||||
running).
|
||||
|
||||
|
||||
Rotating the display
|
||||
====================
|
||||
|
||||
The display can be rotated by the wscons SDL driver. This is useful
|
||||
for the Sharp Zaurus, since the display hardware is wired so that it
|
||||
is correctly rotated only when the display is folded into "PDA mode."
|
||||
When using the Zaurus in "normal," or "keyboard" mode, the hardware
|
||||
screen is rotated 90 degrees anti-clockwise.
|
||||
|
||||
To let the wscons SDL driver rotate the screen, set the environment
|
||||
variable SDL_VIDEO_WSCONS_ROTATION to "CW", "CCW", or "UD", for
|
||||
clockwise, counter clockwise, and upside-down rotation respectively.
|
||||
"CW" makes the screen appear correct on a Sharp Zaurus SL-C3100.
|
||||
|
||||
When using rotation in the driver, a "shadow" frame buffer is used to
|
||||
hold the intermediary display, before blitting it to the actual
|
||||
hardware frame buffer. This slows down performance a bit.
|
||||
|
||||
For completeness, the rotation "NONE" can be specified to use a shadow
|
||||
frame buffer without actually rotating. Unsetting
|
||||
SDL_VIDEO_WSCONS_ROTATION, or setting it to '' turns off the shadow
|
||||
frame buffer for maximum performance.
|
||||
|
||||
|
||||
Running MAME
|
||||
============
|
||||
|
||||
Since my main motivation for writing the driver was playing MAME on
|
||||
the Zaurus, I'll give a few hints:
|
||||
|
||||
XMame compiles just fine under OpenBSD.
|
||||
|
||||
I'm not sure this is strictly necessary, but set
|
||||
|
||||
MY_CPU = arm
|
||||
|
||||
in makefile.unix, and
|
||||
|
||||
CFLAGS.arm = -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS
|
||||
|
||||
in src/unix/unix.max
|
||||
|
||||
to be sure.
|
||||
|
||||
The latest XMame (0.101 at this writing) is a very large program.
|
||||
Either tinker with the make files to compile a version without support
|
||||
for all drivers, or, get an older version of XMame. My recommendation
|
||||
would be 0.37b16.
|
||||
|
||||
When running MAME, DO NOT SET SDL_VIDEO_WSCONS_ROTATION! Performace
|
||||
is MUCH better without this, and it is COMPLETELY UNNECESSARY, since
|
||||
MAME can rotate the picture itself while drawing, and does so MUCH
|
||||
FASTER.
|
||||
|
||||
Use the Xmame command line option "-ror" to rotate the picture to the
|
||||
right.
|
||||
|
||||
|
||||
Acknowledgments
|
||||
===============
|
||||
|
||||
I studied the wsfb driver for XFree86/Xorg quite a bit before writing
|
||||
this, so there ought to be some similarities.
|
||||
|
||||
|
||||
--
|
||||
Staffan Ulfberg <staffan@ulfberg.se>
|
||||
@@ -1,140 +0,0 @@
|
||||
<QPG:Generation>
|
||||
<QPG:Options>
|
||||
<QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
|
||||
<QPG:Defaults type="qnx_package"/>
|
||||
<QPG:Source></QPG:Source>
|
||||
<QPG:Release date="today" number="+"/>
|
||||
<QPG:Build></QPG:Build>
|
||||
<QPG:FileSorting strip="yes"/>
|
||||
<QPG:Package targets="standart"/>
|
||||
<QPG:Repository generate="yes"/>
|
||||
<QPG:FinalDir></QPG:FinalDir>
|
||||
<QPG:Cleanup></QPG:Cleanup>
|
||||
</QPG:Options>
|
||||
|
||||
<QPG:Responsible>
|
||||
<QPG:Company>QNX.ORG.RU Community</QPG:Company>
|
||||
<QPG:Department></QPG:Department>
|
||||
<QPG:Group></QPG:Group>
|
||||
<QPG:Team>QNX.ORG.RU Team</QPG:Team>
|
||||
<QPG:Employee>Mike Gorchak</QPG:Employee>
|
||||
<QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
|
||||
</QPG:Responsible>
|
||||
|
||||
<QPG:Values>
|
||||
<QPG:Files>
|
||||
<QPG:Add file="./COPYING" install="LicenseUrl/" handling="repdata"/>
|
||||
<QPG:Add permissions="0755" file="./src/.libs/libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@" install="/usr/lib/"/>
|
||||
<QPG:Add filetype="symlink" file="libSDL.so" install="/usr/lib/" linkto="libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@"/>
|
||||
<QPG:Add permissions="0644" file="./src/.libs/libSDL.a" install="/usr/lib/"/>
|
||||
<QPG:Add permissions="0644" file="./src/.libs/libSDL.lai" install="/usr/lib/libSDL.la"/>
|
||||
<QPG:Add permissions="0644" file="./src/main/libSDLmain.a" install="/usr/lib/"/>
|
||||
<QPG:Add permissions="0644" file="./include/*.h" install="/usr/include/SDL/"/>
|
||||
<QPG:Add permissions="0755" file="./sdl-config" install="/usr/bin/"/>
|
||||
<QPG:Add permissions="0644" file="./BUGS" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./COPYING" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./CREDITS" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./INSTALL" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./README" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./README-SDL.txt" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./README.CVS" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./README.QNX" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./TODO" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./WhatsNew" install="/usr/share/doc/SDL12/"/>
|
||||
<QPG:Add permissions="0644" file="./docs.html" install="/usr/share/doc/SDL12/Changes.html"/>
|
||||
<QPG:Add permissions="0644" file="./docs/index.html" install="/usr/share/doc/SDL12/docs/"/>
|
||||
<QPG:Add permissions="0644" file="./docs/html/*.html" install="/usr/share/doc/SDL12/docs/html/"/>
|
||||
<QPG:Add permissions="0644" file="./docs/man3/*.3" install="/usr/share/man/man3/"/>
|
||||
<QPG:Add permissions="0644" file="./sdl.m4" install="/usr/share/aclocal/"/>
|
||||
</QPG:Files>
|
||||
<QPG:PackageFilter>
|
||||
<QPM:PackageManifest>
|
||||
|
||||
<QPM:PackageDescription>
|
||||
<QPM:PackageType>Library</QPM:PackageType>
|
||||
<QPM:PackageName>SDL</QPM:PackageName>
|
||||
<QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
|
||||
<QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
|
||||
<QPM:FileVersion>2.6</QPM:FileVersion>
|
||||
</QPM:PackageDescription>
|
||||
|
||||
<QPM:ProductDescription>
|
||||
<QPM:ProductName>Simple DirectMedia Layer (SDL)</QPM:ProductName>
|
||||
<QPM:ProductIdentifier>SDL</QPM:ProductIdentifier>
|
||||
<QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
|
||||
<QPM:VendorName>Public</QPM:VendorName>
|
||||
<QPM:VendorInstallName>public</QPM:VendorInstallName>
|
||||
<QPM:VendorURL>http://www.libsdl.org</QPM:VendorURL>
|
||||
<QPM:VendorEmbedURL/>
|
||||
<QPM:VendorEmail>slouken@libsdl.org</QPM:VendorEmail>
|
||||
<QPM:AuthorName>Sam Lantinga</QPM:AuthorName>
|
||||
<QPM:AuthorURL>http://www.libsdl.org</QPM:AuthorURL>
|
||||
<QPM:AuthorEmbedURL/>
|
||||
<QPM:AuthorEmail>slouken@libsdl.org</QPM:AuthorEmail>
|
||||
<QPM:ProductIconSmall/>
|
||||
<QPM:ProductIconLarge/>
|
||||
<QPM:ProductDescriptionShort>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</QPM:ProductDescriptionShort>
|
||||
<QPM:ProductDescriptionLong>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications.</QPM:ProductDescriptionLong>
|
||||
<QPM:ProductDescriptionURL>http://www.libsdl.org</QPM:ProductDescriptionURL>
|
||||
<QPM:ProductDescriptionEmbedURL/>
|
||||
</QPM:ProductDescription>
|
||||
|
||||
<QPM:ReleaseDescription>
|
||||
<QPM:ReleaseVersion>@VERSION@</QPM:ReleaseVersion>
|
||||
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
|
||||
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
|
||||
<QPM:ReleaseNoteMinor/>
|
||||
<QPM:ReleaseNoteMajor/>
|
||||
<QPM:ReleaseBuild>1</QPM:ReleaseBuild>
|
||||
<QPM:CountryExclude/>
|
||||
<QPM:ReleaseCopyright>GNU Lesser General Public License</QPM:ReleaseCopyright>
|
||||
</QPM:ReleaseDescription>
|
||||
|
||||
<QPM:ContentDescription>
|
||||
<QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
|
||||
<QPM:ContentKeyword>SDL,audio,graphics,demos,games,emulators,direct,media,layer</QPM:ContentKeyword>
|
||||
<QPM:TargetOS>qnx6</QPM:TargetOS>
|
||||
<QPM:HostOS>none</QPM:HostOS>
|
||||
<QPM:DisplayEnvironment xmlmultiple="true">Photon</QPM:DisplayEnvironment>
|
||||
<QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
|
||||
<QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
|
||||
<QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
|
||||
</QPM:ContentDescription>
|
||||
<QPM:LicenseUrl>repdata://LicenseUrl/COPYING</QPM:LicenseUrl>
|
||||
</QPM:PackageManifest>
|
||||
</QPG:PackageFilter>
|
||||
|
||||
<QPG:PackageFilter proc="none" target="none">
|
||||
<QPM:PackageManifest>
|
||||
<QPM:ProductInstallationDependencies>
|
||||
<QPM:ProductRequirements></QPM:ProductRequirements>
|
||||
</QPM:ProductInstallationDependencies>
|
||||
</QPM:PackageManifest>
|
||||
</QPG:PackageFilter>
|
||||
|
||||
<QPG:PackageFilter proc="x86" target="none">
|
||||
<QPM:PackageManifest>
|
||||
<QPM:ProductInstallationDependencies>
|
||||
<QPM:ProductRequirements></QPM:ProductRequirements>
|
||||
</QPM:ProductInstallationDependencies>
|
||||
</QPM:PackageManifest>
|
||||
</QPG:PackageFilter>
|
||||
|
||||
<QPG:PackageFilter proc="none" target="x86">
|
||||
<QPM:PackageManifest>
|
||||
<QPM:ProductInstallationDependencies>
|
||||
<QPM:ProductRequirements></QPM:ProductRequirements>
|
||||
</QPM:ProductInstallationDependencies>
|
||||
</QPM:PackageManifest>
|
||||
</QPG:PackageFilter>
|
||||
|
||||
<QPG:PackageFilter proc="x86" target="x86">
|
||||
<QPM:PackageManifest>
|
||||
<QPM:ProductInstallationDependencies>
|
||||
<QPM:ProductRequirements></QPM:ProductRequirements>
|
||||
</QPM:ProductInstallationDependencies>
|
||||
</QPM:PackageManifest>
|
||||
</QPG:PackageFilter>
|
||||
|
||||
</QPG:Values>
|
||||
</QPG:Generation>
|
||||
@@ -1,113 +0,0 @@
|
||||
Summary: Simple DirectMedia Layer
|
||||
Name: SDL
|
||||
Version: 1.2.14
|
||||
Release: 1
|
||||
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
|
||||
URL: http://www.libsdl.org/
|
||||
License: LGPL
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
%ifos linux
|
||||
Provides: libSDL-1.2.so.0
|
||||
%endif
|
||||
|
||||
%define __defattr %defattr(-,root,root)
|
||||
%define __soext so
|
||||
|
||||
%description
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes and more to develop SDL applications.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
This is the libraries, include files and other resources you can use
|
||||
to develop SDL applications.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%ifos linux
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga
|
||||
%else
|
||||
%configure
|
||||
%endif
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%ifos linux
|
||||
make install prefix=$RPM_BUILD_ROOT%{prefix} \
|
||||
bindir=$RPM_BUILD_ROOT%{_bindir} \
|
||||
libdir=$RPM_BUILD_ROOT%{_libdir} \
|
||||
includedir=$RPM_BUILD_ROOT%{_includedir} \
|
||||
datadir=$RPM_BUILD_ROOT%{_datadir} \
|
||||
mandir=$RPM_BUILD_ROOT%{_mandir}
|
||||
ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0
|
||||
%else
|
||||
%makeinstall
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%{__defattr}
|
||||
%doc README-SDL.txt COPYING CREDITS BUGS
|
||||
%{_libdir}/lib*.%{__soext}.*
|
||||
|
||||
%files devel
|
||||
%{__defattr}
|
||||
%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html
|
||||
%doc docs/index.html docs/html
|
||||
%{_bindir}/*-config
|
||||
%{_libdir}/lib*.a
|
||||
%{_libdir}/lib*.la
|
||||
%{_libdir}/lib*.%{__soext}
|
||||
%dir %{_includedir}/SDL
|
||||
%{_includedir}/SDL/*.h
|
||||
%{_libdir}/pkgconfig/sdl.pc
|
||||
%{_datadir}/aclocal/*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
|
||||
- Removed support for Darwin, due to build problems on ps2linux
|
||||
|
||||
* Mon Jan 03 2004 Anders Bjorklund <afb@algonet.se>
|
||||
- Added support for Darwin, updated spec file
|
||||
|
||||
* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
|
||||
- Re-integrated spec file into SDL distribution
|
||||
- 'name' and 'version' come from configure
|
||||
- Some of the documentation is devel specific
|
||||
- Removed SMP support from %build - it doesn't work with libtool anyway
|
||||
|
||||
* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
|
||||
- Hacked Mandrake sdl spec to build 1.1
|
||||
|
||||
* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Build Release
|
||||
|
||||
* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Add symlink for libSDL-1.0.so.0 required by sdlbomber
|
||||
- Added docs
|
||||
|
||||
* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
|
||||
- v 1.0.0
|
||||
|
||||
* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
|
||||
- First spec file for Mandrake distribution.
|
||||
|
||||
# end of file
|
||||
@@ -1,113 +0,0 @@
|
||||
Summary: Simple DirectMedia Layer
|
||||
Name: SDL
|
||||
Version: @SDL_VERSION@
|
||||
Release: 1
|
||||
Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
|
||||
URL: http://www.libsdl.org/
|
||||
License: LGPL
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
%ifos linux
|
||||
Provides: libSDL-1.2.so.0
|
||||
%endif
|
||||
|
||||
%define __defattr %defattr(-,root,root)
|
||||
%define __soext so
|
||||
|
||||
%description
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes and more to develop SDL applications.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
This is the libraries, include files and other resources you can use
|
||||
to develop SDL applications.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%ifos linux
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga
|
||||
%else
|
||||
%configure
|
||||
%endif
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%ifos linux
|
||||
make install prefix=$RPM_BUILD_ROOT%{prefix} \
|
||||
bindir=$RPM_BUILD_ROOT%{_bindir} \
|
||||
libdir=$RPM_BUILD_ROOT%{_libdir} \
|
||||
includedir=$RPM_BUILD_ROOT%{_includedir} \
|
||||
datadir=$RPM_BUILD_ROOT%{_datadir} \
|
||||
mandir=$RPM_BUILD_ROOT%{_mandir}
|
||||
ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0
|
||||
%else
|
||||
%makeinstall
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%{__defattr}
|
||||
%doc README-SDL.txt COPYING CREDITS BUGS
|
||||
%{_libdir}/lib*.%{__soext}.*
|
||||
|
||||
%files devel
|
||||
%{__defattr}
|
||||
%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html
|
||||
%doc docs/index.html docs/html
|
||||
%{_bindir}/*-config
|
||||
%{_libdir}/lib*.a
|
||||
%{_libdir}/lib*.la
|
||||
%{_libdir}/lib*.%{__soext}
|
||||
%dir %{_includedir}/SDL
|
||||
%{_includedir}/SDL/*.h
|
||||
%{_libdir}/pkgconfig/sdl.pc
|
||||
%{_datadir}/aclocal/*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
|
||||
- Removed support for Darwin, due to build problems on ps2linux
|
||||
|
||||
* Mon Jan 03 2004 Anders Bjorklund <afb@algonet.se>
|
||||
- Added support for Darwin, updated spec file
|
||||
|
||||
* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
|
||||
- Re-integrated spec file into SDL distribution
|
||||
- 'name' and 'version' come from configure
|
||||
- Some of the documentation is devel specific
|
||||
- Removed SMP support from %build - it doesn't work with libtool anyway
|
||||
|
||||
* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
|
||||
- Hacked Mandrake sdl spec to build 1.1
|
||||
|
||||
* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Build Release
|
||||
|
||||
* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Add symlink for libSDL-1.0.so.0 required by sdlbomber
|
||||
- Added docs
|
||||
|
||||
* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
|
||||
- v 1.0.0
|
||||
|
||||
* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
|
||||
- First spec file for Mandrake distribution.
|
||||
|
||||
# end of file
|
||||
@@ -1,25 +1,19 @@
|
||||
|
||||
Wish list for the 1.3 development branch:
|
||||
http://bugzilla.libsdl.org/
|
||||
1.3 release checklist:
|
||||
* http://wiki.libsdl.org/moin.cgi/Roadmap
|
||||
|
||||
* Add mousewheel events (new unified event architecture?)
|
||||
* DirectInput joystick support needs to be implemented
|
||||
* Be able to enumerate and select available audio and video drivers
|
||||
* Fullscreen video mode support for Mac OS X
|
||||
* Explicit vertical retrace wait (maybe separate from SDL_Flip?)
|
||||
* Shaped windows, windows without borders
|
||||
* Multiple windows, multiple display support
|
||||
* SDL_INIT_EVENTTHREAD on Windows and MacOS?
|
||||
* Add a timestamp to events
|
||||
* Add audio input API
|
||||
* Add hardware accelerated scaled blit
|
||||
* Add hardware accelerated alpha blits
|
||||
* Redesign blitting architecture to allow blit plugins
|
||||
* See why windows are being rearranged. Is the shield window not up?
|
||||
* Make sure you can create and show a fullscreen window in one step
|
||||
* Figure out how to handle OpenGL context lost on Mac OS X (does it happen?)
|
||||
* Write automated test case for multi-draw APIs
|
||||
* Make sure you can build SDL without the renderer to slim it down a bunch
|
||||
* Implement assertion code on iPhone
|
||||
* Add __WINDOWS__ in addition to __WIN32__
|
||||
|
||||
In the jump from 1.2 to 1.3, we should change the SDL_Rect members to
|
||||
int and evaluate all the rest of the datatypes. This is the only place
|
||||
we should do it though, since the 1.2 series should not break binary
|
||||
compatibility in this way.
|
||||
|
||||
Requests:
|
||||
* PCM and CDROM volume control (deprecated, but possible)
|
||||
* Check 1.2 revisions:
|
||||
3554 - Need to resolve semantics for locking keys on different platforms
|
||||
4874 - Do we want screen rotation? At what level?
|
||||
4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98
|
||||
4484, 4485 - Verify that SDL's Windows keyboard handling works correctly
|
||||
4865 - See if this is still needed (mouse coordinate clamping)
|
||||
4866 - See if this is still needed (blocking window repositioning)
|
||||
|
||||
1
alienblaster/project/jni/sdl/UNDER_CONSTRUCTION.txt
Normal file
1
alienblaster/project/jni/sdl/UNDER_CONSTRUCTION.txt
Normal file
@@ -0,0 +1 @@
|
||||
WARNING: This code is under construction, may not build, and is unstable!
|
||||
@@ -1,171 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Using SDL with Microsoft Visual C++</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H1>
|
||||
Using SDL with Microsoft Visual C++ 5,6 and 7
|
||||
</H1>
|
||||
<H3>
|
||||
by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
|
||||
James Turk</A>
|
||||
</H3>
|
||||
<p>
|
||||
You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php">
|
||||
the SDL Download web site </A>, or you can build SDL yourself.
|
||||
</p>
|
||||
<H3>
|
||||
Building SDL
|
||||
</H3>
|
||||
<P>
|
||||
Unzip the <CODE>VisualC.zip</CODE> file into the directory that contains this
|
||||
file (<CODE>VisualC.html</CODE>).
|
||||
</P>
|
||||
<P>
|
||||
Be certain that you unzip the zip file for your compiler into <strong>this</strong>
|
||||
directory and not any other directory. If you are using WinZip, be careful to
|
||||
make sure that it extracts to <strong>this</strong> folder, because it's
|
||||
convenient feature of unzipping to a folder with the name of the file currently
|
||||
being unzipped will get you in trouble if you use it right now. And that's all
|
||||
I have to say about that.
|
||||
</P>
|
||||
<P>
|
||||
Now that it's unzipped, go into the VisualC
|
||||
directory that is created, and double-click on the VC++ file "<CODE>SDL.dsw</CODE>"<STRONG><FONT color="#009900">
|
||||
("<CODE>SDL.sln</CODE>").</FONT></STRONG> This should open up the IDE.
|
||||
</P>
|
||||
<P>
|
||||
You may be prompted at this point to upgrade the workspace, should you be using
|
||||
a more recent version of Visual C++. If so, allow the workspace to be upgraded.
|
||||
</P>
|
||||
<P>
|
||||
Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
|
||||
</P>
|
||||
<P>
|
||||
This is done by right clicking on each project in turn (Projects are listed in
|
||||
the Workspace panel in the FileView tab), and selecting "Build".
|
||||
</P>
|
||||
<P>
|
||||
If you get an error about SDL_config.h being missing, you should
|
||||
copy include/SDL_config.h.default to include/SDL_config.h and try again.
|
||||
</P>
|
||||
<P>
|
||||
You may get a few warnings, but you should not get any errors. You do have to
|
||||
have at least the DirectX 5 SDK installed, however. The latest
|
||||
version of DirectX can be downloaded or purchased on a cheap CD (my
|
||||
recommendation) from <A HREF="http://www.microsoft.com">Microsoft </A>.
|
||||
</P>
|
||||
<P>
|
||||
Later, we will refer to the following .lib and .dll files that have just been
|
||||
generated:
|
||||
</P>
|
||||
<ul>
|
||||
<li> SDL.dll</li>
|
||||
<li> SDL.lib</li>
|
||||
<li> SDLmain.lib</li>
|
||||
</ul>
|
||||
<P>
|
||||
Search for these using the Windows Find (Windows-F) utility, if you don't
|
||||
already know where they should be. For those of you with a clue, look inside
|
||||
the Debug or Release directories of the subdirectories of the Project folder.
|
||||
(It might be easier to just use Windows Find if this sounds confusing. And
|
||||
don't worry about needing a clue; we all need visits from the clue fairy
|
||||
frequently.)
|
||||
</P>
|
||||
<H3>
|
||||
Creating a Project with SDL
|
||||
</H3>
|
||||
<P>
|
||||
Create a project as a Win32 Application.
|
||||
</P>
|
||||
<P>
|
||||
Create a C++ file for your project.
|
||||
</P>
|
||||
<P>
|
||||
Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++
|
||||
tab|Code Generation|Runtime Library </CODE>.
|
||||
</P>
|
||||
<P>
|
||||
Add the SDL <CODE>include</CODE> directory to your list of includes in the
|
||||
menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
|
||||
.
|
||||
<br>
|
||||
<STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to
|
||||
add the include and library directories to the list that VC7 keeps. Do this by
|
||||
selecting Tools|Options|Projects|VC++ Directories and under the "Show
|
||||
Directories For:" dropbox select "Include Files", and click the "New Directory
|
||||
Icon" and add the [SDLROOT]\include directory (ex. If you installed to
|
||||
c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the
|
||||
dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
|
||||
</P>
|
||||
<P>
|
||||
The "include directory" I am referring to is the <CODE>include</CODE> folder
|
||||
within the main SDL directory (the one that this HTML file located within).
|
||||
</P>
|
||||
<P>
|
||||
Now we're going to use the files that we had created earlier in the Build SDL
|
||||
step.
|
||||
</P>
|
||||
<P>
|
||||
Copy the following files into your Project directory:
|
||||
</P>
|
||||
<ul>
|
||||
<li> SDL.dll</li>
|
||||
</ul>
|
||||
<P>
|
||||
Add the following files to your project (It is not necessary to copy them to
|
||||
your project directory):
|
||||
</P>
|
||||
<ul>
|
||||
<li> SDL.lib </li>
|
||||
<li> SDLmain.lib</li>
|
||||
</ul>
|
||||
<P>
|
||||
(To add them to your project, right click on your project, and select "Add
|
||||
files to project")
|
||||
</P>
|
||||
<P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more
|
||||
desireable to add them to the linker options: Project|Properties|Linker|Command
|
||||
Line and type the names of the libraries to link with in the "Additional
|
||||
Options:" box. Note: This must be done for each build
|
||||
configuration (eg. Release,Debug).</FONT></STRONG></P>
|
||||
<H3>
|
||||
SDL 101, First Day of Class
|
||||
</H3>
|
||||
<P>
|
||||
Now create the basic body of your project. The body of your program should take
|
||||
the following form: <CODE>
|
||||
<PRE>
|
||||
#include "SDL.h"
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
// Body of the program goes here.
|
||||
return 0;
|
||||
}
|
||||
</PRE>
|
||||
</CODE>
|
||||
<P></P>
|
||||
<H3>
|
||||
That's it!
|
||||
</H3>
|
||||
<P>
|
||||
I hope that this document has helped you get through the most difficult part of
|
||||
using the SDL: installing it. Suggestions for improvements to this document
|
||||
should be sent to the writers of this document.
|
||||
</P>
|
||||
<P>
|
||||
Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
|
||||
</P>
|
||||
<P>
|
||||
This document was originally called "VisualC.txt", and was written by <A HREF="mailto:slouken@libsdl.org">
|
||||
Sam Lantinga</A>.
|
||||
</P>
|
||||
<P>
|
||||
Later, it was converted to HTML and expanded into the document that you see
|
||||
today by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
|
||||
</P>
|
||||
<P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:james@conceptofzero.net">James Turk</A>
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,25 +1,11 @@
|
||||
|
||||
This is a list of API changes in SDL's version history.
|
||||
|
||||
Version 1.0:
|
||||
|
||||
1.2.14:
|
||||
Added cast macros for correct usage with C++:
|
||||
SDL_reinterpret_cast(type, expression)
|
||||
SDL_static_cast(type, expression)
|
||||
|
||||
Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for
|
||||
SDL_VIDEO_FULLSCREEN_HEAD on X11.
|
||||
|
||||
Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal
|
||||
up/down events for Caps-Lock and Num-Lock keys.
|
||||
|
||||
1.2.13:
|
||||
Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants.
|
||||
|
||||
1.2.12:
|
||||
Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
|
||||
of the screensaver on Mac OS X and X11.
|
||||
1.3.0:
|
||||
Added SDL_GetNumVideoDrivers() and SDL_GetVideoDriver().
|
||||
Replaced SDL_VideoDriverName() with SDL_GetCurrentVideoDriver()
|
||||
Added SDL_GetNumAudioDrivers() and SDL_GetAudioDriver().
|
||||
Replaced SDL_AudioDriverName() with SDL_GetCurrentAudioDriver()
|
||||
|
||||
1.2.10:
|
||||
If SDL_OpenAudio() is passed zero for the desired format
|
||||
@@ -434,8 +420,6 @@ Version 1.0:
|
||||
1.0.0:
|
||||
New public release
|
||||
|
||||
Version 0.11:
|
||||
|
||||
0.11.5:
|
||||
A new function SDL_GetVideoSurface() has been added, and returns
|
||||
a pointer to the current display surface.
|
||||
@@ -454,8 +438,6 @@ Version 0.11:
|
||||
installing fatal signal handlers on operating systems that support
|
||||
them.
|
||||
|
||||
Version 0.9:
|
||||
|
||||
0.9.15:
|
||||
SDL_CreateColorCursor() has been removed. Color cursors should
|
||||
be implemented as sprites, blitted by the application when the
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
echo "Generating build information using autoconf"
|
||||
echo "This may take a while ..."
|
||||
|
||||
# Regenerate configuration files
|
||||
cat acinclude/* >aclocal.m4
|
||||
found=false
|
||||
for autoconf in autoconf autoconf259 autoconf-2.59
|
||||
do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
|
||||
done
|
||||
if test x$found = xfalse; then
|
||||
echo "Couldn't find autoconf, aborting"
|
||||
exit 1
|
||||
fi
|
||||
(cd test; sh autogen.sh)
|
||||
|
||||
# Run configure for this platform
|
||||
echo "Now you are ready to run ./configure"
|
||||
@@ -1,629 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD><TITLE>SDL Stable Release</TITLE></HEAD>
|
||||
<BODY BGCOLOR="#FFEBCD" TEXT="#000000">
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
<P>
|
||||
This source is stable, and is fully tested on all supported platforms.<br>
|
||||
Please send bug reports or questions to the SDL mailing list:<br>
|
||||
<a href="http://www.libsdl.org/mailing-list.php"
|
||||
>http://www.libsdl.org/mailing-list.php</a><br>
|
||||
The latest stable release may be found on the
|
||||
<a href="http://www.libsdl.org/">SDL website</A>.
|
||||
</P>
|
||||
|
||||
<H2> <A HREF="docs/index.html">API Documentation</A> </H2>
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
<H2> SDL 1.2.14 Release Notes </H2>
|
||||
<P>
|
||||
SDL 1.2.14 is a significant bug fix release and a recommended update.
|
||||
</P>
|
||||
|
||||
<H3> General Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Fixed flicker when resizing the SDL window
|
||||
</P>
|
||||
<P>
|
||||
Fixed crash in SDL_SetGammaRamp()
|
||||
</P>
|
||||
<P>
|
||||
Fixed freeze in SDL_memset() with 0 length when assembly code is disabled.
|
||||
</P>
|
||||
<P>
|
||||
Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys.
|
||||
</P>
|
||||
<P>
|
||||
Fixed audio quality problem when converting between 22050 Hz and 44100 Hz.
|
||||
</P>
|
||||
<P>
|
||||
Fixed a threading crash when a few threads are rapidly created and complete.
|
||||
</P>
|
||||
<P>
|
||||
Increased accuracy of alpha blending routines.
|
||||
</P>
|
||||
<P>
|
||||
Fixed crash loading BMP files saved with the scanlines inverted.
|
||||
</P>
|
||||
<P>
|
||||
Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event.
|
||||
</P>
|
||||
<P>
|
||||
Added doxygen documentation for the SDL API headers.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Unix Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Fixed potential memory corruption due to assembly bug with SDL_revcpy()
|
||||
</P>
|
||||
<P>
|
||||
Fixed crashes trying to detect SSE features on x86_64 architecture.
|
||||
</P>
|
||||
<P>
|
||||
Fixed assembly for GCC optimized 50% alpha blending blits.
|
||||
</P>
|
||||
<P>
|
||||
Added configure option --enable-screensaver, to allow enabling the screensaver by default.
|
||||
</P>
|
||||
<P>
|
||||
Use XResetScreenSaver() instead of disabling screensaver entirely.
|
||||
</P>
|
||||
<P>
|
||||
Removed the maximum window size limitation on X11.
|
||||
</P>
|
||||
<P>
|
||||
Fixed SDL_GL_SWAP_CONTROL on X11.
|
||||
</P>
|
||||
<P>
|
||||
Fixed setting the X11 window input hint.
|
||||
</P>
|
||||
<P>
|
||||
Fixed distorted X11 window icon for some visuals.
|
||||
</P>
|
||||
<P>
|
||||
Fixed detecting X11 libraries for dynamic loading on 64-bit Linux.
|
||||
</P>
|
||||
<P>
|
||||
SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control.
|
||||
</P>
|
||||
<P>
|
||||
Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11.
|
||||
</P>
|
||||
<P>
|
||||
The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen.
|
||||
</P>
|
||||
<P>
|
||||
Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console.
|
||||
<BR>
|
||||
Valid values are:
|
||||
<UL>
|
||||
<LI>not set - Not rotating, no shadow.
|
||||
<LI>"NONE" - Not rotating, but still using shadow.
|
||||
<LI>"CW" - Rotating screen clockwise.
|
||||
<LI>"UD" - Rotating screen upside down.
|
||||
<LI>"CCW" - Rotating screen counter clockwise.
|
||||
</UL>
|
||||
</P>
|
||||
<P>
|
||||
Fixed DirectFB detection on some Linux distributions.
|
||||
</P>
|
||||
<P>
|
||||
Added code to use the PS3 SPE processors for YUV conversion on Linux.
|
||||
</P>
|
||||
<P>
|
||||
Updated ALSA support to the latest stable API
|
||||
</P>
|
||||
<P>
|
||||
ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.)
|
||||
</P>
|
||||
<P>
|
||||
Improved support for PulseAudio
|
||||
</P>
|
||||
<P>
|
||||
The Network Audio System support is now dynamically loaded at runtime.
|
||||
</P>
|
||||
<P>
|
||||
Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels.
|
||||
</P>
|
||||
<P>
|
||||
Fixed crash in SDL_Quit() when a joystick has been unplugged.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Windows Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Verified 100% compatibility with Windows 7.
|
||||
</P>
|
||||
<P>
|
||||
Prevent loss of OpenGL context when setting the video mode in response to a window resize event.
|
||||
</P>
|
||||
<P>
|
||||
Fixed video initialization with SDL_WINDOWID on Windows XP.
|
||||
</P>
|
||||
<P>
|
||||
Improved mouse input responsiveness for first-person-shooter games.
|
||||
</P>
|
||||
<P>
|
||||
IME messages are now generated for localized input.
|
||||
</P>
|
||||
<P>
|
||||
SDL_RWFromFile() takes a UTF-8 filename when opening a file.
|
||||
</P>
|
||||
<P>
|
||||
The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt.
|
||||
</P>
|
||||
<P>
|
||||
Fixed dynamic object loading on Windows CE.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Mac OS X Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
SDL now builds on Mac OS X 10.6 (Snow Leopard).
|
||||
<BR>
|
||||
Eric Wing posted a good rundown on the numerous changes here: <A HREF="http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html">http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html</A>
|
||||
</P>
|
||||
<P>
|
||||
The X11 video driver is built by default.
|
||||
</P>
|
||||
<P>
|
||||
Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target.
|
||||
</P>
|
||||
<P>
|
||||
Fixed setting the starting working directory in release builds.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
<H2> SDL 1.2.13 Release Notes </H2>
|
||||
<P>
|
||||
SDL 1.2.13 is a minor bug fix release.
|
||||
</P>
|
||||
|
||||
<H3> General Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Fixed link error when building with Intel Compiler 10.
|
||||
</P>
|
||||
<P>
|
||||
Removed stray C++ comment from public headers.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Unix Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Fixed crash in SDL_SoftStretch() on secure operating systems.
|
||||
</P>
|
||||
<P>
|
||||
Fixed undefined symbol on X11 implementations without UTF-8 support.
|
||||
</P>
|
||||
<P>
|
||||
Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver.
|
||||
</P>
|
||||
<P>
|
||||
Scan for all joysticks on Linux instead of stopping at one that was removed.
|
||||
</P>
|
||||
<P>
|
||||
Fixed use of sdl-config arguments in sdl.m4
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Windows Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Fixed crash when a video driver reports higher than 32 bpp video modes.
|
||||
</P>
|
||||
<P>
|
||||
Fixed restoring the desktop after setting a 24-bit OpenGL video mode.
|
||||
</P>
|
||||
<P>
|
||||
Fixed window titles on Windows 95/98/ME.
|
||||
</P>
|
||||
<P>
|
||||
Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons.
|
||||
</P>
|
||||
<P>
|
||||
Added support for quoted command line arguments.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Mac OS X Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
SDL now builds on Mac OS X 10.5 (Leopard).
|
||||
</P>
|
||||
<P>
|
||||
Fixed high frequency crash involving text input.
|
||||
</P>
|
||||
<P>
|
||||
Fixed beeping when the escape key is pressed and UNICODE translation is enabled.
|
||||
</P>
|
||||
<P>
|
||||
Improved trackpad scrolling support.
|
||||
</P>
|
||||
<P>
|
||||
Fixed joystick hat reporting for certain joysticks.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
<H2> SDL 1.2.12 Release Notes </H2>
|
||||
<P>
|
||||
SDL 1.2.12 is a minor bug fix release.
|
||||
</P>
|
||||
|
||||
<H3> General Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Added support for the PulseAudio sound server: http://www.pulseaudio.org/
|
||||
</P>
|
||||
<P>
|
||||
Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.
|
||||
</P>
|
||||
<P>
|
||||
Fixed buffer overrun crash when resampling audio rates.
|
||||
</P>
|
||||
<P>
|
||||
Fixed audio bug where converting to mono was doubling the volume.
|
||||
</P>
|
||||
<P>
|
||||
Fixed off-by-one error in the C implementation of SDL_revcpy()
|
||||
</P>
|
||||
<P>
|
||||
Fixed compiling with Sun Studio.
|
||||
</P>
|
||||
<P>
|
||||
Support for AmigaOS has been removed from the main SDL code.
|
||||
</P>
|
||||
<P>
|
||||
Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code.
|
||||
</P>
|
||||
<P>
|
||||
Unofficial support for the S60/SymbianOS platform has been added.
|
||||
</P>
|
||||
<P>
|
||||
Unofficial support for the Nintendo DS platform has been added.
|
||||
</P>
|
||||
<P>
|
||||
Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only).
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Unix Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Fixed detection of X11 DGA mouse support.
|
||||
</P>
|
||||
<P>
|
||||
Improved XIM support for asian character sets.
|
||||
</P>
|
||||
<P>
|
||||
The GFX_Display has been added to the X11 window information in SDL_syswm.h.
|
||||
</P>
|
||||
<P>
|
||||
Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels.
|
||||
</P>
|
||||
<P>
|
||||
Fixed hang or crash at startup if aRts can't access the hardware.
|
||||
</P>
|
||||
<P>
|
||||
Fixed relative mouse mode when the cursor starts outside the X11 window.
|
||||
</P>
|
||||
<P>
|
||||
Fixed accidental free of stack memory in X11 mouse acceleration code.
|
||||
</P>
|
||||
<P>
|
||||
Closed minor memory leak in XME code.
|
||||
</P>
|
||||
<P>
|
||||
Fixed TEXTRELs in the library to resolve some PIC issues.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Windows Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
The GDI video driver makes better use of the palette in 8-bit modes.
|
||||
</P>
|
||||
<P>
|
||||
The windib driver now supports more mouse buttons with WM_XBUTTON events.
|
||||
</P>
|
||||
<P>
|
||||
On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed.
|
||||
</P>
|
||||
<P>
|
||||
Added support for UTF-8 window titles on Windows.
|
||||
</P>
|
||||
<P>
|
||||
Fixed joystick detection on Windows.
|
||||
</P>
|
||||
<P>
|
||||
Improved performance with Win32 file I/O.
|
||||
</P>
|
||||
<P>
|
||||
Fixed HBITMAP leak in GAPI driver.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Mac OS X Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X.
|
||||
</P>
|
||||
<P>
|
||||
Fixed YUV overlay crash inside Quicktime on Intel Mac OS X.
|
||||
</P>
|
||||
<P>
|
||||
Fixed blitting alignment in Altivec alpha blit functions.
|
||||
</P>
|
||||
<P>
|
||||
Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X.
|
||||
</P>
|
||||
<P>
|
||||
Fixed joystick calibration code on Mac OS X.
|
||||
</P>
|
||||
<P>
|
||||
Fixed mouse jitter when multiple motion events are queued up in Mac OS X.
|
||||
</P>
|
||||
<P>
|
||||
Fixed changing the cursor in fullscreen mode on Mac OS X.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Mac OS Classic Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Added support for gamma ramps to both toolbox and DrawSprocket video drivers.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> BeOS Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Implemented mouse grabbing and mouse relative mode on BeOS.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
<H2> SDL 1.2.11 Release Notes </H2>
|
||||
<P>
|
||||
SDL 1.2.11 is a minor bug fix release.
|
||||
</P>
|
||||
|
||||
<H3> Unix Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX.
|
||||
</P>
|
||||
<P>
|
||||
Fixed building SDL with Xinerama disabled.
|
||||
</P>
|
||||
<P>
|
||||
Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen().
|
||||
</P>
|
||||
<P>
|
||||
Added pkgconfig configuration support.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Windows Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL.
|
||||
</P>
|
||||
<P>
|
||||
The Win32 window positioning code works properly for windows with menus.
|
||||
</P>
|
||||
<P>
|
||||
DirectSound audio quality has been improved on certain sound cards.
|
||||
</P>
|
||||
<P>
|
||||
Fixed 5.1 audio channel ordering on Windows and Mac OS X.
|
||||
</P>
|
||||
<P>
|
||||
Plugged a couple of minor memory leaks in the windib video driver.
|
||||
</P>
|
||||
<P>
|
||||
Fixed type collision with stdint.h when building with gcc on Win32.
|
||||
</P>
|
||||
<P>
|
||||
Fixed building with the Digital Mars Compiler on Win32.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Mac OS X Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above.
|
||||
</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
<H2> SDL 1.2.10 Release Notes </H2>
|
||||
<P>
|
||||
SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes.
|
||||
</P>
|
||||
<H3> API enhancements </H3>
|
||||
<UL>
|
||||
<LI>
|
||||
If SDL_OpenAudio() is passed zero for the desired format
|
||||
fields, the following environment variables will be used
|
||||
to fill them in:
|
||||
<pre><code>
|
||||
SDL_AUDIO_FREQUENCY
|
||||
SDL_AUDIO_FORMAT
|
||||
SDL_AUDIO_CHANNELS
|
||||
SDL_AUDIO_SAMPLES
|
||||
</code></pre>
|
||||
If an environment variable is not specified, it will be set
|
||||
to a reasonable default value.
|
||||
<LI>
|
||||
SDL_SetVideoMode() now accepts 0 for width or height and will use
|
||||
the current video mode (or the desktop mode if no mode has been set.)
|
||||
<LI>
|
||||
Added current_w and current_h to the SDL_VideoInfo structure,
|
||||
which is set to the desktop resolution during video intialization,
|
||||
and then set to the current resolution when a video mode is set.
|
||||
<LI>
|
||||
SDL_GL_LoadLibrary() will load the system default OpenGL library
|
||||
if it is passed NULL as a parameter.
|
||||
<LI>
|
||||
Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
|
||||
<LI>
|
||||
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
|
||||
<LI>
|
||||
SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms.
|
||||
<LI>
|
||||
Added SDL_GetKeyRepeat() to query the key repeat settings.
|
||||
<LI>
|
||||
Added the "dummy" audio driver, which can be used to emulate audio
|
||||
output without a sound card.
|
||||
<LI>
|
||||
Added SDL_config.h, with defaults for various build environments.
|
||||
</UL>
|
||||
|
||||
<H3> General Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
The SDL website now has an <A HREF="http://www.libsdl.org/rss/rss.xml">RSS feed</A>!
|
||||
<P>
|
||||
The SDL development source code is now managed with <A HREF="http://www.libsdl.org/svn.php">Subversion</A>.
|
||||
<P>
|
||||
SDL now uses the Bugzilla <A HREF="http://bugzilla.libsdl.org/">bug tracking system</A>, hosted by icculus.org.
|
||||
<P>
|
||||
SDL is licensed under version 2.1 of the GNU Lesser General Public License.
|
||||
<P>
|
||||
The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform.
|
||||
<P>
|
||||
SDL_opengl.h has been updated with the latest glext.h from <A HREF="http://oss.sgi.com/projects/ogl-sample/registry/">http://oss.sgi.com/projects/ogl-sample/registry/</A>
|
||||
<P>
|
||||
Alex Volkov contributed highly optimized RGB <-> RGBA blitters.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Unix Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed.
|
||||
<P>
|
||||
The XiG XME extension code is now included in the X11 video driver by default.
|
||||
<P>
|
||||
XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1.
|
||||
<P>
|
||||
Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0.
|
||||
<P>
|
||||
XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file.
|
||||
<P>
|
||||
SDL windows are no longer transparent in X11 compositing systems like XGL.
|
||||
<P>
|
||||
The mouse is properly released by the X11 video driver if the fullscreen window loses focus.
|
||||
<P>
|
||||
The X11 input driver now uses XIM to handle international input.
|
||||
<P>
|
||||
The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3.
|
||||
<P>
|
||||
Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver.
|
||||
<P>
|
||||
The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images.
|
||||
<P>
|
||||
The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling.
|
||||
<P>
|
||||
The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back.
|
||||
<P>
|
||||
The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings.
|
||||
<P>
|
||||
The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse.
|
||||
<P>
|
||||
The SVGAlib video driver now has support for banked (non-linear) video modes.
|
||||
<P>
|
||||
A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details.
|
||||
<P>
|
||||
Many patches have been incorporated from *BSD ports.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Windows Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx".
|
||||
<P>
|
||||
SDL has been ported to 64-bit Windows.
|
||||
<P>
|
||||
Dmitry Yakimov contributed a GAPI video driver for Windows CE.
|
||||
<P>
|
||||
The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3.
|
||||
<P>
|
||||
Dialog boxes are now shown when SDL is in windowed OpenGL mode.
|
||||
<P>
|
||||
The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes.
|
||||
<P>
|
||||
An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored.
|
||||
<P>
|
||||
Window positions are retained when switching between fullscreen and windowed modes.
|
||||
<P>
|
||||
ToUnicode() is used, when available, for improved handling of international keyboard input.
|
||||
<P>
|
||||
The PrtScrn is now treated normally with both key down and key up events.
|
||||
<P>
|
||||
Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications.
|
||||
<P>
|
||||
Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting.
|
||||
<P>
|
||||
An MCI error when playing the last track on a CD-ROM has been fixed.
|
||||
<P>
|
||||
OpenWatcom projects for building SDL have been provided by Marc Peter.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> Mac OS X Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details.
|
||||
<P>
|
||||
The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed.
|
||||
<P>
|
||||
Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker.
|
||||
<P>
|
||||
Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3> OS/2 Notes </H3>
|
||||
|
||||
<BLOCKQUOTE>
|
||||
<P>
|
||||
Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details.
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,82 +20,145 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL.h
|
||||
/**
|
||||
* \file SDL.h
|
||||
*
|
||||
* Main include header for the SDL library
|
||||
*/
|
||||
|
||||
/**
|
||||
* \mainpage Simple DirectMedia Layer (SDL)
|
||||
*
|
||||
* http://www.libsdl.org/
|
||||
*
|
||||
* \section intro_sec Introduction
|
||||
*
|
||||
* This is the Simple DirectMedia Layer, a general API that provides low
|
||||
* level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
|
||||
* and 2D framebuffer across multiple platforms.
|
||||
*
|
||||
* The current version supports Windows, Windows CE, Mac OS X, Linux,
|
||||
* FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, and QNX. The code contains
|
||||
* support for other operating systems but those are not officially supported.
|
||||
*
|
||||
* SDL is written in C, but works with C++ natively, and has bindings to
|
||||
* several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
|
||||
* Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
|
||||
* Pike, Pliant, Python, Ruby, and Smalltalk.
|
||||
*
|
||||
* This library is distributed under GNU LGPL version 2, which can be
|
||||
* found in the file "COPYING". This license allows you to use SDL
|
||||
* freely in commercial programs as long as you link with the dynamic
|
||||
* library.
|
||||
*
|
||||
* The best way to learn how to use SDL is to check out the header files in
|
||||
* the "include" subdirectory and the programs in the "test" subdirectory.
|
||||
* The header files and test programs are well commented and always up to date.
|
||||
* More documentation is available in HTML format in "docs/index.html", and
|
||||
* a documentation wiki is available online at:
|
||||
* http://www.libsdl.org/cgi/docwiki.cgi
|
||||
*
|
||||
* The test programs in the "test" subdirectory are in the public domain.
|
||||
*
|
||||
* Frequently asked questions are answered online:
|
||||
* http://www.libsdl.org/faq.php
|
||||
*
|
||||
* If you need help with the library, or just want to discuss SDL related
|
||||
* issues, you can join the developers mailing list:
|
||||
* http://www.libsdl.org/mailing-list.php
|
||||
*
|
||||
* Enjoy!
|
||||
* Sam Lantinga (slouken@libsdl.org)
|
||||
*/
|
||||
|
||||
#ifndef _SDL_H
|
||||
#define _SDL_H
|
||||
|
||||
#include "SDL_main.h"
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_atomic.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_cdrom.h"
|
||||
#include "SDL_cpuinfo.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_loadso.h"
|
||||
#include "SDL_mutex.h"
|
||||
#include "SDL_power.h"
|
||||
#include "SDL_rwops.h"
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_version.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_compat.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** @file SDL.h
|
||||
* @note As of version 0.5, SDL is loaded dynamically into the application
|
||||
*/
|
||||
/* As of version 0.5, SDL is loaded dynamically into the application */
|
||||
|
||||
/** @name SDL_INIT Flags
|
||||
* These are the flags which may be passed to SDL_Init() -- you should
|
||||
/**
|
||||
* \name SDL_INIT_*
|
||||
*
|
||||
* These are the flags which may be passed to SDL_Init(). You should
|
||||
* specify the subsystems which you will be using in your application.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_INIT_TIMER 0x00000001
|
||||
#define SDL_INIT_AUDIO 0x00000010
|
||||
#define SDL_INIT_VIDEO 0x00000020
|
||||
#define SDL_INIT_CDROM 0x00000100
|
||||
#define SDL_INIT_JOYSTICK 0x00000200
|
||||
#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
|
||||
#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */
|
||||
#define SDL_INIT_EVERYTHING 0x0000FFFF
|
||||
#define SDL_INIT_TIMER 0x00000001
|
||||
#define SDL_INIT_AUDIO 0x00000010
|
||||
#define SDL_INIT_VIDEO 0x00000020
|
||||
#define SDL_INIT_JOYSTICK 0x00000200
|
||||
#define SDL_INIT_HAPTIC 0x00001000
|
||||
#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
|
||||
#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */
|
||||
#define SDL_INIT_EVERYTHING 0x0000FFFF
|
||||
/*@}*/
|
||||
|
||||
/** This function loads the SDL dynamically linked library and initializes
|
||||
* the subsystems specified by 'flags' (and those satisfying dependencies)
|
||||
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
|
||||
* signal handlers for some commonly ignored fatal signals (like SIGSEGV)
|
||||
/**
|
||||
* This function loads the SDL dynamically linked library and initializes
|
||||
* the subsystems specified by \c flags (and those satisfying dependencies).
|
||||
* Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
|
||||
* signal handlers for some commonly ignored fatal signals (like SIGSEGV).
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
|
||||
|
||||
/** This function initializes specific SDL subsystems */
|
||||
/**
|
||||
* This function initializes specific SDL subsystems
|
||||
*/
|
||||
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);
|
||||
|
||||
/** This function returns mask of the specified subsystems which have
|
||||
/**
|
||||
* This function returns mask of the specified subsystems which have
|
||||
* been initialized.
|
||||
* If 'flags' is 0, it returns a mask of all initialized subsystems.
|
||||
*
|
||||
* If \c flags is 0, it returns a mask of all initialized subsystems.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
|
||||
|
||||
/** This function cleans up all initialized subsystems and unloads the
|
||||
/**
|
||||
* This function cleans up all initialized subsystems and unloads the
|
||||
* dynamically linked library. You should call it upon all exit conditions.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_H */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_active.h
|
||||
* Include file for SDL application focus event handling
|
||||
*/
|
||||
|
||||
#ifndef _SDL_active_h
|
||||
#define _SDL_active_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @name The available application states */
|
||||
/*@{*/
|
||||
#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */
|
||||
#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */
|
||||
#define SDL_APPACTIVE 0x04 /**< The application is active */
|
||||
/*@}*/
|
||||
|
||||
/* Function prototypes */
|
||||
/**
|
||||
* This function returns the current state of the application, which is a
|
||||
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
|
||||
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
|
||||
* see your application, otherwise it has been iconified or disabled.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_active_h */
|
||||
241
alienblaster/project/jni/sdl/include/SDL_assert.h
Normal file
241
alienblaster/project/jni/sdl/include/SDL_assert.h
Normal file
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_assert_h
|
||||
#define _SDL_assert_h
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#ifndef SDL_ASSERT_LEVEL
|
||||
#ifdef SDL_DEFAULT_ASSERT_LEVEL
|
||||
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
|
||||
#elif defined(_DEBUG) || defined(DEBUG) || \
|
||||
(defined(__GNUC__) && !defined(__OPTIMIZE__))
|
||||
#define SDL_ASSERT_LEVEL 2
|
||||
#else
|
||||
#define SDL_ASSERT_LEVEL 1
|
||||
#endif
|
||||
#endif /* SDL_ASSERT_LEVEL */
|
||||
|
||||
/*
|
||||
These are macros and not first class functions so that the debugger breaks
|
||||
on the assertion line and not in some random guts of SDL, and so each
|
||||
assert can have unique static variables associated with it.
|
||||
*/
|
||||
|
||||
#if (defined(_MSC_VER) && ((_M_IX86) || (_M_X64)))
|
||||
#define SDL_TriggerBreakpoint() __asm { int 3 }
|
||||
#elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||
#elif defined(HAVE_SIGNAL_H)
|
||||
#include <signal.h>
|
||||
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
||||
#else
|
||||
/* How do we trigger breakpoints on this platform? */
|
||||
#define SDL_TriggerBreakpoint()
|
||||
#endif
|
||||
|
||||
#if (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||
# define SDL_FUNCTION __func__
|
||||
#elif ((__GNUC__ >= 2) || defined(_MSC_VER))
|
||||
# define SDL_FUNCTION __FUNCTION__
|
||||
#else
|
||||
# define SDL_FUNCTION "???"
|
||||
#endif
|
||||
#define SDL_FILE __FILE__
|
||||
#define SDL_LINE __LINE__
|
||||
|
||||
/*
|
||||
sizeof (x) makes the compiler still parse the expression even without
|
||||
assertions enabled, so the code is always checked at compile time, but
|
||||
doesn't actually generate code for it, so there are no side effects or
|
||||
expensive checks at run time, just the constant size of what x WOULD be,
|
||||
which presumably gets optimized out as unused.
|
||||
This also solves the problem of...
|
||||
|
||||
int somevalue = blah();
|
||||
SDL_assert(somevalue == 1);
|
||||
|
||||
...which would cause compiles to complain that somevalue is unused if we
|
||||
disable assertions.
|
||||
*/
|
||||
|
||||
#define SDL_disabled_assert(condition) \
|
||||
do { (void) sizeof ((condition)); } while (0)
|
||||
|
||||
#if (SDL_ASSERT_LEVEL > 0)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
|
||||
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
|
||||
SDL_ASSERTION_ABORT, /**< Terminate the program. */
|
||||
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
|
||||
SDL_ASSERTION_ALWAYS_IGNORE, /**< Ignore the assert from now on. */
|
||||
} SDL_assert_state;
|
||||
|
||||
typedef struct SDL_assert_data
|
||||
{
|
||||
int always_ignore;
|
||||
unsigned int trigger_count;
|
||||
const char *condition;
|
||||
const char *filename;
|
||||
int linenum;
|
||||
const char *function;
|
||||
const struct SDL_assert_data *next;
|
||||
} SDL_assert_data;
|
||||
|
||||
/* Never call this directly. Use the SDL_assert* macros. */
|
||||
extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *,
|
||||
const char *,
|
||||
const char *, int);
|
||||
|
||||
/* the do {} while(0) avoids dangling else problems:
|
||||
if (x) SDL_assert(y); else blah();
|
||||
... without the do/while, the "else" could attach to this macro's "if".
|
||||
We try to handle just the minimum we need here in a macro...the loop,
|
||||
the static vars, and break points. The heavy lifting is handled in
|
||||
SDL_ReportAssertion(), in SDL_assert.c.
|
||||
*/
|
||||
#define SDL_enabled_assert(condition) \
|
||||
do { \
|
||||
while ( !(condition) ) { \
|
||||
static struct SDL_assert_data assert_data = { \
|
||||
0, 0, #condition, 0, 0, 0, 0 \
|
||||
}; \
|
||||
const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \
|
||||
SDL_FUNCTION, \
|
||||
SDL_FILE, \
|
||||
SDL_LINE); \
|
||||
if (state == SDL_ASSERTION_RETRY) { \
|
||||
continue; /* go again. */ \
|
||||
} else if (state == SDL_ASSERTION_BREAK) { \
|
||||
SDL_TriggerBreakpoint(); \
|
||||
} \
|
||||
break; /* not retrying. */ \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* enabled assertions support code */
|
||||
|
||||
/* Enable various levels of assertions. */
|
||||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
|
||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||
#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
|
||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
||||
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
|
||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
||||
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
|
||||
#else
|
||||
# error Unknown assertion level.
|
||||
#endif
|
||||
|
||||
|
||||
typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)(
|
||||
const SDL_assert_data *, void *userdata);
|
||||
|
||||
/**
|
||||
* \brief Set an application-defined assertion handler.
|
||||
*
|
||||
* This allows an app to show its own assertion UI and/or force the
|
||||
* response to an assertion failure. If the app doesn't provide this, SDL
|
||||
* will try to do the right thing, popping up a system-specific GUI dialog,
|
||||
* and probably minimizing any fullscreen windows.
|
||||
*
|
||||
* This callback may fire from any thread, but it runs wrapped in a mutex, so
|
||||
* it will only fire from one thread at a time.
|
||||
*
|
||||
* Setting the callback to NULL restores SDL's original internal handler.
|
||||
*
|
||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
||||
*
|
||||
* \return SDL_assert_state value of how to handle the assertion failure.
|
||||
*
|
||||
* \param handler Callback function, called when an assertion fails.
|
||||
* \param userdata A pointer passed to the callback as-is.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
||||
SDL_AssertionHandler handler,
|
||||
void *userdata);
|
||||
|
||||
/**
|
||||
* \brief Get a list of all assertion failures.
|
||||
*
|
||||
* Get all assertions triggered since last call to SDL_ResetAssertionReport(),
|
||||
* or the start of the program.
|
||||
*
|
||||
* The proper way to examine this data looks something like this:
|
||||
*
|
||||
* <code>
|
||||
* const SDL_assert_data *item = SDL_GetAssertionReport();
|
||||
* while (item->condition) {
|
||||
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
|
||||
* item->condition, item->function, item->filename,
|
||||
* item->linenum, item->trigger_count,
|
||||
* item->always_ignore ? "yes" : "no");
|
||||
* item = item->next;
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* \return List of all assertions. This never returns NULL,
|
||||
* even if there are no items.
|
||||
* \sa SDL_ResetAssertionReport
|
||||
*/
|
||||
extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void);
|
||||
|
||||
/**
|
||||
* \brief Reset the list of all assertion failures.
|
||||
*
|
||||
* Reset list of all assertions triggered.
|
||||
*
|
||||
* \sa SDL_GetAssertionReport
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_assert_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
216
alienblaster/project/jni/sdl/include/SDL_atomic.h
Normal file
216
alienblaster/project/jni/sdl/include/SDL_atomic.h
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
|
||||
Contributed by Bob Pendleton, bob@pendleton.com
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_atomic.h
|
||||
*
|
||||
* Atomic operations.
|
||||
*
|
||||
* These operations may, or may not, actually be implemented using
|
||||
* processor specific atomic operations. When possible they are
|
||||
* implemented as true processor specific atomic operations. When that
|
||||
* is not possible the are implemented using locks that *do* use the
|
||||
* available atomic operations.
|
||||
*
|
||||
* At the very minimum spin locks must be implemented. Without spin
|
||||
* locks it is not possible (AFAICT) to emulate the rest of the atomic
|
||||
* operations.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_atomic_h_
|
||||
#define _SDL_atomic_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* \name SDL AtomicLock
|
||||
*
|
||||
* The spin lock functions and type are required and can not be
|
||||
* emulated because they are used in the emulation code.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
typedef volatile Uint32 SDL_SpinLock;
|
||||
|
||||
/**
|
||||
* \brief Lock a spin lock by setting it to a none zero value.
|
||||
*
|
||||
* \param lock Points to the lock.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* \brief Unlock a spin lock by setting it to 0. Always returns immediately
|
||||
*
|
||||
* \param lock Points to the lock.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||
|
||||
/*@}*//*SDL AtomicLock*/
|
||||
|
||||
/**
|
||||
* \name 32 bit atomic operations
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \brief Check to see if \c *ptr == 0 and set it to 1.
|
||||
*
|
||||
* \return SDL_True if the value pointed to by \c ptr was zero and
|
||||
* SDL_False if it was not zero
|
||||
*
|
||||
* \param ptr Points to the value to be tested and set.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Set the value pointed to by \c ptr to be zero.
|
||||
*
|
||||
* \param ptr Address of the value to be set to zero
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicClear32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Fetch the current value of \c *ptr and then increment that
|
||||
* value in place.
|
||||
*
|
||||
* \return The value before it was incremented.
|
||||
*
|
||||
* \param ptr Address of the value to fetch and increment
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Fetch \c *ptr and then decrement the value in place.
|
||||
*
|
||||
* \return The value before it was decremented.
|
||||
*
|
||||
* \param ptr Address of the value to fetch and drement
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Fetch the current value at \c ptr and then add \c value to \c *ptr.
|
||||
*
|
||||
* \return \c *ptr before the addition took place.
|
||||
*
|
||||
* \param ptr The address of data we are changing.
|
||||
* \param value The value to add to \c *ptr.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/**
|
||||
* \brief Fetch \c *ptr and then subtract \c value from it.
|
||||
*
|
||||
* \return \c *ptr before the subtraction took place.
|
||||
*
|
||||
* \param ptr The address of the data being changed.
|
||||
* \param value The value to subtract from \c *ptr.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/**
|
||||
* \brief Add one to the data pointed to by \c ptr and return that value.
|
||||
*
|
||||
* \return The incremented value.
|
||||
*
|
||||
* \param ptr The address of the data to increment.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Subtract one from data pointed to by \c ptr and return the new value.
|
||||
*
|
||||
* \return The decremented value.
|
||||
*
|
||||
* \param ptr The address of the data to decrement.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr);
|
||||
|
||||
/**
|
||||
* \brief Add \c value to the data pointed to by \c ptr and return result.
|
||||
*
|
||||
* \return The sum of \c *ptr and \c value.
|
||||
*
|
||||
* \param ptr The address of the data to be modified.
|
||||
* \param value The value to be added.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/**
|
||||
* \brief Subtract \c value from the data pointed to by \c ptr and return the result.
|
||||
*
|
||||
* \return The difference between \c *ptr and \c value.
|
||||
*
|
||||
* \param ptr The address of the data to be modified.
|
||||
* \param value The value to be subtracted.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value);
|
||||
|
||||
/*@}*//*32 bit atomic operations*/
|
||||
|
||||
/**
|
||||
* \name 64 bit atomic operations
|
||||
*/
|
||||
/*@{*/
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicClear64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value);
|
||||
#endif /* SDL_HAS_64BIT_TYPE */
|
||||
|
||||
/*@}*//*64 bit atomic operations*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_atomic_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -21,8 +21,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_audio.h
|
||||
* Access to the raw audio mixing buffer for the SDL library
|
||||
* \file SDL_audio.h
|
||||
*
|
||||
* Access to the raw audio mixing buffer for the SDL library.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_audio_h
|
||||
@@ -38,113 +39,192 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* When filling in the desired audio spec structure,
|
||||
* - 'desired->freq' should be the desired audio frequency in samples-per-second.
|
||||
* - 'desired->format' should be the desired audio format.
|
||||
* - 'desired->samples' is the desired size of the audio buffer, in samples.
|
||||
* This number should be a power of two, and may be adjusted by the audio
|
||||
* driver to a value more suitable for the hardware. Good values seem to
|
||||
* range between 512 and 8096 inclusive, depending on the application and
|
||||
* CPU speed. Smaller values yield faster response time, but can lead
|
||||
* to underflow if the application is doing heavy processing and cannot
|
||||
* fill the audio buffer in time. A stereo sample consists of both right
|
||||
* and left channels in LR ordering.
|
||||
* Note that the number of samples is directly related to time by the
|
||||
* following formula: ms = (samples*1000)/freq
|
||||
* - 'desired->size' is the size in bytes of the audio buffer, and is
|
||||
* calculated by SDL_OpenAudio().
|
||||
* - 'desired->silence' is the value used to set the buffer to silence,
|
||||
* and is calculated by SDL_OpenAudio().
|
||||
* - 'desired->callback' should be set to a function that will be called
|
||||
* when the audio device is ready for more data. It is passed a pointer
|
||||
* to the audio buffer, and the length in bytes of the audio buffer.
|
||||
* This function usually runs in a separate thread, and so you should
|
||||
* protect data structures that it accesses by calling SDL_LockAudio()
|
||||
* and SDL_UnlockAudio() in your code.
|
||||
* - 'desired->userdata' is passed as the first parameter to your callback
|
||||
* function.
|
||||
*
|
||||
* @note The calculated values in this structure are calculated by SDL_OpenAudio()
|
||||
*
|
||||
* \brief Audio format flags.
|
||||
*
|
||||
* These are what the 16 bits in SDL_AudioFormat currently mean...
|
||||
* (Unspecified bits are always zero).
|
||||
*
|
||||
* \verbatim
|
||||
++-----------------------sample is signed if set
|
||||
||
|
||||
|| ++-----------sample is bigendian if set
|
||||
|| ||
|
||||
|| || ++---sample is float if set
|
||||
|| || ||
|
||||
|| || || +---sample bit size---+
|
||||
|| || || | |
|
||||
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
||||
\endverbatim
|
||||
*
|
||||
* There are macros in SDL 1.3 and later to query these bits.
|
||||
*/
|
||||
typedef struct SDL_AudioSpec {
|
||||
int freq; /**< DSP frequency -- samples per second */
|
||||
Uint16 format; /**< Audio data format */
|
||||
Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
|
||||
Uint8 silence; /**< Audio buffer silence value (calculated) */
|
||||
Uint16 samples; /**< Audio buffer size in samples (power of 2) */
|
||||
Uint16 padding; /**< Necessary for some compile environments */
|
||||
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
||||
/**
|
||||
* This function is called when the audio device needs more data.
|
||||
*
|
||||
* @param[out] stream A pointer to the audio data buffer
|
||||
* @param[in] len The length of the audio buffer in bytes.
|
||||
*
|
||||
* Once the callback returns, the buffer will no longer be valid.
|
||||
* Stereo samples are stored in a LRLRLR ordering.
|
||||
*/
|
||||
void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
|
||||
void *userdata;
|
||||
} SDL_AudioSpec;
|
||||
typedef Uint16 SDL_AudioFormat;
|
||||
|
||||
/**
|
||||
* @name Audio format flags
|
||||
* defaults to LSB byte order
|
||||
* \name Audio flags
|
||||
*/
|
||||
/*@{*/
|
||||
#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
|
||||
#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
|
||||
#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
|
||||
#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
|
||||
#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
|
||||
|
||||
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
|
||||
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
|
||||
#define SDL_AUDIO_MASK_ENDIAN (1<<12)
|
||||
#define SDL_AUDIO_MASK_SIGNED (1<<15)
|
||||
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
|
||||
#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
|
||||
#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
|
||||
#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
|
||||
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
|
||||
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
|
||||
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
|
||||
|
||||
/**
|
||||
* \name Audio format flags
|
||||
*
|
||||
* Defaults to LSB byte order.
|
||||
*/
|
||||
/*@{*/
|
||||
#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
|
||||
#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
|
||||
#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
|
||||
#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
|
||||
#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_U16 AUDIO_U16LSB
|
||||
#define AUDIO_S16 AUDIO_S16LSB
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Native audio byte ordering
|
||||
* \name int32 support
|
||||
*
|
||||
* New to SDL 1.3.
|
||||
*/
|
||||
/*@{*/
|
||||
#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */
|
||||
#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_S32 AUDIO_S32LSB
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name float32 support
|
||||
*
|
||||
* New to SDL 1.3.
|
||||
*/
|
||||
/*@{*/
|
||||
#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */
|
||||
#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_F32 AUDIO_F32LSB
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Native audio byte ordering
|
||||
*/
|
||||
/*@{*/
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define AUDIO_U16SYS AUDIO_U16LSB
|
||||
#define AUDIO_S16SYS AUDIO_S16LSB
|
||||
#define AUDIO_S32SYS AUDIO_S32LSB
|
||||
#define AUDIO_F32SYS AUDIO_F32LSB
|
||||
#else
|
||||
#define AUDIO_U16SYS AUDIO_U16MSB
|
||||
#define AUDIO_S16SYS AUDIO_S16MSB
|
||||
#define AUDIO_S32SYS AUDIO_S32MSB
|
||||
#define AUDIO_F32SYS AUDIO_F32MSB
|
||||
#endif
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Allow change flags
|
||||
*
|
||||
* Which audio format changes are allowed when opening a device.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
|
||||
#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
|
||||
#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
|
||||
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
|
||||
/*@}*/
|
||||
|
||||
/*@}*//*Audio flags*/
|
||||
|
||||
/** A structure to hold a set of audio conversion filters and buffers */
|
||||
typedef struct SDL_AudioCVT {
|
||||
int needed; /**< Set to 1 if conversion possible */
|
||||
Uint16 src_format; /**< Source audio format */
|
||||
Uint16 dst_format; /**< Target audio format */
|
||||
double rate_incr; /**< Rate conversion increment */
|
||||
Uint8 *buf; /**< Buffer to hold entire audio data */
|
||||
int len; /**< Length of original audio buffer */
|
||||
int len_cvt; /**< Length of converted audio buffer */
|
||||
int len_mult; /**< buffer must be len*len_mult big */
|
||||
double len_ratio; /**< Given len, final size is len*len_ratio */
|
||||
void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
|
||||
int filter_index; /**< Current audio conversion function */
|
||||
/**
|
||||
* This function is called when the audio device needs more data.
|
||||
*
|
||||
* \param userdata An application-specific parameter saved in
|
||||
* the SDL_AudioSpec structure
|
||||
* \param stream A pointer to the audio data buffer.
|
||||
* \param len The length of that buffer in bytes.
|
||||
*
|
||||
* Once the callback returns, the buffer will no longer be valid.
|
||||
* Stereo samples are stored in a LRLRLR ordering.
|
||||
*/
|
||||
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
||||
int len);
|
||||
|
||||
/**
|
||||
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
||||
*/
|
||||
typedef struct SDL_AudioSpec
|
||||
{
|
||||
int freq; /**< DSP frequency -- samples per second */
|
||||
SDL_AudioFormat format; /**< Audio data format */
|
||||
Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
|
||||
Uint8 silence; /**< Audio buffer silence value (calculated) */
|
||||
Uint16 samples; /**< Audio buffer size in samples (power of 2) */
|
||||
Uint16 padding; /**< Necessary for some compile environments */
|
||||
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
||||
SDL_AudioCallback callback;
|
||||
void *userdata;
|
||||
} SDL_AudioSpec;
|
||||
|
||||
|
||||
struct SDL_AudioCVT;
|
||||
typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
|
||||
SDL_AudioFormat format);
|
||||
|
||||
/**
|
||||
* A structure to hold a set of audio conversion filters and buffers.
|
||||
*/
|
||||
typedef struct SDL_AudioCVT
|
||||
{
|
||||
int needed; /**< Set to 1 if conversion possible */
|
||||
SDL_AudioFormat src_format; /**< Source audio format */
|
||||
SDL_AudioFormat dst_format; /**< Target audio format */
|
||||
double rate_incr; /**< Rate conversion increment */
|
||||
Uint8 *buf; /**< Buffer to hold entire audio data */
|
||||
int len; /**< Length of original audio buffer */
|
||||
int len_cvt; /**< Length of converted audio buffer */
|
||||
int len_mult; /**< buffer must be len*len_mult big */
|
||||
double len_ratio; /**< Given len, final size is len*len_ratio */
|
||||
SDL_AudioFilter filters[10]; /**< Filter list */
|
||||
int filter_index; /**< Current audio conversion function */
|
||||
} SDL_AudioCVT;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* @name Audio Init and Quit
|
||||
* These functions are used internally, and should not be used unless you
|
||||
* have a specific need to specify the audio driver you want to use.
|
||||
* You should normally use SDL_Init() or SDL_InitSubSystem().
|
||||
* \name Driver discovery functions
|
||||
*
|
||||
* These functions return the list of built in audio drivers, in the
|
||||
* order that they are normally initialized by default.
|
||||
*/
|
||||
/*@{*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* \name Initialization and cleanup
|
||||
*
|
||||
* \internal These functions are used internally, and should not be used unless
|
||||
* you have a specific need to specify the audio driver you want to
|
||||
* use. You should normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*/
|
||||
/*@{*/
|
||||
extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
|
||||
@@ -152,133 +232,279 @@ extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* This function fills the given character buffer with the name of the
|
||||
* current audio driver, and returns a pointer to it if the audio driver has
|
||||
* been initialized. It returns NULL if no driver has been initialized.
|
||||
* This function returns the name of the current audio driver, or NULL
|
||||
* if no driver has been initialized.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
|
||||
/**
|
||||
* This function opens the audio device with the desired parameters, and
|
||||
* returns 0 if successful, placing the actual hardware parameters in the
|
||||
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
|
||||
* data passed to the callback function will be guaranteed to be in the
|
||||
* requested format, and will be automatically converted to the hardware
|
||||
* audio format if necessary. This function returns -1 if it failed
|
||||
* to open the audio device, or couldn't set up the audio thread.
|
||||
*
|
||||
* The audio device starts out playing silence when it's opened, and should
|
||||
* be enabled for playing by calling SDL_PauseAudio(0) when you are ready
|
||||
* for your audio callback function to be called. Since the audio driver
|
||||
* may modify the requested size of the audio buffer, you should allocate
|
||||
* any local mixing buffers after you open the audio device.
|
||||
*
|
||||
* @sa SDL_AudioSpec
|
||||
* This function opens the audio device with the desired parameters, and
|
||||
* returns 0 if successful, placing the actual hardware parameters in the
|
||||
* structure pointed to by \c obtained. If \c obtained is NULL, the audio
|
||||
* data passed to the callback function will be guaranteed to be in the
|
||||
* requested format, and will be automatically converted to the hardware
|
||||
* audio format if necessary. This function returns -1 if it failed
|
||||
* to open the audio device, or couldn't set up the audio thread.
|
||||
*
|
||||
* When filling in the desired audio spec structure,
|
||||
* - \c desired->freq should be the desired audio frequency in samples-per-
|
||||
* second.
|
||||
* - \c desired->format should be the desired audio format.
|
||||
* - \c desired->samples is the desired size of the audio buffer, in
|
||||
* samples. This number should be a power of two, and may be adjusted by
|
||||
* the audio driver to a value more suitable for the hardware. Good values
|
||||
* seem to range between 512 and 8096 inclusive, depending on the
|
||||
* application and CPU speed. Smaller values yield faster response time,
|
||||
* but can lead to underflow if the application is doing heavy processing
|
||||
* and cannot fill the audio buffer in time. A stereo sample consists of
|
||||
* both right and left channels in LR ordering.
|
||||
* Note that the number of samples is directly related to time by the
|
||||
* following formula: \code ms = (samples*1000)/freq \endcode
|
||||
* - \c desired->size is the size in bytes of the audio buffer, and is
|
||||
* calculated by SDL_OpenAudio().
|
||||
* - \c desired->silence is the value used to set the buffer to silence,
|
||||
* and is calculated by SDL_OpenAudio().
|
||||
* - \c desired->callback should be set to a function that will be called
|
||||
* when the audio device is ready for more data. It is passed a pointer
|
||||
* to the audio buffer, and the length in bytes of the audio buffer.
|
||||
* This function usually runs in a separate thread, and so you should
|
||||
* protect data structures that it accesses by calling SDL_LockAudio()
|
||||
* and SDL_UnlockAudio() in your code.
|
||||
* - \c desired->userdata is passed as the first parameter to your callback
|
||||
* function.
|
||||
*
|
||||
* The audio device starts out playing silence when it's opened, and should
|
||||
* be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
|
||||
* for your audio callback function to be called. Since the audio driver
|
||||
* may modify the requested size of the audio buffer, you should allocate
|
||||
* any local mixing buffers after you open the audio device.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
|
||||
|
||||
typedef enum {
|
||||
SDL_AUDIO_STOPPED = 0,
|
||||
SDL_AUDIO_PLAYING,
|
||||
SDL_AUDIO_PAUSED
|
||||
} SDL_audiostatus;
|
||||
|
||||
/** Get the current audio state */
|
||||
extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
|
||||
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
|
||||
SDL_AudioSpec * obtained);
|
||||
|
||||
/**
|
||||
* This function pauses and unpauses the audio callback processing.
|
||||
* It should be called with a parameter of 0 after opening the audio
|
||||
* device to start playing sound. This is so you can safely initialize
|
||||
* data for your callback function after opening the audio device.
|
||||
* Silence will be written to the audio device during the pause.
|
||||
* SDL Audio Device IDs.
|
||||
*
|
||||
* A successful call to SDL_OpenAudio() is always device id 1, and legacy
|
||||
* SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
|
||||
* always returns devices >= 2 on success. The legacy calls are good both
|
||||
* for backwards compatibility and when you don't care about multiple,
|
||||
* specific, or capture devices.
|
||||
*/
|
||||
typedef Uint32 SDL_AudioDeviceID;
|
||||
|
||||
/**
|
||||
* Get the number of available devices exposed by the current driver.
|
||||
* Only valid after a successfully initializing the audio subsystem.
|
||||
* Returns -1 if an explicit list of devices can't be determined; this is
|
||||
* not an error. For example, if SDL is set up to talk to a remote audio
|
||||
* server, it can't list every one available on the Internet, but it will
|
||||
* still allow a specific host to be specified to SDL_OpenAudioDevice().
|
||||
*
|
||||
* In many common cases, when this function returns a value <= 0, it can still
|
||||
* successfully open the default device (NULL for first argument of
|
||||
* SDL_OpenAudioDevice()).
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
|
||||
|
||||
/**
|
||||
* Get the human-readable name of a specific audio device.
|
||||
* Must be a value between 0 and (number of audio devices-1).
|
||||
* Only valid after a successfully initializing the audio subsystem.
|
||||
* The values returned by this function reflect the latest call to
|
||||
* SDL_GetNumAudioDevices(); recall that function to redetect available
|
||||
* hardware.
|
||||
*
|
||||
* The string returned by this function is UTF-8 encoded, read-only, and
|
||||
* managed internally. You are not to free it. If you need to keep the
|
||||
* string for any length of time, you should make your own copy of it, as it
|
||||
* will be invalid next time any of several other SDL functions is called.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
||||
int iscapture);
|
||||
|
||||
|
||||
/**
|
||||
* Open a specific audio device. Passing in a device name of NULL requests
|
||||
* the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
|
||||
*
|
||||
* The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
|
||||
* some drivers allow arbitrary and driver-specific strings, such as a
|
||||
* hostname/IP address for a remote audio server, or a filename in the
|
||||
* diskaudio driver.
|
||||
*
|
||||
* \return 0 on error, a valid device ID that is >= 2 on success.
|
||||
*
|
||||
* SDL_OpenAudio(), unlike this function, always acts on device ID 1.
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
|
||||
*device,
|
||||
int iscapture,
|
||||
const
|
||||
SDL_AudioSpec *
|
||||
desired,
|
||||
SDL_AudioSpec *
|
||||
obtained,
|
||||
int
|
||||
allowed_changes);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \name Audio state
|
||||
*
|
||||
* Get the current audio state.
|
||||
*/
|
||||
/*@{*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_AUDIO_STOPPED = 0,
|
||||
SDL_AUDIO_PLAYING,
|
||||
SDL_AUDIO_PAUSED
|
||||
} SDL_AudioStatus;
|
||||
extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
|
||||
|
||||
extern DECLSPEC SDL_AudioStatus SDLCALL
|
||||
SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
|
||||
/*@}*//*Audio State*/
|
||||
|
||||
/**
|
||||
* \name Pause audio functions
|
||||
*
|
||||
* These functions pause and unpause the audio callback processing.
|
||||
* They should be called with a parameter of 0 after opening the audio
|
||||
* device to start playing sound. This is so you can safely initialize
|
||||
* data for your callback function after opening the audio device.
|
||||
* Silence will be written to the audio device during the pause.
|
||||
*/
|
||||
/*@{*/
|
||||
extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
|
||||
extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
|
||||
int pause_on);
|
||||
/*@}*//*Pause audio functions*/
|
||||
|
||||
/**
|
||||
* This function loads a WAVE from the data source, automatically freeing
|
||||
* that source if 'freesrc' is non-zero. For example, to load a WAVE file,
|
||||
* you could do:
|
||||
* @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode
|
||||
* This function loads a WAVE from the data source, automatically freeing
|
||||
* that source if \c freesrc is non-zero. For example, to load a WAVE file,
|
||||
* you could do:
|
||||
* \code
|
||||
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
|
||||
* \endcode
|
||||
*
|
||||
* If this function succeeds, it returns the given SDL_AudioSpec,
|
||||
* filled with the audio data format of the wave data, and sets
|
||||
* 'audio_buf' to a malloc()'d buffer containing the audio data,
|
||||
* and sets 'audio_len' to the length of that audio buffer, in bytes.
|
||||
* You need to free the audio buffer with SDL_FreeWAV() when you are
|
||||
* done with it.
|
||||
* If this function succeeds, it returns the given SDL_AudioSpec,
|
||||
* filled with the audio data format of the wave data, and sets
|
||||
* \c *audio_buf to a malloc()'d buffer containing the audio data,
|
||||
* and sets \c *audio_len to the length of that audio buffer, in bytes.
|
||||
* You need to free the audio buffer with SDL_FreeWAV() when you are
|
||||
* done with it.
|
||||
*
|
||||
* This function returns NULL and sets the SDL error message if the
|
||||
* wave file cannot be opened, uses an unknown data format, or is
|
||||
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
|
||||
* This function returns NULL and sets the SDL error message if the
|
||||
* wave file cannot be opened, uses an unknown data format, or is
|
||||
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
|
||||
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 */
|
||||
/**
|
||||
* Loads a WAV from a file.
|
||||
* Compatibility convenience function.
|
||||
*/
|
||||
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
|
||||
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
|
||||
|
||||
/**
|
||||
* This function frees data previously allocated with SDL_LoadWAV_RW()
|
||||
* 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
|
||||
* and rate, and initializes the 'cvt' structure with information needed
|
||||
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
|
||||
* to the other.
|
||||
*
|
||||
* @return This function returns 0, or -1 if there was an error.
|
||||
* This function takes a source format and rate and a destination format
|
||||
* and rate, and initializes the \c cvt structure with information needed
|
||||
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
|
||||
* to the other.
|
||||
*
|
||||
* \return -1 if the format conversion is not supported, 0 if there's
|
||||
* no conversion needed, or 1 if the audio filter is set up.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
|
||||
Uint16 src_format, Uint8 src_channels, int src_rate,
|
||||
Uint16 dst_format, Uint8 dst_channels, int dst_rate);
|
||||
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
||||
SDL_AudioFormat src_format,
|
||||
Uint8 src_channels,
|
||||
int src_rate,
|
||||
SDL_AudioFormat dst_format,
|
||||
Uint8 dst_channels,
|
||||
int dst_rate);
|
||||
|
||||
/**
|
||||
* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
|
||||
* created an audio buffer cvt->buf, and filled it with cvt->len bytes of
|
||||
* audio data in the source format, this function will convert it in-place
|
||||
* to the desired format.
|
||||
* The data conversion may expand the size of the audio data, so the buffer
|
||||
* cvt->buf should be allocated after the cvt structure is initialized by
|
||||
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
|
||||
* Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
|
||||
* created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
|
||||
* audio data in the source format, this function will convert it in-place
|
||||
* to the desired format.
|
||||
*
|
||||
* The data conversion may expand the size of the audio data, so the buffer
|
||||
* \c cvt->buf should be allocated after the \c cvt structure is initialized by
|
||||
* SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt);
|
||||
|
||||
#define SDL_MIX_MAXVOLUME 128
|
||||
/**
|
||||
* This takes two audio buffers of the playing audio format and mixes
|
||||
* them, performing addition, volume adjustment, and overflow clipping.
|
||||
* The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume. Note this does not change hardware volume.
|
||||
* This is provided for convenience -- you can mix your own audio data.
|
||||
* This takes two audio buffers of the playing audio format and mixes
|
||||
* them, performing addition, volume adjustment, and overflow clipping.
|
||||
* The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
|
||||
* for full audio volume. Note this does not change hardware volume.
|
||||
* This is provided for convenience -- you can mix your own audio data.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
|
||||
extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
|
||||
Uint32 len, int volume);
|
||||
|
||||
/**
|
||||
* @name Audio Locks
|
||||
* The lock manipulated by these functions protects the callback function.
|
||||
* During a LockAudio/UnlockAudio pair, you can be guaranteed that the
|
||||
* callback function is not running. Do not call these from the callback
|
||||
* function or you will cause deadlock.
|
||||
* This works like SDL_MixAudio(), but you specify the audio format instead of
|
||||
* using the format of audio device 1. Thus it can be used when no audio
|
||||
* device is open at all.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||
const Uint8 * src,
|
||||
SDL_AudioFormat format,
|
||||
Uint32 len, int volume);
|
||||
|
||||
/**
|
||||
* \name Audio lock functions
|
||||
*
|
||||
* The lock manipulated by these functions protects the callback function.
|
||||
* During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
|
||||
* the callback function is not running. Do not call these from the callback
|
||||
* function or you will cause deadlock.
|
||||
*/
|
||||
/*@{*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockAudio(void);
|
||||
extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
|
||||
/*@}*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev);
|
||||
/*@}*//*Audio lock functions*/
|
||||
|
||||
/**
|
||||
* This function shuts down audio processing and closes the audio device.
|
||||
* This function shuts down audio processing and closes the audio device.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
|
||||
extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* \return 1 if audio device is still functioning, zero if not, -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AudioDeviceConnected(SDL_AudioDeviceID dev);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_audio_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_cdrom.h
|
||||
* This is the CD-audio control API for Simple DirectMedia Layer
|
||||
*/
|
||||
|
||||
#ifndef _SDL_cdrom_h
|
||||
#define _SDL_cdrom_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file SDL_cdrom.h
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the SDL_INIT_CDROM flag. This causes SDL to scan the system
|
||||
* for CD-ROM drives, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
/** The maximum number of CD-ROM tracks on a disk */
|
||||
#define SDL_MAX_TRACKS 99
|
||||
|
||||
/** @name Track Types
|
||||
* The types of CD-ROM track possible
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_AUDIO_TRACK 0x00
|
||||
#define SDL_DATA_TRACK 0x04
|
||||
/*@}*/
|
||||
|
||||
/** The possible states which a CD-ROM drive can be in. */
|
||||
typedef enum {
|
||||
CD_TRAYEMPTY,
|
||||
CD_STOPPED,
|
||||
CD_PLAYING,
|
||||
CD_PAUSED,
|
||||
CD_ERROR = -1
|
||||
} CDstatus;
|
||||
|
||||
/** Given a status, returns true if there's a disk in the drive */
|
||||
#define CD_INDRIVE(status) ((int)(status) > 0)
|
||||
|
||||
typedef struct SDL_CDtrack {
|
||||
Uint8 id; /**< Track number */
|
||||
Uint8 type; /**< Data or audio track */
|
||||
Uint16 unused;
|
||||
Uint32 length; /**< Length, in frames, of this track */
|
||||
Uint32 offset; /**< Offset, in frames, from start of disk */
|
||||
} SDL_CDtrack;
|
||||
|
||||
/** This structure is only current as of the last call to SDL_CDStatus() */
|
||||
typedef struct SDL_CD {
|
||||
int id; /**< Private drive identifier */
|
||||
CDstatus status; /**< Current drive status */
|
||||
|
||||
/** The rest of this structure is only valid if there's a CD in drive */
|
||||
/*@{*/
|
||||
int numtracks; /**< Number of tracks on disk */
|
||||
int cur_track; /**< Current track position */
|
||||
int cur_frame; /**< Current frame offset within current track */
|
||||
SDL_CDtrack track[SDL_MAX_TRACKS+1];
|
||||
/*@}*/
|
||||
} SDL_CD;
|
||||
|
||||
/** @name Frames / MSF Conversion Functions
|
||||
* Conversion functions from frames to Minute/Second/Frames and vice versa
|
||||
*/
|
||||
/*@{*/
|
||||
#define CD_FPS 75
|
||||
#define FRAMES_TO_MSF(f, M,S,F) { \
|
||||
int value = f; \
|
||||
*(F) = value%CD_FPS; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = value%60; \
|
||||
value /= 60; \
|
||||
*(M) = value; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
|
||||
/*@}*/
|
||||
|
||||
/* CD-audio API functions: */
|
||||
|
||||
/**
|
||||
* Returns the number of CD-ROM drives on the system, or -1 if
|
||||
* SDL_Init() has not been called with the SDL_INIT_CDROM flag.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
|
||||
|
||||
/**
|
||||
* Returns a human-readable, system-dependent identifier for the CD-ROM.
|
||||
* Example:
|
||||
* - "/dev/cdrom"
|
||||
* - "E:"
|
||||
* - "/dev/disk/ide/1/master"
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
|
||||
|
||||
/**
|
||||
* Opens a CD-ROM drive for access. It returns a drive handle on success,
|
||||
* or NULL if the drive was invalid or busy. This newly opened CD-ROM
|
||||
* becomes the default CD used when other CD functions are passed a NULL
|
||||
* CD-ROM handle.
|
||||
* Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
|
||||
*/
|
||||
extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
|
||||
|
||||
/**
|
||||
* This function returns the current status of the given drive.
|
||||
* If the drive has a CD in it, the table of contents of the CD and current
|
||||
* play position of the CD will be stored in the SDL_CD structure.
|
||||
*/
|
||||
extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
|
||||
|
||||
/**
|
||||
* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
|
||||
* tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
|
||||
* until the end of the CD. This function will skip data tracks.
|
||||
* This function should only be called after calling SDL_CDStatus() to
|
||||
* get track information about the CD.
|
||||
* For example:
|
||||
* @code
|
||||
* // Play entire CD:
|
||||
* if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
* SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
|
||||
* // Play last track:
|
||||
* if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
|
||||
* SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
|
||||
* }
|
||||
* // Play first and second track and 10 seconds of third track:
|
||||
* if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
* SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
|
||||
* @endcode
|
||||
*
|
||||
* @return This function returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
|
||||
int start_track, int start_frame, int ntracks, int nframes);
|
||||
|
||||
/**
|
||||
* Play the given CD starting at 'start' frame for 'length' frames.
|
||||
* @return It returns 0, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
|
||||
|
||||
/** Pause play
|
||||
* @return returns 0, or -1 on error
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
|
||||
|
||||
/** Resume play
|
||||
* @return returns 0, or -1 on error
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
|
||||
|
||||
/** Stop play
|
||||
* @return returns 0, or -1 on error
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
|
||||
|
||||
/** Eject CD-ROM
|
||||
* @return returns 0, or -1 on error
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
|
||||
|
||||
/** Closes the handle for the CD-ROM drive */
|
||||
extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_video_h */
|
||||
342
alienblaster/project/jni/sdl/include/SDL_compat.h
Normal file
342
alienblaster/project/jni/sdl/include/SDL_compat.h
Normal file
@@ -0,0 +1,342 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup Compatibility SDL 1.2 Compatibility API
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \file SDL_compat.h
|
||||
*
|
||||
* This file contains functions for backwards compatibility with SDL 1.2.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def SDL_NO_COMPAT
|
||||
*
|
||||
* #define SDL_NO_COMPAT to prevent SDL_compat.h from being included.
|
||||
* SDL_NO_COMPAT is intended to make it easier to covert SDL 1.2 code to
|
||||
* SDL 1.3/2.0.
|
||||
*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#ifdef SDL_NO_COMPAT
|
||||
#define _SDL_compat_h
|
||||
#endif
|
||||
|
||||
#ifndef _SDL_compat_h
|
||||
#define _SDL_compat_h
|
||||
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_version.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup Compatibility
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \name Surface flags
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_SWSURFACE 0x00000000 /**< \note Not used */
|
||||
#define SDL_SRCALPHA 0x00010000
|
||||
#define SDL_SRCCOLORKEY 0x00020000
|
||||
#define SDL_ANYFORMAT 0x00100000
|
||||
#define SDL_HWPALETTE 0x00200000
|
||||
#define SDL_DOUBLEBUF 0x00400000
|
||||
#define SDL_FULLSCREEN 0x00800000
|
||||
#define SDL_RESIZABLE 0x01000000
|
||||
#define SDL_NOFRAME 0x02000000
|
||||
#define SDL_OPENGL 0x04000000
|
||||
#define SDL_HWSURFACE 0x08000001 /**< \note Not used */
|
||||
#define SDL_ASYNCBLIT 0x08000000 /**< \note Not used */
|
||||
#define SDL_RLEACCELOK 0x08000000 /**< \note Not used */
|
||||
#define SDL_HWACCEL 0x08000000 /**< \note Not used */
|
||||
/*@}*//*Surface flags*/
|
||||
|
||||
#define SDL_APPMOUSEFOCUS 0x01
|
||||
#define SDL_APPINPUTFOCUS 0x02
|
||||
#define SDL_APPACTIVE 0x04
|
||||
|
||||
#define SDL_LOGPAL 0x01
|
||||
#define SDL_PHYSPAL 0x02
|
||||
|
||||
#define SDL_ACTIVEEVENT SDL_EVENT_COMPAT1
|
||||
#define SDL_VIDEORESIZE SDL_EVENT_COMPAT2
|
||||
#define SDL_VIDEOEXPOSE SDL_EVENT_COMPAT3
|
||||
#define SDL_ACTIVEEVENTMASK SDL_ACTIVEEVENT, SDL_ACTIVEEVENT
|
||||
#define SDL_VIDEORESIZEMASK SDL_VIDEORESIZE, SDL_VIDEORESIZE
|
||||
#define SDL_VIDEOEXPOSEMASK SDL_VIDEOEXPOSE, SDL_VIDEOEXPOSE
|
||||
#define SDL_WINDOWEVENTMASK SDL_WINDOWEVENT, SDL_WINDOWEVENT
|
||||
#define SDL_KEYDOWNMASK SDL_KEYDOWN, SDL_KEYDOWN
|
||||
#define SDL_KEYUPMASK SDL_KEYUP, SDL_KEYUP
|
||||
#define SDL_KEYEVENTMASK SDL_KEYDOWN, SDL_KEYUP
|
||||
#define SDL_TEXTEDITINGMASK SDL_TEXTEDITING, SDL_TEXTEDITING
|
||||
#define SDL_TEXTINPUTMASK SDL_TEXTINPUT, SDL_TEXTINPUT
|
||||
#define SDL_MOUSEMOTIONMASK SDL_MOUSEMOTION, SDL_MOUSEMOTION
|
||||
#define SDL_MOUSEBUTTONDOWNMASK SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONDOWN
|
||||
#define SDL_MOUSEBUTTONUPMASK SDL_MOUSEBUTTONUP, SDL_MOUSEBUTTONUP
|
||||
#define SDL_MOUSEWHEELMASK SDL_MOUSEWHEEL, SDL_MOUSEWHEEL
|
||||
#define SDL_MOUSEEVENTMASK SDL_MOUSEMOTION, SDL_MOUSEBUTTONUP
|
||||
#define SDL_JOYAXISMOTIONMASK SDL_JOYAXISMOTION, SDL_JOYAXISMOTION
|
||||
#define SDL_JOYBALLMOTIONMASK SDL_JOYBALLMOTION, SDL_JOYBALLMOTION
|
||||
#define SDL_JOYHATMOTIONMASK SDL_JOYHATMOTION, SDL_JOYHATMOTION
|
||||
#define SDL_JOYBUTTONDOWNMASK SDL_JOYBUTTONDOWN, SDL_JOYBUTTONDOWN
|
||||
#define SDL_JOYBUTTONUPMASK SDL_JOYBUTTONUP, SDL_JOYBUTTONUP
|
||||
#define SDL_JOYEVENTMASK SDL_JOYAXISMOTION, SDL_JOYBUTTONUP
|
||||
#define SDL_QUITMASK SDL_QUIT, SDL_QUIT
|
||||
#define SDL_SYSWMEVENTMASK SDL_SYSWMEVENT, SDL_SYSWMEVENT
|
||||
#define SDL_PROXIMITYINMASK SDL_PROXIMITYIN, SDL_PROXIMITYIN
|
||||
#define SDL_PROXIMITYOUTMASK SDL_PROXIMITYOUT, SDL_PROXIMITYOUT
|
||||
#define SDL_ALLEVENTS SDL_FIRSTEVENT, SDL_LASTEVENT
|
||||
|
||||
#define SDL_BUTTON_WHEELUP 4
|
||||
#define SDL_BUTTON_WHEELDOWN 5
|
||||
|
||||
#define SDL_DEFAULT_REPEAT_DELAY 500
|
||||
#define SDL_DEFAULT_REPEAT_INTERVAL 30
|
||||
|
||||
typedef struct SDL_VideoInfo
|
||||
{
|
||||
Uint32 hw_available:1;
|
||||
Uint32 wm_available:1;
|
||||
Uint32 UnusedBits1:6;
|
||||
Uint32 UnusedBits2:1;
|
||||
Uint32 blit_hw:1;
|
||||
Uint32 blit_hw_CC:1;
|
||||
Uint32 blit_hw_A:1;
|
||||
Uint32 blit_sw:1;
|
||||
Uint32 blit_sw_CC:1;
|
||||
Uint32 blit_sw_A:1;
|
||||
Uint32 blit_fill:1;
|
||||
Uint32 UnusedBits3:16;
|
||||
Uint32 video_mem;
|
||||
|
||||
SDL_PixelFormat *vfmt;
|
||||
|
||||
int current_w;
|
||||
int current_h;
|
||||
} SDL_VideoInfo;
|
||||
|
||||
/**
|
||||
* \name Overlay formats
|
||||
*
|
||||
* The most common video overlay formats.
|
||||
*
|
||||
* For an explanation of these pixel formats, see:
|
||||
* http://www.webartz.com/fourcc/indexyuv.htm
|
||||
*
|
||||
* For information on the relationship between color spaces, see:
|
||||
* http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */
|
||||
#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */
|
||||
#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
||||
#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
||||
#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
||||
/*@}*//*Overlay formats*/
|
||||
|
||||
/**
|
||||
* The YUV hardware video overlay.
|
||||
*/
|
||||
typedef struct SDL_Overlay
|
||||
{
|
||||
Uint32 format; /**< Read-only */
|
||||
int w, h; /**< Read-only */
|
||||
int planes; /**< Read-only */
|
||||
Uint16 *pitches; /**< Read-only */
|
||||
Uint8 **pixels; /**< Read-write */
|
||||
|
||||
/**
|
||||
* \name Hardware-specific surface info
|
||||
*/
|
||||
/*@{*/
|
||||
struct private_yuvhwfuncs *hwfuncs;
|
||||
struct private_yuvhwdata *hwdata;
|
||||
/*@}*//*Hardware-specific surface info*/
|
||||
|
||||
/**
|
||||
* \name Special flags
|
||||
*/
|
||||
/*@{*/
|
||||
Uint32 hw_overlay:1; /**< Flag: This overlay hardware accelerated? */
|
||||
Uint32 UnusedBits:31;
|
||||
/*@}*//*Special flags*/
|
||||
} SDL_Overlay;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_GRAB_QUERY = -1,
|
||||
SDL_GRAB_OFF = 0,
|
||||
SDL_GRAB_ON = 1
|
||||
} SDL_GrabMode;
|
||||
|
||||
struct SDL_SysWMinfo;
|
||||
|
||||
/**
|
||||
* \name Obsolete or renamed key codes
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \name Renamed keys
|
||||
*
|
||||
* These key constants were renamed for clarity or consistency.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDLK_KP0 SDLK_KP_0
|
||||
#define SDLK_KP1 SDLK_KP_1
|
||||
#define SDLK_KP2 SDLK_KP_2
|
||||
#define SDLK_KP3 SDLK_KP_3
|
||||
#define SDLK_KP4 SDLK_KP_4
|
||||
#define SDLK_KP5 SDLK_KP_5
|
||||
#define SDLK_KP6 SDLK_KP_6
|
||||
#define SDLK_KP7 SDLK_KP_7
|
||||
#define SDLK_KP8 SDLK_KP_8
|
||||
#define SDLK_KP9 SDLK_KP_9
|
||||
#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
|
||||
#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
|
||||
#define SDLK_PRINT SDLK_PRINTSCREEN
|
||||
#define SDLK_LMETA SDLK_LGUI
|
||||
#define SDLK_RMETA SDLK_RGUI
|
||||
/*@}*//*Renamed keys*/
|
||||
|
||||
/**
|
||||
* \name META modifier
|
||||
*
|
||||
* The META modifier is equivalent to the GUI modifier from the USB standard.
|
||||
*/
|
||||
/*@{*/
|
||||
#define KMOD_LMETA KMOD_LGUI
|
||||
#define KMOD_RMETA KMOD_RGUI
|
||||
#define KMOD_META KMOD_GUI
|
||||
/*@}*//*META modifier*/
|
||||
|
||||
/**
|
||||
* \name Not in USB
|
||||
*
|
||||
* These keys don't appear in the USB specification (or at least not under
|
||||
* those names). I'm unsure if the following assignments make sense or if these
|
||||
* codes should be defined as actual additional SDLK_ constants.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDLK_LSUPER SDLK_LMETA
|
||||
#define SDLK_RSUPER SDLK_RMETA
|
||||
#define SDLK_COMPOSE SDLK_APPLICATION
|
||||
#define SDLK_BREAK SDLK_STOP
|
||||
#define SDLK_EURO SDLK_2
|
||||
/*@}*//*Not in USB*/
|
||||
|
||||
/*@}*//*Obsolete or renamed key codes*/
|
||||
|
||||
#define SDL_SetModuleHandle(x)
|
||||
#define SDL_AllocSurface SDL_CreateRGBSurface
|
||||
|
||||
extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
|
||||
extern DECLSPEC char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
|
||||
extern DECLSPEC char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
|
||||
extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
|
||||
extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
|
||||
int height,
|
||||
int bpp, Uint32 flags);
|
||||
extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes(const SDL_PixelFormat *
|
||||
format, Uint32 flags);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode(int width, int height,
|
||||
int bpp, Uint32 flags);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface(void);
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateRects(SDL_Surface * screen,
|
||||
int numrects, SDL_Rect * rects);
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateRect(SDL_Surface * screen,
|
||||
Sint32 x,
|
||||
Sint32 y, Uint32 w, Uint32 h);
|
||||
extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface * screen);
|
||||
extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface * surface,
|
||||
Uint32 flag, Uint8 alpha);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormat(SDL_Surface * surface);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
|
||||
surface);
|
||||
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
|
||||
const char *icon);
|
||||
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(const char **title,
|
||||
const char **icon);
|
||||
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
|
||||
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
|
||||
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
|
||||
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
|
||||
extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface * surface,
|
||||
int flags,
|
||||
const SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface * surface,
|
||||
const SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
extern DECLSPEC int SDLCALL SDL_GetWMInfo(struct SDL_SysWMinfo *info);
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
|
||||
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
|
||||
extern DECLSPEC SDL_Overlay *SDLCALL SDL_CreateYUVOverlay(int width,
|
||||
int height,
|
||||
Uint32 format,
|
||||
SDL_Surface *
|
||||
display);
|
||||
extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay * overlay);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay * overlay);
|
||||
extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
|
||||
SDL_Rect * dstrect);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
|
||||
extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
|
||||
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
|
||||
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
|
||||
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
|
||||
|
||||
#define SDL_TextureID SDL_Texture*
|
||||
#define SDL_WindowID SDL_Window*
|
||||
#define SDL_RenderPoint SDL_RenderDrawPoint
|
||||
#define SDL_RenderLine SDL_RenderDrawLine
|
||||
#define SDL_RenderFill(X) (X) ? SDL_RenderFillRect(X) : SDL_RenderClear()
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
|
||||
|
||||
/*@}*//*Compatibility*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_compat_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -25,19 +25,21 @@
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Add any platform that doesn't build using the configure system */
|
||||
#if defined(__DREAMCAST__)
|
||||
#include "SDL_config_dreamcast.h"
|
||||
#elif defined(__MACOS__)
|
||||
#include "SDL_config_macos.h"
|
||||
/**
|
||||
* \file SDL_config.h.default
|
||||
*
|
||||
* SDL_config.h for any platform that doesn't build using the configure system.
|
||||
*/
|
||||
|
||||
/* Add any platform that doesn't build using the configure system. */
|
||||
#if defined(__NINTENDODS__)
|
||||
#include "SDL_config_nintendods.h"
|
||||
#elif defined(__IPHONEOS__)
|
||||
#include "SDL_config_iphoneos.h"
|
||||
#elif defined(__MACOSX__)
|
||||
#include "SDL_config_macosx.h"
|
||||
#elif defined(__SYMBIAN32__)
|
||||
#include "SDL_config_symbian.h" /* must be before win32! */
|
||||
#elif defined(__WIN32__)
|
||||
#include "SDL_config_win32.h"
|
||||
#elif defined(__OS2__)
|
||||
#include "SDL_config_os2.h"
|
||||
#elif defined(ANDROID)
|
||||
#include "SDL_config_android.h"
|
||||
#else
|
||||
|
||||
@@ -25,19 +25,21 @@
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* Add any platform that doesn't build using the configure system */
|
||||
#if defined(__DREAMCAST__)
|
||||
#include "SDL_config_dreamcast.h"
|
||||
#elif defined(__MACOS__)
|
||||
#include "SDL_config_macos.h"
|
||||
/**
|
||||
* \file SDL_config.h.default
|
||||
*
|
||||
* SDL_config.h for any platform that doesn't build using the configure system.
|
||||
*/
|
||||
|
||||
/* Add any platform that doesn't build using the configure system. */
|
||||
#if defined(__NINTENDODS__)
|
||||
#include "SDL_config_nintendods.h"
|
||||
#elif defined(__IPHONEOS__)
|
||||
#include "SDL_config_iphoneos.h"
|
||||
#elif defined(__MACOSX__)
|
||||
#include "SDL_config_macosx.h"
|
||||
#elif defined(__SYMBIAN32__)
|
||||
#include "SDL_config_symbian.h" /* must be before win32! */
|
||||
#elif defined(__WIN32__)
|
||||
#include "SDL_config_win32.h"
|
||||
#elif defined(__OS2__)
|
||||
#include "SDL_config_os2.h"
|
||||
#else
|
||||
#include "SDL_config_minimal.h"
|
||||
#endif /* platform config */
|
||||
|
||||
@@ -23,7 +23,11 @@
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
/**
|
||||
* \file SDL_config.h.in
|
||||
*
|
||||
* This is a set of defines to configure the SDL features
|
||||
*/
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
@@ -39,6 +43,7 @@
|
||||
#undef volatile
|
||||
|
||||
/* C datatypes */
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#undef size_t
|
||||
#undef int8_t
|
||||
#undef uint8_t
|
||||
@@ -49,10 +54,10 @@
|
||||
#undef int64_t
|
||||
#undef uint64_t
|
||||
#undef uintptr_t
|
||||
#undef SDL_HAS_64BIT_TYPE
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
/* Endianness */
|
||||
#undef SDL_BYTEORDER
|
||||
#undef SIZEOF_VOIDP
|
||||
#undef SDL_HAS_64BIT_TYPE
|
||||
|
||||
/* Comment this if you want to build without any C library requirements */
|
||||
#undef HAVE_LIBC
|
||||
@@ -85,6 +90,7 @@
|
||||
#undef HAVE_ALLOCA
|
||||
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
|
||||
#undef HAVE_GETENV
|
||||
#undef HAVE_SETENV
|
||||
#undef HAVE_PUTENV
|
||||
#undef HAVE_UNSETENV
|
||||
#endif
|
||||
@@ -129,10 +135,24 @@
|
||||
#undef HAVE_SSCANF
|
||||
#undef HAVE_SNPRINTF
|
||||
#undef HAVE_VSNPRINTF
|
||||
#undef HAVE_ICONV
|
||||
#undef HAVE_M_PI
|
||||
#undef HAVE_CEIL
|
||||
#undef HAVE_COPYSIGN
|
||||
#undef HAVE_COS
|
||||
#undef HAVE_COSF
|
||||
#undef HAVE_FABS
|
||||
#undef HAVE_FLOOR
|
||||
#undef HAVE_LOG
|
||||
#undef HAVE_POW
|
||||
#undef HAVE_SCALBN
|
||||
#undef HAVE_SIN
|
||||
#undef HAVE_SINF
|
||||
#undef HAVE_SQRT
|
||||
#undef HAVE_SIGACTION
|
||||
#undef HAVE_SETJMP
|
||||
#undef HAVE_NANOSLEEP
|
||||
#undef HAVE_SYSCONF
|
||||
#undef HAVE_SYSCTLBYNAME
|
||||
#undef HAVE_CLOCK_GETTIME
|
||||
#undef HAVE_GETPAGESIZE
|
||||
#undef HAVE_MPROTECT
|
||||
@@ -142,80 +162,68 @@
|
||||
#include <stdarg.h>
|
||||
#endif /* HAVE_LIBC */
|
||||
|
||||
/* SDL internal assertion support */
|
||||
#undef SDL_DEFAULT_ASSERT_LEVEL
|
||||
|
||||
/* Allow disabling of core subsystems */
|
||||
#undef SDL_AUDIO_DISABLED
|
||||
#undef SDL_CDROM_DISABLED
|
||||
#undef SDL_CPUINFO_DISABLED
|
||||
#undef SDL_EVENTS_DISABLED
|
||||
#undef SDL_FILE_DISABLED
|
||||
#undef SDL_JOYSTICK_DISABLED
|
||||
#undef SDL_HAPTIC_DISABLED
|
||||
#undef SDL_LOADSO_DISABLED
|
||||
#undef SDL_THREADS_DISABLED
|
||||
#undef SDL_TIMERS_DISABLED
|
||||
#undef SDL_VIDEO_DISABLED
|
||||
#undef SDL_POWER_DISABLED
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#undef SDL_AUDIO_DRIVER_ALSA
|
||||
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_ARTS
|
||||
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_BAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_PULSEAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_BEOSAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_BSD
|
||||
#undef SDL_AUDIO_DRIVER_COREAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_DART
|
||||
#undef SDL_AUDIO_DRIVER_DC
|
||||
#undef SDL_AUDIO_DRIVER_DISK
|
||||
#undef SDL_AUDIO_DRIVER_DUMMY
|
||||
#undef SDL_AUDIO_DRIVER_DMEDIA
|
||||
#undef SDL_AUDIO_DRIVER_DSOUND
|
||||
#undef SDL_AUDIO_DRIVER_PULSE
|
||||
#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_ESD
|
||||
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_MINT
|
||||
#undef SDL_AUDIO_DRIVER_MMEAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_NAS
|
||||
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
#undef SDL_AUDIO_DRIVER_NDS
|
||||
#undef SDL_AUDIO_DRIVER_OSS
|
||||
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
|
||||
#undef SDL_AUDIO_DRIVER_PAUD
|
||||
#undef SDL_AUDIO_DRIVER_QNXNTO
|
||||
#undef SDL_AUDIO_DRIVER_SNDMGR
|
||||
#undef SDL_AUDIO_DRIVER_PAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_QSA
|
||||
#undef SDL_AUDIO_DRIVER_SUNAUDIO
|
||||
#undef SDL_AUDIO_DRIVER_WAVEOUT
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#undef SDL_CDROM_AIX
|
||||
#undef SDL_CDROM_BEOS
|
||||
#undef SDL_CDROM_BSDI
|
||||
#undef SDL_CDROM_DC
|
||||
#undef SDL_CDROM_DUMMY
|
||||
#undef SDL_CDROM_FREEBSD
|
||||
#undef SDL_CDROM_LINUX
|
||||
#undef SDL_CDROM_MACOS
|
||||
#undef SDL_CDROM_MACOSX
|
||||
#undef SDL_CDROM_MINT
|
||||
#undef SDL_CDROM_OPENBSD
|
||||
#undef SDL_CDROM_OS2
|
||||
#undef SDL_CDROM_OSF
|
||||
#undef SDL_CDROM_QNX
|
||||
#undef SDL_CDROM_WIN32
|
||||
#undef SDL_AUDIO_DRIVER_WINWAVEOUT
|
||||
#undef SDL_AUDIO_DRIVER_FUSIONSOUND
|
||||
#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
||||
|
||||
/* Enable various input drivers */
|
||||
#undef SDL_INPUT_LINUXEV
|
||||
#undef SDL_INPUT_TSLIB
|
||||
#undef SDL_JOYSTICK_BEOS
|
||||
#undef SDL_JOYSTICK_DC
|
||||
#undef SDL_JOYSTICK_DINPUT
|
||||
#undef SDL_JOYSTICK_DUMMY
|
||||
#undef SDL_JOYSTICK_IOKIT
|
||||
#undef SDL_JOYSTICK_LINUX
|
||||
#undef SDL_JOYSTICK_MACOS
|
||||
#undef SDL_JOYSTICK_MINT
|
||||
#undef SDL_JOYSTICK_OS2
|
||||
#undef SDL_JOYSTICK_NDS
|
||||
#undef SDL_JOYSTICK_RISCOS
|
||||
#undef SDL_JOYSTICK_WINMM
|
||||
#undef SDL_JOYSTICK_USBHID
|
||||
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
|
||||
#undef SDL_HAPTIC_DUMMY
|
||||
#undef SDL_HAPTIC_LINUX
|
||||
#undef SDL_HAPTIC_IOKIT
|
||||
#undef SDL_HAPTIC_DINPUT
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#undef SDL_LOADSO_BEOS
|
||||
@@ -223,15 +231,11 @@
|
||||
#undef SDL_LOADSO_DLOPEN
|
||||
#undef SDL_LOADSO_DUMMY
|
||||
#undef SDL_LOADSO_LDG
|
||||
#undef SDL_LOADSO_MACOS
|
||||
#undef SDL_LOADSO_OS2
|
||||
#undef SDL_LOADSO_WIN32
|
||||
|
||||
/* Enable various threading systems */
|
||||
#undef SDL_THREAD_BEOS
|
||||
#undef SDL_THREAD_DC
|
||||
#undef SDL_THREAD_OS2
|
||||
#undef SDL_THREAD_PTH
|
||||
#undef SDL_THREAD_NDS
|
||||
#undef SDL_THREAD_PTHREAD
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
|
||||
@@ -240,71 +244,69 @@
|
||||
|
||||
/* Enable various timer systems */
|
||||
#undef SDL_TIMER_BEOS
|
||||
#undef SDL_TIMER_DC
|
||||
#undef SDL_TIMER_DUMMY
|
||||
#undef SDL_TIMER_MACOS
|
||||
#undef SDL_TIMER_MINT
|
||||
#undef SDL_TIMER_OS2
|
||||
#undef SDL_TIMER_NDS
|
||||
#undef SDL_TIMER_RISCOS
|
||||
#undef SDL_TIMER_UNIX
|
||||
#undef SDL_TIMER_WIN32
|
||||
#undef SDL_TIMER_WINCE
|
||||
|
||||
/* Enable various video drivers */
|
||||
#undef SDL_VIDEO_DRIVER_AALIB
|
||||
#undef SDL_VIDEO_DRIVER_BWINDOW
|
||||
#undef SDL_VIDEO_DRIVER_CACA
|
||||
#undef SDL_VIDEO_DRIVER_DC
|
||||
#undef SDL_VIDEO_DRIVER_DDRAW
|
||||
#undef SDL_VIDEO_DRIVER_DGA
|
||||
#undef SDL_VIDEO_DRIVER_COCOA
|
||||
#undef SDL_VIDEO_DRIVER_DIRECTFB
|
||||
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
|
||||
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_DUMMY
|
||||
#undef SDL_VIDEO_DRIVER_FBCON
|
||||
#undef SDL_VIDEO_DRIVER_GAPI
|
||||
#undef SDL_VIDEO_DRIVER_GEM
|
||||
#undef SDL_VIDEO_DRIVER_GGI
|
||||
#undef SDL_VIDEO_DRIVER_IPOD
|
||||
#undef SDL_VIDEO_DRIVER_NANOX
|
||||
#undef SDL_VIDEO_DRIVER_OS2FS
|
||||
#undef SDL_VIDEO_DRIVER_NDS
|
||||
#undef SDL_VIDEO_DRIVER_PHOTON
|
||||
#undef SDL_VIDEO_DRIVER_PICOGUI
|
||||
#undef SDL_VIDEO_DRIVER_PS2GS
|
||||
#undef SDL_VIDEO_DRIVER_QNXGF
|
||||
#undef SDL_VIDEO_DRIVER_PS3
|
||||
#undef SDL_VIDEO_DRIVER_QTOPIA
|
||||
#undef SDL_VIDEO_DRIVER_QUARTZ
|
||||
#undef SDL_VIDEO_DRIVER_RISCOS
|
||||
#undef SDL_VIDEO_DRIVER_SVGALIB
|
||||
#undef SDL_VIDEO_DRIVER_TOOLBOX
|
||||
#undef SDL_VIDEO_DRIVER_VGL
|
||||
#undef SDL_VIDEO_DRIVER_WINDIB
|
||||
#undef SDL_VIDEO_DRIVER_WSCONS
|
||||
#undef SDL_VIDEO_DRIVER_WIN32
|
||||
#undef SDL_VIDEO_DRIVER_X11
|
||||
#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT
|
||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
|
||||
#undef SDL_VIDEO_DRIVER_X11_VIDMODE
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
|
||||
#undef SDL_VIDEO_DRIVER_X11_XME
|
||||
#undef SDL_VIDEO_DRIVER_X11_XRANDR
|
||||
#undef SDL_VIDEO_DRIVER_X11_XINPUT
|
||||
#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER
|
||||
#undef SDL_VIDEO_DRIVER_X11_XV
|
||||
#undef SDL_VIDEO_DRIVER_XBIOS
|
||||
|
||||
#undef SDL_VIDEO_RENDER_D3D
|
||||
#undef SDL_VIDEO_RENDER_GDI
|
||||
#undef SDL_VIDEO_RENDER_OGL
|
||||
#undef SDL_VIDEO_RENDER_OGL_ES
|
||||
#undef SDL_VIDEO_RENDER_X11
|
||||
#undef SDL_VIDEO_RENDER_GAPI
|
||||
#undef SDL_VIDEO_RENDER_DDRAW
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#undef SDL_VIDEO_OPENGL
|
||||
#undef SDL_VIDEO_OPENGL_ES
|
||||
#undef SDL_VIDEO_OPENGL_BGL
|
||||
#undef SDL_VIDEO_OPENGL_CGL
|
||||
#undef SDL_VIDEO_OPENGL_GLX
|
||||
#undef SDL_VIDEO_OPENGL_WGL
|
||||
#undef SDL_VIDEO_OPENGL_OSMESA
|
||||
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
|
||||
|
||||
/* Disable screensaver */
|
||||
#undef SDL_VIDEO_DISABLE_SCREENSAVER
|
||||
/* Enable system power support */
|
||||
#undef SDL_POWER_LINUX
|
||||
#undef SDL_POWER_WINDOWS
|
||||
#undef SDL_POWER_MACOSX
|
||||
#undef SDL_POWER_BEOS
|
||||
#undef SDL_POWER_NINTENDODS
|
||||
#undef SDL_POWER_HARDWIRED
|
||||
|
||||
/* Enable assembly routines */
|
||||
#undef SDL_ASSEMBLY_ROUTINES
|
||||
#undef SDL_HERMES_BLITTERS
|
||||
#undef SDL_ALTIVEC_BLITTERS
|
||||
|
||||
#endif /* _SDL_config_h */
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_minimal_h
|
||||
#define _SDL_config_minimal_h
|
||||
#ifndef _SDL_config_android_h
|
||||
#define _SDL_config_android_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
@@ -31,22 +31,37 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#define SDL_AUDIO_DRIVER_ANDROID 1
|
||||
#define SDL_VIDEO_DRIVER_ANDROID 1
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
// #define SDL_AUDIO_DRIVER_ANDROID 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1 // TODO: fix audio and remove that
|
||||
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
#define SDL_JOYSTICK_DUMMY 1 // TODO: add joystick and remove that
|
||||
#define SDL_JOYSTICK_ANDROID 1
|
||||
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
#define SDL_HAPTIC_DUMMY 1 // TODO: add vibrator and remove that
|
||||
#define SDL_HAPTIC_ANDROID 1
|
||||
|
||||
#define SDL_TIMER_UNIX 1
|
||||
#define SDL_POWER_DISABLED 1 // TODO: add battery meter and remove that
|
||||
#define SDL_POWER_ANDROID 1
|
||||
#undef SDL_POWER_LINUX
|
||||
|
||||
#define SDL_VIDEO_DRIVER_ANDROID 1
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
#define HAVE_STDIO_H 1
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
#define HAVE_STDIO_H 1
|
||||
|
||||
|
||||
#define SIZEOF_VOIDP 4
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* FireSlash found that SDL native memcpy crashes sometimes, these defines fix it (and they are faster) */
|
||||
#define HAVE_LIBC 1
|
||||
@@ -126,4 +141,23 @@
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
#define HAVE_MPROTECT 1
|
||||
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#undef HAVE_SYSCTLBYNAME
|
||||
#undef SDL_ALTIVEC_BLITTERS
|
||||
#define SDL_ASSEMBLY_ROUTINES 1 // There is no assembly code for Arm CPU yet
|
||||
|
||||
#endif /* _SDL_config_minimal_h */
|
||||
|
||||
158
alienblaster/project/jni/sdl/include/SDL_config_iphoneos.h
Normal file
158
alienblaster/project/jni/sdl/include/SDL_config_iphoneos.h
Normal file
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_iphoneos_h
|
||||
#define _SDL_config_iphoneos_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_BCOPY 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_SYSCTLBYNAME 1
|
||||
|
||||
/* enable iPhone version of Core Audio driver */
|
||||
#define SDL_AUDIO_DRIVER_COREAUDIOIPHONE 1
|
||||
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
|
||||
#define SDL_HAPTIC_DISABLED 1
|
||||
|
||||
/* Enable Unix style SO loading */
|
||||
/* Technically this works, but it violates the iPhone developer agreement */
|
||||
/* #define SDL_LOADSO_DLOPEN 1 */
|
||||
|
||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Supported video drivers */
|
||||
#define SDL_VIDEO_DRIVER_UIKIT 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
/* enable OpenGL ES */
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_UIKIT 1
|
||||
|
||||
/* enable iPhone keyboard support */
|
||||
#define SDL_IPHONE_KEYBOARD 0
|
||||
|
||||
/* Enable emulation of multiple mice through multi-touch */
|
||||
#define SDL_IPHONE_MULTIPLE_MICE 1
|
||||
|
||||
/* Set max recognized G-force from acceleromter
|
||||
See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
|
||||
*/
|
||||
#define SDL_IPHONE_MAX_GFORCE 5.0
|
||||
|
||||
#endif /* _SDL_config_iphoneos_h */
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_macos_h
|
||||
#define _SDL_config_macos_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#include <MacTypes.h>
|
||||
|
||||
typedef SInt8 int8_t;
|
||||
typedef UInt8 uint8_t;
|
||||
typedef SInt16 int16_t;
|
||||
typedef UInt16 uint16_t;
|
||||
typedef SInt32 int32_t;
|
||||
typedef UInt32 uint32_t;
|
||||
typedef SInt64 int64_t;
|
||||
typedef UInt64 uint64_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_ABS 1
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_SNDMGR 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#if TARGET_API_MAC_CARBON
|
||||
#define SDL_CDROM_DUMMY 1
|
||||
#else
|
||||
#define SDL_CDROM_MACOS 1
|
||||
#endif
|
||||
|
||||
/* Enable various input drivers */
|
||||
#if TARGET_API_MAC_CARBON
|
||||
#define SDL_JOYSTICK_DUMMY 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_MACOS 1
|
||||
#endif
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_MACOS 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_MACOS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
|
||||
#define SDL_VIDEO_DRIVER_TOOLBOX 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
|
||||
#endif /* _SDL_config_macos_h */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -30,6 +30,12 @@
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#ifdef __LP64__
|
||||
#define SIZEOF_VOIDP 8
|
||||
#else
|
||||
#define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
@@ -54,6 +60,7 @@
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
@@ -84,28 +91,35 @@
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_SYSCONF 1
|
||||
#define HAVE_SYSCTLBYNAME 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_MACOSX 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_IOKIT 1
|
||||
#define SDL_HAPTIC_IOKIT 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#ifdef __ppc__
|
||||
/* For Mac OS X 10.2 compatibility */
|
||||
#define SDL_LOADSO_DLCOMPAT 1
|
||||
#else
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
#endif
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
@@ -115,31 +129,32 @@
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_COCOA 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
|
||||
#define SDL_VIDEO_DRIVER_TOOLBOX 1
|
||||
#else
|
||||
#define SDL_VIDEO_DRIVER_QUARTZ 1
|
||||
#endif
|
||||
#define SDL_VIDEO_DRIVER_DGA 1
|
||||
#define SDL_VIDEO_DRIVER_X11 1
|
||||
#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "/usr/X11R6/lib/libXi.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.6.dylib"
|
||||
#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XME 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XINPUT 1
|
||||
#define SDL_VIDEO_DRIVER_X11_SCRNSAVER 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XV 1
|
||||
|
||||
#define SDL_VIDEO_RENDER_OGL 1
|
||||
#define SDL_VIDEO_RENDER_X11 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#define SDL_VIDEO_OPENGL_GLX 1
|
||||
#define SDL_VIDEO_OPENGL_CGL 1
|
||||
#define SDL_VIDEO_OPENGL_GLX 1
|
||||
|
||||
/* Disable screensaver */
|
||||
#define SDL_VIDEO_DISABLE_SCREENSAVER 1
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_MACOSX 1
|
||||
|
||||
/* Enable assembly routines */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -25,12 +25,15 @@
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is the minimal configuration that can be used to build SDL */
|
||||
/**
|
||||
* \file SDL_config_minimal.h
|
||||
*
|
||||
* This is the minimal configuration that can be used to build SDL.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
@@ -39,23 +42,27 @@ typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int size_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
*/
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
|
||||
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
|
||||
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
|
||||
#define SDL_HAPTIC_DISABLED 1
|
||||
|
||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
||||
/* Enable the stub thread support (src/thread/generic/\*.c) */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
#define SDL_TIMER_UNIX 1
|
||||
/* Enable the stub timer support (src/timer/dummy/\*.c) */
|
||||
#define SDL_TIMERS_DISABLED 1
|
||||
|
||||
#define SDL_VIDEO_DRIVER_ANDROID 1
|
||||
|
||||
#define HAVE_STDIO_H 1
|
||||
/* Enable the dummy video driver (src/video/dummy/\*.c) */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_minimal_h */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,13 +20,14 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_dreamcast_h
|
||||
#define _SDL_config_dreamcast_h
|
||||
#ifndef _SDL_config_nintendods_h
|
||||
#define _SDL_config_nintendods_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
@@ -35,7 +36,16 @@ typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
/* LiF: __PTRDIFF_TYPE__ was causing errors of conflicting typedefs with the
|
||||
<stdint.h> shipping with devkitARM. copied a similar ifdef from it. */
|
||||
#ifndef __PTRDIFF_TYPE__
|
||||
typedef unsigned long uintptr_t;
|
||||
#else
|
||||
typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
|
||||
#endif
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Useful headers */
|
||||
@@ -52,6 +62,7 @@ typedef unsigned long uintptr_t;
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_QSORT 1
|
||||
#define HAVE_ABS 1
|
||||
@@ -79,28 +90,32 @@ typedef unsigned long uintptr_t;
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DC 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
/* DS isn't that sophisticated */
|
||||
#define LACKS_SYS_MMAN_H 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_DC 1
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_NDS 1
|
||||
/*#define SDL_AUDIO_DRIVER_DUMMY 1 TODO: uncomment this later*/
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_DC 1
|
||||
#define SDL_JOYSTICK_NDS 1
|
||||
/*#define SDL_JOYSTICK_DUMMY 1 TODO: uncomment this later*/
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_DUMMY 1
|
||||
/* DS has no dynamic linking afaik */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_DC 1
|
||||
/*#define SDL_THREAD_NDS 1*/
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_DC 1
|
||||
#define SDL_TIMER_NDS 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DC 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_NDS 1
|
||||
/*#define SDL_VIDEO_DRIVER_DUMMY 1 TODO: uncomment this later*/
|
||||
|
||||
#endif /* _SDL_config_dreamcast_h */
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_NINTENDODS 1
|
||||
|
||||
#endif /* _SDL_config_nintendods_h */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,23 +20,17 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_nds_h
|
||||
#define _SDL_config_nds_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
/* C datatypes */
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Endianness */
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
@@ -44,21 +38,22 @@
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
@@ -68,8 +63,6 @@
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
@@ -87,29 +80,42 @@
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_NDS 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_OSS 1
|
||||
|
||||
/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
#define SDL_INPUT_LINUXEV 1
|
||||
#define SDL_INPUT_TSLIB 1
|
||||
#define SDL_JOYSTICK_LINUX 1
|
||||
#define SDL_HAPTIC_LINUX 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_NDS 1
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
||||
#define SDL_LOADSO_DISABLED 1
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
|
||||
|
||||
/* Enable the stub thread support (src/thread/generic/\*.c) */
|
||||
#define SDL_THREADS_DISABLED 1
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_NDS 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_X11 1
|
||||
#define SDL_VIDEO_DRIVER_X11_XINPUT 1
|
||||
#define SDL_VIDEO_DRIVER_PANDORA 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_NDS 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
|
||||
#endif /* _SDL_config_nds_h */
|
||||
#endif /* _SDL_config_h */
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
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 */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -27,22 +27,23 @@
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
#if defined(__GNUC__) || defined(__DMC__)
|
||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
||||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
|
||||
#define HAVE_STDINT_H 1
|
||||
#elif defined(_MSC_VER)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#endif
|
||||
@@ -53,7 +54,7 @@ typedef unsigned int uintptr_t;
|
||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
||||
#define LONG_PTR LONG
|
||||
#endif
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
#else /* !__GNUC__ && !_MSC_VER */
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
@@ -68,10 +69,17 @@ typedef unsigned int size_t;
|
||||
#endif
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif /* __GNUC__ || _MSC_VER */
|
||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||
|
||||
#ifdef _WIN64
|
||||
# define SIZEOF_VOIDP 8
|
||||
#else
|
||||
# define SIZEOF_VOIDP 4
|
||||
#endif
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
|
||||
/* Enabled for SDL 1.2 (binary compatibility) */
|
||||
#define HAVE_LIBC 1
|
||||
//#define HAVE_LIBC 1
|
||||
#ifdef HAVE_LIBC
|
||||
/* Useful headers */
|
||||
#define HAVE_STDIO_H 1
|
||||
@@ -116,6 +124,19 @@ typedef unsigned int uintptr_t;
|
||||
#define HAVE__STRICMP 1
|
||||
#define HAVE__STRNICMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_POW 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#else
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
@@ -125,22 +146,17 @@ typedef unsigned int uintptr_t;
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
||||
#endif
|
||||
#define SDL_AUDIO_DRIVER_WAVEOUT 1
|
||||
#define SDL_AUDIO_DRIVER_WINWAVEOUT 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
#else
|
||||
#define SDL_CDROM_WIN32 1
|
||||
#endif
|
||||
|
||||
/* Enable various input drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
#define SDL_JOYSTICK_DISABLED 1
|
||||
#define SDL_HAPTIC_DUMMY 1
|
||||
#else
|
||||
#define SDL_JOYSTICK_WINMM 1
|
||||
#define SDL_JOYSTICK_DINPUT 1
|
||||
#define SDL_HAPTIC_DINPUT 1
|
||||
#endif
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
@@ -157,23 +173,21 @@ typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
|
||||
/* Enable various video drivers */
|
||||
#ifdef _WIN32_WCE
|
||||
#define SDL_VIDEO_DRIVER_GAPI 1
|
||||
#endif
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_VIDEO_DRIVER_DDRAW 1
|
||||
#endif
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_WINDIB 1
|
||||
#define SDL_VIDEO_DRIVER_WIN32 1
|
||||
|
||||
#define SDL_VIDEO_RENDER_D3D 1
|
||||
#define SDL_VIDEO_RENDER_GDI 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
#ifndef _WIN32_WCE
|
||||
#define SDL_VIDEO_OPENGL 1
|
||||
#define SDL_VIDEO_OPENGL_WGL 1
|
||||
#define SDL_VIDEO_RENDER_OGL 1
|
||||
#endif
|
||||
|
||||
/* Disable screensaver */
|
||||
#define SDL_VIDEO_DISABLE_SCREENSAVER 1
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_WINDOWS 1
|
||||
|
||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
||||
#ifndef _WIN64
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,30 +20,23 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_config_os2_h
|
||||
#define _SDL_config_os2_h
|
||||
|
||||
#include "SDL_platform.h"
|
||||
#ifndef _SDL_config_h
|
||||
#define _SDL_config_h
|
||||
|
||||
/* This is a set of defines to configure the SDL features */
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int size_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
/* General platform specific identifiers */
|
||||
#include "SDL_platform.h"
|
||||
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
/* Make sure that this isn't included by Visual C++ */
|
||||
#ifdef _MSC_VER
|
||||
#error You should copy include/SDL_config.h.default to include/SDL_config.h
|
||||
#endif
|
||||
|
||||
/* Use Watcom's LIBC */
|
||||
#define HAVE_LIBC 1
|
||||
#define SDL_HAS_64BIT_TYPE 1
|
||||
#define SDL_BYTEORDER 1234
|
||||
|
||||
/* Useful headers */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIO_H 1
|
||||
#define STDC_HEADERS 1
|
||||
@@ -57,15 +50,15 @@ typedef unsigned long long uint64_t;
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_MATH_H 1
|
||||
#define HAVE_ICONV_H 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* C library functions */
|
||||
#define HAVE_MALLOC 1
|
||||
#define HAVE_CALLOC 1
|
||||
#define HAVE_REALLOC 1
|
||||
#define HAVE_FREE 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_GETENV 1
|
||||
#define HAVE_SETENV 1
|
||||
#define HAVE_PUTENV 1
|
||||
#define HAVE_UNSETENV 1
|
||||
#define HAVE_QSORT 1
|
||||
@@ -74,68 +67,60 @@ typedef unsigned long long uint64_t;
|
||||
#define HAVE_MEMSET 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
#define HAVE_MEMCMP 1
|
||||
#define HAVE_STRLEN 1
|
||||
#define HAVE_STRLCPY 1
|
||||
#define HAVE_STRLCAT 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE__STRREV 1
|
||||
#define HAVE__STRUPR 1
|
||||
#define HAVE__STRLWR 1
|
||||
#define HAVE_INDEX 1
|
||||
#define HAVE_RINDEX 1
|
||||
#define HAVE_STRCHR 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_ITOA 1
|
||||
#define HAVE__LTOA 1
|
||||
#define HAVE__UITOA 1
|
||||
#define HAVE__ULTOA 1
|
||||
#define HAVE_STRTOL 1
|
||||
#define HAVE__I64TOA 1
|
||||
#define HAVE__UI64TOA 1
|
||||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRTOD 1
|
||||
#define HAVE_STRTOULL 1
|
||||
#define HAVE_ATOI 1
|
||||
#define HAVE_ATOF 1
|
||||
#define HAVE_STRCMP 1
|
||||
#define HAVE_STRNCMP 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#define HAVE_SSCANF 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_M_PI 1
|
||||
#define HAVE_CEIL 1
|
||||
#define HAVE_COPYSIGN 1
|
||||
#define HAVE_COS 1
|
||||
#define HAVE_COSF 1
|
||||
#define HAVE_FABS 1
|
||||
#define HAVE_FLOOR 1
|
||||
#define HAVE_LOG 1
|
||||
#define HAVE_SCALBN 1
|
||||
#define HAVE_SIN 1
|
||||
#define HAVE_SINF 1
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
#define HAVE_POW 1
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_DART 1
|
||||
#define SDL_AUDIO_DRIVER_DISK 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_CDROM_DISABLED 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
#define SDL_AUDIO_DRIVER_OSS 1
|
||||
|
||||
/* Enable various cdrom drivers */
|
||||
#define SDL_CDROM_OS2 1
|
||||
#define SDL_INPUT_LINUXEV 1
|
||||
#define SDL_INPUT_TSLIB 1
|
||||
#define SDL_JOYSTICK_LINUX 1
|
||||
#define SDL_HAPTIC_LINUX 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
#define SDL_JOYSTICK_OS2 1
|
||||
#define SDL_LOADSO_DLOPEN 1
|
||||
|
||||
/* Enable various shared object loading systems */
|
||||
#define SDL_LOADSO_OS2 1
|
||||
#define SDL_THREAD_PTHREAD 1
|
||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
|
||||
|
||||
/* Enable various threading systems */
|
||||
#define SDL_THREAD_OS2 1
|
||||
#define SDL_TIMER_UNIX 1
|
||||
|
||||
/* Enable various timer systems */
|
||||
#define SDL_TIMER_OS2 1
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_PANDORA 1
|
||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
||||
#define SDL_VIDEO_OPENGL_ES 1
|
||||
|
||||
/* Enable various video drivers */
|
||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
||||
#define SDL_VIDEO_DRIVER_OS2FS 1
|
||||
|
||||
/* Enable OpenGL support */
|
||||
/* Nothing here yet for OS/2... :( */
|
||||
|
||||
/* Enable assembly routines where available */
|
||||
#define SDL_ASSEMBLY_ROUTINES 1
|
||||
|
||||
#endif /* _SDL_config_os2_h */
|
||||
#endif /* _SDL_config_h */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -19,4 +19,3 @@
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -21,8 +21,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_cpuinfo.h
|
||||
* CPU feature detection for SDL
|
||||
* \file SDL_cpuinfo.h
|
||||
*
|
||||
* CPU feature detection for SDL.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_cpuinfo_h
|
||||
@@ -33,37 +34,64 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** This function returns true if the CPU has the RDTSC instruction */
|
||||
/**
|
||||
* This function returns the number of CPU cores available.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
||||
|
||||
/**
|
||||
* This function returns true if the CPU has the RDTSC instruction.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
|
||||
|
||||
/** This function returns true if the CPU has MMX features */
|
||||
/**
|
||||
* This function returns true if the CPU has MMX features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
|
||||
/** This function returns true if the CPU has MMX Ext. features */
|
||||
/**
|
||||
* This function returns true if the CPU has MMX Ext.\ features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
|
||||
|
||||
/** This function returns true if the CPU has 3DNow features */
|
||||
/**
|
||||
* This function returns true if the CPU has 3DNow!\ features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
|
||||
|
||||
/** This function returns true if the CPU has 3DNow! Ext. features */
|
||||
/**
|
||||
* This function returns true if the CPU has 3DNow!\ Ext.\ features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
|
||||
|
||||
/** This function returns true if the CPU has SSE features */
|
||||
/**
|
||||
* This function returns true if the CPU has SSE features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
|
||||
/** This function returns true if the CPU has SSE2 features */
|
||||
/**
|
||||
* This function returns true if the CPU has SSE2 features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
|
||||
/** This function returns true if the CPU has AltiVec features */
|
||||
/**
|
||||
* This function returns true if the CPU has AltiVec features.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_cpuinfo_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -21,7 +21,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_endian.h
|
||||
* \file SDL_endian.h
|
||||
*
|
||||
* Functions for reading and writing endian-specific values
|
||||
*/
|
||||
|
||||
@@ -30,15 +31,15 @@
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/** @name SDL_ENDIANs
|
||||
* The two types of endianness
|
||||
/**
|
||||
* \name The two types of endianness
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_LIL_ENDIAN 1234
|
||||
#define SDL_BIG_ENDIAN 4321
|
||||
/*@}*/
|
||||
|
||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
||||
#if defined(__hppa__) || \
|
||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||
(defined(__MIPS__) && defined(__MISPEB__)) || \
|
||||
@@ -54,156 +55,199 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name SDL_Swap Functions
|
||||
* Use inline functions for compilers that support them, and static
|
||||
* \file SDL_endian.h
|
||||
*
|
||||
* Uses inline functions for compilers that support them, and static
|
||||
* functions for those that do not. Because these functions become
|
||||
* static for compilers that do not support inline functions, this
|
||||
* header should only be included in files that actually use them.
|
||||
*/
|
||||
/*@{*/
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
|
||||
static __inline__ Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
|
||||
return x;
|
||||
__asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#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));
|
||||
return x;
|
||||
__asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
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));
|
||||
return result;
|
||||
__asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
|
||||
return result;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x)
|
||||
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
|
||||
static __inline__ Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
__asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
|
||||
return x;
|
||||
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
static __inline__ Uint16 SDL_Swap16(Uint16 x) {
|
||||
return((x<<8)|(x>>8));
|
||||
static __inline__ Uint16
|
||||
SDL_Swap16(Uint16 x)
|
||||
{
|
||||
return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x)
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
static __inline__ Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("bswap %0" : "=r" (x) : "0" (x));
|
||||
return x;
|
||||
__asm__("bswap %0": "=r"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#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));
|
||||
return x;
|
||||
__asm__("bswapl %0": "=r"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#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,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
|
||||
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
|
||||
return result;
|
||||
__asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
|
||||
__asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
|
||||
__asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
|
||||
return result;
|
||||
}
|
||||
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x)
|
||||
#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
|
||||
static __inline__ Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
|
||||
return x;
|
||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
static __inline__ Uint32 SDL_Swap32(Uint32 x) {
|
||||
return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
|
||||
static __inline__ Uint32
|
||||
SDL_Swap32(Uint32 x)
|
||||
{
|
||||
return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
|
||||
((x >> 8) & 0x0000FF00) | (x >> 24)));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
#if defined(__GNUC__) && defined(__i386__) && \
|
||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
||||
static __inline__ Uint64 SDL_Swap64(Uint64 x)
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
static __inline__ Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
union {
|
||||
struct { Uint32 a,b; } s;
|
||||
Uint64 u;
|
||||
} v;
|
||||
v.u = x;
|
||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
|
||||
: "=r" (v.s.a), "=r" (v.s.b)
|
||||
: "0" (v.s.a), "1" (v.s.b));
|
||||
return v.u;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
Uint32 a, b;
|
||||
} s;
|
||||
Uint64 u;
|
||||
} v;
|
||||
v.u = x;
|
||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
|
||||
"1"(v.s.
|
||||
b));
|
||||
return v.u;
|
||||
}
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
static __inline__ Uint64 SDL_Swap64(Uint64 x)
|
||||
static __inline__ Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
__asm__("bswapq %0" : "=r" (x) : "0" (x));
|
||||
return x;
|
||||
__asm__("bswapq %0": "=r"(x):"0"(x));
|
||||
return x;
|
||||
}
|
||||
#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 */
|
||||
lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
||||
x >>= 32;
|
||||
hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
||||
x = SDL_Swap32(lo);
|
||||
x <<= 32;
|
||||
x |= SDL_Swap32(hi);
|
||||
return(x);
|
||||
/* Separate into high and low 32-bit values and swap them */
|
||||
lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
||||
x >>= 32;
|
||||
hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
||||
x = SDL_Swap32(lo);
|
||||
x <<= 32;
|
||||
x |= SDL_Swap32(hi);
|
||||
return (x);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/* This is mainly to keep compilers from complaining in SDL code.
|
||||
* If there is no real 64-bit datatype, then compilers will complain about
|
||||
* the fake 64-bit datatype that SDL provides when it compiles user code.
|
||||
/**
|
||||
* This is mainly to keep compilers from complaining in SDL code.
|
||||
* If there is no real 64-bit datatype, then compilers will complain about
|
||||
* the fake 64-bit datatype that SDL provides when it compiles user code.
|
||||
*/
|
||||
#define SDL_Swap64(X) (X)
|
||||
#endif /* SDL_HAS_64BIT_TYPE */
|
||||
/*@}*/
|
||||
|
||||
|
||||
static __inline__ float
|
||||
SDL_SwapFloat(float x)
|
||||
{
|
||||
union
|
||||
{
|
||||
float f;
|
||||
Uint32 ui32;
|
||||
} swapper;
|
||||
swapper.f = x;
|
||||
swapper.ui32 = SDL_Swap32(swapper.ui32);
|
||||
return swapper.f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @name SDL_SwapLE and SDL_SwapBE Functions
|
||||
* Byteswap item from the specified endianness to the native endianness
|
||||
* \name Swap to native
|
||||
* Byteswap item from the specified endianness to the native endianness.
|
||||
*/
|
||||
/*@{*/
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define SDL_SwapLE16(X) (X)
|
||||
#define SDL_SwapLE32(X) (X)
|
||||
#define SDL_SwapLE64(X) (X)
|
||||
#define SDL_SwapFloatLE(X) (X)
|
||||
#define SDL_SwapBE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapBE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapBE64(X) SDL_Swap64(X)
|
||||
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
|
||||
#else
|
||||
#define SDL_SwapLE16(X) SDL_Swap16(X)
|
||||
#define SDL_SwapLE32(X) SDL_Swap32(X)
|
||||
#define SDL_SwapLE64(X) SDL_Swap64(X)
|
||||
#define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
|
||||
#define SDL_SwapBE16(X) (X)
|
||||
#define SDL_SwapBE32(X) (X)
|
||||
#define SDL_SwapBE64(X) (X)
|
||||
#define SDL_SwapFloatBE(X) (X)
|
||||
#endif
|
||||
/*@}*/
|
||||
/*@}*//*Swap to native*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_endian_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -21,8 +21,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_error.h
|
||||
* Simple error message routines for SDL
|
||||
* \file SDL_error.h
|
||||
*
|
||||
* Simple error message routines for SDL.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_error_h
|
||||
@@ -33,40 +34,45 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Public functions
|
||||
*/
|
||||
/*@{*/
|
||||
/* Public functions */
|
||||
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);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* @name Private functions
|
||||
* @internal Private error message function - used internally
|
||||
* \name Internal error functions
|
||||
*
|
||||
* \internal
|
||||
* Private error message function - used internally.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
|
||||
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
|
||||
typedef enum {
|
||||
SDL_ENOMEM,
|
||||
SDL_EFREAD,
|
||||
SDL_EFWRITE,
|
||||
SDL_EFSEEK,
|
||||
SDL_UNSUPPORTED,
|
||||
SDL_LASTERROR
|
||||
typedef enum
|
||||
{
|
||||
SDL_ENOMEM,
|
||||
SDL_EFREAD,
|
||||
SDL_EFWRITE,
|
||||
SDL_EFSEEK,
|
||||
SDL_UNSUPPORTED,
|
||||
SDL_LASTERROR
|
||||
} SDL_errorcode;
|
||||
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
|
||||
/*@}*/
|
||||
/*@}*//*Internal error functions*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_error_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -21,8 +21,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file SDL_events.h
|
||||
* Include file for SDL event handling
|
||||
* \file SDL_events.h
|
||||
*
|
||||
* Include file for SDL event handling.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_events_h
|
||||
@@ -30,7 +31,7 @@
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_active.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_keyboard.h"
|
||||
#include "SDL_mouse.h"
|
||||
#include "SDL_joystick.h"
|
||||
@@ -39,318 +40,493 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** @name General keyboard/mouse state definitions */
|
||||
/*@{*/
|
||||
/* General keyboard/mouse state definitions */
|
||||
#define SDL_RELEASED 0
|
||||
#define SDL_PRESSED 1
|
||||
/*@}*/
|
||||
|
||||
/** Event enumerations */
|
||||
typedef enum {
|
||||
SDL_NOEVENT = 0, /**< Unused (do not remove) */
|
||||
SDL_ACTIVEEVENT, /**< Application loses/gains visibility */
|
||||
SDL_KEYDOWN, /**< Keys pressed */
|
||||
SDL_KEYUP, /**< Keys released */
|
||||
SDL_MOUSEMOTION, /**< Mouse moved */
|
||||
SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
|
||||
SDL_MOUSEBUTTONUP, /**< Mouse button released */
|
||||
SDL_JOYAXISMOTION, /**< Joystick axis motion */
|
||||
SDL_JOYBALLMOTION, /**< Joystick trackball motion */
|
||||
SDL_JOYHATMOTION, /**< Joystick hat position change */
|
||||
SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
|
||||
SDL_JOYBUTTONUP, /**< Joystick button released */
|
||||
SDL_QUIT, /**< User-requested quit */
|
||||
SDL_SYSWMEVENT, /**< System specific event */
|
||||
SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */
|
||||
SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */
|
||||
SDL_VIDEORESIZE, /**< User resized video mode */
|
||||
SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */
|
||||
SDL_EVENT_RESERVED2, /**< Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED3, /**< Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED4, /**< Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED5, /**< Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED6, /**< Reserved for future use.. */
|
||||
SDL_EVENT_RESERVED7, /**< Reserved for future use.. */
|
||||
/** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
|
||||
SDL_USEREVENT = 24,
|
||||
/** This last event is only for bounding internal arrays
|
||||
* It is the number of bits in the event mask datatype -- Uint32
|
||||
*/
|
||||
SDL_NUMEVENTS = 32
|
||||
/**
|
||||
* \brief The types of events that can be delivered.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
|
||||
|
||||
/* Application events */
|
||||
SDL_QUIT = 0x100, /**< User-requested quit */
|
||||
|
||||
/* Window events */
|
||||
SDL_WINDOWEVENT = 0x200, /**< Window state change */
|
||||
SDL_SYSWMEVENT, /**< System specific event */
|
||||
|
||||
/* Keyboard events */
|
||||
SDL_KEYDOWN = 0x300, /**< Keys pressed */
|
||||
SDL_KEYUP, /**< Keys released */
|
||||
SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
|
||||
SDL_TEXTINPUT, /**< Keyboard text input */
|
||||
|
||||
/* Mouse events */
|
||||
SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
|
||||
SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
|
||||
SDL_MOUSEBUTTONUP, /**< Mouse button released */
|
||||
SDL_MOUSEWHEEL, /**< Mouse wheel motion */
|
||||
|
||||
/* Tablet or multiple mice input device events */
|
||||
SDL_INPUTMOTION = 0x500, /**< Input moved */
|
||||
SDL_INPUTBUTTONDOWN, /**< Input button pressed */
|
||||
SDL_INPUTBUTTONUP, /**< Input button released */
|
||||
SDL_INPUTWHEEL, /**< Input wheel motion */
|
||||
SDL_INPUTPROXIMITYIN, /**< Input pen entered proximity */
|
||||
SDL_INPUTPROXIMITYOUT, /**< Input pen left proximity */
|
||||
|
||||
/* Joystick events */
|
||||
SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
|
||||
SDL_JOYBALLMOTION, /**< Joystick trackball motion */
|
||||
SDL_JOYHATMOTION, /**< Joystick hat position change */
|
||||
SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
|
||||
SDL_JOYBUTTONUP, /**< Joystick button released */
|
||||
|
||||
/* Obsolete events */
|
||||
SDL_EVENT_COMPAT1 = 0x7000, /**< SDL 1.2 events for compatibility */
|
||||
SDL_EVENT_COMPAT2,
|
||||
SDL_EVENT_COMPAT3,
|
||||
|
||||
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
|
||||
* and should be allocated with SDL_RegisterEvents()
|
||||
*/
|
||||
SDL_USEREVENT = 0x8000,
|
||||
|
||||
/**
|
||||
* This last event is only for bounding internal arrays
|
||||
*/
|
||||
SDL_LASTEVENT = 0xFFFF
|
||||
} SDL_EventType;
|
||||
|
||||
/** @name Predefined event masks */
|
||||
/*@{*/
|
||||
#define SDL_EVENTMASK(X) (1<<(X))
|
||||
typedef enum {
|
||||
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
|
||||
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
|
||||
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
|
||||
SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
|
||||
SDL_EVENTMASK(SDL_KEYUP),
|
||||
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
|
||||
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
|
||||
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
|
||||
SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
|
||||
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
|
||||
SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
|
||||
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
|
||||
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
|
||||
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
|
||||
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
|
||||
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
|
||||
SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
|
||||
SDL_EVENTMASK(SDL_JOYBALLMOTION)|
|
||||
SDL_EVENTMASK(SDL_JOYHATMOTION)|
|
||||
SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
|
||||
SDL_EVENTMASK(SDL_JOYBUTTONUP),
|
||||
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
|
||||
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
|
||||
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
|
||||
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
|
||||
} SDL_EventMask ;
|
||||
#define SDL_ALLEVENTS 0xFFFFFFFF
|
||||
/*@}*/
|
||||
/**
|
||||
* \brief Window state change event data (event.window.*)
|
||||
*/
|
||||
typedef struct SDL_WindowEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_WINDOWEVENT */
|
||||
Uint32 windowID; /**< The associated window */
|
||||
Uint8 event; /**< ::SDL_WindowEventID */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
int data1; /**< event dependent data */
|
||||
int data2; /**< event dependent data */
|
||||
} SDL_WindowEvent;
|
||||
|
||||
/** Application visibility event structure */
|
||||
typedef struct SDL_ActiveEvent {
|
||||
Uint8 type; /**< SDL_ACTIVEEVENT */
|
||||
Uint8 gain; /**< Whether given states were gained or lost (1/0) */
|
||||
Uint8 state; /**< A mask of the focus states */
|
||||
} SDL_ActiveEvent;
|
||||
|
||||
/** Keyboard event structure */
|
||||
typedef struct SDL_KeyboardEvent {
|
||||
Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */
|
||||
Uint8 which; /**< The keyboard device index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
SDL_keysym keysym;
|
||||
/**
|
||||
* \brief Keyboard button event structure (event.key.*)
|
||||
*/
|
||||
typedef struct SDL_KeyboardEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
SDL_keysym keysym; /**< The key that was pressed or released */
|
||||
} SDL_KeyboardEvent;
|
||||
|
||||
/** Mouse motion event structure */
|
||||
typedef struct SDL_MouseMotionEvent {
|
||||
Uint8 type; /**< SDL_MOUSEMOTION */
|
||||
Uint8 which; /**< The mouse device index */
|
||||
Uint8 state; /**< The current button state */
|
||||
Uint16 x, y; /**< The X/Y coordinates of the mouse */
|
||||
Sint16 xrel; /**< The relative motion in the X direction */
|
||||
Sint16 yrel; /**< The relative motion in the Y direction */
|
||||
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
|
||||
/**
|
||||
* \brief Keyboard text editing event structure (event.edit.*)
|
||||
*/
|
||||
typedef struct SDL_TextEditingEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_TEXTEDITING */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
|
||||
int start; /**< The start cursor of selected editing text */
|
||||
int length; /**< The length of selected editing text */
|
||||
} SDL_TextEditingEvent;
|
||||
|
||||
|
||||
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
|
||||
/**
|
||||
* \brief Keyboard text input event structure (event.text.*)
|
||||
*/
|
||||
typedef struct SDL_TextInputEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_TEXTINPUT */
|
||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
|
||||
} SDL_TextInputEvent;
|
||||
|
||||
/**
|
||||
* \brief Mouse motion event structure (event.motion.*)
|
||||
*/
|
||||
typedef struct SDL_MouseMotionEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_MOUSEMOTION */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint8 state; /**< The current button state */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
int x; /**< X coordinate, relative to window */
|
||||
int y; /**< Y coordinate, relative to window */
|
||||
int xrel; /**< The relative motion in the X direction */
|
||||
int yrel; /**< The relative motion in the Y direction */
|
||||
} SDL_MouseMotionEvent;
|
||||
|
||||
/** Mouse button event structure */
|
||||
typedef struct SDL_MouseButtonEvent {
|
||||
Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
|
||||
Uint8 which; /**< The mouse device index */
|
||||
Uint8 button; /**< The mouse button index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */
|
||||
/**
|
||||
* \brief Mouse button event structure (event.button.*)
|
||||
*/
|
||||
typedef struct SDL_MouseButtonEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
Uint8 button; /**< The mouse button index */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
int x; /**< X coordinate, relative to window */
|
||||
int y; /**< Y coordinate, relative to window */
|
||||
} SDL_MouseButtonEvent;
|
||||
|
||||
/** Joystick axis motion event structure */
|
||||
typedef struct SDL_JoyAxisEvent {
|
||||
Uint8 type; /**< SDL_JOYAXISMOTION */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 axis; /**< The joystick axis index */
|
||||
Sint16 value; /**< The axis value (range: -32768 to 32767) */
|
||||
/**
|
||||
* \brief Mouse wheel event structure (event.wheel.*)
|
||||
*/
|
||||
typedef struct SDL_MouseWheelEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_MOUSEWHEEL */
|
||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
||||
int x; /**< The amount scrolled horizontally */
|
||||
int y; /**< The amount scrolled vertically */
|
||||
} SDL_MouseWheelEvent;
|
||||
|
||||
/**
|
||||
* \brief Joystick axis motion event structure (event.jaxis.*)
|
||||
*/
|
||||
typedef struct SDL_JoyAxisEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_JOYAXISMOTION */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 axis; /**< The joystick axis index */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
int value; /**< The axis value (range: -32768 to 32767) */
|
||||
} SDL_JoyAxisEvent;
|
||||
|
||||
/** Joystick trackball motion event structure */
|
||||
typedef struct SDL_JoyBallEvent {
|
||||
Uint8 type; /**< SDL_JOYBALLMOTION */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 ball; /**< The joystick trackball index */
|
||||
Sint16 xrel; /**< The relative motion in the X direction */
|
||||
Sint16 yrel; /**< The relative motion in the Y direction */
|
||||
/**
|
||||
* \brief Joystick trackball motion event structure (event.jball.*)
|
||||
*/
|
||||
typedef struct SDL_JoyBallEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 ball; /**< The joystick trackball index */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
int xrel; /**< The relative motion in the X direction */
|
||||
int yrel; /**< The relative motion in the Y direction */
|
||||
} SDL_JoyBallEvent;
|
||||
|
||||
/** Joystick hat position change event structure */
|
||||
typedef struct SDL_JoyHatEvent {
|
||||
Uint8 type; /**< SDL_JOYHATMOTION */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 hat; /**< The joystick hat index */
|
||||
Uint8 value; /**< The hat position value:
|
||||
* SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
|
||||
* SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
|
||||
* SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
|
||||
* Note that zero means the POV is centered.
|
||||
*/
|
||||
/**
|
||||
* \brief Joystick hat position change event structure (event.jhat.*)
|
||||
*/
|
||||
typedef struct SDL_JoyHatEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_JOYHATMOTION */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 hat; /**< The joystick hat index */
|
||||
Uint8 value; /**< The hat position value.
|
||||
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
|
||||
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
|
||||
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
|
||||
*
|
||||
* Note that zero means the POV is centered.
|
||||
*/
|
||||
Uint8 padding1;
|
||||
} SDL_JoyHatEvent;
|
||||
|
||||
/** Joystick button event structure */
|
||||
typedef struct SDL_JoyButtonEvent {
|
||||
Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 button; /**< The joystick button index */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
/**
|
||||
* \brief Joystick button event structure (event.jbutton.*)
|
||||
*/
|
||||
typedef struct SDL_JoyButtonEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
|
||||
Uint8 which; /**< The joystick device index */
|
||||
Uint8 button; /**< The joystick button index */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
} SDL_JoyButtonEvent;
|
||||
|
||||
/** The "window resized" event
|
||||
* When you get this event, you are responsible for setting a new video
|
||||
* mode with the new width and height.
|
||||
/**
|
||||
* \brief The "quit requested" event
|
||||
*/
|
||||
typedef struct SDL_ResizeEvent {
|
||||
Uint8 type; /**< SDL_VIDEORESIZE */
|
||||
int w; /**< New width */
|
||||
int h; /**< New height */
|
||||
} SDL_ResizeEvent;
|
||||
|
||||
/** The "screen redraw" event */
|
||||
typedef struct SDL_ExposeEvent {
|
||||
Uint8 type; /**< SDL_VIDEOEXPOSE */
|
||||
} SDL_ExposeEvent;
|
||||
|
||||
/** The "quit requested" event */
|
||||
typedef struct SDL_QuitEvent {
|
||||
Uint8 type; /**< SDL_QUIT */
|
||||
typedef struct SDL_QuitEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_QUIT */
|
||||
} SDL_QuitEvent;
|
||||
|
||||
/** A user-defined event type */
|
||||
typedef struct SDL_UserEvent {
|
||||
Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */
|
||||
int code; /**< User defined event code */
|
||||
void *data1; /**< User defined data pointer */
|
||||
void *data2; /**< User defined data pointer */
|
||||
/**
|
||||
* \brief A user-defined event type (event.user.*)
|
||||
*/
|
||||
typedef struct SDL_UserEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */
|
||||
Uint32 windowID; /**< The associated window if any */
|
||||
int code; /**< User defined event code */
|
||||
void *data1; /**< User defined data pointer */
|
||||
void *data2; /**< User defined data pointer */
|
||||
} SDL_UserEvent;
|
||||
|
||||
/** If you want to use this event, you should include SDL_syswm.h */
|
||||
struct SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMEvent {
|
||||
Uint8 type;
|
||||
SDL_SysWMmsg *msg;
|
||||
|
||||
/**
|
||||
* \brief A video driver dependent system event (event.syswm.*)
|
||||
*
|
||||
* \note If you want to use this event, you should include SDL_syswm.h.
|
||||
*/
|
||||
typedef struct SDL_SysWMEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_SYSWMEVENT */
|
||||
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
||||
} SDL_SysWMEvent;
|
||||
|
||||
/** General event structure */
|
||||
typedef union SDL_Event {
|
||||
Uint8 type;
|
||||
SDL_ActiveEvent active;
|
||||
SDL_KeyboardEvent key;
|
||||
SDL_MouseMotionEvent motion;
|
||||
SDL_MouseButtonEvent button;
|
||||
SDL_JoyAxisEvent jaxis;
|
||||
SDL_JoyBallEvent jball;
|
||||
SDL_JoyHatEvent jhat;
|
||||
SDL_JoyButtonEvent jbutton;
|
||||
SDL_ResizeEvent resize;
|
||||
SDL_ExposeEvent expose;
|
||||
SDL_QuitEvent quit;
|
||||
SDL_UserEvent user;
|
||||
SDL_SysWMEvent syswm;
|
||||
#ifndef SDL_NO_COMPAT
|
||||
/**
|
||||
* \addtogroup Compatibility
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* \name Typedefs for backwards compatibility
|
||||
*/
|
||||
/*@{*/
|
||||
typedef struct SDL_ActiveEvent
|
||||
{
|
||||
Uint32 type;
|
||||
Uint8 gain;
|
||||
Uint8 state;
|
||||
} SDL_ActiveEvent;
|
||||
|
||||
typedef struct SDL_ResizeEvent
|
||||
{
|
||||
Uint32 type;
|
||||
int w;
|
||||
int h;
|
||||
} SDL_ResizeEvent;
|
||||
/*@}*/
|
||||
|
||||
/*@}*//*Compatibility*/
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief General event structure
|
||||
*/
|
||||
typedef union SDL_Event
|
||||
{
|
||||
Uint32 type; /**< Event type, shared with all events */
|
||||
SDL_WindowEvent window; /**< Window event data */
|
||||
SDL_KeyboardEvent key; /**< Keyboard event data */
|
||||
SDL_TextEditingEvent edit; /**< Text editing event data */
|
||||
SDL_TextInputEvent text; /**< Text input event data */
|
||||
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
|
||||
SDL_MouseButtonEvent button; /**< Mouse button event data */
|
||||
SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
|
||||
SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
|
||||
SDL_JoyBallEvent jball; /**< Joystick ball event data */
|
||||
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
|
||||
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
|
||||
SDL_QuitEvent quit; /**< Quit request event data */
|
||||
SDL_UserEvent user; /**< Custom event data */
|
||||
SDL_SysWMEvent syswm; /**< System dependent window event data */
|
||||
|
||||
/** Temporarily here for backwards compatibility */
|
||||
/*@{*/
|
||||
#ifndef SDL_NO_COMPAT
|
||||
SDL_ActiveEvent active;
|
||||
SDL_ResizeEvent resize;
|
||||
#endif
|
||||
/*@}*/
|
||||
} SDL_Event;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/** Pumps the event loop, gathering events from the input devices.
|
||||
/**
|
||||
* Pumps the event loop, gathering events from the input devices.
|
||||
*
|
||||
* This function updates the event queue and internal input device state.
|
||||
*
|
||||
* This should only be run in the thread that sets the video mode.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
|
||||
typedef enum {
|
||||
SDL_ADDEVENT,
|
||||
SDL_PEEKEVENT,
|
||||
SDL_GETEVENT
|
||||
/*@{*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_ADDEVENT,
|
||||
SDL_PEEKEVENT,
|
||||
SDL_GETEVENT
|
||||
} SDL_eventaction;
|
||||
|
||||
/**
|
||||
* Checks the event queue for messages and optionally returns them.
|
||||
*
|
||||
* If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
|
||||
*
|
||||
* If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
|
||||
* the back of the event queue.
|
||||
* If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
|
||||
* of the event queue, matching 'mask', will be returned and will not
|
||||
*
|
||||
* If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
|
||||
* of the event queue, matching \c mask, will be returned and will not
|
||||
* be removed from the queue.
|
||||
* If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
|
||||
* of the event queue, matching 'mask', will be returned and will be
|
||||
*
|
||||
* If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
|
||||
* of the event queue, matching \c mask, will be returned and will be
|
||||
* removed from the queue.
|
||||
*
|
||||
* @return
|
||||
* This function returns the number of events actually stored, or -1
|
||||
* if there was an error.
|
||||
*
|
||||
*
|
||||
* \return The number of events actually stored, or -1 if there was an error.
|
||||
*
|
||||
* This function is thread-safe.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
|
||||
SDL_eventaction action, Uint32 mask);
|
||||
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
||||
SDL_eventaction action,
|
||||
Uint32 minType, Uint32 maxType);
|
||||
/*@}*/
|
||||
|
||||
/** Polls for currently pending events, and returns 1 if there are any pending
|
||||
* events, or 0 if there are none available. If 'event' is not NULL, the next
|
||||
* event is removed from the queue and stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
|
||||
/** Waits indefinitely for the next available event, returning 1, or 0 if there
|
||||
* was an error while waiting for events. If 'event' is not NULL, the next
|
||||
* event is removed from the queue and stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
|
||||
/** Add an event to the event queue.
|
||||
* This function returns 0 on success, or -1 if the event queue was full
|
||||
* or there was some other error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
|
||||
/** @name Event Filtering */
|
||||
/*@{*/
|
||||
typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
|
||||
/**
|
||||
* This function sets up a filter to process all events before they
|
||||
* change internal state and are posted to the internal event queue.
|
||||
*
|
||||
* The filter is protypted as:
|
||||
* @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode
|
||||
*
|
||||
* If the filter returns 1, then the event will be added to the internal queue.
|
||||
* If it returns 0, then the event will be dropped from the queue, but the
|
||||
* internal state will still be updated. This allows selective filtering of
|
||||
* dynamically arriving events.
|
||||
*
|
||||
* @warning Be very careful of what you do in the event filter function, as
|
||||
* it may run in a different thread!
|
||||
*
|
||||
* There is one caveat when dealing with the SDL_QUITEVENT event type. The
|
||||
* event filter is only called when the window manager desires to close the
|
||||
* application window. If the event filter returns 1, then the window will
|
||||
* be closed, otherwise the window will remain open if possible.
|
||||
* If the quit event is generated by an interrupt signal, it will bypass the
|
||||
* internal queue and be delivered to the application at the next event poll.
|
||||
* Checks to see if certain event types are in the event queue.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
|
||||
/**
|
||||
* This function clears events from the event queue
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
||||
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
||||
|
||||
/**
|
||||
* \brief Polls for currently pending events.
|
||||
*
|
||||
* \return 1 if there are any pending events, or 0 if there are none available.
|
||||
*
|
||||
* \param event If not NULL, the next event is removed from the queue and
|
||||
* stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
|
||||
|
||||
/**
|
||||
* \brief Waits indefinitely for the next available event.
|
||||
*
|
||||
* \return 1, or 0 if there was an error while waiting for events.
|
||||
*
|
||||
* \param event If not NULL, the next event is removed from the queue and
|
||||
* stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
|
||||
|
||||
/**
|
||||
* \brief Waits until the specified timeout (in milliseconds) for the next
|
||||
* available event.
|
||||
*
|
||||
* \return 1, or 0 if there was an error while waiting for events.
|
||||
*
|
||||
* \param event If not NULL, the next event is removed from the queue and
|
||||
* stored in that area.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
|
||||
int timeout);
|
||||
|
||||
/**
|
||||
* \brief Add an event to the event queue.
|
||||
*
|
||||
* \return 1 on success, 0 if the event was filtered, or -1 if the event queue
|
||||
* was full or there was some other error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
|
||||
|
||||
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
||||
|
||||
/**
|
||||
* Sets up a filter to process all events before they change internal state and
|
||||
* are posted to the internal event queue.
|
||||
*
|
||||
* The filter is protypted as:
|
||||
* \code
|
||||
* int SDL_EventFilter(void *userdata, SDL_Event * event);
|
||||
* \endcode
|
||||
*
|
||||
* If the filter returns 1, then the event will be added to the internal queue.
|
||||
* If it returns 0, then the event will be dropped from the queue, but the
|
||||
* internal state will still be updated. This allows selective filtering of
|
||||
* dynamically arriving events.
|
||||
*
|
||||
* \warning Be very careful of what you do in the event filter function, as
|
||||
* it may run in a different thread!
|
||||
*
|
||||
* There is one caveat when dealing with the ::SDL_QUITEVENT event type. The
|
||||
* event filter is only called when the window manager desires to close the
|
||||
* application window. If the event filter returns 1, then the window will
|
||||
* be closed, otherwise the window will remain open if possible.
|
||||
*
|
||||
* If the quit event is generated by an interrupt signal, it will bypass the
|
||||
* internal queue and be delivered to the application at the next event poll.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
|
||||
void *userdata);
|
||||
|
||||
/**
|
||||
* Return the current event filter - can be used to "chain" filters.
|
||||
* If there is no event filter set, this function returns NULL.
|
||||
* If there is no event filter set, this function returns SDL_FALSE.
|
||||
*/
|
||||
extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
|
||||
/*@}*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
|
||||
void **userdata);
|
||||
|
||||
/**
|
||||
* Run the filter function on the current event queue, removing any
|
||||
* events for which the filter returns 0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
||||
void *userdata);
|
||||
|
||||
/** @name Event State */
|
||||
/*@{*/
|
||||
#define SDL_QUERY -1
|
||||
#define SDL_IGNORE 0
|
||||
#define SDL_DISABLE 0
|
||||
#define SDL_ENABLE 1
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* This function allows you to set the state of processing certain events.
|
||||
* If 'state' is set to SDL_IGNORE, that event will be automatically dropped
|
||||
* from the event queue and will not event be filtered.
|
||||
* If 'state' is set to SDL_ENABLE, that event will be processed normally.
|
||||
* If 'state' is set to SDL_QUERY, SDL_EventState() will return the
|
||||
* current processing state of the specified event.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
|
||||
* This function allows you to set the state of processing certain events.
|
||||
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
|
||||
* dropped from the event queue and will not event be filtered.
|
||||
* - If \c state is set to ::SDL_ENABLE, that event will be processed
|
||||
* normally.
|
||||
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
|
||||
* current processing state of the specified event.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
|
||||
/*@}*/
|
||||
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
|
||||
|
||||
/**
|
||||
* This function allocates a set of user-defined events, and returns
|
||||
* the beginning event number for that set of events.
|
||||
*
|
||||
* If there aren't enough user-defined events left, this function
|
||||
* returns (Uint32)-1
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_events_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
1123
alienblaster/project/jni/sdl/include/SDL_haptic.h
Normal file
1123
alienblaster/project/jni/sdl/include/SDL_haptic.h
Normal file
File diff suppressed because it is too large
Load Diff
88
alienblaster/project/jni/sdl/include/SDL_input.h
Normal file
88
alienblaster/project/jni/sdl/include/SDL_input.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_input.h
|
||||
*
|
||||
* Include file for lowlevel SDL input device handling.
|
||||
*
|
||||
* This talks about individual devices, and not the system cursor. If you
|
||||
* just want to know when the user moves the pointer somewhere in your
|
||||
* window, this is NOT the API you want. This one handles things like
|
||||
* multi-touch, drawing tablets, and multiple, separate mice.
|
||||
*
|
||||
* The other API is in SDL_mouse.h
|
||||
*/
|
||||
|
||||
#ifndef _SDL_input_h
|
||||
#define _SDL_input_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_video.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* !!! FIXME: real documentation
|
||||
* - Redetect devices
|
||||
* - This invalidates all existing device information from previous queries!
|
||||
* - There is an implicit (re)detect upon SDL_Init().
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RedetectInputDevices(void);
|
||||
|
||||
/**
|
||||
* \brief Get the number of mouse input devices available.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumInputDevices(void);
|
||||
|
||||
/**
|
||||
* \brief Gets the name of a device with the given index.
|
||||
*
|
||||
* \param index is the index of the device, whose name is to be returned.
|
||||
*
|
||||
* \return the name of the device with the specified index
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetInputDeviceName(int index);
|
||||
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_IsDeviceDisconnected(int index);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mouse_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,7 +20,9 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_joystick.h
|
||||
/**
|
||||
* \file SDL_joystick.h
|
||||
*
|
||||
* Include file for SDL joystick event handling
|
||||
*/
|
||||
|
||||
@@ -33,109 +35,111 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** @file SDL_joystick.h
|
||||
* @note In order to use these functions, SDL_Init() must have been called
|
||||
* with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* for joysticks, and load appropriate drivers.
|
||||
/**
|
||||
* \file SDL_joystick.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* for joysticks, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
/** The joystick structure used to identify an SDL joystick */
|
||||
/* The joystick structure used to identify an SDL joystick */
|
||||
struct _SDL_Joystick;
|
||||
typedef struct _SDL_Joystick SDL_Joystick;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
/**
|
||||
* Count the number of joysticks attached to the system
|
||||
* Count the number of joysticks attached to the system
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
*
|
||||
* This can be called before any joysticks are opened.
|
||||
* If no name can be found, this function returns NULL.
|
||||
* Get the implementation dependent name of a joystick.
|
||||
* This can be called before any joysticks are opened.
|
||||
* If no name can be found, this function returns NULL.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
|
||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(int device_index);
|
||||
|
||||
/**
|
||||
* Open a joystick for use.
|
||||
*
|
||||
* @param[in] device_index
|
||||
* The index passed as an argument refers to
|
||||
* the N'th joystick on the system. This index is the value which will
|
||||
* identify this joystick in future joystick events.
|
||||
*
|
||||
* @return This function returns a joystick identifier, or NULL if an error occurred.
|
||||
* Open a joystick for use.
|
||||
* The index passed as an argument refers tothe N'th joystick on the system.
|
||||
* This index is the value which will identify this joystick in future joystick
|
||||
* events.
|
||||
*
|
||||
* \return A joystick identifier, or NULL if an error occurred.
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
|
||||
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);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* Joystick trackballs have only relative motion events associated
|
||||
* with them and their state cannot be polled.
|
||||
* Get the number of trackballs on a joystick.
|
||||
*
|
||||
* Joystick trackballs have only relative motion events associated
|
||||
* with them and their state cannot be polled.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
|
||||
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.
|
||||
*
|
||||
* This is called automatically by the event loop if any joystick
|
||||
* events are enabled.
|
||||
* Update the current state of the open joysticks.
|
||||
*
|
||||
* This is called automatically by the event loop if any joystick
|
||||
* events are enabled.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
||||
|
||||
/**
|
||||
* Enable/disable joystick event polling.
|
||||
*
|
||||
* If joystick events are disabled, you must call SDL_JoystickUpdate()
|
||||
* yourself and check the state of the joystick when you want joystick
|
||||
* information.
|
||||
*
|
||||
* @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
|
||||
* Enable/disable joystick event polling.
|
||||
*
|
||||
* If joystick events are disabled, you must call SDL_JoystickUpdate()
|
||||
* yourself and check the state of the joystick when you want joystick
|
||||
* information.
|
||||
*
|
||||
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
||||
|
||||
/**
|
||||
* Get the current state of an axis control on a joystick
|
||||
*
|
||||
* @param[in] axis The axis indices start at index 0.
|
||||
*
|
||||
* @return The state is a value ranging from -32768 to 32767.
|
||||
* Get the current state of an axis control on a joystick.
|
||||
*
|
||||
* The state is a value ranging from -32768 to 32767.
|
||||
*
|
||||
* The axis indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
|
||||
int axis);
|
||||
|
||||
/**
|
||||
* @name Hat Positions
|
||||
* The return value of SDL_JoystickGetHat() is one of the following positions:
|
||||
* \name Hat positions
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_HAT_CENTERED 0x00
|
||||
@@ -149,39 +153,57 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int a
|
||||
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Get the current state of a POV hat on a joystick
|
||||
/**
|
||||
* Get the current state of a POV hat on a joystick.
|
||||
*
|
||||
* @param[in] hat The hat indices start at index 0.
|
||||
* The hat indices start at index 0.
|
||||
*
|
||||
* \return The return value is one of the following positions:
|
||||
* - ::SDL_HAT_CENTERED
|
||||
* - ::SDL_HAT_UP
|
||||
* - ::SDL_HAT_RIGHT
|
||||
* - ::SDL_HAT_DOWN
|
||||
* - ::SDL_HAT_LEFT
|
||||
* - ::SDL_HAT_RIGHTUP
|
||||
* - ::SDL_HAT_RIGHTDOWN
|
||||
* - ::SDL_HAT_LEFTUP
|
||||
* - ::SDL_HAT_LEFTDOWN
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick,
|
||||
int hat);
|
||||
|
||||
/**
|
||||
* Get the ball axis change since the last poll
|
||||
*
|
||||
* @param[in] ball The ball indices start at index 0.
|
||||
*
|
||||
* @return This returns 0, or -1 if you passed it invalid parameters.
|
||||
* Get the ball axis change since the last poll.
|
||||
*
|
||||
* \return 0, or -1 if you passed it invalid parameters.
|
||||
*
|
||||
* The ball indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
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
|
||||
*
|
||||
* @param[in] button The button indices start at index 0.
|
||||
* Get the current state of a button on a joystick.
|
||||
*
|
||||
* The button indices start at index 0.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
|
||||
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++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_joystick_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,7 +20,9 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_keyboard.h
|
||||
/**
|
||||
* \file SDL_keyboard.h
|
||||
*
|
||||
* Include file for SDL keyboard event handling
|
||||
*/
|
||||
|
||||
@@ -30,106 +32,139 @@
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_keysym.h"
|
||||
#include "SDL_video.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** Keysym structure
|
||||
*
|
||||
* - The scancode is hardware dependent, and should not be used by general
|
||||
* applications. If no hardware scancode is available, it will be 0.
|
||||
*
|
||||
* - The 'unicode' translated character is only available when character
|
||||
* translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
|
||||
* this is a UNICODE character corresponding to the keypress. If the
|
||||
* high 9 bits of the character are 0, then this maps to the equivalent
|
||||
* ASCII character:
|
||||
* @code
|
||||
* char ch;
|
||||
* if ( (keysym.unicode & 0xFF80) == 0 ) {
|
||||
* ch = keysym.unicode & 0x7F;
|
||||
* } else {
|
||||
* An international character..
|
||||
* }
|
||||
* @endcode
|
||||
/**
|
||||
* \brief The SDL keysym structure, used in key events.
|
||||
*/
|
||||
typedef struct SDL_keysym {
|
||||
Uint8 scancode; /**< hardware specific scancode */
|
||||
SDLKey sym; /**< SDL virtual keysym */
|
||||
SDLMod mod; /**< current key modifiers */
|
||||
Uint16 unicode; /**< translated character */
|
||||
typedef struct SDL_keysym
|
||||
{
|
||||
SDL_scancode scancode; /**< SDL physical key code - see ::SDL_scancode for details */
|
||||
SDLKey sym; /**< SDL virtual key code - see ::SDLKey for details */
|
||||
Uint16 mod; /**< current key modifiers */
|
||||
Uint32 unicode; /**< \deprecated use SDL_TextInputEvent instead */
|
||||
} SDL_keysym;
|
||||
|
||||
/** This is the mask which refers to all hotkey bindings */
|
||||
#define SDL_ALL_HOTKEYS 0xFFFFFFFF
|
||||
|
||||
/* Function prototypes */
|
||||
/**
|
||||
* Enable/Disable UNICODE translation of keyboard input.
|
||||
*
|
||||
* This translation has some overhead, so translation defaults off.
|
||||
*
|
||||
* @param[in] enable
|
||||
* If 'enable' is 1, translation is enabled.
|
||||
* If 'enable' is 0, translation is disabled.
|
||||
* If 'enable' is -1, the translation state is not changed.
|
||||
*
|
||||
* @return It returns the previous state of keyboard translation.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
|
||||
|
||||
#define SDL_DEFAULT_REPEAT_DELAY 500
|
||||
#define SDL_DEFAULT_REPEAT_INTERVAL 30
|
||||
/**
|
||||
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
|
||||
*
|
||||
* @param[in] delay
|
||||
* 'delay' is the initial delay in ms between the time when a key is
|
||||
* pressed, and keyboard repeat begins.
|
||||
*
|
||||
* @param[in] interval
|
||||
* 'interval' is the time in ms between keyboard repeat events.
|
||||
*
|
||||
* If 'delay' is set to 0, keyboard repeat is disabled.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
|
||||
extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
|
||||
|
||||
/**
|
||||
* Get a snapshot of the current state of the keyboard.
|
||||
* Returns an array of keystates, indexed by the SDLK_* syms.
|
||||
* Usage:
|
||||
* @code
|
||||
* Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
* if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed.
|
||||
* @endcode
|
||||
* \brief Get the window which currently has keyboard focus.
|
||||
*/
|
||||
extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
|
||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
||||
|
||||
/**
|
||||
* Get the current key modifier state
|
||||
* \brief Get a snapshot of the current state of the keyboard.
|
||||
*
|
||||
* \param numkeys if non-NULL, receives the length of the returned array.
|
||||
*
|
||||
* \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values.
|
||||
*
|
||||
* \b Example:
|
||||
* \code
|
||||
* Uint8 *state = SDL_GetKeyboardState(NULL);
|
||||
* if ( state[SDL_SCANCODE_RETURN] ) {
|
||||
* printf("<RETURN> is pressed.\n");
|
||||
* }
|
||||
* \endcode
|
||||
*/
|
||||
extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
|
||||
/**
|
||||
* \brief Get the current key modifier state for the keyboard.
|
||||
*/
|
||||
extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
|
||||
|
||||
/**
|
||||
* Set the current key modifier state.
|
||||
* This does not change the keyboard state, only the key modifier flags.
|
||||
* \brief Set the current key modifier state for the keyboard.
|
||||
*
|
||||
* \note This does not change the keyboard state, only the key modifier flags.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
|
||||
|
||||
/**
|
||||
* Get the name of an SDL virtual keysym
|
||||
* \brief Get the key code corresponding to the given scancode according
|
||||
* to the current keyboard layout.
|
||||
*
|
||||
* See ::SDLKey for details.
|
||||
*
|
||||
* \sa SDL_GetKeyName()
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
|
||||
extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode);
|
||||
|
||||
/**
|
||||
* \brief Get the scancode corresponding to the given key code according to the
|
||||
* current keyboard layout.
|
||||
*
|
||||
* See ::SDL_scancode for details.
|
||||
*
|
||||
* \sa SDL_GetScancodeName()
|
||||
*/
|
||||
extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
|
||||
|
||||
/**
|
||||
* \brief Get a human-readable name for a scancode.
|
||||
*
|
||||
* \return A pointer to a UTF-8 string that stays valid at least until the next
|
||||
* call to this function. If you need it around any longer, you must
|
||||
* copy it. If the scancode doesn't have a name, this function returns
|
||||
* an empty string ("").
|
||||
*
|
||||
* \sa SDL_scancode
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode
|
||||
scancode);
|
||||
|
||||
/**
|
||||
* \brief Get a human-readable name for a key.
|
||||
*
|
||||
* \return A pointer to a UTF-8 string that stays valid at least until the next
|
||||
* call to this function. If you need it around any longer, you must
|
||||
* copy it. If the key doesn't have a name, this function returns an
|
||||
* empty string ("").
|
||||
*
|
||||
* \sa SDLKey
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
|
||||
|
||||
/**
|
||||
* \brief Start accepting Unicode text input events.
|
||||
*
|
||||
* \sa SDL_StopTextInput()
|
||||
* \sa SDL_SetTextInputRect()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
||||
|
||||
/**
|
||||
* \brief Stop receiving any text input events.
|
||||
*
|
||||
* \sa SDL_StartTextInput()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
||||
|
||||
/**
|
||||
* \brief Set the rectangle used to type Unicode text inputs.
|
||||
*
|
||||
* \sa SDL_StartTextInput()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_keyboard_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,307 +20,323 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_keysym.h
|
||||
*
|
||||
* Defines constants which identify keyboard keys and modifiers.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_keysym_h
|
||||
#define _SDL_keysym_h
|
||||
|
||||
/** What we really want is a mapping of every raw key on the keyboard.
|
||||
* To support international keyboards, we use the range 0xA1 - 0xFF
|
||||
* as international virtual keycodes. We'll follow in the footsteps of X11...
|
||||
* @brief The names of the keys
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_scancode.h"
|
||||
|
||||
/**
|
||||
* \brief The SDL virtual key representation.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys using the current
|
||||
* layout of the keyboard. These values include Unicode values representing
|
||||
* the unmodified character that would be generated by pressing the key, or
|
||||
* an SDLK_* constant for those keys that do not generate characters.
|
||||
*/
|
||||
typedef enum {
|
||||
/** @name ASCII mapped keysyms
|
||||
* The keyboard syms have been cleverly chosen to map to ASCII
|
||||
*/
|
||||
/*@{*/
|
||||
SDLK_UNKNOWN = 0,
|
||||
SDLK_FIRST = 0,
|
||||
SDLK_BACKSPACE = 8,
|
||||
SDLK_TAB = 9,
|
||||
SDLK_CLEAR = 12,
|
||||
SDLK_RETURN = 13,
|
||||
SDLK_PAUSE = 19,
|
||||
SDLK_ESCAPE = 27,
|
||||
SDLK_SPACE = 32,
|
||||
SDLK_EXCLAIM = 33,
|
||||
SDLK_QUOTEDBL = 34,
|
||||
SDLK_HASH = 35,
|
||||
SDLK_DOLLAR = 36,
|
||||
SDLK_AMPERSAND = 38,
|
||||
SDLK_QUOTE = 39,
|
||||
SDLK_LEFTPAREN = 40,
|
||||
SDLK_RIGHTPAREN = 41,
|
||||
SDLK_ASTERISK = 42,
|
||||
SDLK_PLUS = 43,
|
||||
SDLK_COMMA = 44,
|
||||
SDLK_MINUS = 45,
|
||||
SDLK_PERIOD = 46,
|
||||
SDLK_SLASH = 47,
|
||||
SDLK_0 = 48,
|
||||
SDLK_1 = 49,
|
||||
SDLK_2 = 50,
|
||||
SDLK_3 = 51,
|
||||
SDLK_4 = 52,
|
||||
SDLK_5 = 53,
|
||||
SDLK_6 = 54,
|
||||
SDLK_7 = 55,
|
||||
SDLK_8 = 56,
|
||||
SDLK_9 = 57,
|
||||
SDLK_COLON = 58,
|
||||
SDLK_SEMICOLON = 59,
|
||||
SDLK_LESS = 60,
|
||||
SDLK_EQUALS = 61,
|
||||
SDLK_GREATER = 62,
|
||||
SDLK_QUESTION = 63,
|
||||
SDLK_AT = 64,
|
||||
/*
|
||||
Skip uppercase letters
|
||||
*/
|
||||
SDLK_LEFTBRACKET = 91,
|
||||
SDLK_BACKSLASH = 92,
|
||||
SDLK_RIGHTBRACKET = 93,
|
||||
SDLK_CARET = 94,
|
||||
SDLK_UNDERSCORE = 95,
|
||||
SDLK_BACKQUOTE = 96,
|
||||
SDLK_a = 97,
|
||||
SDLK_b = 98,
|
||||
SDLK_c = 99,
|
||||
SDLK_d = 100,
|
||||
SDLK_e = 101,
|
||||
SDLK_f = 102,
|
||||
SDLK_g = 103,
|
||||
SDLK_h = 104,
|
||||
SDLK_i = 105,
|
||||
SDLK_j = 106,
|
||||
SDLK_k = 107,
|
||||
SDLK_l = 108,
|
||||
SDLK_m = 109,
|
||||
SDLK_n = 110,
|
||||
SDLK_o = 111,
|
||||
SDLK_p = 112,
|
||||
SDLK_q = 113,
|
||||
SDLK_r = 114,
|
||||
SDLK_s = 115,
|
||||
SDLK_t = 116,
|
||||
SDLK_u = 117,
|
||||
SDLK_v = 118,
|
||||
SDLK_w = 119,
|
||||
SDLK_x = 120,
|
||||
SDLK_y = 121,
|
||||
SDLK_z = 122,
|
||||
SDLK_DELETE = 127,
|
||||
/* End of ASCII mapped keysyms */
|
||||
/*@}*/
|
||||
typedef Sint32 SDLKey;
|
||||
|
||||
/** @name International keyboard syms */
|
||||
/*@{*/
|
||||
SDLK_WORLD_0 = 160, /* 0xA0 */
|
||||
SDLK_WORLD_1 = 161,
|
||||
SDLK_WORLD_2 = 162,
|
||||
SDLK_WORLD_3 = 163,
|
||||
SDLK_WORLD_4 = 164,
|
||||
SDLK_WORLD_5 = 165,
|
||||
SDLK_WORLD_6 = 166,
|
||||
SDLK_WORLD_7 = 167,
|
||||
SDLK_WORLD_8 = 168,
|
||||
SDLK_WORLD_9 = 169,
|
||||
SDLK_WORLD_10 = 170,
|
||||
SDLK_WORLD_11 = 171,
|
||||
SDLK_WORLD_12 = 172,
|
||||
SDLK_WORLD_13 = 173,
|
||||
SDLK_WORLD_14 = 174,
|
||||
SDLK_WORLD_15 = 175,
|
||||
SDLK_WORLD_16 = 176,
|
||||
SDLK_WORLD_17 = 177,
|
||||
SDLK_WORLD_18 = 178,
|
||||
SDLK_WORLD_19 = 179,
|
||||
SDLK_WORLD_20 = 180,
|
||||
SDLK_WORLD_21 = 181,
|
||||
SDLK_WORLD_22 = 182,
|
||||
SDLK_WORLD_23 = 183,
|
||||
SDLK_WORLD_24 = 184,
|
||||
SDLK_WORLD_25 = 185,
|
||||
SDLK_WORLD_26 = 186,
|
||||
SDLK_WORLD_27 = 187,
|
||||
SDLK_WORLD_28 = 188,
|
||||
SDLK_WORLD_29 = 189,
|
||||
SDLK_WORLD_30 = 190,
|
||||
SDLK_WORLD_31 = 191,
|
||||
SDLK_WORLD_32 = 192,
|
||||
SDLK_WORLD_33 = 193,
|
||||
SDLK_WORLD_34 = 194,
|
||||
SDLK_WORLD_35 = 195,
|
||||
SDLK_WORLD_36 = 196,
|
||||
SDLK_WORLD_37 = 197,
|
||||
SDLK_WORLD_38 = 198,
|
||||
SDLK_WORLD_39 = 199,
|
||||
SDLK_WORLD_40 = 200,
|
||||
SDLK_WORLD_41 = 201,
|
||||
SDLK_WORLD_42 = 202,
|
||||
SDLK_WORLD_43 = 203,
|
||||
SDLK_WORLD_44 = 204,
|
||||
SDLK_WORLD_45 = 205,
|
||||
SDLK_WORLD_46 = 206,
|
||||
SDLK_WORLD_47 = 207,
|
||||
SDLK_WORLD_48 = 208,
|
||||
SDLK_WORLD_49 = 209,
|
||||
SDLK_WORLD_50 = 210,
|
||||
SDLK_WORLD_51 = 211,
|
||||
SDLK_WORLD_52 = 212,
|
||||
SDLK_WORLD_53 = 213,
|
||||
SDLK_WORLD_54 = 214,
|
||||
SDLK_WORLD_55 = 215,
|
||||
SDLK_WORLD_56 = 216,
|
||||
SDLK_WORLD_57 = 217,
|
||||
SDLK_WORLD_58 = 218,
|
||||
SDLK_WORLD_59 = 219,
|
||||
SDLK_WORLD_60 = 220,
|
||||
SDLK_WORLD_61 = 221,
|
||||
SDLK_WORLD_62 = 222,
|
||||
SDLK_WORLD_63 = 223,
|
||||
SDLK_WORLD_64 = 224,
|
||||
SDLK_WORLD_65 = 225,
|
||||
SDLK_WORLD_66 = 226,
|
||||
SDLK_WORLD_67 = 227,
|
||||
SDLK_WORLD_68 = 228,
|
||||
SDLK_WORLD_69 = 229,
|
||||
SDLK_WORLD_70 = 230,
|
||||
SDLK_WORLD_71 = 231,
|
||||
SDLK_WORLD_72 = 232,
|
||||
SDLK_WORLD_73 = 233,
|
||||
SDLK_WORLD_74 = 234,
|
||||
SDLK_WORLD_75 = 235,
|
||||
SDLK_WORLD_76 = 236,
|
||||
SDLK_WORLD_77 = 237,
|
||||
SDLK_WORLD_78 = 238,
|
||||
SDLK_WORLD_79 = 239,
|
||||
SDLK_WORLD_80 = 240,
|
||||
SDLK_WORLD_81 = 241,
|
||||
SDLK_WORLD_82 = 242,
|
||||
SDLK_WORLD_83 = 243,
|
||||
SDLK_WORLD_84 = 244,
|
||||
SDLK_WORLD_85 = 245,
|
||||
SDLK_WORLD_86 = 246,
|
||||
SDLK_WORLD_87 = 247,
|
||||
SDLK_WORLD_88 = 248,
|
||||
SDLK_WORLD_89 = 249,
|
||||
SDLK_WORLD_90 = 250,
|
||||
SDLK_WORLD_91 = 251,
|
||||
SDLK_WORLD_92 = 252,
|
||||
SDLK_WORLD_93 = 253,
|
||||
SDLK_WORLD_94 = 254,
|
||||
SDLK_WORLD_95 = 255, /* 0xFF */
|
||||
/*@}*/
|
||||
#define SDLK_SCANCODE_MASK (1<<30)
|
||||
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
|
||||
|
||||
/** @name Numeric keypad */
|
||||
/*@{*/
|
||||
SDLK_KP0 = 256,
|
||||
SDLK_KP1 = 257,
|
||||
SDLK_KP2 = 258,
|
||||
SDLK_KP3 = 259,
|
||||
SDLK_KP4 = 260,
|
||||
SDLK_KP5 = 261,
|
||||
SDLK_KP6 = 262,
|
||||
SDLK_KP7 = 263,
|
||||
SDLK_KP8 = 264,
|
||||
SDLK_KP9 = 265,
|
||||
SDLK_KP_PERIOD = 266,
|
||||
SDLK_KP_DIVIDE = 267,
|
||||
SDLK_KP_MULTIPLY = 268,
|
||||
SDLK_KP_MINUS = 269,
|
||||
SDLK_KP_PLUS = 270,
|
||||
SDLK_KP_ENTER = 271,
|
||||
SDLK_KP_EQUALS = 272,
|
||||
/*@}*/
|
||||
enum
|
||||
{
|
||||
SDLK_UNKNOWN = 0,
|
||||
|
||||
/** @name Arrows + Home/End pad */
|
||||
/*@{*/
|
||||
SDLK_UP = 273,
|
||||
SDLK_DOWN = 274,
|
||||
SDLK_RIGHT = 275,
|
||||
SDLK_LEFT = 276,
|
||||
SDLK_INSERT = 277,
|
||||
SDLK_HOME = 278,
|
||||
SDLK_END = 279,
|
||||
SDLK_PAGEUP = 280,
|
||||
SDLK_PAGEDOWN = 281,
|
||||
/*@}*/
|
||||
SDLK_RETURN = '\r',
|
||||
SDLK_ESCAPE = '\033',
|
||||
SDLK_BACKSPACE = '\b',
|
||||
SDLK_TAB = '\t',
|
||||
SDLK_SPACE = ' ',
|
||||
SDLK_EXCLAIM = '!',
|
||||
SDLK_QUOTEDBL = '"',
|
||||
SDLK_HASH = '#',
|
||||
SDLK_PERCENT = '%',
|
||||
SDLK_DOLLAR = '$',
|
||||
SDLK_AMPERSAND = '&',
|
||||
SDLK_QUOTE = '\'',
|
||||
SDLK_LEFTPAREN = '(',
|
||||
SDLK_RIGHTPAREN = ')',
|
||||
SDLK_ASTERISK = '*',
|
||||
SDLK_PLUS = '+',
|
||||
SDLK_COMMA = ',',
|
||||
SDLK_MINUS = '-',
|
||||
SDLK_PERIOD = '.',
|
||||
SDLK_SLASH = '/',
|
||||
SDLK_0 = '0',
|
||||
SDLK_1 = '1',
|
||||
SDLK_2 = '2',
|
||||
SDLK_3 = '3',
|
||||
SDLK_4 = '4',
|
||||
SDLK_5 = '5',
|
||||
SDLK_6 = '6',
|
||||
SDLK_7 = '7',
|
||||
SDLK_8 = '8',
|
||||
SDLK_9 = '9',
|
||||
SDLK_COLON = ':',
|
||||
SDLK_SEMICOLON = ';',
|
||||
SDLK_LESS = '<',
|
||||
SDLK_EQUALS = '=',
|
||||
SDLK_GREATER = '>',
|
||||
SDLK_QUESTION = '?',
|
||||
SDLK_AT = '@',
|
||||
/*
|
||||
Skip uppercase letters
|
||||
*/
|
||||
SDLK_LEFTBRACKET = '[',
|
||||
SDLK_BACKSLASH = '\\',
|
||||
SDLK_RIGHTBRACKET = ']',
|
||||
SDLK_CARET = '^',
|
||||
SDLK_UNDERSCORE = '_',
|
||||
SDLK_BACKQUOTE = '`',
|
||||
SDLK_a = 'a',
|
||||
SDLK_b = 'b',
|
||||
SDLK_c = 'c',
|
||||
SDLK_d = 'd',
|
||||
SDLK_e = 'e',
|
||||
SDLK_f = 'f',
|
||||
SDLK_g = 'g',
|
||||
SDLK_h = 'h',
|
||||
SDLK_i = 'i',
|
||||
SDLK_j = 'j',
|
||||
SDLK_k = 'k',
|
||||
SDLK_l = 'l',
|
||||
SDLK_m = 'm',
|
||||
SDLK_n = 'n',
|
||||
SDLK_o = 'o',
|
||||
SDLK_p = 'p',
|
||||
SDLK_q = 'q',
|
||||
SDLK_r = 'r',
|
||||
SDLK_s = 's',
|
||||
SDLK_t = 't',
|
||||
SDLK_u = 'u',
|
||||
SDLK_v = 'v',
|
||||
SDLK_w = 'w',
|
||||
SDLK_x = 'x',
|
||||
SDLK_y = 'y',
|
||||
SDLK_z = 'z',
|
||||
|
||||
/** @name Function keys */
|
||||
/*@{*/
|
||||
SDLK_F1 = 282,
|
||||
SDLK_F2 = 283,
|
||||
SDLK_F3 = 284,
|
||||
SDLK_F4 = 285,
|
||||
SDLK_F5 = 286,
|
||||
SDLK_F6 = 287,
|
||||
SDLK_F7 = 288,
|
||||
SDLK_F8 = 289,
|
||||
SDLK_F9 = 290,
|
||||
SDLK_F10 = 291,
|
||||
SDLK_F11 = 292,
|
||||
SDLK_F12 = 293,
|
||||
SDLK_F13 = 294,
|
||||
SDLK_F14 = 295,
|
||||
SDLK_F15 = 296,
|
||||
/*@}*/
|
||||
SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
|
||||
|
||||
/** @name Key state modifier keys */
|
||||
/*@{*/
|
||||
SDLK_NUMLOCK = 300,
|
||||
SDLK_CAPSLOCK = 301,
|
||||
SDLK_SCROLLOCK = 302,
|
||||
SDLK_RSHIFT = 303,
|
||||
SDLK_LSHIFT = 304,
|
||||
SDLK_RCTRL = 305,
|
||||
SDLK_LCTRL = 306,
|
||||
SDLK_RALT = 307,
|
||||
SDLK_LALT = 308,
|
||||
SDLK_RMETA = 309,
|
||||
SDLK_LMETA = 310,
|
||||
SDLK_LSUPER = 311, /**< Left "Windows" key */
|
||||
SDLK_RSUPER = 312, /**< Right "Windows" key */
|
||||
SDLK_MODE = 313, /**< "Alt Gr" key */
|
||||
SDLK_COMPOSE = 314, /**< Multi-key compose key */
|
||||
/*@}*/
|
||||
SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
|
||||
SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
|
||||
SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
|
||||
SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
|
||||
SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
|
||||
SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
|
||||
SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
|
||||
SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
|
||||
SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
|
||||
SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
|
||||
SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
|
||||
SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
|
||||
|
||||
/** @name Miscellaneous function keys */
|
||||
/*@{*/
|
||||
SDLK_HELP = 315,
|
||||
SDLK_PRINT = 316,
|
||||
SDLK_SYSREQ = 317,
|
||||
SDLK_BREAK = 318,
|
||||
SDLK_MENU = 319,
|
||||
SDLK_POWER = 320, /**< Power Macintosh power key */
|
||||
SDLK_EURO = 321, /**< Some european keyboards */
|
||||
SDLK_UNDO = 322, /**< Atari keyboard has Undo */
|
||||
/*@}*/
|
||||
SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
|
||||
SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
|
||||
SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
|
||||
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
|
||||
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
|
||||
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
|
||||
SDLK_DELETE = '\177',
|
||||
SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
|
||||
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
|
||||
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
|
||||
SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
|
||||
SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
|
||||
SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
|
||||
|
||||
/* Add any other keys here */
|
||||
SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
|
||||
SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
|
||||
SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
|
||||
SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
|
||||
SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
|
||||
SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
|
||||
SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
|
||||
SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
|
||||
SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
|
||||
SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
|
||||
SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
|
||||
SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
|
||||
SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
|
||||
SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
|
||||
SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
|
||||
SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
|
||||
SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
|
||||
|
||||
SDLK_LAST
|
||||
} SDLKey;
|
||||
SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
|
||||
SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
|
||||
SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
|
||||
SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
|
||||
SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
|
||||
SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
|
||||
SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
|
||||
SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
|
||||
SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
|
||||
SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
|
||||
SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
|
||||
SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
|
||||
SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
|
||||
SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
|
||||
SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
|
||||
SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
|
||||
SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
|
||||
SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
|
||||
SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
|
||||
SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
|
||||
SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
|
||||
SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
|
||||
SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
|
||||
SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
|
||||
SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
|
||||
SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
|
||||
SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
|
||||
SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
|
||||
SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
|
||||
SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
|
||||
SDLK_KP_EQUALSAS400 =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
|
||||
|
||||
/** Enumeration of valid key mods (possibly OR'd together) */
|
||||
typedef enum {
|
||||
KMOD_NONE = 0x0000,
|
||||
KMOD_LSHIFT= 0x0001,
|
||||
KMOD_RSHIFT= 0x0002,
|
||||
KMOD_LCTRL = 0x0040,
|
||||
KMOD_RCTRL = 0x0080,
|
||||
KMOD_LALT = 0x0100,
|
||||
KMOD_RALT = 0x0200,
|
||||
KMOD_LMETA = 0x0400,
|
||||
KMOD_RMETA = 0x0800,
|
||||
KMOD_NUM = 0x1000,
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
KMOD_RESERVED = 0x8000
|
||||
SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
|
||||
SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
|
||||
SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
|
||||
SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
|
||||
SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
|
||||
SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
|
||||
SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
|
||||
SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
|
||||
SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
|
||||
SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
|
||||
SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
|
||||
SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
|
||||
|
||||
SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
|
||||
SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
|
||||
SDLK_THOUSANDSSEPARATOR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
|
||||
SDLK_DECIMALSEPARATOR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
|
||||
SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
|
||||
SDLK_CURRENCYSUBUNIT =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
|
||||
SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
|
||||
SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
|
||||
SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
|
||||
SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
|
||||
SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
|
||||
SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
|
||||
SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
|
||||
SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
|
||||
SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
|
||||
SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
|
||||
SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
|
||||
SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
|
||||
SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
|
||||
SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
|
||||
SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
|
||||
SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
|
||||
SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
|
||||
SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
|
||||
SDLK_KP_DBLAMPERSAND =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
|
||||
SDLK_KP_VERTICALBAR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
|
||||
SDLK_KP_DBLVERTICALBAR =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
|
||||
SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
|
||||
SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
|
||||
SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
|
||||
SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
|
||||
SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
|
||||
SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
|
||||
SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
|
||||
SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
|
||||
SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
|
||||
SDLK_KP_MEMSUBTRACT =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
|
||||
SDLK_KP_MEMMULTIPLY =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
|
||||
SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
|
||||
SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
|
||||
SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
|
||||
SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
|
||||
SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
|
||||
SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
|
||||
SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
|
||||
SDLK_KP_HEXADECIMAL =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
|
||||
|
||||
SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
|
||||
SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
|
||||
SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
|
||||
SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
|
||||
SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
|
||||
SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
|
||||
SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
|
||||
SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
|
||||
|
||||
SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
|
||||
|
||||
SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
|
||||
SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
|
||||
SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
|
||||
SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
|
||||
SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
|
||||
SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
|
||||
SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
|
||||
SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
|
||||
SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
|
||||
SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
|
||||
SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
|
||||
SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
|
||||
SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
|
||||
SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
|
||||
SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
|
||||
SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
|
||||
SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
|
||||
|
||||
SDLK_BRIGHTNESSDOWN =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
|
||||
SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
|
||||
SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
|
||||
SDLK_KBDILLUMTOGGLE =
|
||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
|
||||
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
|
||||
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
|
||||
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
|
||||
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP)
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Enumeration of valid key mods (possibly OR'd together).
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
KMOD_NONE = 0x0000,
|
||||
KMOD_LSHIFT = 0x0001,
|
||||
KMOD_RSHIFT = 0x0002,
|
||||
KMOD_LCTRL = 0x0040,
|
||||
KMOD_RCTRL = 0x0080,
|
||||
KMOD_LALT = 0x0100,
|
||||
KMOD_RALT = 0x0200,
|
||||
KMOD_LGUI = 0x0400,
|
||||
KMOD_RGUI = 0x0800,
|
||||
KMOD_NUM = 0x1000,
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
KMOD_RESERVED = 0x8000
|
||||
} SDLMod;
|
||||
|
||||
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
|
||||
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
|
||||
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
|
||||
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
|
||||
#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI)
|
||||
|
||||
#endif /* _SDL_keysym_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,26 +20,25 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_loadso.h
|
||||
/**
|
||||
* \file SDL_loadso.h
|
||||
*
|
||||
* System dependent library loading routines
|
||||
*/
|
||||
|
||||
/** @file SDL_loadso.h
|
||||
*
|
||||
* Some things to keep in mind:
|
||||
* - These functions only work on C function names. Other languages may
|
||||
* have name mangling and intrinsic language support that varies from
|
||||
* compiler to compiler.
|
||||
* - Make sure you declare your function pointers with the same calling
|
||||
* convention as the actual library function. Your code will crash
|
||||
* mysteriously if you do not do this.
|
||||
* - Avoid namespace collisions. If you load a symbol from the library,
|
||||
* it is not defined whether or not it goes into the global symbol
|
||||
* namespace for the application. If it does and it conflicts with
|
||||
* symbols in your code or other shared libraries, you will not get
|
||||
* the results you expect. :)
|
||||
* \li These functions only work on C function names. Other languages may
|
||||
* have name mangling and intrinsic language support that varies from
|
||||
* compiler to compiler.
|
||||
* \li Make sure you declare your function pointers with the same calling
|
||||
* convention as the actual library function. Your code will crash
|
||||
* mysteriously if you do not do this.
|
||||
* \li Avoid namespace collisions. If you load a symbol from the library,
|
||||
* it is not defined whether or not it goes into the global symbol
|
||||
* namespace for the application. If it does and it conflicts with
|
||||
* symbols in your code or other shared libraries, you will not get
|
||||
* the results you expect. :)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SDL_loadso_h
|
||||
#define _SDL_loadso_h
|
||||
|
||||
@@ -49,30 +48,39 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This function dynamically loads a shared object and returns a pointer
|
||||
* to the object handle (or NULL if there was an error).
|
||||
* The 'sofile' parameter is a system dependent name of the object file.
|
||||
* This function dynamically loads a shared object and returns a pointer
|
||||
* to the object handle (or NULL if there was an error).
|
||||
* The 'sofile' parameter is a system dependent name of the object file.
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
|
||||
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
||||
|
||||
/**
|
||||
* Given an object handle, this function looks up the address of the
|
||||
* named function in the shared object and returns it. This address
|
||||
* is no longer valid after calling SDL_UnloadObject().
|
||||
* Given an object handle, this function looks up the address of the
|
||||
* named function in the shared object and returns it. This address
|
||||
* is no longer valid after calling SDL_UnloadObject().
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
|
||||
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);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_loadso_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -25,14 +25,15 @@
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/** @file SDL_main.h
|
||||
* Redefine main() on Win32 and MacOS so that it is called by winmain.c
|
||||
/**
|
||||
* \file SDL_main.h
|
||||
*
|
||||
* Redefine main() on some platforms so that it is called by SDL.
|
||||
*/
|
||||
|
||||
#if defined(__WIN32__) || \
|
||||
(defined(__MWERKS__) && !defined(__BEOS__)) || \
|
||||
defined(__MACOS__) || defined(__MACOSX__) || \
|
||||
defined(__SYMBIAN32__) || defined(QWS)
|
||||
defined(__SYMBIAN32__) || defined(__IPHONEOS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define C_LINKAGE "C"
|
||||
@@ -40,67 +41,56 @@
|
||||
#define C_LINKAGE
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** The application's main() function must be called with C linkage,
|
||||
/**
|
||||
* \file SDL_main.h
|
||||
*
|
||||
* The application's main() function must be called with C linkage,
|
||||
* and should be declared like this:
|
||||
* @code
|
||||
* #ifdef __cplusplus
|
||||
* extern "C"
|
||||
* #endif
|
||||
* int main(int argc, char *argv[])
|
||||
* {
|
||||
* }
|
||||
* @endcode
|
||||
* \code
|
||||
* #ifdef __cplusplus
|
||||
* extern "C"
|
||||
* #endif
|
||||
* int main(int argc, char *argv[])
|
||||
* {
|
||||
* }
|
||||
* \endcode
|
||||
*/
|
||||
|
||||
#define main SDL_main
|
||||
|
||||
/** The prototype for the application's main() function */
|
||||
/**
|
||||
* The prototype for the application's main() function
|
||||
*/
|
||||
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
|
||||
|
||||
|
||||
/** @name 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__
|
||||
|
||||
#include "begin_code.h"
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** This should be called from your WinMain() function, if any */
|
||||
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
|
||||
/** This can also be called, but is no longer necessary */
|
||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
|
||||
/** This can also be called, but is no longer necessary (SDL_Quit calls it) */
|
||||
/**
|
||||
* This can be called to set the application class at startup
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
|
||||
void *hInst);
|
||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
#endif
|
||||
/*@}*/
|
||||
|
||||
/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */
|
||||
/*@{*/
|
||||
#if defined(__MACOS__)
|
||||
|
||||
#include "begin_code.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Forward declaration so we don't need to include QuickDraw.h */
|
||||
struct QDGlobals;
|
||||
|
||||
/** This should be called from your main() function, if any */
|
||||
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
#endif
|
||||
/*@}*/
|
||||
|
||||
#endif /* Need to redefine main()? */
|
||||
|
||||
#endif /* _SDL_main_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,8 +20,26 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_mouse.h
|
||||
* Include file for SDL mouse event handling
|
||||
/**
|
||||
* \file SDL_mouse.h
|
||||
*
|
||||
* Include file for SDL mouse event handling.
|
||||
*
|
||||
* Please note that this ONLY discusses "mice" with the notion of the
|
||||
* desktop GUI. You (usually) have one system cursor, and the OS hides
|
||||
* the hardware details from you. If you plug in 10 mice, all ten move that
|
||||
* one cursor. For many applications and games, this is perfect, and this
|
||||
* API has served hundreds of SDL programs well since its birth.
|
||||
*
|
||||
* It's not the whole picture, though. If you want more lowlevel control,
|
||||
* SDL offers a different API, that gives you visibility into each input
|
||||
* device, multi-touch interfaces, etc.
|
||||
*
|
||||
* Those two APIs are incompatible, and you usually should not use both
|
||||
* at the same time. But for legacy purposes, this API refers to a "mouse"
|
||||
* when it actually means the system pointer and not a physical mouse.
|
||||
*
|
||||
* The other API is in SDL_input.h
|
||||
*/
|
||||
|
||||
#ifndef _SDL_mouse_h
|
||||
@@ -34,110 +52,154 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
typedef struct WMcursor WMcursor; /**< Implementation dependent */
|
||||
typedef struct SDL_Cursor {
|
||||
SDL_Rect area; /**< The area of the mouse cursor */
|
||||
Sint16 hot_x, hot_y; /**< The "tip" of the cursor */
|
||||
Uint8 *data; /**< B/W cursor data */
|
||||
Uint8 *mask; /**< B/W cursor mask */
|
||||
Uint8 *save[2]; /**< Place to save cursor area */
|
||||
WMcursor *wm_cursor; /**< Window-manager cursor */
|
||||
} SDL_Cursor;
|
||||
typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Retrieve the current state of the mouse.
|
||||
* The current button state is returned as a button bitmask, which can
|
||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
||||
* current mouse cursor position. You can pass NULL for either x or y.
|
||||
* \brief Get the window which currently has mouse focus.
|
||||
*/
|
||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current state of the mouse.
|
||||
*
|
||||
* The current button state is returned as a button bitmask, which can
|
||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
||||
* mouse cursor position relative to the focus window for the currently
|
||||
* selected mouse. You can pass NULL for either x or y.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
|
||||
|
||||
/**
|
||||
* Retrieve the current state of the mouse.
|
||||
* The current button state is returned as a button bitmask, which can
|
||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
||||
* mouse deltas since the last call to SDL_GetRelativeMouseState().
|
||||
* \brief Retrieve the relative state of the mouse.
|
||||
*
|
||||
* The current button state is returned as a button bitmask, which can
|
||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
||||
* mouse deltas since the last call to SDL_GetRelativeMouseState().
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
|
||||
|
||||
/**
|
||||
* Set the position of the mouse cursor (generates a mouse motion event)
|
||||
* \brief Moves the mouse to the given position within the window.
|
||||
*
|
||||
* \param window The window to move the mouse into, or NULL for the current mouse focus
|
||||
* \param x The x coordinate within the window
|
||||
* \param y The y coordinate within the window
|
||||
*
|
||||
* \note This function generates a mouse motion event
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
|
||||
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
||||
int x, int y);
|
||||
|
||||
/**
|
||||
* Create a cursor using the specified data and mask (in MSB format).
|
||||
* The cursor width must be a multiple of 8 bits.
|
||||
* \brief Set relative mouse mode.
|
||||
*
|
||||
* \param enabled Whether or not to enable relative mode
|
||||
*
|
||||
* The cursor is created in black and white according to the following:
|
||||
* data mask resulting pixel on screen
|
||||
* 0 1 White
|
||||
* 1 1 Black
|
||||
* 0 0 Transparent
|
||||
* 1 0 Inverted color if possible, black if not.
|
||||
*
|
||||
* Cursors created with this function must be freed with SDL_FreeCursor().
|
||||
* \return 0 on success, or -1 if relative mode is not supported.
|
||||
*
|
||||
* While the mouse is in relative mode, the cursor is hidden, and the
|
||||
* driver will try to report continuous motion in the current window.
|
||||
* Only relative motion events will be delivered, the mouse position
|
||||
* will not change.
|
||||
*
|
||||
* \note This function will flush any pending mouse motion.
|
||||
*
|
||||
* \sa SDL_GetRelativeMouseMode()
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
|
||||
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
|
||||
extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Set the currently active cursor to the specified one.
|
||||
* If the cursor is currently visible, the change will be immediately
|
||||
* represented on the display.
|
||||
* \brief Query whether relative mouse mode is enabled.
|
||||
*
|
||||
* \sa SDL_SetRelativeMouseMode()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
||||
|
||||
/**
|
||||
* Returns the currently active cursor.
|
||||
* \brief Create a cursor, using the specified bitmap data and
|
||||
* mask (in MSB format).
|
||||
*
|
||||
* The cursor width must be a multiple of 8 bits.
|
||||
*
|
||||
* The cursor is created in black and white according to the following:
|
||||
* <table>
|
||||
* <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
|
||||
* <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
|
||||
* <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
|
||||
* <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
|
||||
* <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
|
||||
* if not. </td></tr>
|
||||
* </table>
|
||||
*
|
||||
* \sa SDL_FreeCursor()
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
||||
const Uint8 * mask,
|
||||
int w, int h, int hot_x,
|
||||
int hot_y);
|
||||
|
||||
/**
|
||||
* Deallocates a cursor created with SDL_CreateCursor().
|
||||
* \brief Set the active cursor.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
|
||||
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
||||
|
||||
/**
|
||||
* Toggle whether or not the cursor is shown on the screen.
|
||||
* The cursor start off displayed, but can be turned off.
|
||||
* SDL_ShowCursor() returns 1 if the cursor was being displayed
|
||||
* before the call, or 0 if it was not. You can query the current
|
||||
* state by passing a 'toggle' value of -1.
|
||||
* \brief Return the active cursor.
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
||||
|
||||
/**
|
||||
* \brief Frees a cursor created with SDL_CreateCursor().
|
||||
*
|
||||
* \sa SDL_CreateCursor()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
|
||||
|
||||
/**
|
||||
* \brief Toggle whether or not the cursor is shown.
|
||||
*
|
||||
* \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
|
||||
* state.
|
||||
*
|
||||
* \return 1 if the cursor is shown, or 0 if the cursor is hidden.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
|
||||
|
||||
/*@{*/
|
||||
/** Used as a mask when testing buttons in buttonstate
|
||||
* Button 1: Left mouse button
|
||||
* Button 2: Middle mouse button
|
||||
* Button 3: Right mouse button
|
||||
* Button 4: Mouse wheel up (may also be a real button)
|
||||
* Button 5: Mouse wheel down (may also be a real button)
|
||||
/**
|
||||
* Used as a mask when testing buttons in buttonstate.
|
||||
* - Button 1: Left mouse button
|
||||
* - Button 2: Middle mouse button
|
||||
* - Button 3: Right mouse button
|
||||
*/
|
||||
#define SDL_BUTTON(X) (1 << ((X)-1))
|
||||
#define SDL_BUTTON_LEFT 1
|
||||
#define SDL_BUTTON_MIDDLE 2
|
||||
#define SDL_BUTTON_RIGHT 3
|
||||
#define SDL_BUTTON_WHEELUP 4
|
||||
#define SDL_BUTTON_WHEELDOWN 5
|
||||
#define SDL_BUTTON_X1 6
|
||||
#define SDL_BUTTON_X2 7
|
||||
#define SDL_BUTTON_X1 4
|
||||
#define SDL_BUTTON_X2 5
|
||||
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
|
||||
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
|
||||
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
|
||||
#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
|
||||
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
|
||||
/*@}*/
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mouse_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -23,10 +23,10 @@
|
||||
#ifndef _SDL_mutex_h
|
||||
#define _SDL_mutex_h
|
||||
|
||||
/** @file SDL_mutex.h
|
||||
* Functions to provide thread synchronization primitives
|
||||
*
|
||||
* @note These are independent of the other SDL routines.
|
||||
/**
|
||||
* \file SDL_mutex.h
|
||||
*
|
||||
* Functions to provide thread synchronization primitives.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -35,143 +35,189 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** Synchronization functions which can time out return this value
|
||||
/**
|
||||
* Synchronization functions which can time out return this value
|
||||
* if they time out.
|
||||
*/
|
||||
#define SDL_MUTEX_TIMEDOUT 1
|
||||
|
||||
/** This is the timeout value which corresponds to never time out */
|
||||
/**
|
||||
* This is the timeout value which corresponds to never time out.
|
||||
*/
|
||||
#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/** @name Mutex functions */ /*@{*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/**
|
||||
* \name Mutex functions
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/** The SDL mutex structure, defined in SDL_mutex.c */
|
||||
/* The SDL mutex structure, defined in SDL_mutex.c */
|
||||
struct SDL_mutex;
|
||||
typedef struct SDL_mutex SDL_mutex;
|
||||
|
||||
/** Create a mutex, initialized unlocked */
|
||||
extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
|
||||
/**
|
||||
* Create a mutex, initialized unlocked.
|
||||
*/
|
||||
extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
|
||||
|
||||
/**
|
||||
* Lock the mutex.
|
||||
*
|
||||
* \return 0, or -1 on error.
|
||||
*/
|
||||
#define SDL_LockMutex(m) SDL_mutexP(m)
|
||||
/** Lock the mutex
|
||||
* @return 0, or -1 on error
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
|
||||
extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex * mutex);
|
||||
|
||||
/**
|
||||
* Unlock the mutex.
|
||||
*
|
||||
* \return 0, or -1 on error.
|
||||
*
|
||||
* \warning It is an error to unlock a mutex that has not been locked by
|
||||
* the current thread, and doing so results in undefined behavior.
|
||||
*/
|
||||
#define SDL_UnlockMutex(m) SDL_mutexV(m)
|
||||
/** Unlock the mutex
|
||||
* @return 0, or -1 on error
|
||||
*
|
||||
* It is an error to unlock a mutex that has not been locked by
|
||||
* the current thread, and doing so results in undefined behavior.
|
||||
extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex * mutex);
|
||||
|
||||
/**
|
||||
* Destroy a mutex.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
|
||||
|
||||
/** Destroy a mutex */
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
|
||||
/*@}*//*Mutex functions*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/** @name Semaphore functions */ /*@{*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/**
|
||||
* \name Semaphore functions
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/** The SDL semaphore structure, defined in SDL_sem.c */
|
||||
/* The SDL semaphore structure, defined in SDL_sem.c */
|
||||
struct SDL_semaphore;
|
||||
typedef struct SDL_semaphore SDL_sem;
|
||||
|
||||
/** Create a semaphore, initialized with value, returns NULL on failure. */
|
||||
extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
||||
|
||||
/** Destroy a semaphore */
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
|
||||
/**
|
||||
* Create a semaphore, initialized with value, returns NULL on failure.
|
||||
*/
|
||||
extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
||||
|
||||
/**
|
||||
* This function suspends the calling thread until the semaphore pointed
|
||||
* to by sem has a positive count. It then atomically decreases the semaphore
|
||||
* count.
|
||||
* Destroy a semaphore.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
|
||||
|
||||
/** Non-blocking variant of SDL_SemWait().
|
||||
* @return 0 if the wait succeeds,
|
||||
* SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
|
||||
/**
|
||||
* This function suspends the calling thread until the semaphore pointed
|
||||
* to by \c sem has a positive count. It then atomically decreases the
|
||||
* semaphore count.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
|
||||
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
|
||||
|
||||
/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
|
||||
* the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
|
||||
* the allotted time, and -1 on error.
|
||||
*
|
||||
* On some platforms this function is implemented by looping with a delay
|
||||
* of 1 ms, and so should be avoided if possible.
|
||||
/**
|
||||
* Non-blocking variant of SDL_SemWait().
|
||||
*
|
||||
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
|
||||
* block, and -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
|
||||
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
||||
|
||||
/** Atomically increases the semaphore's count (not blocking).
|
||||
* @return 0, or -1 on error.
|
||||
/**
|
||||
* Variant of SDL_SemWait() with a timeout in milliseconds.
|
||||
*
|
||||
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
|
||||
* succeed in the allotted time, and -1 on error.
|
||||
*
|
||||
* \warning On some platforms this function is implemented by looping with a
|
||||
* delay of 1 ms, and so should be avoided if possible.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
|
||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
|
||||
|
||||
/** Returns the current count of the semaphore */
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
|
||||
/**
|
||||
* Atomically increases the semaphore's count (not blocking).
|
||||
*
|
||||
* \return 0, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
|
||||
|
||||
/*@}*/
|
||||
/**
|
||||
* Returns the current count of the semaphore.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/** @name Condition_variable_functions */ /*@{*/
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/*@}*//*Semaphore functions*/
|
||||
|
||||
|
||||
/**
|
||||
* \name 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;
|
||||
typedef struct SDL_cond SDL_cond;
|
||||
/*@}*/
|
||||
|
||||
/** Create a condition variable */
|
||||
extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
|
||||
|
||||
/** Destroy a condition variable */
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
|
||||
|
||||
/** Restart one of the threads that are waiting on the condition variable,
|
||||
* @return 0 or -1 on error.
|
||||
/**
|
||||
* Create a condition variable.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
|
||||
extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
|
||||
|
||||
/** Restart all threads that are waiting on the condition variable,
|
||||
* @return 0 or -1 on error.
|
||||
/**
|
||||
* Destroy a condition variable.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
|
||||
|
||||
/** Wait on the condition variable, unlocking the provided mutex.
|
||||
* The mutex must be locked before entering this function!
|
||||
/**
|
||||
* Restart one of the threads that are waiting on the condition variable.
|
||||
*
|
||||
* \return 0 or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
|
||||
|
||||
/**
|
||||
* Restart all threads that are waiting on the condition variable.
|
||||
* \return 0 or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
|
||||
|
||||
/**
|
||||
* Wait on the condition variable, unlocking the provided mutex.
|
||||
*
|
||||
* \warning The mutex must be locked before entering this function!
|
||||
*
|
||||
* The mutex is re-locked once the condition variable is signaled.
|
||||
* @return 0 when it is signaled, or -1 on error.
|
||||
*
|
||||
* \return 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
|
||||
* variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
|
||||
/**
|
||||
* Waits for at most \c ms milliseconds, and returns 0 if the condition
|
||||
* variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
|
||||
* signaled in the allotted time, and -1 on error.
|
||||
* On some platforms this function is implemented by looping with a delay
|
||||
* of 1 ms, and so should be avoided if possible.
|
||||
*
|
||||
* \warning On some platforms this function is implemented by looping with a
|
||||
* delay of 1 ms, and so should be avoided if possible.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
|
||||
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
|
||||
SDL_mutex * mutex, Uint32 ms);
|
||||
|
||||
/*@}*//*Condition variable functions*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_mutex_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1039
alienblaster/project/jni/sdl/include/SDL_opengles.h
Normal file
1039
alienblaster/project/jni/sdl/include/SDL_opengles.h
Normal file
File diff suppressed because it is too large
Load Diff
399
alienblaster/project/jni/sdl/include/SDL_pixels.h
Normal file
399
alienblaster/project/jni/sdl/include/SDL_pixels.h
Normal file
@@ -0,0 +1,399 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_pixels.h
|
||||
*
|
||||
* Header for the enumerated pixel format definitions.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_pixels_h
|
||||
#define _SDL_pixels_h
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name Transparency definitions
|
||||
*
|
||||
* These define alpha as the opacity of a surface.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_ALPHA_OPAQUE 255
|
||||
#define SDL_ALPHA_TRANSPARENT 0
|
||||
/*@}*/
|
||||
|
||||
/** Pixel type. */
|
||||
enum
|
||||
{
|
||||
SDL_PIXELTYPE_UNKNOWN,
|
||||
SDL_PIXELTYPE_INDEX1,
|
||||
SDL_PIXELTYPE_INDEX4,
|
||||
SDL_PIXELTYPE_INDEX8,
|
||||
SDL_PIXELTYPE_PACKED8,
|
||||
SDL_PIXELTYPE_PACKED16,
|
||||
SDL_PIXELTYPE_PACKED32,
|
||||
SDL_PIXELTYPE_ARRAYU8,
|
||||
SDL_PIXELTYPE_ARRAYU16,
|
||||
SDL_PIXELTYPE_ARRAYU32,
|
||||
SDL_PIXELTYPE_ARRAYF16,
|
||||
SDL_PIXELTYPE_ARRAYF32
|
||||
};
|
||||
|
||||
/** Bitmap pixel order, high bit -> low bit. */
|
||||
enum
|
||||
{
|
||||
SDL_BITMAPORDER_NONE,
|
||||
SDL_BITMAPORDER_4321,
|
||||
SDL_BITMAPORDER_1234
|
||||
};
|
||||
|
||||
/** Packed component order, high bit -> low bit. */
|
||||
enum
|
||||
{
|
||||
SDL_PACKEDORDER_NONE,
|
||||
SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDORDER_RGBX,
|
||||
SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDORDER_RGBA,
|
||||
SDL_PACKEDORDER_XBGR,
|
||||
SDL_PACKEDORDER_BGRX,
|
||||
SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDORDER_BGRA
|
||||
};
|
||||
|
||||
/** Array component order, low byte -> high byte. */
|
||||
enum
|
||||
{
|
||||
SDL_ARRAYORDER_NONE,
|
||||
SDL_ARRAYORDER_RGB,
|
||||
SDL_ARRAYORDER_RGBA,
|
||||
SDL_ARRAYORDER_ARGB,
|
||||
SDL_ARRAYORDER_BGR,
|
||||
SDL_ARRAYORDER_BGRA,
|
||||
SDL_ARRAYORDER_ABGR
|
||||
};
|
||||
|
||||
/** Packed component layout. */
|
||||
enum
|
||||
{
|
||||
SDL_PACKEDLAYOUT_NONE,
|
||||
SDL_PACKEDLAYOUT_332,
|
||||
SDL_PACKEDLAYOUT_4444,
|
||||
SDL_PACKEDLAYOUT_1555,
|
||||
SDL_PACKEDLAYOUT_5551,
|
||||
SDL_PACKEDLAYOUT_565,
|
||||
SDL_PACKEDLAYOUT_8888,
|
||||
SDL_PACKEDLAYOUT_2101010,
|
||||
SDL_PACKEDLAYOUT_1010102
|
||||
};
|
||||
|
||||
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) \
|
||||
((A) | ((B) << 8) | ((C) << 16) | ((D) << 24))
|
||||
|
||||
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
|
||||
((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
|
||||
((bits) << 8) | ((bytes) << 0))
|
||||
|
||||
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
|
||||
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
|
||||
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
|
||||
#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
|
||||
#define SDL_BYTESPERPIXEL(X) (((X) >> 0) & 0xFF)
|
||||
|
||||
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))
|
||||
|
||||
#define SDL_ISPIXELFORMAT_ALPHA(format) \
|
||||
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
|
||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
|
||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
|
||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))
|
||||
|
||||
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
||||
((format) && !((format) & 0x80000000))
|
||||
|
||||
enum
|
||||
{
|
||||
SDL_PIXELFORMAT_UNKNOWN,
|
||||
SDL_PIXELFORMAT_INDEX1LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
|
||||
1, 0),
|
||||
SDL_PIXELFORMAT_INDEX1MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
|
||||
1, 0),
|
||||
SDL_PIXELFORMAT_INDEX4LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
|
||||
4, 0),
|
||||
SDL_PIXELFORMAT_INDEX4MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
|
||||
4, 0),
|
||||
SDL_PIXELFORMAT_INDEX8 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
|
||||
SDL_PIXELFORMAT_RGB332 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_332, 8, 1),
|
||||
SDL_PIXELFORMAT_RGB444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_4444, 12, 2),
|
||||
SDL_PIXELFORMAT_RGB555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
||||
SDL_PIXELFORMAT_BGR555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
||||
SDL_PIXELFORMAT_ARGB4444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
||||
SDL_PIXELFORMAT_ABGR4444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
||||
SDL_PIXELFORMAT_ARGB1555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
||||
SDL_PIXELFORMAT_ABGR1555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
||||
SDL_PIXELFORMAT_RGB565 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
||||
SDL_PIXELFORMAT_BGR565 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
||||
SDL_PIXELFORMAT_RGB24 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
|
||||
24, 3),
|
||||
SDL_PIXELFORMAT_BGR24 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
|
||||
24, 3),
|
||||
SDL_PIXELFORMAT_RGB888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
||||
SDL_PIXELFORMAT_BGR888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
|
||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
||||
SDL_PIXELFORMAT_ARGB8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_RGBA8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_ABGR8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_BGRA8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_ARGB2101010 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
||||
|
||||
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
||||
SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
|
||||
SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
|
||||
SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
||||
SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
|
||||
SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
||||
SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
|
||||
SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U')
|
||||
};
|
||||
|
||||
typedef struct SDL_Color
|
||||
{
|
||||
Uint8 r;
|
||||
Uint8 g;
|
||||
Uint8 b;
|
||||
Uint8 unused;
|
||||
} SDL_Color;
|
||||
#define SDL_Colour SDL_Color
|
||||
|
||||
typedef struct SDL_Palette SDL_Palette;
|
||||
typedef int (*SDL_PaletteChangedFunc) (void *userdata, SDL_Palette * palette);
|
||||
typedef struct SDL_PaletteWatch SDL_PaletteWatch;
|
||||
|
||||
struct SDL_Palette
|
||||
{
|
||||
int ncolors;
|
||||
SDL_Color *colors;
|
||||
|
||||
int refcount;
|
||||
SDL_PaletteWatch *watch;
|
||||
};
|
||||
|
||||
/**
|
||||
* \note Everything in the pixel format structure is read-only.
|
||||
*/
|
||||
typedef struct SDL_PixelFormat
|
||||
{
|
||||
SDL_Palette *palette;
|
||||
Uint8 BitsPerPixel;
|
||||
Uint8 BytesPerPixel;
|
||||
Uint8 Rloss;
|
||||
Uint8 Gloss;
|
||||
Uint8 Bloss;
|
||||
Uint8 Aloss;
|
||||
Uint8 Rshift;
|
||||
Uint8 Gshift;
|
||||
Uint8 Bshift;
|
||||
Uint8 Ashift;
|
||||
Uint32 Rmask;
|
||||
Uint32 Gmask;
|
||||
Uint32 Bmask;
|
||||
Uint32 Amask;
|
||||
} SDL_PixelFormat;
|
||||
|
||||
/**
|
||||
* \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
|
||||
*
|
||||
* \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
|
||||
*
|
||||
* \sa SDL_MasksToPixelFormatEnum()
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
||||
int *bpp,
|
||||
Uint32 * Rmask,
|
||||
Uint32 * Gmask,
|
||||
Uint32 * Bmask,
|
||||
Uint32 * Amask);
|
||||
|
||||
/**
|
||||
* \brief Convert a bpp and RGBA masks to an enumerated pixel format.
|
||||
*
|
||||
* \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
|
||||
* wasn't possible.
|
||||
*
|
||||
* \sa SDL_PixelFormatEnumToMasks()
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
||||
Uint32 Rmask,
|
||||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
Uint32 Amask);
|
||||
|
||||
/**
|
||||
* \brief Create a palette structure with the specified number of color
|
||||
* entries.
|
||||
*
|
||||
* \return A new palette, or NULL if there wasn't enough memory.
|
||||
*
|
||||
* \note The palette entries are initialized to white.
|
||||
*
|
||||
* \sa SDL_FreePalette()
|
||||
*/
|
||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
||||
|
||||
/**
|
||||
* \brief Add a callback function which is called when the palette changes.
|
||||
*
|
||||
* \sa SDL_DelPaletteWatch()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddPaletteWatch(SDL_Palette * palette,
|
||||
SDL_PaletteChangedFunc
|
||||
callback, void *userdata);
|
||||
|
||||
/**
|
||||
* \brief Remove a callback function previously added with
|
||||
* SDL_AddPaletteWatch().
|
||||
*
|
||||
* \sa SDL_AddPaletteWatch()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DelPaletteWatch(SDL_Palette * palette,
|
||||
SDL_PaletteChangedFunc
|
||||
callback, void *userdata);
|
||||
|
||||
/**
|
||||
* \brief Set a range of colors in a palette.
|
||||
*
|
||||
* \param palette The palette to modify.
|
||||
* \param colors An array of colors to copy into the palette.
|
||||
* \param firstcolor The index of the first palette entry to modify.
|
||||
* \param ncolors The number of entries to modify.
|
||||
*
|
||||
* \return 0 on success, or -1 if not all of the colors could be set.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
const SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
|
||||
/**
|
||||
* \brief Free a palette created with SDL_AllocPalette().
|
||||
*
|
||||
* \sa SDL_AllocPalette()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
||||
|
||||
/**
|
||||
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
|
||||
*
|
||||
* \sa SDL_MapRGBA
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
/**
|
||||
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
|
||||
*
|
||||
* \sa SDL_MapRGB
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b,
|
||||
Uint8 a);
|
||||
|
||||
/**
|
||||
* \brief Get the RGB components from a pixel of the specified format.
|
||||
*
|
||||
* \sa SDL_GetRGBA
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
Uint8 * r, Uint8 * g, Uint8 * b);
|
||||
|
||||
/**
|
||||
* \brief Get the RGBA components from a pixel of the specified format.
|
||||
*
|
||||
* \sa SDL_GetRGB
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
Uint8 * r, Uint8 * g, Uint8 * b,
|
||||
Uint8 * a);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_pixels_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,8 +20,10 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_platform.h
|
||||
* Try to get a standard set of platform defines
|
||||
/**
|
||||
* \file SDL_platform.h
|
||||
*
|
||||
* Try to get a standard set of platform defines.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_platform_h
|
||||
@@ -37,7 +39,7 @@
|
||||
#endif
|
||||
#if defined(__HAIKU__)
|
||||
#undef __HAIKU__
|
||||
#define __HAIKU__ 1
|
||||
#define __HAIKU__ 1
|
||||
#endif
|
||||
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
|
||||
#undef __BSDI__
|
||||
@@ -51,10 +53,6 @@
|
||||
#undef __FREEBSD__
|
||||
#define __FREEBSD__ 1
|
||||
#endif
|
||||
#if defined(__HAIKU__)
|
||||
#undef __HAIKU__
|
||||
#define __HAIKU__ 1
|
||||
#endif
|
||||
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
|
||||
#undef __HPUX__
|
||||
#define __HPUX__ 1
|
||||
@@ -67,13 +65,30 @@
|
||||
#undef __LINUX__
|
||||
#define __LINUX__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
/* lets us know what version of Mac OS X we're compiling on */
|
||||
#include "AvailabilityMacros.h"
|
||||
#ifdef MAC_OS_X_VERSION_10_3
|
||||
#include "TargetConditionals.h" /* this header is in 10.3 or later */
|
||||
#if TARGET_OS_IPHONE
|
||||
/* if compiling for iPhone */
|
||||
#undef __IPHONEOS__
|
||||
#define __IPHONEOS__ 1
|
||||
#undef __MACOSX__
|
||||
#else
|
||||
/* if not compiling for iPhone */
|
||||
#undef __MACOSX__
|
||||
#define __MACOSX__ 1
|
||||
#endif /* TARGET_OS_IPHONE */
|
||||
#else
|
||||
/* if earlier verion of Mac OS X than version 10.3 */
|
||||
#undef __MACOSX__
|
||||
#define __MACOSX__ 1
|
||||
#elif defined(macintosh)
|
||||
#undef __MACOS__
|
||||
#define __MACOS__ 1
|
||||
#endif
|
||||
|
||||
#endif /* defined(__APPLE__) */
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#undef __NETBSD__
|
||||
#define __NETBSD__ 1
|
||||
@@ -107,4 +122,33 @@
|
||||
#define __WIN32__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__NDS__)
|
||||
#undef __NINTENDODS__
|
||||
#define __NINTENDODS__ 1
|
||||
#endif
|
||||
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Gets the name of the platform.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_platform_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
80
alienblaster/project/jni/sdl/include/SDL_power.h
Normal file
80
alienblaster/project/jni/sdl/include/SDL_power.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#ifndef _SDL_power_h
|
||||
#define _SDL_power_h
|
||||
|
||||
/**
|
||||
* \file SDL_power.h
|
||||
*
|
||||
* Header for the SDL power management routines.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief The basic state for the system's power supply.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
|
||||
SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
|
||||
SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
|
||||
SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
|
||||
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
|
||||
} SDL_PowerState;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the current power supply details.
|
||||
*
|
||||
* \param secs Seconds of battery life left. You can pass a NULL here if
|
||||
* you don't care. Will return -1 if we can't determine a
|
||||
* value, or we're not running on a battery.
|
||||
*
|
||||
* \param pct Percentage of battery life left, between 0 and 100. You can
|
||||
* pass a NULL here if you don't care. Will return -1 if we
|
||||
* can't determine a value, or we're not running on a battery.
|
||||
*
|
||||
* \return The state of the battery (if any).
|
||||
*/
|
||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_power_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,8 +20,10 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_quit.h
|
||||
* Include file for SDL quit event handling
|
||||
/**
|
||||
* \file SDL_quit.h
|
||||
*
|
||||
* Include file for SDL quit event handling.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_quit_h
|
||||
@@ -30,8 +32,10 @@
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
|
||||
/** @file SDL_quit.h
|
||||
* An SDL_QUITEVENT is generated when the user tries to close the application
|
||||
/**
|
||||
* \file SDL_quit.h
|
||||
*
|
||||
* An ::SDL_QUIT event is generated when the user tries to close the application
|
||||
* window. If it is ignored or filtered out, the window will remain open.
|
||||
* If it is not ignored or filtered, it is queued normally and the window
|
||||
* is allowed to close. When the window is closed, screen updates will
|
||||
@@ -39,15 +43,15 @@
|
||||
*
|
||||
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
|
||||
* and SIGTERM (system termination request), if handlers do not already
|
||||
* exist, that generate SDL_QUITEVENT events as well. There is no way
|
||||
* to determine the cause of an SDL_QUITEVENT, but setting a signal
|
||||
* exist, that generate ::SDL_QUIT events as well. There is no way
|
||||
* to determine the cause of an ::SDL_QUIT event, but setting a signal
|
||||
* handler in your application will override the default generation of
|
||||
* quit events for that signal.
|
||||
*
|
||||
* \sa SDL_Quit()
|
||||
*/
|
||||
|
||||
/** @file SDL_quit.h
|
||||
* There are no functions directly affecting the quit event
|
||||
*/
|
||||
/* There are no functions directly affecting the quit event */
|
||||
|
||||
#define SDL_QuitRequested() \
|
||||
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
|
||||
|
||||
137
alienblaster/project/jni/sdl/include/SDL_rect.h
Normal file
137
alienblaster/project/jni/sdl/include/SDL_rect.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_rect.h
|
||||
*
|
||||
* Header file for SDL_rect definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_rect_h
|
||||
#define _SDL_rect_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_pixels.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief The structure that defines a point
|
||||
*
|
||||
* \sa SDL_EnclosePoints
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} SDL_Point;
|
||||
|
||||
/**
|
||||
* \brief A rectangle, with the origin at the upper left.
|
||||
*
|
||||
* \sa SDL_RectEmpty
|
||||
* \sa SDL_RectEquals
|
||||
* \sa SDL_HasIntersection
|
||||
* \sa SDL_IntersectRect
|
||||
* \sa SDL_UnionRect
|
||||
* \sa SDL_EnclosePoints
|
||||
*/
|
||||
typedef struct SDL_Rect
|
||||
{
|
||||
int x, y;
|
||||
int w, h;
|
||||
} SDL_Rect;
|
||||
|
||||
/**
|
||||
* \brief Returns true if the rectangle has no area.
|
||||
*/
|
||||
#define SDL_RectEmpty(X) (((X)->w <= 0) || ((X)->h <= 0))
|
||||
|
||||
/**
|
||||
* \brief Returns true if the two rectangles are equal.
|
||||
*/
|
||||
#define SDL_RectEquals(A, B) (((A)->x == (B)->x) && ((A)->y == (B)->y) && \
|
||||
((A)->w == (B)->w) && ((A)->h == (B)->h))
|
||||
|
||||
/**
|
||||
* \brief Determine whether two rectangles intersect.
|
||||
*
|
||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
|
||||
const SDL_Rect * B);
|
||||
|
||||
/**
|
||||
* \brief Calculate the intersection of two rectangles.
|
||||
*
|
||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
|
||||
const SDL_Rect * B,
|
||||
SDL_Rect * result);
|
||||
|
||||
/**
|
||||
* \brief Calculate the union of two rectangles.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
|
||||
const SDL_Rect * B,
|
||||
SDL_Rect * result);
|
||||
|
||||
/**
|
||||
* \brief Calculate a minimal rectangle enclosing a set of points
|
||||
*
|
||||
* \return SDL_TRUE if any points were within the clipping rect
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
|
||||
int count,
|
||||
const SDL_Rect * clip,
|
||||
SDL_Rect * result);
|
||||
|
||||
/**
|
||||
* \brief Calculate the intersection of a rectangle and line segment.
|
||||
*
|
||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
|
||||
rect, int *X1,
|
||||
int *Y1, int *X2,
|
||||
int *Y2);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_rect_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
1
alienblaster/project/jni/sdl/include/SDL_revision.h
Normal file
1
alienblaster/project/jni/sdl/include/SDL_revision.h
Normal file
@@ -0,0 +1 @@
|
||||
#define SDL_REVISION "hg-4467:0baef09fe702"
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,7 +20,9 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_rwops.h
|
||||
/**
|
||||
* \file SDL_rwops.h
|
||||
*
|
||||
* This file provides a general interface for SDL to read and write
|
||||
* data sources. It can easily be extended to files, memory, etc.
|
||||
*/
|
||||
@@ -34,122 +36,171 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** This is the read/write operation structure -- very basic */
|
||||
/**
|
||||
* This is the read/write operation structure -- very basic.
|
||||
*/
|
||||
typedef struct SDL_RWops
|
||||
{
|
||||
/**
|
||||
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
||||
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
||||
*
|
||||
* \return the final offset in the data source.
|
||||
*/
|
||||
long (SDLCALL * seek) (struct SDL_RWops * context, long offset,
|
||||
int whence);
|
||||
|
||||
typedef struct SDL_RWops {
|
||||
/** Seek to 'offset' relative to whence, one of stdio's whence values:
|
||||
* SEEK_SET, SEEK_CUR, SEEK_END
|
||||
* Returns the final offset in the data source.
|
||||
*/
|
||||
int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
|
||||
/**
|
||||
* Read up to \c maxnum objects each of size \c size from the data
|
||||
* source to the area pointed at by \c ptr.
|
||||
*
|
||||
* \return the number of objects read, or 0 at error or end of file.
|
||||
*/
|
||||
size_t(SDLCALL * read) (struct SDL_RWops * context, void *ptr,
|
||||
size_t size, size_t maxnum);
|
||||
|
||||
/** Read up to 'maxnum' objects each of size 'size' from the data
|
||||
* source to the area pointed at by 'ptr'.
|
||||
* Returns the number of objects read, or -1 if the read failed.
|
||||
*/
|
||||
int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
|
||||
/**
|
||||
* Write exactly \c num objects each of size \c objsize from the area
|
||||
* pointed at by \c ptr to data source.
|
||||
*
|
||||
* \return the number of objects written, or 0 at error or end of file.
|
||||
*/
|
||||
size_t(SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
|
||||
size_t size, size_t num);
|
||||
|
||||
/** Write exactly 'num' objects each of size 'objsize' from the area
|
||||
* pointed at by 'ptr' to data source.
|
||||
* Returns 'num', or -1 if the write failed.
|
||||
*/
|
||||
int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
|
||||
/**
|
||||
* Close and free an allocated SDL_RWops structure.
|
||||
*
|
||||
* \return 0 if successful or -1 on write error when flushing data.
|
||||
*/
|
||||
int (SDLCALL * close) (struct SDL_RWops * context);
|
||||
|
||||
/** Close and free an allocated SDL_FSops structure */
|
||||
int (SDLCALL *close)(struct SDL_RWops *context);
|
||||
|
||||
Uint32 type;
|
||||
union {
|
||||
#if defined(__WIN32__) && !defined(__SYMBIAN32__)
|
||||
struct {
|
||||
int append;
|
||||
void *h;
|
||||
struct {
|
||||
void *data;
|
||||
int size;
|
||||
int left;
|
||||
} buffer;
|
||||
} win32io;
|
||||
Uint32 type;
|
||||
union
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
struct
|
||||
{
|
||||
SDL_bool append;
|
||||
void *h;
|
||||
struct
|
||||
{
|
||||
void *data;
|
||||
size_t size;
|
||||
size_t left;
|
||||
} buffer;
|
||||
} win32io;
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
struct {
|
||||
int autoclose;
|
||||
FILE *fp;
|
||||
} stdio;
|
||||
#ifdef HAVE_STDIO_H
|
||||
struct
|
||||
{
|
||||
SDL_bool autoclose;
|
||||
FILE *fp;
|
||||
} stdio;
|
||||
#endif
|
||||
struct {
|
||||
Uint8 *base;
|
||||
Uint8 *here;
|
||||
Uint8 *stop;
|
||||
} mem;
|
||||
struct {
|
||||
void *data1;
|
||||
} unknown;
|
||||
} hidden;
|
||||
struct
|
||||
{
|
||||
Uint8 *base;
|
||||
Uint8 *here;
|
||||
Uint8 *stop;
|
||||
} mem;
|
||||
struct
|
||||
{
|
||||
void *data1;
|
||||
} unknown;
|
||||
} hidden;
|
||||
|
||||
} SDL_RWops;
|
||||
|
||||
|
||||
/** @name Functions to create SDL_RWops structures from various data sources */
|
||||
/**
|
||||
* \name RWFrom functions
|
||||
*
|
||||
* Functions to create SDL_RWops structures from various data sources.
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
||||
const char *mode);
|
||||
|
||||
#ifdef HAVE_STDIO_H
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
|
||||
SDL_bool autoclose);
|
||||
#else
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
|
||||
SDL_bool autoclose);
|
||||
#endif
|
||||
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
||||
int size);
|
||||
|
||||
extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
|
||||
/*@}*//*RWFrom functions*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
/** @name Seek Reference Points */
|
||||
/*@{*/
|
||||
#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
||||
#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
||||
#define RW_SEEK_END 2 /**< Seek relative to the end of data */
|
||||
/*@}*/
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
||||
|
||||
/** @name Macros to easily read and write from an SDL_RWops structure */
|
||||
#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
||||
#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
||||
#define RW_SEEK_END 2 /**< Seek relative to the end of data */
|
||||
|
||||
/**
|
||||
* \name Read/write macros
|
||||
*
|
||||
* Macros to easily read and write from an SDL_RWops structure.
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
|
||||
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
|
||||
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
|
||||
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
|
||||
#define SDL_RWclose(ctx) (ctx)->close(ctx)
|
||||
/*@}*/
|
||||
/*@}*//*Read/write macros*/
|
||||
|
||||
/** @name Read an item of the specified endianness and return in native format */
|
||||
/*@{*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
|
||||
/*@}*/
|
||||
|
||||
/** @name Write an item of native format to the specified endianness */
|
||||
/**
|
||||
* \name Read endian functions
|
||||
*
|
||||
* Read an item of the specified endianness and return in native format.
|
||||
*/
|
||||
/*@{*/
|
||||
extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
|
||||
extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
|
||||
/*@}*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
||||
/*@}*//*Read endian functions*/
|
||||
|
||||
/**
|
||||
* \name Write endian functions
|
||||
*
|
||||
* Write an item of native format to the specified endianness.
|
||||
*/
|
||||
/*@{*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
|
||||
/*@}*//*Write endian functions*/
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_rwops_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
399
alienblaster/project/jni/sdl/include/SDL_scancode.h
Normal file
399
alienblaster/project/jni/sdl/include/SDL_scancode.h
Normal file
@@ -0,0 +1,399 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_scancode.h
|
||||
*
|
||||
* Defines keyboard scancodes.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_scancode_h
|
||||
#define _SDL_scancode_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
/**
|
||||
* \brief The SDL keyboard scancode representation.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys, among other places
|
||||
* in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
|
||||
* SDL_Event structure.
|
||||
*
|
||||
* The values in this enumeration are based on the USB usage page standard:
|
||||
* http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_SCANCODE_UNKNOWN = 0,
|
||||
|
||||
/**
|
||||
* \name Usage page 0x07
|
||||
*
|
||||
* These values are from usage page 0x07 (USB keyboard page).
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
SDL_SCANCODE_A = 4,
|
||||
SDL_SCANCODE_B = 5,
|
||||
SDL_SCANCODE_C = 6,
|
||||
SDL_SCANCODE_D = 7,
|
||||
SDL_SCANCODE_E = 8,
|
||||
SDL_SCANCODE_F = 9,
|
||||
SDL_SCANCODE_G = 10,
|
||||
SDL_SCANCODE_H = 11,
|
||||
SDL_SCANCODE_I = 12,
|
||||
SDL_SCANCODE_J = 13,
|
||||
SDL_SCANCODE_K = 14,
|
||||
SDL_SCANCODE_L = 15,
|
||||
SDL_SCANCODE_M = 16,
|
||||
SDL_SCANCODE_N = 17,
|
||||
SDL_SCANCODE_O = 18,
|
||||
SDL_SCANCODE_P = 19,
|
||||
SDL_SCANCODE_Q = 20,
|
||||
SDL_SCANCODE_R = 21,
|
||||
SDL_SCANCODE_S = 22,
|
||||
SDL_SCANCODE_T = 23,
|
||||
SDL_SCANCODE_U = 24,
|
||||
SDL_SCANCODE_V = 25,
|
||||
SDL_SCANCODE_W = 26,
|
||||
SDL_SCANCODE_X = 27,
|
||||
SDL_SCANCODE_Y = 28,
|
||||
SDL_SCANCODE_Z = 29,
|
||||
|
||||
SDL_SCANCODE_1 = 30,
|
||||
SDL_SCANCODE_2 = 31,
|
||||
SDL_SCANCODE_3 = 32,
|
||||
SDL_SCANCODE_4 = 33,
|
||||
SDL_SCANCODE_5 = 34,
|
||||
SDL_SCANCODE_6 = 35,
|
||||
SDL_SCANCODE_7 = 36,
|
||||
SDL_SCANCODE_8 = 37,
|
||||
SDL_SCANCODE_9 = 38,
|
||||
SDL_SCANCODE_0 = 39,
|
||||
|
||||
SDL_SCANCODE_RETURN = 40,
|
||||
SDL_SCANCODE_ESCAPE = 41,
|
||||
SDL_SCANCODE_BACKSPACE = 42,
|
||||
SDL_SCANCODE_TAB = 43,
|
||||
SDL_SCANCODE_SPACE = 44,
|
||||
|
||||
SDL_SCANCODE_MINUS = 45,
|
||||
SDL_SCANCODE_EQUALS = 46,
|
||||
SDL_SCANCODE_LEFTBRACKET = 47,
|
||||
SDL_SCANCODE_RIGHTBRACKET = 48,
|
||||
SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
|
||||
* key on ISO keyboards and at the right end
|
||||
* of the QWERTY row on ANSI keyboards.
|
||||
* Produces REVERSE SOLIDUS (backslash) and
|
||||
* VERTICAL LINE in a US layout, REVERSE
|
||||
* SOLIDUS and VERTICAL LINE in a UK Mac
|
||||
* layout, NUMBER SIGN and TILDE in a UK
|
||||
* Windows layout, DOLLAR SIGN and POUND SIGN
|
||||
* in a Swiss German layout, NUMBER SIGN and
|
||||
* APOSTROPHE in a German layout, GRAVE
|
||||
* ACCENT and POUND SIGN in a French Mac
|
||||
* layout, and ASTERISK and MICRO SIGN in a
|
||||
* French Windows layout.
|
||||
*/
|
||||
SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
|
||||
* instead of 49 for the same key, but all
|
||||
* OSes I've seen treat the two codes
|
||||
* identically. So, as an implementor, unless
|
||||
* your keyboard generates both of those
|
||||
* codes and your OS treats them differently,
|
||||
* you should generate SDL_SCANCODE_BACKSLASH
|
||||
* instead of this code. As a user, you
|
||||
* should not rely on this code because SDL
|
||||
* will never generate it with most (all?)
|
||||
* keyboards.
|
||||
*/
|
||||
SDL_SCANCODE_SEMICOLON = 51,
|
||||
SDL_SCANCODE_APOSTROPHE = 52,
|
||||
SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
|
||||
* and ISO keyboards). Produces GRAVE ACCENT and
|
||||
* TILDE in a US Windows layout and in US and UK
|
||||
* Mac layouts on ANSI keyboards, GRAVE ACCENT
|
||||
* and NOT SIGN in a UK Windows layout, SECTION
|
||||
* SIGN and PLUS-MINUS SIGN in US and UK Mac
|
||||
* layouts on ISO keyboards, SECTION SIGN and
|
||||
* DEGREE SIGN in a Swiss German layout (Mac:
|
||||
* only on ISO keyboards), CIRCUMFLEX ACCENT and
|
||||
* DEGREE SIGN in a German layout (Mac: only on
|
||||
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
|
||||
* French Windows layout, COMMERCIAL AT and
|
||||
* NUMBER SIGN in a French Mac layout on ISO
|
||||
* keyboards, and LESS-THAN SIGN and GREATER-THAN
|
||||
* SIGN in a Swiss German, German, or French Mac
|
||||
* layout on ANSI keyboards.
|
||||
*/
|
||||
SDL_SCANCODE_COMMA = 54,
|
||||
SDL_SCANCODE_PERIOD = 55,
|
||||
SDL_SCANCODE_SLASH = 56,
|
||||
|
||||
SDL_SCANCODE_CAPSLOCK = 57,
|
||||
|
||||
SDL_SCANCODE_F1 = 58,
|
||||
SDL_SCANCODE_F2 = 59,
|
||||
SDL_SCANCODE_F3 = 60,
|
||||
SDL_SCANCODE_F4 = 61,
|
||||
SDL_SCANCODE_F5 = 62,
|
||||
SDL_SCANCODE_F6 = 63,
|
||||
SDL_SCANCODE_F7 = 64,
|
||||
SDL_SCANCODE_F8 = 65,
|
||||
SDL_SCANCODE_F9 = 66,
|
||||
SDL_SCANCODE_F10 = 67,
|
||||
SDL_SCANCODE_F11 = 68,
|
||||
SDL_SCANCODE_F12 = 69,
|
||||
|
||||
SDL_SCANCODE_PRINTSCREEN = 70,
|
||||
SDL_SCANCODE_SCROLLLOCK = 71,
|
||||
SDL_SCANCODE_PAUSE = 72,
|
||||
SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
|
||||
does send code 73, not 117) */
|
||||
SDL_SCANCODE_HOME = 74,
|
||||
SDL_SCANCODE_PAGEUP = 75,
|
||||
SDL_SCANCODE_DELETE = 76,
|
||||
SDL_SCANCODE_END = 77,
|
||||
SDL_SCANCODE_PAGEDOWN = 78,
|
||||
SDL_SCANCODE_RIGHT = 79,
|
||||
SDL_SCANCODE_LEFT = 80,
|
||||
SDL_SCANCODE_DOWN = 81,
|
||||
SDL_SCANCODE_UP = 82,
|
||||
|
||||
SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
|
||||
*/
|
||||
SDL_SCANCODE_KP_DIVIDE = 84,
|
||||
SDL_SCANCODE_KP_MULTIPLY = 85,
|
||||
SDL_SCANCODE_KP_MINUS = 86,
|
||||
SDL_SCANCODE_KP_PLUS = 87,
|
||||
SDL_SCANCODE_KP_ENTER = 88,
|
||||
SDL_SCANCODE_KP_1 = 89,
|
||||
SDL_SCANCODE_KP_2 = 90,
|
||||
SDL_SCANCODE_KP_3 = 91,
|
||||
SDL_SCANCODE_KP_4 = 92,
|
||||
SDL_SCANCODE_KP_5 = 93,
|
||||
SDL_SCANCODE_KP_6 = 94,
|
||||
SDL_SCANCODE_KP_7 = 95,
|
||||
SDL_SCANCODE_KP_8 = 96,
|
||||
SDL_SCANCODE_KP_9 = 97,
|
||||
SDL_SCANCODE_KP_0 = 98,
|
||||
SDL_SCANCODE_KP_PERIOD = 99,
|
||||
|
||||
SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
|
||||
* keyboards have over ANSI ones,
|
||||
* located between left shift and Y.
|
||||
* Produces GRAVE ACCENT and TILDE in a
|
||||
* US or UK Mac layout, REVERSE SOLIDUS
|
||||
* (backslash) and VERTICAL LINE in a
|
||||
* US or UK Windows layout, and
|
||||
* LESS-THAN SIGN and GREATER-THAN SIGN
|
||||
* in a Swiss German, German, or French
|
||||
* layout. */
|
||||
SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
|
||||
SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
|
||||
* not a physical key - but some Mac keyboards
|
||||
* do have a power key. */
|
||||
SDL_SCANCODE_KP_EQUALS = 103,
|
||||
SDL_SCANCODE_F13 = 104,
|
||||
SDL_SCANCODE_F14 = 105,
|
||||
SDL_SCANCODE_F15 = 106,
|
||||
SDL_SCANCODE_F16 = 107,
|
||||
SDL_SCANCODE_F17 = 108,
|
||||
SDL_SCANCODE_F18 = 109,
|
||||
SDL_SCANCODE_F19 = 110,
|
||||
SDL_SCANCODE_F20 = 111,
|
||||
SDL_SCANCODE_F21 = 112,
|
||||
SDL_SCANCODE_F22 = 113,
|
||||
SDL_SCANCODE_F23 = 114,
|
||||
SDL_SCANCODE_F24 = 115,
|
||||
SDL_SCANCODE_EXECUTE = 116,
|
||||
SDL_SCANCODE_HELP = 117,
|
||||
SDL_SCANCODE_MENU = 118,
|
||||
SDL_SCANCODE_SELECT = 119,
|
||||
SDL_SCANCODE_STOP = 120,
|
||||
SDL_SCANCODE_AGAIN = 121, /**< redo */
|
||||
SDL_SCANCODE_UNDO = 122,
|
||||
SDL_SCANCODE_CUT = 123,
|
||||
SDL_SCANCODE_COPY = 124,
|
||||
SDL_SCANCODE_PASTE = 125,
|
||||
SDL_SCANCODE_FIND = 126,
|
||||
SDL_SCANCODE_MUTE = 127,
|
||||
SDL_SCANCODE_VOLUMEUP = 128,
|
||||
SDL_SCANCODE_VOLUMEDOWN = 129,
|
||||
/* not sure whether there's a reason to enable these */
|
||||
/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
|
||||
/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
|
||||
/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
|
||||
SDL_SCANCODE_KP_COMMA = 133,
|
||||
SDL_SCANCODE_KP_EQUALSAS400 = 134,
|
||||
|
||||
SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
|
||||
footnotes in USB doc */
|
||||
SDL_SCANCODE_INTERNATIONAL2 = 136,
|
||||
SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
|
||||
SDL_SCANCODE_INTERNATIONAL4 = 138,
|
||||
SDL_SCANCODE_INTERNATIONAL5 = 139,
|
||||
SDL_SCANCODE_INTERNATIONAL6 = 140,
|
||||
SDL_SCANCODE_INTERNATIONAL7 = 141,
|
||||
SDL_SCANCODE_INTERNATIONAL8 = 142,
|
||||
SDL_SCANCODE_INTERNATIONAL9 = 143,
|
||||
SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
|
||||
SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
|
||||
SDL_SCANCODE_LANG3 = 146, /**< Katakana */
|
||||
SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
|
||||
SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
|
||||
SDL_SCANCODE_LANG6 = 149, /**< reserved */
|
||||
SDL_SCANCODE_LANG7 = 150, /**< reserved */
|
||||
SDL_SCANCODE_LANG8 = 151, /**< reserved */
|
||||
SDL_SCANCODE_LANG9 = 152, /**< reserved */
|
||||
|
||||
SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
|
||||
SDL_SCANCODE_SYSREQ = 154,
|
||||
SDL_SCANCODE_CANCEL = 155,
|
||||
SDL_SCANCODE_CLEAR = 156,
|
||||
SDL_SCANCODE_PRIOR = 157,
|
||||
SDL_SCANCODE_RETURN2 = 158,
|
||||
SDL_SCANCODE_SEPARATOR = 159,
|
||||
SDL_SCANCODE_OUT = 160,
|
||||
SDL_SCANCODE_OPER = 161,
|
||||
SDL_SCANCODE_CLEARAGAIN = 162,
|
||||
SDL_SCANCODE_CRSEL = 163,
|
||||
SDL_SCANCODE_EXSEL = 164,
|
||||
|
||||
SDL_SCANCODE_KP_00 = 176,
|
||||
SDL_SCANCODE_KP_000 = 177,
|
||||
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
|
||||
SDL_SCANCODE_DECIMALSEPARATOR = 179,
|
||||
SDL_SCANCODE_CURRENCYUNIT = 180,
|
||||
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
|
||||
SDL_SCANCODE_KP_LEFTPAREN = 182,
|
||||
SDL_SCANCODE_KP_RIGHTPAREN = 183,
|
||||
SDL_SCANCODE_KP_LEFTBRACE = 184,
|
||||
SDL_SCANCODE_KP_RIGHTBRACE = 185,
|
||||
SDL_SCANCODE_KP_TAB = 186,
|
||||
SDL_SCANCODE_KP_BACKSPACE = 187,
|
||||
SDL_SCANCODE_KP_A = 188,
|
||||
SDL_SCANCODE_KP_B = 189,
|
||||
SDL_SCANCODE_KP_C = 190,
|
||||
SDL_SCANCODE_KP_D = 191,
|
||||
SDL_SCANCODE_KP_E = 192,
|
||||
SDL_SCANCODE_KP_F = 193,
|
||||
SDL_SCANCODE_KP_XOR = 194,
|
||||
SDL_SCANCODE_KP_POWER = 195,
|
||||
SDL_SCANCODE_KP_PERCENT = 196,
|
||||
SDL_SCANCODE_KP_LESS = 197,
|
||||
SDL_SCANCODE_KP_GREATER = 198,
|
||||
SDL_SCANCODE_KP_AMPERSAND = 199,
|
||||
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
|
||||
SDL_SCANCODE_KP_VERTICALBAR = 201,
|
||||
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
|
||||
SDL_SCANCODE_KP_COLON = 203,
|
||||
SDL_SCANCODE_KP_HASH = 204,
|
||||
SDL_SCANCODE_KP_SPACE = 205,
|
||||
SDL_SCANCODE_KP_AT = 206,
|
||||
SDL_SCANCODE_KP_EXCLAM = 207,
|
||||
SDL_SCANCODE_KP_MEMSTORE = 208,
|
||||
SDL_SCANCODE_KP_MEMRECALL = 209,
|
||||
SDL_SCANCODE_KP_MEMCLEAR = 210,
|
||||
SDL_SCANCODE_KP_MEMADD = 211,
|
||||
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
|
||||
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
|
||||
SDL_SCANCODE_KP_MEMDIVIDE = 214,
|
||||
SDL_SCANCODE_KP_PLUSMINUS = 215,
|
||||
SDL_SCANCODE_KP_CLEAR = 216,
|
||||
SDL_SCANCODE_KP_CLEARENTRY = 217,
|
||||
SDL_SCANCODE_KP_BINARY = 218,
|
||||
SDL_SCANCODE_KP_OCTAL = 219,
|
||||
SDL_SCANCODE_KP_DECIMAL = 220,
|
||||
SDL_SCANCODE_KP_HEXADECIMAL = 221,
|
||||
|
||||
SDL_SCANCODE_LCTRL = 224,
|
||||
SDL_SCANCODE_LSHIFT = 225,
|
||||
SDL_SCANCODE_LALT = 226, /**< alt, option */
|
||||
SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
|
||||
SDL_SCANCODE_RCTRL = 228,
|
||||
SDL_SCANCODE_RSHIFT = 229,
|
||||
SDL_SCANCODE_RALT = 230, /**< alt gr, option */
|
||||
SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
|
||||
|
||||
SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered
|
||||
* by any of the above, but since there's a
|
||||
* special KMOD_MODE for it I'm adding it here
|
||||
*/
|
||||
|
||||
/*@}*//*Usage page 0x07*/
|
||||
|
||||
/**
|
||||
* \name Usage page 0x0C
|
||||
*
|
||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
SDL_SCANCODE_AUDIONEXT = 258,
|
||||
SDL_SCANCODE_AUDIOPREV = 259,
|
||||
SDL_SCANCODE_AUDIOSTOP = 260,
|
||||
SDL_SCANCODE_AUDIOPLAY = 261,
|
||||
SDL_SCANCODE_AUDIOMUTE = 262,
|
||||
SDL_SCANCODE_MEDIASELECT = 263,
|
||||
SDL_SCANCODE_WWW = 264,
|
||||
SDL_SCANCODE_MAIL = 265,
|
||||
SDL_SCANCODE_CALCULATOR = 266,
|
||||
SDL_SCANCODE_COMPUTER = 267,
|
||||
SDL_SCANCODE_AC_SEARCH = 268,
|
||||
SDL_SCANCODE_AC_HOME = 269,
|
||||
SDL_SCANCODE_AC_BACK = 270,
|
||||
SDL_SCANCODE_AC_FORWARD = 271,
|
||||
SDL_SCANCODE_AC_STOP = 272,
|
||||
SDL_SCANCODE_AC_REFRESH = 273,
|
||||
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
||||
|
||||
/*@}*//*Usage page 0x0C*/
|
||||
|
||||
/**
|
||||
* \name Walther keys
|
||||
*
|
||||
* These are values that Christian Walther added (for mac keyboard?).
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
|
||||
SDL_SCANCODE_BRIGHTNESSUP = 276,
|
||||
SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
|
||||
switch, video mode switch */
|
||||
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
|
||||
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
||||
SDL_SCANCODE_KBDILLUMUP = 280,
|
||||
SDL_SCANCODE_EJECT = 281,
|
||||
SDL_SCANCODE_SLEEP = 282,
|
||||
|
||||
/*@}*//*Walther keys*/
|
||||
|
||||
/* Add any other keys here. */
|
||||
|
||||
SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
|
||||
for array bounds */
|
||||
} SDL_scancode;
|
||||
|
||||
#endif /* _SDL_scancode_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,8 +20,10 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_stdinc.h
|
||||
* This is a general header that includes C language support
|
||||
/**
|
||||
* \file SDL_stdinc.h
|
||||
*
|
||||
* This is a general header that includes C language support.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_stdinc_h
|
||||
@@ -70,16 +72,26 @@
|
||||
#ifdef HAVE_CTYPE_H
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
#ifdef HAVE_MATH_H
|
||||
# include <math.h>
|
||||
#endif
|
||||
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
|
||||
/** The number of elements in an array */
|
||||
/**
|
||||
* The number of elements in an array.
|
||||
*/
|
||||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
||||
#define SDL_TABLESIZE(table) SDL_arraysize(table)
|
||||
|
||||
/* Use proper C++ casts when compiled as C++ to be compatible with the option
|
||||
-Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
|
||||
/**
|
||||
* \name Cast operators
|
||||
*
|
||||
* Use proper C++ casts when compiled as C++ to be compatible with the option
|
||||
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
|
||||
*/
|
||||
/*@{*/
|
||||
#ifdef __cplusplus
|
||||
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
|
||||
#define SDL_static_cast(type, expression) static_cast<type>(expression)
|
||||
@@ -87,93 +99,130 @@
|
||||
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
|
||||
#define SDL_static_cast(type, expression) ((type)(expression))
|
||||
#endif
|
||||
/*@}*//*Cast operators*/
|
||||
|
||||
/** @name Basic data types */
|
||||
/**
|
||||
* \name Basic data types
|
||||
*/
|
||||
/*@{*/
|
||||
typedef enum {
|
||||
SDL_FALSE = 0,
|
||||
SDL_TRUE = 1
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_FALSE = 0,
|
||||
SDL_TRUE = 1
|
||||
} SDL_bool;
|
||||
|
||||
typedef int8_t Sint8;
|
||||
typedef uint8_t Uint8;
|
||||
typedef int16_t Sint16;
|
||||
typedef uint16_t Uint16;
|
||||
typedef int32_t Sint32;
|
||||
typedef uint32_t Uint32;
|
||||
/**
|
||||
* \brief A signed 8-bit integer type.
|
||||
*/
|
||||
typedef int8_t Sint8;
|
||||
/**
|
||||
* \brief An unsigned 8-bit integer type.
|
||||
*/
|
||||
typedef uint8_t Uint8;
|
||||
/**
|
||||
* \brief A signed 16-bit integer type.
|
||||
*/
|
||||
typedef int16_t Sint16;
|
||||
/**
|
||||
* \brief An unsigned 16-bit integer type.
|
||||
*/
|
||||
typedef uint16_t Uint16;
|
||||
/**
|
||||
* \brief A signed 32-bit integer type.
|
||||
*/
|
||||
typedef int32_t Sint32;
|
||||
/**
|
||||
* \brief An unsigned 32-bit integer type.
|
||||
*/
|
||||
typedef uint32_t Uint32;
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
typedef int64_t Sint64;
|
||||
#ifndef SYMBIAN32_GCCE
|
||||
typedef uint64_t Uint64;
|
||||
#endif
|
||||
/**
|
||||
* \brief A signed 64-bit integer type.
|
||||
* \warning On platforms without any sort of 64-bit datatype, this is equivalent to Sint32!
|
||||
*/
|
||||
typedef int64_t Sint64;
|
||||
/**
|
||||
* \brief An unsigned 64-bit integer type.
|
||||
* \warning On platforms without any sort of 64-bit datatype, this is equivalent to Uint32!
|
||||
*/
|
||||
typedef uint64_t Uint64;
|
||||
#else
|
||||
/* This is really just a hack to prevent the compiler from complaining */
|
||||
typedef struct {
|
||||
Uint32 hi;
|
||||
Uint32 lo;
|
||||
} Uint64, Sint64;
|
||||
typedef Sint32 Sint64;
|
||||
typedef Uint32 Uint64;
|
||||
#endif
|
||||
|
||||
/*@}*/
|
||||
/*@}*//*Basic data types*/
|
||||
|
||||
|
||||
/** @name Make sure the types really have the right sizes */
|
||||
/*@{*/
|
||||
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
||||
typedef int SDL_dummy_ ## name[(x) * 2 - 1]
|
||||
|
||||
/** \cond */
|
||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
|
||||
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
|
||||
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
|
||||
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
|
||||
#ifndef __NINTENDODS__ /* TODO: figure out why the following happens:
|
||||
include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
|
||||
include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
|
||||
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
|
||||
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
||||
/*@}*/
|
||||
#endif
|
||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
||||
/** \endcond */
|
||||
|
||||
/** @name Enum Size Check
|
||||
* Check to make sure enums are the size of ints, for structure packing.
|
||||
* For both Watcom C/C++ and Borland C/C++ the compiler option that makes
|
||||
* enums having the size of an int must be enabled.
|
||||
* This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
|
||||
*/
|
||||
/* Check to make sure enums are the size of ints, for structure packing.
|
||||
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
|
||||
enums having the size of an int must be enabled.
|
||||
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
|
||||
*/
|
||||
/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
|
||||
#ifdef __MWERKS__
|
||||
#pragma enumsalwaysint on
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
DUMMY_ENUM_VALUE
|
||||
/** \cond */
|
||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||
#ifndef __NINTENDODS__ /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
||||
typedef enum
|
||||
{
|
||||
DUMMY_ENUM_VALUE
|
||||
} SDL_DUMMY_ENUM;
|
||||
|
||||
#ifndef __NDS__
|
||||
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
|
||||
#endif
|
||||
/*@}*/
|
||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
||||
/** \endcond */
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC
|
||||
#define SDL_malloc malloc
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
|
||||
extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CALLOC
|
||||
#define SDL_calloc calloc
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REALLOC
|
||||
#define SDL_realloc realloc
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FREE
|
||||
@@ -197,11 +246,11 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
||||
# elif defined(__DMC__)
|
||||
# include <stdlib.h>
|
||||
# elif defined(__AIX__)
|
||||
#pragma alloca
|
||||
#pragma alloca
|
||||
# elif defined(__MRC__)
|
||||
void *alloca (unsigned);
|
||||
void *alloca(unsigned);
|
||||
# else
|
||||
char *alloca ();
|
||||
char *alloca();
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_ALLOCA
|
||||
@@ -215,20 +264,23 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
||||
#ifdef HAVE_GETENV
|
||||
#define SDL_getenv getenv
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
|
||||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PUTENV
|
||||
#define SDL_putenv putenv
|
||||
/* SDL_putenv() has moved to SDL_compat. */
|
||||
#ifdef HAVE_SETENV
|
||||
#define SDL_setenv setenv
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
|
||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value,
|
||||
int overwrite);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_QSORT
|
||||
#define SDL_qsort qsort
|
||||
#else
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
|
||||
int (*compare)(const void *, const void *));
|
||||
int (*compare) (const void *,
|
||||
const void *));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ABS
|
||||
@@ -255,8 +307,10 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
|
||||
#ifdef HAVE_MEMSET
|
||||
#define SDL_memset memset
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
|
||||
extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len);
|
||||
#endif
|
||||
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
||||
|
||||
#if defined(__GNUC__) && defined(i386)
|
||||
#define SDL_memset4(dst, val, len) \
|
||||
@@ -275,7 +329,7 @@ do { \
|
||||
do { \
|
||||
unsigned _count = (len); \
|
||||
unsigned _n = (_count + 3) / 4; \
|
||||
Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
|
||||
Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
|
||||
Uint32 _val = (val); \
|
||||
if (len == 0) break; \
|
||||
switch (_count % 4) { \
|
||||
@@ -316,7 +370,8 @@ do { \
|
||||
#elif defined(HAVE_BCOPY)
|
||||
#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
|
||||
#else
|
||||
extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
|
||||
extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src,
|
||||
size_t len);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -343,8 +398,8 @@ do { \
|
||||
#define SDL_revcpy(dst, src, len) \
|
||||
do { \
|
||||
int u0, u1, u2; \
|
||||
char *dstp = SDL_static_cast(char *, dst); \
|
||||
char *srcp = SDL_static_cast(char *, src); \
|
||||
char *dstp = SDL_static_cast(char *, dst); \
|
||||
char *srcp = SDL_static_cast(char *, src); \
|
||||
int n = (len); \
|
||||
if ( n >= 4 ) { \
|
||||
__asm__ __volatile__ ( \
|
||||
@@ -367,7 +422,8 @@ do { \
|
||||
} while(0)
|
||||
#endif
|
||||
#ifndef SDL_revcpy
|
||||
extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
|
||||
extern DECLSPEC void *SDLCALL SDL_revcpy(void *dst, const void *src,
|
||||
size_t len);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMMOVE
|
||||
@@ -388,7 +444,8 @@ do { \
|
||||
#ifdef HAVE_MEMCMP
|
||||
#define SDL_memcmp memcmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
||||
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2,
|
||||
size_t len);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRLEN
|
||||
@@ -397,40 +454,51 @@ extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t le
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WCSLEN
|
||||
#define SDL_wcslen wcslen
|
||||
#else
|
||||
#if !defined(wchar_t) && defined(__NINTENDODS__)
|
||||
#define wchar_t short /* TODO: figure out why libnds doesn't have this */
|
||||
#endif
|
||||
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRLCPY
|
||||
#define SDL_strlcpy strlcpy
|
||||
#else
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src,
|
||||
size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRLCAT
|
||||
#define SDL_strlcat strlcat
|
||||
#else
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src,
|
||||
size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRDUP
|
||||
#define SDL_strdup strdup
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
|
||||
extern DECLSPEC char *SDLCALL SDL_strdup(const char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__STRREV
|
||||
#define SDL_strrev _strrev
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
|
||||
extern DECLSPEC char *SDLCALL SDL_strrev(char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__STRUPR
|
||||
#define SDL_strupr _strupr
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
|
||||
extern DECLSPEC char *SDLCALL SDL_strupr(char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__STRLWR
|
||||
#define SDL_strlwr _strlwr
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
|
||||
extern DECLSPEC char *SDLCALL SDL_strlwr(char *string);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRCHR
|
||||
@@ -438,7 +506,7 @@ extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
|
||||
#elif defined(HAVE_INDEX)
|
||||
#define SDL_strchr index
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
|
||||
extern DECLSPEC char *SDLCALL SDL_strchr(const char *string, int c);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRRCHR
|
||||
@@ -446,13 +514,14 @@ extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
|
||||
#elif defined(HAVE_RINDEX)
|
||||
#define SDL_strrchr rindex
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
|
||||
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *string, int c);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRSTR
|
||||
#define SDL_strstr strstr
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
||||
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack,
|
||||
const char *needle);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ITOA
|
||||
@@ -464,7 +533,7 @@ extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *need
|
||||
#ifdef HAVE__LTOA
|
||||
#define SDL_ltoa _ltoa
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *string, int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__UITOA
|
||||
@@ -476,19 +545,22 @@ extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
|
||||
#ifdef HAVE__ULTOA
|
||||
#define SDL_ultoa _ultoa
|
||||
#else
|
||||
extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *string,
|
||||
int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOL
|
||||
#define SDL_strtol strtol
|
||||
#else
|
||||
extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
|
||||
extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp,
|
||||
int base);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOUL
|
||||
#define SDL_strtoul strtoul
|
||||
#else
|
||||
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
|
||||
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string,
|
||||
char **endp, int base);
|
||||
#endif
|
||||
|
||||
#ifdef SDL_HAS_64BIT_TYPE
|
||||
@@ -496,25 +568,29 @@ extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **end
|
||||
#ifdef HAVE__I64TOA
|
||||
#define SDL_lltoa _i64toa
|
||||
#else
|
||||
extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *string,
|
||||
int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE__UI64TOA
|
||||
#define SDL_ulltoa _ui64toa
|
||||
#else
|
||||
extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *string,
|
||||
int radix);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOLL
|
||||
#define SDL_strtoll strtoll
|
||||
#else
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp,
|
||||
int base);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRTOULL
|
||||
#define SDL_strtoull strtoull
|
||||
#else
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp,
|
||||
int base);
|
||||
#endif
|
||||
|
||||
#endif /* SDL_HAS_64BIT_TYPE */
|
||||
@@ -546,7 +622,8 @@ extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
||||
#ifdef HAVE_STRNCMP
|
||||
#define SDL_strncmp strncmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
||||
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2,
|
||||
size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRCASECMP
|
||||
@@ -554,7 +631,8 @@ extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size
|
||||
#elif defined(HAVE__STRICMP)
|
||||
#define SDL_strcasecmp _stricmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
||||
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1,
|
||||
const char *str2);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRNCASECMP
|
||||
@@ -562,36 +640,112 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
||||
#elif defined(HAVE__STRNICMP)
|
||||
#define SDL_strncasecmp _strnicmp
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
||||
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1,
|
||||
const char *str2, size_t maxlen);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SSCANF
|
||||
#define SDL_sscanf sscanf
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
|
||||
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt,
|
||||
...);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
#define SDL_snprintf snprintf
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
|
||||
extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen,
|
||||
const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
#define SDL_vsnprintf vsnprintf
|
||||
#else
|
||||
extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
|
||||
extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen,
|
||||
const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
/** @name SDL_ICONV Error Codes
|
||||
* The SDL implementation of iconv() returns these error codes
|
||||
*/
|
||||
/*@{*/
|
||||
#ifndef HAVE_M_PI
|
||||
#define M_PI 3.14159265358979323846264338327950288 /* pi */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CEIL
|
||||
#define SDL_ceil ceil
|
||||
#else
|
||||
#define SDL_ceil(x) ((double)(int)((x)+0.5))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COPYSIGN
|
||||
#define SDL_copysign copysign
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COS
|
||||
#define SDL_cos cos
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_cos(double x);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_COSF
|
||||
#define SDL_cosf cosf
|
||||
#else
|
||||
#define SDL_cosf(x) (float)SDL_cos((double)x)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FABS
|
||||
#define SDL_fabs fabs
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_fabs(double x);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FLOOR
|
||||
#define SDL_floor floor
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_floor(double x);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOG
|
||||
#define SDL_log log
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_log(double x);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POW
|
||||
#define SDL_pow pow
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SCALBN
|
||||
#define SDL_scalbn scalbn
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SIN
|
||||
#define SDL_sin sin
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_sin(double x);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SINF
|
||||
#define SDL_sinf sinf
|
||||
#else
|
||||
#define SDL_sinf(x) (float)SDL_sin((double)x)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SQRT
|
||||
#define SDL_sqrt sqrt
|
||||
#else
|
||||
extern DECLSPEC double SDLCALL SDL_sqrt(double x);
|
||||
#endif
|
||||
|
||||
/* The SDL implementation of iconv() returns these error codes */
|
||||
#define SDL_ICONV_ERROR (size_t)-1
|
||||
#define SDL_ICONV_E2BIG (size_t)-2
|
||||
#define SDL_ICONV_EILSEQ (size_t)-3
|
||||
#define SDL_ICONV_EINVAL (size_t)-4
|
||||
/*@}*/
|
||||
|
||||
#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
|
||||
#define SDL_iconv_t iconv_t
|
||||
@@ -599,22 +753,33 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char
|
||||
#define SDL_iconv_close iconv_close
|
||||
#else
|
||||
typedef struct _SDL_iconv_t *SDL_iconv_t;
|
||||
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
|
||||
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
|
||||
const char *fromcode);
|
||||
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
||||
#endif
|
||||
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
|
||||
/** This function converts a string between encodings in one pass, returning a
|
||||
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
||||
size_t * inbytesleft, char **outbuf,
|
||||
size_t * outbytesleft);
|
||||
/**
|
||||
* This function converts a string between encodings in one pass, returning a
|
||||
* string that must be freed with SDL_free() or NULL on error.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
|
||||
extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
||||
const char *fromcode,
|
||||
const char *inbuf,
|
||||
size_t inbytesleft);
|
||||
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
|
||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_stdinc_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
700
alienblaster/project/jni/sdl/include/SDL_surface.h
Normal file
700
alienblaster/project/jni/sdl/include/SDL_surface.h
Normal file
@@ -0,0 +1,700 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_surface.h
|
||||
*
|
||||
* Header file for ::SDL_surface definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_surface_h
|
||||
#define _SDL_surface_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_pixels.h"
|
||||
#include "SDL_rect.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name Surface flags
|
||||
*
|
||||
* These are the currently supported flags for the ::SDL_surface.
|
||||
*
|
||||
* \internal
|
||||
* Used internally (read-only).
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
|
||||
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
|
||||
/*@}*//*Surface flags*/
|
||||
|
||||
/**
|
||||
* Evaluates to true if the surface needs to be locked before access.
|
||||
*/
|
||||
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
||||
|
||||
/**
|
||||
* \brief A collection of pixels used in software blitting.
|
||||
*
|
||||
* \note This structure should be treated as read-only, except for \c pixels,
|
||||
* which, if not NULL, contains the raw pixel data for the surface.
|
||||
*/
|
||||
typedef struct SDL_Surface
|
||||
{
|
||||
Uint32 flags; /**< Read-only */
|
||||
SDL_PixelFormat *format; /**< Read-only */
|
||||
int w, h; /**< Read-only */
|
||||
int pitch; /**< Read-only */
|
||||
void *pixels; /**< Read-write */
|
||||
|
||||
/** Application data associated with the surface */
|
||||
void *userdata; /**< Read-write */
|
||||
|
||||
/** information needed for surfaces requiring locks */
|
||||
int locked; /**< Read-only */
|
||||
void *lock_data; /**< Read-only */
|
||||
|
||||
/** clipping information */
|
||||
SDL_Rect clip_rect; /**< Read-only */
|
||||
|
||||
/** info for fast blit mapping to other surfaces */
|
||||
struct SDL_BlitMap *map; /**< Private */
|
||||
|
||||
/** format version, bumped at every change to invalidate blit maps */
|
||||
unsigned int format_version; /**< Private */
|
||||
|
||||
/** Reference count -- used when freeing surface */
|
||||
int refcount; /**< Read-mostly */
|
||||
} SDL_Surface;
|
||||
|
||||
/**
|
||||
* \brief The type of function used for surface blitting functions.
|
||||
*/
|
||||
typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
||||
struct SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
/**
|
||||
* Allocate and free an RGB surface.
|
||||
*
|
||||
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
|
||||
* If the depth is greater than 8 bits, the pixel format is set using the
|
||||
* flags '[RGB]mask'.
|
||||
*
|
||||
* If the function runs out of memory, it will return NULL.
|
||||
*
|
||||
* \param flags The \c flags are obsolete and should be set to 0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
||||
(Uint32 flags, int width, int height, int depth,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
int pitch,
|
||||
Uint32 Rmask,
|
||||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
Uint32 Amask);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
||||
|
||||
/**
|
||||
* \brief Set the palette used by a surface.
|
||||
*
|
||||
* \return 0, or -1 if the surface format doesn't use a palette.
|
||||
*
|
||||
* \note A single palette can be shared with many surfaces.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
|
||||
SDL_Palette * palette);
|
||||
|
||||
/**
|
||||
* \brief Sets up a surface for directly accessing the pixels.
|
||||
*
|
||||
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
|
||||
* to and read from \c surface->pixels, using the pixel format stored in
|
||||
* \c surface->format. Once you are done accessing the surface, you should
|
||||
* use SDL_UnlockSurface() to release it.
|
||||
*
|
||||
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
|
||||
* to 0, then you can read and write to the surface at any time, and the
|
||||
* pixel format of the surface will not change.
|
||||
*
|
||||
* No operating system or library calls should be made between lock/unlock
|
||||
* pairs, as critical system locks may be held during this time.
|
||||
*
|
||||
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
|
||||
*
|
||||
* \sa SDL_UnlockSurface()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
|
||||
/** \sa SDL_LockSurface() */
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
|
||||
|
||||
/**
|
||||
* Load a surface from a seekable SDL data source (memory or file).
|
||||
*
|
||||
* If \c freesrc is non-zero, the source will be closed after being read.
|
||||
*
|
||||
* The new surface should be freed with SDL_FreeSurface().
|
||||
*
|
||||
* \return the new surface, or NULL if there was an error.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
||||
int freesrc);
|
||||
|
||||
/**
|
||||
* Load a surface from a file.
|
||||
*
|
||||
* Convenience macro.
|
||||
*/
|
||||
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
|
||||
|
||||
/**
|
||||
* Save a surface to a seekable SDL data source (memory or file).
|
||||
*
|
||||
* If \c freedst is non-zero, the source will be closed after being written.
|
||||
*
|
||||
* \return 0 if successful or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
||||
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
|
||||
|
||||
/**
|
||||
* Save a surface to a file.
|
||||
*
|
||||
* Convenience macro.
|
||||
*/
|
||||
#define SDL_SaveBMP(surface, file) \
|
||||
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
||||
|
||||
/**
|
||||
* \brief Sets the RLE acceleration hint for a surface.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid
|
||||
*
|
||||
* \note If RLE is enabled, colorkey and alpha blending blits are much faster,
|
||||
* but the surface must be locked before directly accessing the pixels.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
|
||||
int flag);
|
||||
|
||||
/**
|
||||
* \brief Sets the color key (transparent pixel) in a blittable surface.
|
||||
*
|
||||
* \param surface The surface to update
|
||||
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
|
||||
* \param key The transparent pixel in the native surface format
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
|
||||
int flag, Uint32 key);
|
||||
|
||||
/**
|
||||
* \brief Gets the color key (transparent pixel) in a blittable surface.
|
||||
*
|
||||
* \param surface The surface to update
|
||||
* \param key A pointer filled in with the transparent pixel in the native
|
||||
* surface format
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid or colorkey is not
|
||||
* enabled.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
|
||||
Uint32 * key);
|
||||
|
||||
/**
|
||||
* \brief Set an additional color value used in blit operations.
|
||||
*
|
||||
* \param surface The surface to update.
|
||||
* \param r The red source color value multiplied into blit operations.
|
||||
* \param g The green source color value multiplied into blit operations.
|
||||
* \param b The blue source color value multiplied into blit operations.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid.
|
||||
*
|
||||
* \sa SDL_GetSurfaceColorMod()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
|
||||
Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get the additional color value used in blit operations.
|
||||
*
|
||||
* \param surface The surface to query.
|
||||
* \param r A pointer filled in with the source red color value.
|
||||
* \param g A pointer filled in with the source green color value.
|
||||
* \param b A pointer filled in with the source blue color value.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid.
|
||||
*
|
||||
* \sa SDL_SetSurfaceColorMod()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
|
||||
Uint8 * r, Uint8 * g,
|
||||
Uint8 * b);
|
||||
|
||||
/**
|
||||
* \brief Set an additional alpha value used in blit operations.
|
||||
*
|
||||
* \param surface The surface to update.
|
||||
* \param alpha The source alpha value multiplied into blit operations.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid.
|
||||
*
|
||||
* \sa SDL_GetSurfaceAlphaMod()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
|
||||
Uint8 alpha);
|
||||
|
||||
/**
|
||||
* \brief Get the additional alpha value used in blit operations.
|
||||
*
|
||||
* \param surface The surface to query.
|
||||
* \param alpha A pointer filled in with the source alpha value.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid.
|
||||
*
|
||||
* \sa SDL_SetSurfaceAlphaMod()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
|
||||
Uint8 * alpha);
|
||||
|
||||
/**
|
||||
* \brief Set the blend mode used for blit operations.
|
||||
*
|
||||
* \param surface The surface to update.
|
||||
* \param blendMode ::SDL_BlendMode to use for blit blending.
|
||||
*
|
||||
* \return 0 on success, or -1 if the parameters are not valid.
|
||||
*
|
||||
* \sa SDL_GetSurfaceBlendMode()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
||||
int blendMode);
|
||||
|
||||
/**
|
||||
* \brief Get the blend mode used for blit operations.
|
||||
*
|
||||
* \param surface The surface to query.
|
||||
* \param blendMode A pointer filled in with the current blend mode.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid.
|
||||
*
|
||||
* \sa SDL_SetSurfaceBlendMode()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
||||
int *blendMode);
|
||||
|
||||
/**
|
||||
* \brief Set the scale mode used for blit operations.
|
||||
*
|
||||
* \param surface The surface to update.
|
||||
* \param scaleMode ::SDL_TextureScaleMode to use for blit scaling.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid or the scale mode is
|
||||
* not supported.
|
||||
*
|
||||
* \note If the scale mode is not supported, the closest supported mode is
|
||||
* chosen. Currently only ::SDL_TEXTURESCALEMODE_FAST is supported on
|
||||
* surfaces.
|
||||
*
|
||||
* \sa SDL_GetSurfaceScaleMode()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
|
||||
int scaleMode);
|
||||
|
||||
/**
|
||||
* \brief Get the scale mode used for blit operations.
|
||||
*
|
||||
* \param surface The surface to query.
|
||||
* \param scaleMode A pointer filled in with the current scale mode.
|
||||
*
|
||||
* \return 0 on success, or -1 if the surface is not valid.
|
||||
*
|
||||
* \sa SDL_SetSurfaceScaleMode()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface,
|
||||
int *scaleMode);
|
||||
|
||||
/**
|
||||
* Sets the clipping rectangle for the destination surface in a blit.
|
||||
*
|
||||
* If the clip rectangle is NULL, clipping will be disabled.
|
||||
*
|
||||
* If the clip rectangle doesn't intersect the surface, the function will
|
||||
* return SDL_FALSE and blits will be completely clipped. Otherwise the
|
||||
* function returns SDL_TRUE and blits to the surface will be clipped to
|
||||
* the intersection of the surface area and the clipping rectangle.
|
||||
*
|
||||
* Note that blits are automatically clipped to the edges of the source
|
||||
* and destination surfaces.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
|
||||
const SDL_Rect * rect);
|
||||
|
||||
/**
|
||||
* Gets the clipping rectangle for the destination surface in a blit.
|
||||
*
|
||||
* \c rect must be a pointer to a valid rectangle which will be filled
|
||||
* with the correct values.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
|
||||
SDL_Rect * rect);
|
||||
|
||||
/**
|
||||
* Creates a new surface of the specified format, and then copies and maps
|
||||
* the given surface to it so the blit of the converted surface will be as
|
||||
* fast as possible. If this function fails, it returns NULL.
|
||||
*
|
||||
* The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
|
||||
* semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
|
||||
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
|
||||
* surface.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
|
||||
(SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags);
|
||||
|
||||
/**
|
||||
* \brief Copy a block of pixels of one format to another format
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
||||
Uint32 src_format,
|
||||
const void * src, int src_pitch,
|
||||
Uint32 dst_format,
|
||||
void * dst, int dst_pitch);
|
||||
|
||||
/**
|
||||
* Draws a point with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DrawPoint
|
||||
(SDL_Surface * dst, int x, int y, Uint32 color);
|
||||
extern DECLSPEC int SDLCALL SDL_DrawPoints
|
||||
(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends a point with an RGBA value.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendPoint
|
||||
(SDL_Surface * dst, int x, int y,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
extern DECLSPEC int SDLCALL SDL_BlendPoints
|
||||
(SDL_Surface * dst, const SDL_Point * points, int count,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Draws a line with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DrawLine
|
||||
(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
|
||||
extern DECLSPEC int SDLCALL SDL_DrawLines
|
||||
(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value along a line.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendLine
|
||||
(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
extern DECLSPEC int SDLCALL SDL_BlendLines
|
||||
(SDL_Surface * dst, const SDL_Point * points, int count,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Draws the given rectangle with \c color.
|
||||
*
|
||||
* If \c rect is NULL, the whole surface will be outlined with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DrawRect
|
||||
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
|
||||
extern DECLSPEC int SDLCALL SDL_DrawRects
|
||||
(SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value into the outline of the given rectangle.
|
||||
*
|
||||
* If \c rect is NULL, the whole surface will have a blended outline.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendRect
|
||||
(SDL_Surface * dst, const SDL_Rect * rect,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
extern DECLSPEC int SDLCALL SDL_BlendRects
|
||||
(SDL_Surface * dst, const SDL_Rect ** rects, int count,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Performs a fast fill of the given rectangle with \c color.
|
||||
*
|
||||
* If \c rect is NULL, the whole surface will be filled with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillRect
|
||||
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
|
||||
extern DECLSPEC int SDLCALL SDL_FillRects
|
||||
(SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value into the given rectangle.
|
||||
*
|
||||
* If \c rect is NULL, the whole surface will be blended with the color.
|
||||
*
|
||||
* \return This function returns 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendFillRect
|
||||
(SDL_Surface * dst, const SDL_Rect * rect,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
extern DECLSPEC int SDLCALL SDL_BlendFillRects
|
||||
(SDL_Surface * dst, const SDL_Rect ** rects, int count,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* Draws the given circle with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DrawCircle
|
||||
(SDL_Surface * dst, int x, int y, int radius, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value into the outline of the given circle.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendCircle
|
||||
(SDL_Surface * dst, int x, int y, int radius,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Fills the given circle with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillCircle
|
||||
(SDL_Surface * dst, int x, int y, int radius, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value into the given circle.
|
||||
*
|
||||
* \return This function returns 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendFillCircle
|
||||
(SDL_Surface * dst, int x, int y, int radius,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Draws the given ellipse with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DrawEllipse
|
||||
(SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value into the outline of the given ellipse.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendEllipse
|
||||
(SDL_Surface * dst, int x, int y, int w, int h,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Fills the given ellipse with \c color.
|
||||
*
|
||||
* The color should be a pixel of the format used by the surface, and
|
||||
* can be generated by the SDL_MapRGB() function.
|
||||
*
|
||||
* \return 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillEllipse
|
||||
(SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
|
||||
|
||||
/**
|
||||
* Blends an RGBA value into the given ellipse.
|
||||
*
|
||||
* \return This function returns 0 on success, or -1 on error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
|
||||
(SDL_Surface * dst, int x, int y, int w, int h,
|
||||
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
#endif // 0
|
||||
|
||||
/**
|
||||
* Performs a fast blit from the source surface to the destination surface.
|
||||
*
|
||||
* This assumes that the source and destination rectangles are
|
||||
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
|
||||
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
|
||||
* in \c srcrect and \c dstrect after all clipping is performed.
|
||||
*
|
||||
* \return If the blit is successful, it returns 0, otherwise it returns -1.
|
||||
*
|
||||
* The blit function should not be called on a locked surface.
|
||||
*
|
||||
* The blit semantics for surfaces with and without alpha and colorkey
|
||||
* are defined as follows:
|
||||
* \verbatim
|
||||
RGBA->RGB:
|
||||
SDL_SRCALPHA set:
|
||||
alpha-blend (using alpha-channel).
|
||||
SDL_SRCCOLORKEY ignored.
|
||||
SDL_SRCALPHA not set:
|
||||
copy RGB.
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
RGB values of the source colour key, ignoring alpha in the
|
||||
comparison.
|
||||
|
||||
RGB->RGBA:
|
||||
SDL_SRCALPHA set:
|
||||
alpha-blend (using the source per-surface alpha value);
|
||||
set destination alpha to opaque.
|
||||
SDL_SRCALPHA not set:
|
||||
copy RGB, set destination alpha to source per-surface alpha value.
|
||||
both:
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
source colour key.
|
||||
|
||||
RGBA->RGBA:
|
||||
SDL_SRCALPHA set:
|
||||
alpha-blend (using the source alpha channel) the RGB values;
|
||||
leave destination alpha untouched. [Note: is this correct?]
|
||||
SDL_SRCCOLORKEY ignored.
|
||||
SDL_SRCALPHA not set:
|
||||
copy all of RGBA to the destination.
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
RGB values of the source colour key, ignoring alpha in the
|
||||
comparison.
|
||||
|
||||
RGB->RGB:
|
||||
SDL_SRCALPHA set:
|
||||
alpha-blend (using the source per-surface alpha value).
|
||||
SDL_SRCALPHA not set:
|
||||
copy RGB.
|
||||
both:
|
||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
||||
source colour key.
|
||||
\endverbatim
|
||||
*
|
||||
* If either of the surfaces were in video memory, and the blit returns -2,
|
||||
* the video memory was lost, so it should be reloaded with artwork and
|
||||
* re-blitted:
|
||||
* @code
|
||||
* while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
|
||||
* while ( SDL_LockSurface(image) < 0 )
|
||||
* Sleep(10);
|
||||
* -- Write image pixels to image->pixels --
|
||||
* SDL_UnlockSurface(image);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* This happens under DirectX 5.0 when the system switches away from your
|
||||
* fullscreen application. The lock will also fail until you have access
|
||||
* to the video memory again.
|
||||
*
|
||||
* You should call SDL_BlitSurface() unless you know exactly how SDL
|
||||
* blitting works internally and how to use the other blit functions.
|
||||
*/
|
||||
#define SDL_BlitSurface SDL_UpperBlit
|
||||
|
||||
/**
|
||||
* This is the public blit function, SDL_BlitSurface(), and it performs
|
||||
* rectangle validation and clipping before passing it to SDL_LowerBlit()
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpperBlit
|
||||
(SDL_Surface * src, SDL_Rect * srcrect,
|
||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
/**
|
||||
* This is a semi-private blit function and it performs low-level surface
|
||||
* blitting only.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
||||
(SDL_Surface * src, SDL_Rect * srcrect,
|
||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
/**
|
||||
* \brief Perform a fast, low quality, stretch blit between two surfaces of the
|
||||
* same pixel format.
|
||||
*
|
||||
* \note This function uses a static buffer, and is not thread-safe.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
|
||||
const SDL_Rect * srcrect,
|
||||
SDL_Surface * dst,
|
||||
const SDL_Rect * dstrect);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_surface_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,8 +20,10 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_syswm.h
|
||||
* Include file for SDL custom system window manager hooks
|
||||
/**
|
||||
* \file SDL_syswm.h
|
||||
*
|
||||
* Include file for SDL custom system window manager hooks.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_syswm_h
|
||||
@@ -29,23 +31,27 @@
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_version.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** @file SDL_syswm.h
|
||||
* Your application has access to a special type of event 'SDL_SYSWMEVENT',
|
||||
/**
|
||||
* \file SDL_syswm.h
|
||||
*
|
||||
* Your application has access to a special type of event ::SDL_SYSWMEVENT,
|
||||
* which contains window-manager specific information and arrives whenever
|
||||
* an unhandled window event occurs. This event is ignored by default, but
|
||||
* you can enable it with SDL_EventState()
|
||||
* you can enable it with SDL_EventState().
|
||||
*/
|
||||
#ifdef SDL_PROTOTYPES_ONLY
|
||||
struct SDL_SysWMinfo;
|
||||
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
||||
#else
|
||||
|
||||
/* This is the structure for custom window manager events */
|
||||
@@ -63,163 +69,194 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
||||
#undef Cursor
|
||||
#endif
|
||||
|
||||
/** These are the various supported subsystems under UNIX */
|
||||
typedef enum {
|
||||
SDL_SYSWM_X11
|
||||
/**
|
||||
* These are the various supported subsystems under UNIX.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_SYSWM_X11
|
||||
} SDL_SYSWM_TYPE;
|
||||
|
||||
/** The UNIX custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
SDL_SYSWM_TYPE subsystem;
|
||||
union {
|
||||
XEvent xevent;
|
||||
} event;
|
||||
/**
|
||||
* The UNIX custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
SDL_version version;
|
||||
SDL_SYSWM_TYPE subsystem;
|
||||
union
|
||||
{
|
||||
XEvent xevent;
|
||||
} 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
|
||||
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
|
||||
*/
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
SDL_SYSWM_TYPE subsystem;
|
||||
union {
|
||||
struct {
|
||||
Display *display; /**< The X11 display */
|
||||
Window window; /**< The X11 display window */
|
||||
/** These locking functions should be called around
|
||||
* any X11 functions using the display variable,
|
||||
* but not the gfxdisplay variable.
|
||||
* They lock the event thread, so should not be
|
||||
* called around event functions or from event filters.
|
||||
*/
|
||||
/*@{*/
|
||||
void (*lock_func)(void);
|
||||
void (*unlock_func)(void);
|
||||
/*@}*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
SDL_version version;
|
||||
SDL_SYSWM_TYPE subsystem;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
Display *display; /**< The X11 display */
|
||||
Window window; /**< The X11 display window */
|
||||
/**
|
||||
* These locking functions should be called around
|
||||
* any X11 functions using the display variable.
|
||||
* They lock the event thread, so should not be
|
||||
* called around event functions or from event filters.
|
||||
*/
|
||||
/*@{*/
|
||||
void (*lock_func) (void);
|
||||
void (*unlock_func) (void);
|
||||
/*@}*/
|
||||
|
||||
/** @name Introduced in SDL 1.0.2 */
|
||||
/*@{*/
|
||||
Window fswindow; /**< The X11 fullscreen window */
|
||||
Window wmwindow; /**< The X11 managed input window */
|
||||
/*@}*/
|
||||
|
||||
/** @name Introduced in SDL 1.2.12 */
|
||||
/*@{*/
|
||||
Display *gfxdisplay; /**< The X11 display to which rendering is done */
|
||||
/*@}*/
|
||||
} x11;
|
||||
} info;
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_NANOX)
|
||||
#include <microwin/nano-X.h>
|
||||
|
||||
/** The generic custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
/**
|
||||
* Introduced in SDL 1.0.2.
|
||||
*/
|
||||
/*@{*/
|
||||
Window fswindow; /**< The X11 fullscreen window */
|
||||
Window wmwindow; /**< The X11 managed input window */
|
||||
/*@}*/
|
||||
} x11;
|
||||
} info;
|
||||
};
|
||||
|
||||
/** The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version ;
|
||||
GR_WINDOW_ID window ; /* The display window */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
|
||||
#elif defined(SDL_VIDEO_DRIVER_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
/** The windows custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
HWND hwnd; /**< The window for the message */
|
||||
UINT msg; /**< The type of message */
|
||||
WPARAM wParam; /**< WORD message parameter */
|
||||
LPARAM lParam; /**< LONG message parameter */
|
||||
/**
|
||||
* The windows custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
SDL_version version;
|
||||
HWND hwnd; /**< The window for the message */
|
||||
UINT msg; /**< The type of message */
|
||||
WPARAM wParam; /**< WORD message parameter */
|
||||
LPARAM lParam; /**< LONG message parameter */
|
||||
};
|
||||
|
||||
/** The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
HWND window; /**< The Win32 display window */
|
||||
HGLRC hglrc; /**< The OpenGL context, if any */
|
||||
} SDL_SysWMinfo;
|
||||
/**
|
||||
* The windows custom window manager information structure.
|
||||
*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
SDL_version version;
|
||||
HWND window; /**< The Win32 display window */
|
||||
};
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_RISCOS)
|
||||
|
||||
/** RISC OS custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int eventCode; /**< The window for the message */
|
||||
int pollBlock[64];
|
||||
/**
|
||||
* RISC OS custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
SDL_version version;
|
||||
int eventCode; /**< The window for the message */
|
||||
int pollBlock[64];
|
||||
};
|
||||
|
||||
/** The RISC OS custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int wimpVersion; /**< Wimp version running under */
|
||||
int taskHandle; /**< The RISC OS task handle */
|
||||
int window; /**< The RISC OS display window */
|
||||
} SDL_SysWMinfo;
|
||||
/**
|
||||
* The RISC OS custom window manager information structure.
|
||||
*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
SDL_version version;
|
||||
int wimpVersion; /**< Wimp version running under */
|
||||
int taskHandle; /**< The RISC OS task handle */
|
||||
int window; /**< The RISC OS display window */
|
||||
};
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_PHOTON)
|
||||
#elif defined(SDL_VIDEO_DRIVER_PHOTON) || defined(SDL_VIDEO_DRIVER_QNXGF)
|
||||
#include <sys/neutrino.h>
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
#include <gf/gf.h>
|
||||
#endif /* SDL_VIDEO_OPENGL_ES */
|
||||
#include <Ph.h>
|
||||
|
||||
/** The QNX custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
/**
|
||||
* The QNX custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/** The QNX custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int data;
|
||||
} SDL_SysWMinfo;
|
||||
/**
|
||||
* The QNX Photon custom window manager information structure.
|
||||
*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
/** The generic custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
int data;
|
||||
/**
|
||||
* The generic custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
/** The generic custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
int data;
|
||||
} SDL_SysWMinfo;
|
||||
/**
|
||||
* The generic custom window manager information structure.
|
||||
*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
SDL_version version;
|
||||
int data;
|
||||
};
|
||||
|
||||
#endif /* video driver type */
|
||||
|
||||
#endif /* SDL_PROTOTYPES_ONLY */
|
||||
|
||||
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
||||
|
||||
/* Function prototypes */
|
||||
/**
|
||||
* This function gives you custom hooks into the window manager information.
|
||||
* It fills the structure pointed to by 'info' with custom information and
|
||||
* returns 1 if the function is implemented. If it's not implemented, or
|
||||
* the version member of the 'info' structure is invalid, it returns 0.
|
||||
*
|
||||
* You typically use this function like this:
|
||||
* @code
|
||||
* SDL_SysWMInfo info;
|
||||
* SDL_VERSION(&info.version);
|
||||
* if ( SDL_GetWMInfo(&info) ) { ... }
|
||||
* @endcode
|
||||
* \brief This function allows access to driver-dependent window information.
|
||||
*
|
||||
* \param windowID The window about which information is being requested
|
||||
* \param info This structure must be initialized with the SDL version, and is
|
||||
* then filled in with information about the given window.
|
||||
*
|
||||
* \return SDL_TRUE if the function is implemented and the version member of
|
||||
* the \c info struct is valid, SDL_FALSE otherwise.
|
||||
*
|
||||
* You typically use this function like this:
|
||||
* \code
|
||||
* SDL_SysWMInfo info;
|
||||
* SDL_VERSION(&info.version);
|
||||
* if ( SDL_GetWindowWMInfo(&info) ) { ... }
|
||||
* \endcode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
|
||||
SDL_SysWMinfo * info);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_syswm_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -23,10 +23,10 @@
|
||||
#ifndef _SDL_thread_h
|
||||
#define _SDL_thread_h
|
||||
|
||||
/** @file SDL_thread.h
|
||||
* Header for the SDL thread management routines
|
||||
*
|
||||
* @note These are independent of the other SDL routines.
|
||||
/**
|
||||
* \file SDL_thread.h
|
||||
*
|
||||
* Header for the SDL thread management routines.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -38,83 +38,136 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** The SDL thread structure, defined in SDL_thread.c */
|
||||
/* The SDL thread structure, defined in SDL_thread.c */
|
||||
struct SDL_Thread;
|
||||
typedef struct SDL_Thread SDL_Thread;
|
||||
|
||||
/** Create a thread */
|
||||
#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__)
|
||||
/* The SDL thread ID */
|
||||
typedef unsigned long SDL_threadID;
|
||||
|
||||
#if defined(__WIN32__) && !defined(HAVE_LIBC)
|
||||
/**
|
||||
* We compile SDL into a DLL on OS/2. This means, that it's the DLL which
|
||||
* \file SDL_thread.h
|
||||
*
|
||||
* We compile SDL into a DLL. This means, that it's the DLL which
|
||||
* creates a new thread for the calling process with the SDL_CreateThread()
|
||||
* API. There is a problem with this, that only the RTL of the SDL.DLL will
|
||||
* be initialized for those threads, and not the RTL of the calling application!
|
||||
* be initialized for those threads, and not the RTL of the calling
|
||||
* application!
|
||||
*
|
||||
* To solve this, we make a little hack here.
|
||||
*
|
||||
* We'll always use the caller's _beginthread() and _endthread() APIs to
|
||||
* start a new thread. This way, if it's the SDL.DLL which uses this API,
|
||||
* then the RTL of SDL.DLL will be used to create the new thread, and if it's
|
||||
* the application, then the RTL of the application will be used.
|
||||
*
|
||||
* So, in short:
|
||||
* Always use the _beginthread() and _endthread() of the calling runtime library!
|
||||
* Always use the _beginthread() and _endthread() of the calling runtime
|
||||
* library!
|
||||
*/
|
||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
||||
#ifndef _WIN32_WCE
|
||||
#include <process.h> /* This has _beginthread() and _endthread() defined! */
|
||||
#include <process.h> /* This has _beginthread() and _endthread() defined! */
|
||||
#endif
|
||||
|
||||
#ifdef __OS2__
|
||||
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
|
||||
typedef void (*pfnSDL_CurrentEndThread)(void);
|
||||
#elif __GNUC__
|
||||
typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *func)(void *), void *arg,
|
||||
unsigned, unsigned *threadID);
|
||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
|
||||
#ifdef __GNUC__
|
||||
typedef unsigned long (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned
|
||||
(__stdcall *
|
||||
func) (void *),
|
||||
void *arg,
|
||||
unsigned,
|
||||
unsigned
|
||||
*threadID);
|
||||
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
||||
#else
|
||||
typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *func)(void *), void *arg,
|
||||
unsigned, unsigned *threadID);
|
||||
typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
|
||||
typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
|
||||
unsigned (__stdcall *
|
||||
func) (void
|
||||
*),
|
||||
void *arg, unsigned,
|
||||
unsigned *threadID);
|
||||
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
||||
#endif
|
||||
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
|
||||
/**
|
||||
* Create a thread.
|
||||
*/
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThread(int (SDLCALL * f) (void *), void *data,
|
||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
||||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
||||
#ifdef __OS2__
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
|
||||
#elif defined(_WIN32_WCE)
|
||||
#if defined(_WIN32_WCE)
|
||||
|
||||
/**
|
||||
* Create a thread.
|
||||
*/
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
* Create a thread.
|
||||
*/
|
||||
#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
|
||||
|
||||
#endif
|
||||
#else
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
|
||||
|
||||
/**
|
||||
* Create a thread.
|
||||
*/
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThread(int (SDLCALL * fn) (void *), void *data);
|
||||
|
||||
#endif
|
||||
|
||||
/** Get the 32-bit thread identifier for the current thread */
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
|
||||
|
||||
/** Get the 32-bit thread identifier for the specified thread,
|
||||
* equivalent to SDL_ThreadID() if the specified thread is NULL.
|
||||
/**
|
||||
* Get the thread identifier for the current thread.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
|
||||
extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
||||
|
||||
/** Wait for a thread to finish.
|
||||
/**
|
||||
* Get the thread identifier for the specified thread.
|
||||
*
|
||||
* Equivalent to SDL_ThreadID() if the specified thread is NULL.
|
||||
*/
|
||||
extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
||||
|
||||
/**
|
||||
* Wait for a thread to finish.
|
||||
*
|
||||
* The return code for the thread function is placed in the area
|
||||
* pointed to by 'status', if 'status' is not NULL.
|
||||
* pointed to by \c status, if \c 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 */
|
||||
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
|
||||
/**
|
||||
* \deprecated This function is here for binary compatibility with legacy apps,
|
||||
* but in SDL 1.3 and later, it's a no-op.
|
||||
*
|
||||
* You cannot forcibly kill a thread in a safe manner on many platforms. You
|
||||
* should instead find a way to alert your thread that it is time to terminate,
|
||||
* and then have it gracefully exit on its own. Do not ever call this function!
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread * thread);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_thread_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -23,8 +23,10 @@
|
||||
#ifndef _SDL_timer_h
|
||||
#define _SDL_timer_h
|
||||
|
||||
/** @file SDL_timer.h
|
||||
* Header for the SDL time management routines
|
||||
/**
|
||||
* \file SDL_timer.h
|
||||
*
|
||||
* Header for the SDL time management routines.
|
||||
*/
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
@@ -33,93 +35,119 @@
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** This is the OS scheduler timeslice, in milliseconds */
|
||||
/**
|
||||
* This is the OS scheduler timeslice, in milliseconds.
|
||||
*/
|
||||
#define SDL_TIMESLICE 10
|
||||
|
||||
/** This is the maximum resolution of the SDL timer on all platforms */
|
||||
#define TIMER_RESOLUTION 10 /**< Experimentally determined */
|
||||
/**
|
||||
* This is the maximum resolution of the SDL timer on all platforms.
|
||||
*/
|
||||
#define TIMER_RESOLUTION 10 /**< Experimentally determined */
|
||||
|
||||
/**
|
||||
* Get the number of milliseconds since the SDL library initialization.
|
||||
* Note that this value wraps if the program runs for more than ~49 days.
|
||||
*/
|
||||
* Get the number of milliseconds since the SDL library initialization.
|
||||
*
|
||||
* Note that this value wraps if the program runs for more than ~49 days.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
|
||||
|
||||
/** Wait a specified number of milliseconds before returning */
|
||||
/**
|
||||
* Wait a specified number of milliseconds before returning.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
||||
|
||||
/** Function prototype for the timer callback function */
|
||||
typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
|
||||
/**
|
||||
* Function prototype for the timer callback function.
|
||||
*/
|
||||
typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval);
|
||||
|
||||
/**
|
||||
* Set a callback to run after the specified number of milliseconds has
|
||||
* elapsed. The callback function is passed the current timer interval
|
||||
* and returns the next timer interval. If the returned value is the
|
||||
* same as the one passed in, the periodic alarm continues, otherwise a
|
||||
* new alarm is scheduled. If the callback returns 0, the periodic alarm
|
||||
* is cancelled.
|
||||
*
|
||||
* To cancel a currently running timer, call SDL_SetTimer(0, NULL);
|
||||
*
|
||||
* The timer callback function may run in a different thread than your
|
||||
* main code, and so shouldn't call any functions from within itself.
|
||||
*
|
||||
* The maximum resolution of this timer is 10 ms, which means that if
|
||||
* you request a 16 ms timer, your callback will run approximately 20 ms
|
||||
* later on an unloaded system. If you wanted to set a flag signaling
|
||||
* a frame update at 30 frames per second (every 33 ms), you might set a
|
||||
* timer for 30 ms:
|
||||
* @code SDL_SetTimer((33/10)*10, flag_update); @endcode
|
||||
*
|
||||
* If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
|
||||
*
|
||||
* Under UNIX, you should not use raise or use SIGALRM and this function
|
||||
* in the same program, as it is implemented using setitimer(). You also
|
||||
* should not use this function in multi-threaded applications as signals
|
||||
* to multi-threaded apps have undefined behavior in some implementations.
|
||||
*
|
||||
* This function returns 0 if successful, or -1 if there was an error.
|
||||
* Set a callback to run after the specified number of milliseconds has
|
||||
* elapsed. The callback function is passed the current timer interval
|
||||
* and returns the next timer interval. If the returned value is the
|
||||
* same as the one passed in, the periodic alarm continues, otherwise a
|
||||
* new alarm is scheduled. If the callback returns 0, the periodic alarm
|
||||
* is cancelled.
|
||||
*
|
||||
* To cancel a currently running timer, call
|
||||
* \code SDL_SetTimer(0, NULL); \endcode
|
||||
*
|
||||
* The timer callback function may run in a different thread than your
|
||||
* main code, and so shouldn't call any functions from within itself.
|
||||
*
|
||||
* The maximum resolution of this timer is 10 ms, which means that if
|
||||
* you request a 16 ms timer, your callback will run approximately 20 ms
|
||||
* later on an unloaded system. If you wanted to set a flag signaling
|
||||
* a frame update at 30 frames per second (every 33 ms), you might set a
|
||||
* timer for 30 ms:
|
||||
* \code
|
||||
* SDL_SetTimer((33/10)*10, flag_update);
|
||||
* \endcode
|
||||
*
|
||||
* If you use this function, you need to pass ::SDL_INIT_TIMER to SDL_Init().
|
||||
*
|
||||
* Under UNIX, you should not use raise or use SIGALRM and this function
|
||||
* in the same program, as it is implemented using setitimer(). You also
|
||||
* should not use this function in multi-threaded applications as signals
|
||||
* to multi-threaded apps have undefined behavior in some implementations.
|
||||
*
|
||||
* \return 0 if successful, or -1 if there was an error.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
|
||||
extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval,
|
||||
SDL_TimerCallback callback);
|
||||
|
||||
/** @name New timer API
|
||||
* New timer API, supports multiple timers
|
||||
* Written by Stephane Peter <megastep@lokigames.com>
|
||||
/**
|
||||
* \name Peter timers
|
||||
* New timer API, supports multiple timers
|
||||
* Written by Stephane Peter <megastep@lokigames.com>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Function prototype for the new timer callback function.
|
||||
* The callback function is passed the current timer interval and returns
|
||||
* the next timer interval. If the returned value is the same as the one
|
||||
* passed in, the periodic alarm continues, otherwise a new alarm is
|
||||
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
|
||||
* Function prototype for the new timer callback function.
|
||||
*
|
||||
* The callback function is passed the current timer interval and returns
|
||||
* the next timer interval. If the returned value is the same as the one
|
||||
* passed in, the periodic alarm continues, otherwise a new alarm is
|
||||
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
|
||||
*/
|
||||
typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
|
||||
|
||||
/** Definition of the timer ID type */
|
||||
typedef struct _SDL_TimerID *SDL_TimerID;
|
||||
|
||||
/** Add a new timer to the pool of timers already running.
|
||||
* Returns a timer ID, or NULL when an error occurs.
|
||||
*/
|
||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
|
||||
typedef Uint32(SDLCALL * SDL_NewTimerCallback) (Uint32 interval, void *param);
|
||||
|
||||
/**
|
||||
* Remove one of the multiple timers knowing its ID.
|
||||
* Returns a boolean value indicating success.
|
||||
* Definition of the timer ID type.
|
||||
*/
|
||||
typedef struct _SDL_TimerID *SDL_TimerID;
|
||||
|
||||
/**
|
||||
* Add a new timer to the pool of timers already running.
|
||||
* \return A timer ID, or NULL when an error occurs.
|
||||
*/
|
||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
||||
SDL_NewTimerCallback
|
||||
callback, void *param);
|
||||
|
||||
/**
|
||||
* Remove one of the multiple timers knowing its ID.
|
||||
* \return A boolean value indicating success or failure.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
|
||||
|
||||
/*@}*/
|
||||
/*@}*//*Peter timers*/
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_timer_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,8 +20,10 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_types.h
|
||||
* @deprecated Use SDL_stdinc.h instead.
|
||||
/**
|
||||
* \file SDL_types.h
|
||||
*
|
||||
* \deprecated
|
||||
*/
|
||||
|
||||
/* DEPRECATED */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -20,72 +20,139 @@
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/** @file SDL_version.h
|
||||
* This header defines the current SDL version
|
||||
/**
|
||||
* \file SDL_version.h
|
||||
*
|
||||
* This header defines the current SDL version.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_version_h
|
||||
#define _SDL_version_h
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_revision.h"
|
||||
|
||||
#include "begin_code.h"
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/** @name Version Number
|
||||
* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
||||
/**
|
||||
* \brief Information the version of SDL in use.
|
||||
*
|
||||
* Represents the library's version as three levels: major revision
|
||||
* (increments with massive changes, additions, and enhancements),
|
||||
* minor revision (increments with backwards-compatible changes to the
|
||||
* major revision), and patchlevel (increments with fixes to the minor
|
||||
* revision).
|
||||
*
|
||||
* \sa SDL_VERSION
|
||||
* \sa SDL_GetVersion
|
||||
*/
|
||||
/*@{*/
|
||||
#define SDL_MAJOR_VERSION 1
|
||||
#define SDL_MINOR_VERSION 2
|
||||
#define SDL_PATCHLEVEL 14
|
||||
/*@}*/
|
||||
|
||||
typedef struct SDL_version {
|
||||
Uint8 major;
|
||||
Uint8 minor;
|
||||
Uint8 patch;
|
||||
typedef struct SDL_version
|
||||
{
|
||||
Uint8 major; /**< major version */
|
||||
Uint8 minor; /**< minor version */
|
||||
Uint8 patch; /**< update version */
|
||||
} SDL_version;
|
||||
|
||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
||||
*/
|
||||
#define SDL_MAJOR_VERSION 1
|
||||
#define SDL_MINOR_VERSION 3
|
||||
#define SDL_PATCHLEVEL 0
|
||||
|
||||
/**
|
||||
* This macro can be used to fill a version structure with the compile-time
|
||||
* version of the SDL library.
|
||||
* \brief Macro to determine SDL version program was compiled against.
|
||||
*
|
||||
* This macro fills in a SDL_version structure with the version of the
|
||||
* library you compiled against. This is determined by what header the
|
||||
* compiler uses. Note that if you dynamically linked the library, you might
|
||||
* have a slightly newer or older version at runtime. That version can be
|
||||
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
|
||||
* is not a macro.
|
||||
*
|
||||
* \param x A pointer to a SDL_version struct to initialize.
|
||||
*
|
||||
* \sa SDL_version
|
||||
* \sa SDL_GetVersion
|
||||
*/
|
||||
#define SDL_VERSION(X) \
|
||||
#define SDL_VERSION(x) \
|
||||
{ \
|
||||
(X)->major = SDL_MAJOR_VERSION; \
|
||||
(X)->minor = SDL_MINOR_VERSION; \
|
||||
(X)->patch = SDL_PATCHLEVEL; \
|
||||
(x)->major = SDL_MAJOR_VERSION; \
|
||||
(x)->minor = SDL_MINOR_VERSION; \
|
||||
(x)->patch = SDL_PATCHLEVEL; \
|
||||
}
|
||||
|
||||
/** This macro turns the version numbers into a numeric value:
|
||||
* (1,2,3) -> (1203)
|
||||
* This assumes that there will never be more than 100 patchlevels
|
||||
/**
|
||||
* This macro turns the version numbers into a numeric value:
|
||||
* \verbatim
|
||||
(1,2,3) -> (1203)
|
||||
\endverbatim
|
||||
*
|
||||
* This assumes that there will never be more than 100 patchlevels.
|
||||
*/
|
||||
#define SDL_VERSIONNUM(X, Y, Z) \
|
||||
((X)*1000 + (Y)*100 + (Z))
|
||||
|
||||
/** This is the version number macro for the current SDL version */
|
||||
/**
|
||||
* This is the version number macro for the current SDL version.
|
||||
*/
|
||||
#define SDL_COMPILEDVERSION \
|
||||
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
|
||||
|
||||
/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */
|
||||
/**
|
||||
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
|
||||
*/
|
||||
#define SDL_VERSION_ATLEAST(X, Y, Z) \
|
||||
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
||||
|
||||
/** This function gets the version of the dynamically linked SDL library.
|
||||
* it should NOT be used to fill a version structure, instead you should
|
||||
* use the SDL_Version() macro.
|
||||
/**
|
||||
* \brief Get the version of SDL that is linked against your program.
|
||||
*
|
||||
* If you are using a shared library (DLL) version of SDL, then it is
|
||||
* possible that it will be different than the version you compiled against.
|
||||
*
|
||||
* This is a real function; the macro SDL_VERSION() tells you what version
|
||||
* of SDL you compiled against:
|
||||
*
|
||||
* \code
|
||||
* SDL_version compiled;
|
||||
* SDL_version linked;
|
||||
*
|
||||
* SDL_VERSION(&compiled);
|
||||
* SDL_GetVersion(&linked);
|
||||
* printf("We compiled against SDL version %d.%d.%d ...\n",
|
||||
* compiled.major, compiled.minor, compiled.patch);
|
||||
* printf("But we linked against SDL version %d.%d.%d.\n",
|
||||
* linked.major, linked.minor, linked.patch);
|
||||
* \endcode
|
||||
*
|
||||
* This function may be called safely at any time, even before SDL_Init().
|
||||
*
|
||||
* \sa SDL_VERSION
|
||||
*/
|
||||
extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
|
||||
extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
|
||||
|
||||
/**
|
||||
* \brief Get the code revision of SDL that is linked against your program.
|
||||
*
|
||||
* This is an arbitrary string (a hash value, actually), and is only useful
|
||||
* in comparing against other revisions. It is NOT an incrementing number.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_version_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,45 +1,40 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 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,
|
||||
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.
|
||||
Lesser 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
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file begin_code.h
|
||||
/**
|
||||
* \file begin_code.h
|
||||
*
|
||||
* This file sets things up for C dynamic library function definitions,
|
||||
* static inlined functions, and structures aligned at 4-byte alignment.
|
||||
* If you don't like ugly C preprocessor code, don't look at this file. :)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file begin_code.h
|
||||
* This shouldn't be nested -- included it around code only.
|
||||
*/
|
||||
/* 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
|
||||
|
||||
/**
|
||||
* @def DECLSPEC
|
||||
* Some compilers use a special export keyword
|
||||
*/
|
||||
/* Some compilers use a special export keyword */
|
||||
#ifndef DECLSPEC
|
||||
# if defined(__BEOS__) || defined(__HAIKU__)
|
||||
# if defined(__GNUC__)
|
||||
@@ -50,32 +45,13 @@
|
||||
# elif defined(__WIN32__)
|
||||
# ifdef __BORLANDC__
|
||||
# ifdef BUILD_SDL
|
||||
# define DECLSPEC
|
||||
# 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
|
||||
# elif defined (__GNUC__) && __GNUC__ < 4
|
||||
# /* Added support for GCC-EMX <v4.x */
|
||||
# /* this is needed for XFree86/OS2 developement */
|
||||
# /* F. Ambacher(anakor@snafu.de) 05.2008 */
|
||||
# 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")))
|
||||
@@ -85,45 +61,25 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def SDLCALL
|
||||
* By default SDL uses the C calling convention
|
||||
*/
|
||||
/* By default SDL uses the C calling convention */
|
||||
#ifndef SDLCALL
|
||||
# if defined(__WIN32__) && !defined(__GNUC__)
|
||||
# define SDLCALL __cdecl
|
||||
# elif defined(__OS2__)
|
||||
# if defined (__GNUC__) && __GNUC__ < 4
|
||||
# /* Added support for GCC-EMX <v4.x */
|
||||
# /* this is needed for XFree86/OS2 developement */
|
||||
# /* F. Ambacher(anakor@snafu.de) 05.2008 */
|
||||
# define SDLCALL _cdecl
|
||||
# else
|
||||
# /* On other compilers on OS/2, we use the _System calling convention */
|
||||
# /* to be compatible with every compiler */
|
||||
# define SDLCALL _System
|
||||
# endif
|
||||
# else
|
||||
# define SDLCALL
|
||||
# endif
|
||||
#if defined(__WIN32__) && !defined(__GNUC__)
|
||||
#define SDLCALL __cdecl
|
||||
#else
|
||||
#define SDLCALL
|
||||
#endif
|
||||
#endif /* SDLCALL */
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
#ifndef EKA2
|
||||
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
|
||||
#ifdef __SYMBIAN32__
|
||||
#undef DECLSPEC
|
||||
#define DECLSPEC
|
||||
#elif !defined(__WINS__)
|
||||
#undef DECLSPEC
|
||||
#define DECLSPEC __declspec(dllexport)
|
||||
#endif /* !EKA2 */
|
||||
#endif /* __SYMBIAN32__ */
|
||||
|
||||
/**
|
||||
* @file begin_code.h
|
||||
* 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
|
||||
/* 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
|
||||
@@ -133,15 +89,9 @@
|
||||
#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 */
|
||||
|
||||
/**
|
||||
* @def SDL_INLINE_OKAY
|
||||
* Set up compiler-specific options for inlining functions
|
||||
*/
|
||||
/* Set up compiler-specific options for inlining functions */
|
||||
#ifndef SDL_INLINE_OKAY
|
||||
#ifdef __GNUC__
|
||||
#define SDL_INLINE_OKAY
|
||||
@@ -150,7 +100,7 @@
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || \
|
||||
defined(__DMC__) || defined(__SC__) || \
|
||||
defined(__WATCOMC__) || defined(__LCC__) || \
|
||||
defined(__DECC) || defined(__EABI__)
|
||||
defined(__DECC)
|
||||
#ifndef __inline__
|
||||
#define __inline__ __inline
|
||||
#endif
|
||||
@@ -166,20 +116,15 @@
|
||||
#endif /* GNU C */
|
||||
#endif /* SDL_INLINE_OKAY */
|
||||
|
||||
/**
|
||||
* @def __inline__
|
||||
* 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)
|
||||
*/
|
||||
/* 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
|
||||
|
||||
/**
|
||||
* @def NULL
|
||||
* Apparently this is needed by several Windows compilers
|
||||
*/
|
||||
/* Apparently this is needed by several Windows compilers */
|
||||
#if !defined(__MACH__)
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,46 +1,38 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 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,
|
||||
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.
|
||||
Lesser 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
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file close_code.h
|
||||
* \file close_code.h
|
||||
*
|
||||
* This file reverses the effects of begin_code.h and should be included
|
||||
* after you finish any function and structure declarations in your headers
|
||||
*/
|
||||
|
||||
#undef _begin_code_h
|
||||
|
||||
/**
|
||||
* @file close_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__)
|
||||
#ifdef __BORLANDC__
|
||||
#pragma nopackwarning
|
||||
#endif
|
||||
#if (defined(__MWERKS__) && defined(__MACOS__))
|
||||
#pragma options align=reset
|
||||
#pragma enumsalwaysint reset
|
||||
#else
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* Compiler needs structure packing set */
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
exec_prefix_set=no
|
||||
libdir=@libdir@
|
||||
|
||||
@ENABLE_STATIC_FALSE@usage="\
|
||||
@ENABLE_STATIC_FALSE@Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
|
||||
@ENABLE_STATIC_TRUE@usage="\
|
||||
@ENABLE_STATIC_TRUE@Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
if test $exec_prefix_set = no ; then
|
||||
exec_prefix=$optarg
|
||||
fi
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
exec_prefix_set=yes
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo $exec_prefix
|
||||
;;
|
||||
--version)
|
||||
echo @SDL_VERSION@
|
||||
;;
|
||||
--cflags)
|
||||
echo -I@includedir@/SDL @SDL_CFLAGS@
|
||||
;;
|
||||
@ENABLE_SHARED_TRUE@ --libs)
|
||||
@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
|
||||
@ENABLE_SHARED_TRUE@ ;;
|
||||
@ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs)
|
||||
@ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs)
|
||||
@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@
|
||||
@ENABLE_STATIC_TRUE@ ;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
@@ -1,183 +0,0 @@
|
||||
# Configure paths for SDL
|
||||
# Sam Lantinga 9/21/99
|
||||
# stolen from Manish Singh
|
||||
# stolen back from Frank Belew
|
||||
# stolen from Manish Singh
|
||||
# Shamelessly stolen from Owen Taylor
|
||||
|
||||
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_SDL],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the sdl-config script
|
||||
dnl
|
||||
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
|
||||
sdl_prefix="$withval", sdl_prefix="")
|
||||
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
|
||||
sdl_exec_prefix="$withval", sdl_exec_prefix="")
|
||||
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
|
||||
, enable_sdltest=yes)
|
||||
|
||||
if test x$sdl_exec_prefix != x ; then
|
||||
sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
|
||||
if test x${SDL_CONFIG+set} != xset ; then
|
||||
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
|
||||
fi
|
||||
fi
|
||||
if test x$sdl_prefix != x ; then
|
||||
sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
|
||||
if test x${SDL_CONFIG+set} != xset ; then
|
||||
SDL_CONFIG=$sdl_prefix/bin/sdl-config
|
||||
fi
|
||||
fi
|
||||
|
||||
as_save_PATH="$PATH"
|
||||
if test "x$prefix" != xNONE; then
|
||||
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
|
||||
fi
|
||||
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
|
||||
PATH="$as_save_PATH"
|
||||
min_sdl_version=ifelse([$1], ,0.11.0,$1)
|
||||
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
|
||||
no_sdl=""
|
||||
if test "$SDL_CONFIG" = "no" ; then
|
||||
no_sdl=yes
|
||||
else
|
||||
SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
|
||||
SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
|
||||
|
||||
sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_sdltest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed SDL is sufficiently new. (Also sanity
|
||||
dnl checks the results of sdl-config to some extent
|
||||
dnl
|
||||
rm -f conf.sdltest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "SDL.h"
|
||||
|
||||
char*
|
||||
my_strdup (char *str)
|
||||
{
|
||||
char *new_str;
|
||||
|
||||
if (str)
|
||||
{
|
||||
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
||||
strcpy (new_str, str);
|
||||
}
|
||||
else
|
||||
new_str = NULL;
|
||||
|
||||
return new_str;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
/* This hangs on some systems (?)
|
||||
system ("touch conf.sdltest");
|
||||
*/
|
||||
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = my_strdup("$min_sdl_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_sdl_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (($sdl_major_version > major) ||
|
||||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
|
||||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
|
||||
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
|
||||
printf("*** best to upgrade to the required version.\n");
|
||||
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
|
||||
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
|
||||
printf("*** config.cache before re-running configure\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_sdl" = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$SDL_CONFIG" = "no" ; then
|
||||
echo "*** The sdl-config script installed by SDL could not be found"
|
||||
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the SDL_CONFIG environment variable to the"
|
||||
echo "*** full path to sdl-config."
|
||||
else
|
||||
if test -f conf.sdltest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run SDL test program, checking why..."
|
||||
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
|
||||
LIBS="$LIBS $SDL_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include "SDL.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{ return 0; }
|
||||
#undef main
|
||||
#define main K_and_R_C_main
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding SDL or finding the wrong"
|
||||
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
|
||||
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
SDL_CFLAGS=""
|
||||
SDL_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(SDL_CFLAGS)
|
||||
AC_SUBST(SDL_LIBS)
|
||||
rm -f conf.sdltest
|
||||
])
|
||||
@@ -1,15 +0,0 @@
|
||||
# sdl pkg-config source file
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: sdl
|
||||
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
|
||||
Version: @SDL_VERSION@
|
||||
Requires:
|
||||
Conflicts:
|
||||
Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
|
||||
Libs.private: @SDL_STATIC_LIBS@
|
||||
Cflags: -I${includedir}/SDL @SDL_CFLAGS@
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
SDL - Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2009 Sam Lantinga
|
||||
Copyright (C) 1997-2010 Sam Lantinga
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -25,326 +25,336 @@
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_fatal.h"
|
||||
#include "SDL_assert.h"
|
||||
|
||||
#if !SDL_VIDEO_DISABLED
|
||||
#include "video/SDL_leaks.h"
|
||||
#endif
|
||||
|
||||
#if SDL_THREAD_PTH
|
||||
#include <pth.h>
|
||||
#endif
|
||||
|
||||
/* Initialization/Cleanup routines */
|
||||
#if !SDL_JOYSTICK_DISABLED
|
||||
extern int SDL_JoystickInit(void);
|
||||
extern int SDL_JoystickInit(void);
|
||||
extern void SDL_JoystickQuit(void);
|
||||
#endif
|
||||
#if !SDL_CDROM_DISABLED
|
||||
extern int SDL_CDROMInit(void);
|
||||
extern void SDL_CDROMQuit(void);
|
||||
#if !SDL_HAPTIC_DISABLED
|
||||
extern int SDL_HapticInit(void);
|
||||
extern int SDL_HapticQuit(void);
|
||||
#endif
|
||||
#if !SDL_TIMERS_DISABLED
|
||||
extern void SDL_StartTicks(void);
|
||||
extern int SDL_TimerInit(void);
|
||||
extern int SDL_TimerInit(void);
|
||||
extern void SDL_TimerQuit(void);
|
||||
#endif
|
||||
#if defined(__WIN32__)
|
||||
extern int SDL_HelperWindowCreate(void);
|
||||
extern int SDL_HelperWindowDestroy(void);
|
||||
#endif
|
||||
|
||||
/* The current SDL version */
|
||||
static SDL_version version =
|
||||
{ SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL };
|
||||
extern int SDL_AssertionsInit(void);
|
||||
extern void SDL_AssertionsQuit(void);
|
||||
|
||||
/* The initialized subsystems */
|
||||
static Uint32 SDL_initialized = 0;
|
||||
#if !SDL_TIMERS_DISABLED
|
||||
static Uint32 ticks_started = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CHECK_LEAKS
|
||||
int surfaces_allocated = 0;
|
||||
#endif
|
||||
|
||||
int SDL_InitSubSystem(Uint32 flags)
|
||||
int
|
||||
SDL_InitSubSystem(Uint32 flags)
|
||||
{
|
||||
#if !SDL_VIDEO_DISABLED
|
||||
/* Initialize the video/event subsystem */
|
||||
if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) {
|
||||
if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"),
|
||||
(flags&SDL_INIT_EVENTTHREAD)) < 0 ) {
|
||||
return(-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_VIDEO;
|
||||
}
|
||||
/* Initialize the video/event subsystem */
|
||||
if ((flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO)) {
|
||||
if (SDL_VideoInit(NULL, (flags & SDL_INIT_EVENTTHREAD)) < 0) {
|
||||
return (-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_VIDEO;
|
||||
}
|
||||
#else
|
||||
if ( flags & SDL_INIT_VIDEO ) {
|
||||
SDL_SetError("SDL not built with video support");
|
||||
return(-1);
|
||||
}
|
||||
if (flags & SDL_INIT_VIDEO) {
|
||||
SDL_SetError("SDL not built with video support");
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SDL_AUDIO_DISABLED
|
||||
/* Initialize the audio subsystem */
|
||||
if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) {
|
||||
if ( SDL_AudioInit(SDL_getenv("SDL_AUDIODRIVER")) < 0 ) {
|
||||
return(-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_AUDIO;
|
||||
}
|
||||
/* Initialize the audio subsystem */
|
||||
if ((flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO)) {
|
||||
if (SDL_AudioInit(NULL) < 0) {
|
||||
return (-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_AUDIO;
|
||||
}
|
||||
#else
|
||||
if ( flags & SDL_INIT_AUDIO ) {
|
||||
SDL_SetError("SDL not built with audio support");
|
||||
return(-1);
|
||||
}
|
||||
if (flags & SDL_INIT_AUDIO) {
|
||||
SDL_SetError("SDL not built with audio support");
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SDL_TIMERS_DISABLED
|
||||
/* Initialize the timer subsystem */
|
||||
if ( ! ticks_started ) {
|
||||
SDL_StartTicks();
|
||||
ticks_started = 1;
|
||||
}
|
||||
if ( (flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER) ) {
|
||||
if ( SDL_TimerInit() < 0 ) {
|
||||
return(-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_TIMER;
|
||||
}
|
||||
/* Initialize the timer subsystem */
|
||||
if (!ticks_started) {
|
||||
SDL_StartTicks();
|
||||
ticks_started = 1;
|
||||
}
|
||||
if ((flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER)) {
|
||||
if (SDL_TimerInit() < 0) {
|
||||
return (-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_TIMER;
|
||||
}
|
||||
#else
|
||||
if ( flags & SDL_INIT_TIMER ) {
|
||||
SDL_SetError("SDL not built with timer support");
|
||||
return(-1);
|
||||
}
|
||||
if (flags & SDL_INIT_TIMER) {
|
||||
SDL_SetError("SDL not built with timer support");
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SDL_JOYSTICK_DISABLED
|
||||
/* Initialize the joystick subsystem */
|
||||
if ( (flags & SDL_INIT_JOYSTICK) &&
|
||||
!(SDL_initialized & SDL_INIT_JOYSTICK) ) {
|
||||
if ( SDL_JoystickInit() < 0 ) {
|
||||
return(-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_JOYSTICK;
|
||||
}
|
||||
/* Initialize the joystick subsystem */
|
||||
if ((flags & SDL_INIT_JOYSTICK) && !(SDL_initialized & SDL_INIT_JOYSTICK)) {
|
||||
if (SDL_JoystickInit() < 0) {
|
||||
return (-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_JOYSTICK;
|
||||
}
|
||||
#else
|
||||
if ( flags & SDL_INIT_JOYSTICK ) {
|
||||
SDL_SetError("SDL not built with joystick support");
|
||||
return(-1);
|
||||
}
|
||||
if (flags & SDL_INIT_JOYSTICK) {
|
||||
SDL_SetError("SDL not built with joystick support");
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SDL_CDROM_DISABLED
|
||||
/* Initialize the CD-ROM subsystem */
|
||||
if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) {
|
||||
if ( SDL_CDROMInit() < 0 ) {
|
||||
return(-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_CDROM;
|
||||
}
|
||||
#if !SDL_HAPTIC_DISABLED
|
||||
/* Initialize the haptic subsystem */
|
||||
if ((flags & SDL_INIT_HAPTIC) && !(SDL_initialized & SDL_INIT_HAPTIC)) {
|
||||
if (SDL_HapticInit() < 0) {
|
||||
return (-1);
|
||||
}
|
||||
SDL_initialized |= SDL_INIT_HAPTIC;
|
||||
}
|
||||
#else
|
||||
if ( flags & SDL_INIT_CDROM ) {
|
||||
SDL_SetError("SDL not built with cdrom support");
|
||||
return(-1);
|
||||
}
|
||||
if (flags & SDL_INIT_HAPTIC) {
|
||||
SDL_SetError("SDL not built with haptic (force feedback) support");
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
return(0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int SDL_Init(Uint32 flags)
|
||||
int
|
||||
SDL_Init(Uint32 flags)
|
||||
{
|
||||
#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
|
||||
if (!pth_init()) {
|
||||
return -1;
|
||||
}
|
||||
if (SDL_AssertionsInit() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Clear the error message */
|
||||
SDL_ClearError();
|
||||
|
||||
#if defined(__WIN32__)
|
||||
if (SDL_HelperWindowCreate() < 0) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Clear the error message */
|
||||
SDL_ClearError();
|
||||
/* Initialize the desired subsystems */
|
||||
if (SDL_InitSubSystem(flags) < 0) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Initialize the desired subsystems */
|
||||
if ( SDL_InitSubSystem(flags) < 0 ) {
|
||||
return(-1);
|
||||
}
|
||||
/* Everything is initialized */
|
||||
if (!(flags & SDL_INIT_NOPARACHUTE)) {
|
||||
SDL_InstallParachute();
|
||||
}
|
||||
|
||||
/* Everything is initialized */
|
||||
if ( !(flags & SDL_INIT_NOPARACHUTE) ) {
|
||||
SDL_InstallParachute();
|
||||
}
|
||||
return(0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
void SDL_QuitSubSystem(Uint32 flags)
|
||||
void
|
||||
SDL_QuitSubSystem(Uint32 flags)
|
||||
{
|
||||
/* Shut down requested initialized subsystems */
|
||||
#if !SDL_CDROM_DISABLED
|
||||
if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) {
|
||||
SDL_CDROMQuit();
|
||||
SDL_initialized &= ~SDL_INIT_CDROM;
|
||||
}
|
||||
#endif
|
||||
/* Shut down requested initialized subsystems */
|
||||
#if !SDL_JOYSTICK_DISABLED
|
||||
if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) {
|
||||
SDL_JoystickQuit();
|
||||
SDL_initialized &= ~SDL_INIT_JOYSTICK;
|
||||
}
|
||||
if ((flags & SDL_initialized & SDL_INIT_JOYSTICK)) {
|
||||
SDL_JoystickQuit();
|
||||
SDL_initialized &= ~SDL_INIT_JOYSTICK;
|
||||
}
|
||||
#endif
|
||||
#if !SDL_HAPTIC_DISABLED
|
||||
if ((flags & SDL_initialized & SDL_INIT_HAPTIC)) {
|
||||
SDL_HapticQuit();
|
||||
SDL_initialized &= ~SDL_INIT_HAPTIC;
|
||||
}
|
||||
#endif
|
||||
#if !SDL_TIMERS_DISABLED
|
||||
if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) {
|
||||
SDL_TimerQuit();
|
||||
SDL_initialized &= ~SDL_INIT_TIMER;
|
||||
}
|
||||
if ((flags & SDL_initialized & SDL_INIT_TIMER)) {
|
||||
SDL_TimerQuit();
|
||||
SDL_initialized &= ~SDL_INIT_TIMER;
|
||||
}
|
||||
#endif
|
||||
#if !SDL_AUDIO_DISABLED
|
||||
if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) {
|
||||
SDL_AudioQuit();
|
||||
SDL_initialized &= ~SDL_INIT_AUDIO;
|
||||
}
|
||||
if ((flags & SDL_initialized & SDL_INIT_AUDIO)) {
|
||||
SDL_AudioQuit();
|
||||
SDL_initialized &= ~SDL_INIT_AUDIO;
|
||||
}
|
||||
#endif
|
||||
#if !SDL_VIDEO_DISABLED
|
||||
if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) {
|
||||
SDL_VideoQuit();
|
||||
SDL_initialized &= ~SDL_INIT_VIDEO;
|
||||
}
|
||||
if ((flags & SDL_initialized & SDL_INIT_VIDEO)) {
|
||||
SDL_VideoQuit();
|
||||
SDL_initialized &= ~SDL_INIT_VIDEO;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Uint32 SDL_WasInit(Uint32 flags)
|
||||
Uint32
|
||||
SDL_WasInit(Uint32 flags)
|
||||
{
|
||||
if ( ! flags ) {
|
||||
flags = SDL_INIT_EVERYTHING;
|
||||
}
|
||||
return (SDL_initialized&flags);
|
||||
if (!flags) {
|
||||
flags = SDL_INIT_EVERYTHING;
|
||||
}
|
||||
return (SDL_initialized & flags);
|
||||
}
|
||||
|
||||
void SDL_Quit(void)
|
||||
void
|
||||
SDL_Quit(void)
|
||||
{
|
||||
/* Quit all subsystems */
|
||||
/* Quit all subsystems */
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); fflush(stdout);
|
||||
printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
|
||||
|
||||
#if defined(__WIN32__)
|
||||
SDL_HelperWindowDestroy();
|
||||
#endif
|
||||
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
|
||||
|
||||
#ifdef CHECK_LEAKS
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Quit] : CHECK_LEAKS\n"); fflush(stdout);
|
||||
printf("[SDL_Quit] : CHECK_LEAKS\n");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
/* Print the number of surfaces not freed */
|
||||
if ( surfaces_allocated != 0 ) {
|
||||
fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n",
|
||||
surfaces_allocated);
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Quit] : SDL_UninstallParachute()\n"); fflush(stdout);
|
||||
#endif
|
||||
|
||||
/* Uninstall any parachute signal handlers */
|
||||
SDL_UninstallParachute();
|
||||
|
||||
#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
|
||||
pth_kill();
|
||||
#endif
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Quit] : Returning!\n"); fflush(stdout);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* Return the library version number */
|
||||
const SDL_version * SDL_Linked_Version(void)
|
||||
{
|
||||
return(&version);
|
||||
}
|
||||
|
||||
#if defined(__OS2__)
|
||||
/* Building for OS/2 */
|
||||
#ifdef __WATCOMC__
|
||||
|
||||
#define INCL_DOSERRORS
|
||||
#define INCL_DOSEXCEPTIONS
|
||||
#include <os2.h>
|
||||
|
||||
/* Exception handler to prevent the Audio thread hanging, making a zombie process! */
|
||||
ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec,
|
||||
PEXCEPTIONREGISTRATIONRECORD pERegRec,
|
||||
PCONTEXTRECORD pCtxRec,
|
||||
PVOID p)
|
||||
{
|
||||
if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND)
|
||||
return XCPT_CONTINUE_SEARCH;
|
||||
if (pERepRec->fHandlerFlags & EH_UNWINDING)
|
||||
return XCPT_CONTINUE_SEARCH;
|
||||
if (pERepRec->fHandlerFlags & EH_NESTED_CALL)
|
||||
return XCPT_CONTINUE_SEARCH;
|
||||
|
||||
/* Do cleanup at every fatal exception! */
|
||||
if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) &&
|
||||
(pERepRec->ExceptionNum != XCPT_BREAKPOINT) &&
|
||||
(pERepRec->ExceptionNum != XCPT_SINGLE_STEP)
|
||||
)
|
||||
{
|
||||
if (SDL_initialized & SDL_INIT_AUDIO)
|
||||
{
|
||||
/* This removes the zombie audio thread in case of emergency. */
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n");
|
||||
#endif
|
||||
SDL_CloseAudio();
|
||||
/* !!! FIXME: make this an assertion. */
|
||||
/* Print the number of surfaces not freed */
|
||||
if (surfaces_allocated != 0) {
|
||||
fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n",
|
||||
surfaces_allocated);
|
||||
}
|
||||
}
|
||||
return (XCPT_CONTINUE_SEARCH);
|
||||
#endif
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Quit] : SDL_UninstallParachute()\n");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
/* Uninstall any parachute signal handlers */
|
||||
SDL_UninstallParachute();
|
||||
|
||||
SDL_AssertionsQuit();
|
||||
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("[SDL_Quit] : Returning!\n");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler};
|
||||
|
||||
/* The main DLL entry for DLL Initialization and Uninitialization: */
|
||||
unsigned _System LibMain(unsigned hmod, unsigned termination)
|
||||
/* Get the library version number */
|
||||
void
|
||||
SDL_GetVersion(SDL_version * ver)
|
||||
{
|
||||
if (termination)
|
||||
{
|
||||
#ifdef DEBUG_BUILD
|
||||
/* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */
|
||||
#endif
|
||||
DosUnsetExceptionHandler(&SDL_Main_xcpthand);
|
||||
return 1;
|
||||
} else
|
||||
{
|
||||
#ifdef DEBUG_BUILD
|
||||
/* Make stdout and stderr unbuffered! */
|
||||
setbuf(stdout, NULL);
|
||||
setbuf(stderr, NULL);
|
||||
#endif
|
||||
/* Fire up exception handler */
|
||||
#ifdef DEBUG_BUILD
|
||||
/* printf("[SDL DLL Initialization] : Setting exception handler\n"); */
|
||||
#endif
|
||||
/* Set exception handler */
|
||||
DosSetExceptionHandler(&SDL_Main_xcpthand);
|
||||
|
||||
return 1;
|
||||
}
|
||||
SDL_VERSION(ver);
|
||||
}
|
||||
#endif /* __WATCOMC__ */
|
||||
|
||||
#elif defined(__WIN32__) && !defined(__SYMBIAN32__)
|
||||
/* Get the library source revision */
|
||||
const char *
|
||||
SDL_GetRevision(void)
|
||||
{
|
||||
return SDL_REVISION;
|
||||
}
|
||||
|
||||
/* Get the name of the platform */
|
||||
const char *
|
||||
SDL_GetPlatform()
|
||||
{
|
||||
#if __AIX__
|
||||
return "AIX";
|
||||
#elif __HAIKU__
|
||||
/* Haiku must appear here before BeOS, since it also defines __BEOS__ */
|
||||
return "Haiku";
|
||||
#elif __BEOS__
|
||||
return "BeOS";
|
||||
#elif __BSDI__
|
||||
return "BSDI";
|
||||
#elif __DREAMCAST__
|
||||
return "Dreamcast";
|
||||
#elif __FREEBSD__
|
||||
return "FreeBSD";
|
||||
#elif __HPUX__
|
||||
return "HP-UX";
|
||||
#elif __IRIX__
|
||||
return "Irix";
|
||||
#elif __LINUX__
|
||||
return "Linux";
|
||||
#elif __MINT__
|
||||
return "Atari MiNT";
|
||||
#elif __MACOS__
|
||||
return "MacOS Classic";
|
||||
#elif __MACOSX__
|
||||
return "Mac OS X";
|
||||
#elif __NETBSD__
|
||||
return "NetBSD";
|
||||
#elif __OPENBSD__
|
||||
return "OpenBSD";
|
||||
#elif __OS2__
|
||||
return "OS/2";
|
||||
#elif __OSF__
|
||||
return "OSF/1";
|
||||
#elif __QNXNTO__
|
||||
return "QNX Neutrino";
|
||||
#elif __RISCOS__
|
||||
return "RISC OS";
|
||||
#elif __SOLARIS__
|
||||
return "Solaris";
|
||||
#elif __WIN32__
|
||||
#ifdef _WIN32_WCE
|
||||
return "Windows CE";
|
||||
#else
|
||||
return "Windows";
|
||||
#endif
|
||||
#elif __IPHONEOS__
|
||||
return "iPhone OS";
|
||||
#else
|
||||
return "Unknown (see SDL_platform.h)";
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__WIN32__)
|
||||
|
||||
#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL))
|
||||
/* Need to include DllMain() on Watcom C for some reason.. */
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved )
|
||||
BOOL APIENTRY
|
||||
_DllMainCRTStartup(HANDLE hModule,
|
||||
DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* building DLL with Watcom C */
|
||||
|
||||
#endif /* OS/2 elif __WIN32__ */
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user