Compare commits

...

No commits in common. "master" and "wiki" have entirely different histories.
master ... wiki

1502 changed files with 18 additions and 499447 deletions

20
.gitignore vendored
View file

@ -1,20 +0,0 @@
SDL/lib
SDL/obj
SDL_gfx/lib
SDL_gfx/include
SDL_gfx/obj
SDL_image/lib
SDL_image/include
SDL_image/obj
SDL_mixer/lib
SDL_mixer/include
SDL_mixer/obj
SDL_net/lib
SDL_net/include
SDL_net/obj
SDL_ttf/lib
SDL_ttf/include
SDL_ttf/obj
smpeg/lib
smpeg/include
smpeg/obj

View file

@ -1,26 +0,0 @@
all:
cd SDL; $(MAKE) -f Makefile
cd SDL_gfx; $(MAKE) -f Makefile
cd smpeg; $(MAKE) -f Makefile
cd SDL_mixer; $(MAKE) -f Makefile
cd SDL_image; $(MAKE) -f Makefile
cd SDL_net; $(MAKE) -f Makefile
cd SDL_ttf; $(MAKE) -f Makefile
clean:
cd SDL; $(MAKE) -f Makefile clean
cd SDL_gfx; $(MAKE) -f Makefile clean
cd smpeg; $(MAKE) -f Makefile clean
cd SDL_mixer; $(MAKE) -f Makefile clean
cd SDL_image; $(MAKE) -f Makefile clean
cd SDL_net; $(MAKE) -f Makefile clean
cd SDL_ttf; $(MAKE) -f Makefile clean
install:
cd SDL; $(MAKE) -f Makefile install
cd SDL_gfx; $(MAKE) -f Makefile install
cd smpeg; $(MAKE) -f Makefile install
cd SDL_mixer; $(MAKE) -f Makefile install
cd SDL_image; $(MAKE) -f Makefile install
cd SDL_net; $(MAKE) -f Makefile install
cd SDL_ttf; $(MAKE) -f Makefile install

18
ProjectHome.md Normal file
View file

@ -0,0 +1,18 @@
A central repository for SDL on Wii.
You can [download](http://code.google.com/p/sdl-wii/downloads/list) the latest compiled SDL libraries, or compile the latest source yourself. If you are a developer and wish to contribute code back to the SDL port, please post on the Issues page or contact me directly to be added to the project.
If you use SDL in your project, please link back to this SVN (eg: on your own SVN repository), so that anyone interested in compiling your source or working on a different SDL project can find it.
## Usage: ##
1. Ensure that you have [devkitPPC r24 and libogc 1.8.7](http://www.devkitpro.org) or higher installed. If you have an older version, completely uninstall it first.
1. Download and copy the PPC [ported libraries](http://sourceforge.net/projects/devkitpro/files/portlibs) to your portlibs folder (on Windows this is c:\devkitPro\portlibs\ppc)
1. Copy all of the [SDL files](http://code.google.com/p/sdl-wii/downloads/list) to the libogc folder (on Windows by default this is c:\devkitPro\libogc).
## Compiling: ##
1. Ensure that you have [devkitPPC r24 and libogc 1.8.7](http://www.devkitpro.org) or higher installed.
1. Download and copy the PPC [ported libraries](http://sourceforge.net/projects/devkitpro/files/portlibs) to your PPC portlibs folder (on Windows this is c:\devkitPro\portlibs\ppc)
1. Download the latest source from [SVN](http://code.google.com/p/sdl-wii/source/checkout).
1. Compile and install SDL by running 'make install'.

View file

@ -1,18 +0,0 @@
Bugs are now managed in the SDL bug tracker, here:
http://bugzilla.libsdl.org/
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL mailing list. Subscription information:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
bugs discussed on the mailing list may be forgotten or missed.

View file

@ -1,458 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS

View file

@ -1,92 +0,0 @@
Simple DirectMedia Layer CREDITS
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
* 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. :)
* 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
* 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.
* 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,
Erkki Kontilla, Levon Gavalian, Hal Emerich, David Wiktorsson,
S. Schury and F. Hufsky, Ciska de Ruyver, Shredweat, Tyler Montbriand,
Martin Andersson, Merlyn Wysard, Fernando Ibanez, David Miller,
Andre Bommele, lovesby.com, Francisco Camenforte Torres, and David Igreja
for other logo entries.
* Bob Pendleton and David Olofson for being long time contributors to
the SDL mailing list.
* Everybody at Loki Software, Inc. for their great contributions!
And a big hand to everyone else who gave me appreciation, advice,
and suggestions, especially the good folks on the SDL mailing list.
THANKS! :)
-- Sam Lantinga <slouken@libsdl.org>

View file

@ -1,102 +0,0 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif
include $(DEVKITPPC)/wii_rules
# Directories.
OBJ_DIR := obj/wii
LIB_DIR := lib
BIN_DIR := bin/wii
SDL_OBJ_DIR := $(OBJ_DIR)/sdl
SDL_SRC_DIR := src
INSTALL_HEADER_DIR ?= $(LIBOGC_INC)
INSTALL_LIB_DIR ?= $(LIBOGC_LIB)
# Tools.
PIPE_TO_SED := 2>&1 | sed "s/:\([0-9]*\):/\(\1\) :/"
# Library source files.
SDL_SRCS := \
$(wildcard $(SDL_SRC_DIR)/*.c) \
$(wildcard $(SDL_SRC_DIR)/audio/*.c) \
$(wildcard $(SDL_SRC_DIR)/audio/dummy/*.c) \
$(wildcard $(SDL_SRC_DIR)/audio/wii/*.c) \
$(wildcard $(SDL_SRC_DIR)/cdrom/*.c) \
$(wildcard $(SDL_SRC_DIR)/cdrom/dummy/*.c) \
$(wildcard $(SDL_SRC_DIR)/cpuinfo/*.c) \
$(wildcard $(SDL_SRC_DIR)/events/*.c) \
$(wildcard $(SDL_SRC_DIR)/file/*.c) \
$(wildcard $(SDL_SRC_DIR)/file/wii/*.c) \
$(wildcard $(SDL_SRC_DIR)/joystick/*.c) \
$(wildcard $(SDL_SRC_DIR)/joystick/wii/*.c) \
$(wildcard $(SDL_SRC_DIR)/loadso/dummy/*.c) \
$(wildcard $(SDL_SRC_DIR)/main/wii/*.c) \
$(wildcard $(SDL_SRC_DIR)/stdlib/*.c) \
$(wildcard $(SDL_SRC_DIR)/thread/*.c) \
$(wildcard $(SDL_SRC_DIR)/thread/wii/*.c) \
$(wildcard $(SDL_SRC_DIR)/timer/*.c) \
$(wildcard $(SDL_SRC_DIR)/timer/wii/*.c) \
$(wildcard $(SDL_SRC_DIR)/video/*.c) \
$(wildcard $(SDL_SRC_DIR)/video/dummy/*.c) \
$(wildcard $(SDL_SRC_DIR)/video/wii/*.c)
# Library object files.
SDL_OBJS := $(subst $(SDL_SRC_DIR),$(SDL_OBJ_DIR),$(SDL_SRCS:.c=.o))
# What's a full build?
all: $(LIB_DIR)/libSDL.a
# How to delete the intermediate files.
clean:
@echo Cleaning $(LIB_DIR) $(SDL_OBJS)
@rm -fr $(LIB_DIR) $(SDL_OBJS)
install: all
@mkdir -p $(INSTALL_HEADER_DIR) $(INSTALL_LIB_DIR)
@mkdir -p $(INSTALL_HEADER_DIR)/SDL
@cp -frv $(LIB_DIR)/*.* $(INSTALL_LIB_DIR)
@cp -frv include/*.* $(INSTALL_HEADER_DIR)/SDL
# Used to install library by pressing Alt+R in Programmer's Notepad
run: all install
test-make:
$(MAKE) -f Makefile.test install
test-clean:
$(MAKE) -f Makefile.test clean
# How to build a library.
$(LIB_DIR)/libSDL.a: $(SDL_OBJS)
@echo Archiving $@
@-mkdir -p $(dir $@)
@$(DEVKITPPC)/bin/powerpc-eabi-ar crs $@ $(SDL_OBJS)
@echo ----
# How to build a DOL.
$(BIN_DIR)/%.dol: $(TEST_OBJ_DIR)/%.elf
@echo Creating DOL $@
@-mkdir -p $(dir $@)
@$(DEVKITPPC)/bin/elf2dol $< $@
@echo ----
# Compilation flags.
COMMON_FLAGS := -g -O3 -Wall $(MACHDEP)
INCLUDES := -Iinclude -I$(LIBOGC_INC)
DEFINES := -DGEKKO
CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES)
# Test link flags.
LDFLAGS := $(COMMON_FLAGS) -L$(LIB_DIR) -L$(LIBOGC_LIB) -lSDL -lwiikeyboard -lfat -lwiiuse -lbte -logc -lm
# How to compile C file (SDL library).
$(SDL_OBJ_DIR)/%.o: $(SDL_SRC_DIR)/%.c
@echo Compiling $<
@-mkdir -p $(dir $@)
@$(DEVKITPPC)/bin/powerpc-eabi-gcc $(CFLAGS) -c $< -o $@ $(PIPE_TO_SED)

View file

@ -1,63 +0,0 @@
# Directories.
OBJ_DIR := obj/wii
LIB_DIR := lib
BIN_DIR := bin/wii
TEST_OBJ_DIR := $(OBJ_DIR)/test
TEST_SRC_DIR := test
TEST_DOL_DIR := test_dols
# Tools.
PIPE_TO_SED := 2>&1 | sed "s/:\([0-9]*\):/\(\1\) :/"
# Test source files.
# It can be useful to switch this variable around to select individual tests which are problematic.
TEST_SRCS := $(wildcard $(TEST_SRC_DIR)/*.c)
#TEST_SRCS := $(TEST_SRC_DIR)/testsprite.c
# Test object files.
TEST_OBJS := $(subst $(TEST_SRC_DIR)/,$(TEST_OBJ_DIR)/,$(TEST_SRCS:.c=.o))
# Test .DOL files.
TEST_DOLS := $(subst $(TEST_OBJ_DIR),$(BIN_DIR),$(TEST_OBJS:.o=.dol))
# How to build test files
install: $(TEST_DOLS)
@-mkdir -p ${TEST_DOL_DIR}
cp $(TEST_DOLS) ${TEST_DOL_DIR}
# How to delete the intermediate files
clean:
@echo Cleaning $(TEST_DOLS) $(TEST_OBJS)
@rm -fr $(TEST_DOLS) $(TEST_OBJS) ${TEST_DOL_DIR}
# How to build a DOL.
$(BIN_DIR)/%.dol: $(TEST_OBJ_DIR)/%.elf
@echo Creating DOL $@
@-mkdir -p $(dir $@)
elf2dol $< $@
@echo ----
# Compilation flags.
#COMMON_FLAGS := -g -O2 -mrvl -Wall -mcpu=750 -meabi -mhard-float $(MACHDEP)
COMMON_FLAGS := -g -O2 -mrvl -Wall -mcpu=750 -meabi -mhard-float $(MACHDEP)
INCLUDES := -Iinclude -I$(DEVKITPRO)/libogc/include
#DEFINES := -DGEKKO -DDEBUG_ERROR -DDEBUG_TIMERS -DDEBUG_THREADS -DDEBUG_BUILD -DDEBUG_CONVERT -DSDL_AUDIO_DRIVER_WII
DEFINES := -DGEKKO -DSDL_AUDIO_DRIVER_WII
CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES)
# Test link flags.
LDFLAGS := $(COMMON_FLAGS) -L$(LIB_DIR) -L$(DEVKITPRO)/libogc/lib/wii -lSDL -lfat -lwiiuse -lbte -logc -lm
# How to link an ELF.
$(TEST_OBJ_DIR)/%.elf: $(TEST_OBJ_DIR)/%.o $(LIB_DIR)/libSDL.a
@echo Linking $@
@-mkdir -p $(dir $@)
powerpc-eabi-g++ -o $@ $< $(LDFLAGS)
#keep elf for debugging
#cp $@ /tmp/elf
# How to compile C file (Tests).
$(TEST_OBJ_DIR)/%.o: $(TEST_SRC_DIR)/%.c
@echo Compiling $<
@-mkdir -p $(dir $@)
powerpc-eabi-gcc $(CFLAGS) -c $< -o $@ $(PIPE_TO_SsED)

View file

@ -1,49 +0,0 @@
Simple DirectMedia Layer
(SDL)
Version 1.2
---
http://www.libsdl.org/
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.
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)

View file

@ -1,13 +0,0 @@
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library
designed to make it easy to write multi-media software, such as games and
emulators.
The Simple DirectMedia Layer library source code is available from:
http://www.libsdl.org/
This library is distributed under the terms of the GNU LGPL license:
http://www.gnu.org/copyleft/lesser.html

View file

@ -1,56 +0,0 @@
* Porting To A New Platform
The first thing you have to do when porting to a new platform, is look at
include/SDL_platform.h and create an entry there for your operating system.
The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
Ideally SDL_platform.h will be able to auto-detect the system it's building
on based on C preprocessor symbols.
There are two basic ways of building SDL at the moment:
1. The "UNIX" way: ./configure; make; make install
If you have a GNUish system, then you might try this. Edit configure.in,
take a look at the large section labelled:
"Set up the configuration based on the target platform!"
Add a section for your platform, and then re-run autogen.sh and build!
2. Using an IDE:
If you're using an IDE or other non-configure build system, you'll probably
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
add a section for your platform, and create a custom SDL_config_{platform}.h,
based on SDL_config.h.minimal and SDL_config.h.in
Add the top level include directory to the header search path, and then add
the following sources to the project:
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/disk/*.c
src/video/dummy/*.c
src/joystick/dummy/*.c
src/cdrom/dummy/*.c
src/thread/generic/*.c
src/timer/dummy/*.c
src/loadso/dummy/*.c
Once you have a working library without any drivers, you can go back to each
of the major subsystems and start implementing drivers for your platform.
If you have any questions, don't hesitate to ask on the SDL mailing list:
http://www.libsdl.org/mailing-list.php
Enjoy!
Sam Lantinga (slouken@libsdl.org)

View file

@ -1,25 +0,0 @@
Wish list for the 1.3 development branch:
http://bugzilla.libsdl.org/
* 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
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)

View file

@ -1,716 +0,0 @@
This is a list of API changes in SDL's version history.
Version 1.0:
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.2.10:
If SDL_OpenAudio() is passed zero for the desired format
fields, the following environment variables will be used
to fill them in:
SDL_AUDIO_FREQUENCY
SDL_AUDIO_FORMAT
SDL_AUDIO_CHANNELS
SDL_AUDIO_SAMPLES
If an environment variable is not specified, it will be set
to a reasonable default value.
Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment
variable, currently supported on X11 Xinerama configurations.
Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
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.
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.)
Added SDL_GetKeyRepeat()
Added SDL_config.h, with defaults for various build environments.
1.2.7:
Added CPU feature detection functions to SDL_cpuinfo.h:
SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(),
SDL_HasAltiVec()
Added function to create RWops from const memory: SDL_RWFromConstMem()
1.2.6:
Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject()
Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA
1.2.5:
Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5)
Added SDL_GL_STEREO for stereoscopic OpenGL contexts
1.2.0:
Added SDL_VIDEOEXPOSE event to signal that the screen needs to
be redrawn. This is currently only delivered to OpenGL windows
on X11, though it may be delivered in the future when the video
memory is lost under DirectX.
1.1.8:
You can pass SDL_NOFRAME to SDL_VideoMode() to create a window
that has no title bar or frame decoration. Fullscreen video
modes automatically have this flag set.
Added a function to query the clipping rectangle for a surface:
void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
Added a function to query the current event filter:
SDL_EventFilter SDL_GetEventFilter(void)
If you pass -1 to SDL_ShowCursor(), it won't change the current
cursor visibility state, but will still return it.
SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning
you can nest them as deep as you want, as long as each lock call
has a matching unlock call. The surface remains locked until the
last matching unlock call.
Note that you may not blit to or from a locked surface.
1.1.7:
The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take
arrays of Uint16 values instead of Uint8 values. For the most part,
you can just take your old values and shift them up 8 bits to get
new correct values for your gamma ramps.
You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface()
and SDL will try to RLE accelerate colorkey and alpha blits in the
resulting surface.
1.1.6:
Added a function to return the thread ID of a specific thread:
Uint32 SDL_GetThreadID(SDL_Thread *thread)
If 'thread' is NULL, this function returns the id for this thread.
1.1.5:
The YUV overlay structure has been changed to use an array of
pitches and pixels representing the planes of a YUV image, to
better enable hardware acceleration. The YV12 and IYUV formats
each have three planes, corresponding to the Y, U, and V portions
of the image, while packed pixel YUV formats just have one plane.
For palettized mode (8bpp), the screen colormap is now split in
a physical and a logical palette. The physical palette determines
what colours the screen pixels will get when displayed, and the
logical palette controls the mapping from blits to/from the screen.
A new function, SDL_SetPalette() has been added to change
logical and physical palettes separately. SDL_SetColors() works
just as before, and is equivalent to calling SDL_SetPalette() with
a flag argument of (SDL_LOGPAL|SDL_PHYSPAL).
SDL_BlitSurface() no longer modifies the source rectangle, only the
destination rectangle. The width/height members of the destination
rectangle are ignored, only the position is used.
The old source clipping function SDL_SetClipping() has been replaced
with a more useful function to set the destination clipping rectangle:
SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect)
Added a function to see what subsystems have been initialized:
Uint32 SDL_WasInit(Uint32 flags)
The Big Alpha Flip: SDL now treats alpha as opacity like everybody
else, and not as transparency:
A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255
A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0
Values between 0 and 255 vary from fully transparent to fully opaque.
New functions:
SDL_DisplayFormatAlpha()
Returns a surface converted to a format with alpha-channel
that can be blit efficiently to the screen. (In other words,
like SDL_DisplayFormat() but the resulting surface has
an alpha channel.) This is useful for surfaces with alpha.
SDL_MapRGBA()
Works as SDL_MapRGB() but takes an additional alpha parameter.
SDL_GetRGBA()
Works as SDL_GetRGB() but also returns the alpha value
(SDL_ALPHA_OPAQUE for formats without an alpha channel)
Both SDL_GetRGB() and SDL_GetRGBA() now always return values in
the [0..255] interval. Previously, SDL_GetRGB() would return
(0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format.
(N.B.: This is broken for bit fields < 3 bits.)
SDL_MapRGB() returns pixels in which the alpha channel is set opaque.
SDL_SetAlpha() can now be used for both setting the per-surface
alpha, using the new way of thinking of alpha, and also to enable
and disable per-pixel alpha blending for surfaces with an alpha
channel:
To disable alpha blending:
SDL_SetAlpha(surface, 0, 0);
To re-enable alpha blending:
SDL_SetAlpha(surface, SDL_SRCALPHA, 0);
Surfaces with an alpha channel have blending enabled by default.
SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests
RLE acceleration of blits, just as like with SDL_SetColorKey().
This flag can be set for both surfaces with an alpha channel
and surfaces with an alpha value set by SDL_SetAlpha().
As always, RLE surfaces must be locked before pixel access is
allowed, and unlocked before any other SDL operations are done
on it.
The blit semantics for surfaces with and without alpha and colorkey
have now been defined:
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 opaque.
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.
As a special case, blits from surfaces with per-surface alpha
value of 128 (50% transparency) are optimised and much faster
than other alpha values. This does not apply to surfaces with
alpha channels (per-pixel alpha).
New functions for manipulating the gamma of the display have
been added:
int SDL_SetGamma(float red, float green, float blue);
int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
Gamma ramps are tables with 256 entries which map the screen color
components into actually displayed colors. For an example of
implementing gamma correction and gamma fades, see test/testgamma.c
Gamma control is not supported on all hardware.
1.1.4:
The size of the SDL_CDtrack structure changed from 8 to 12 bytes
as the size of the length member was extended to 32 bits.
You can now use SDL for 2D blitting with a GL mode by passing the
SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or
32 bpp, and the data in the framebuffer is put into the GL scene
when you call SDL_UpdateRects(), and the scene will be visible
when you call SDL_GL_SwapBuffers().
Run the "testgl" test program with the -logo command line option
to see an example of this blending of 2D and 3D in SDL.
1.1.3:
Added SDL_FreeRW() to the API, to complement SDL_AllocRW()
Added resizable window support - just add SDL_RESIZABLE to the
SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events.
See SDL_events.h for details on the new SDL_ResizeEvent structure.
Added condition variable support, based on mutexes and semaphores.
SDL_CreateCond()
SDL_DestroyCond()
SDL_CondSignal()
SDL_CondBroadcast()
SDL_CondWait()
SDL_CondTimedWait()
The new function prototypes are in SDL_mutex.h
Added counting semaphore support, based on the mutex primitive.
SDL_CreateSemaphore()
SDL_DestroySemaphore()
SDL_SemWait()
SDL_SemTryWait()
SDL_SemWaitTimeout()
SDL_SemPost()
SDL_SemValue()
The new function prototypes are in SDL_mutex.h
Added support for asynchronous blitting. To take advantage of this,
you must set the SDL_ASYNCBLIT flag when setting the video mode and
creating surfaces that you want accelerated in this way. You must
lock surfaces that have this flag set, and the lock will block until
any queued blits have completed.
Added YUV video overlay support.
The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU.
This function creates an overlay surface:
SDL_CreateYUVOverlay()
You must lock and unlock the overlay to get access to the data:
SDL_LockYUVOverlay() SDL_UnlockYUVOverlay()
You can then display the overlay:
SDL_DisplayYUVOverlay()
You must free the overlay when you are done using it:
SDL_FreeYUVOverlay()
See SDL_video.h for the full function prototypes.
The joystick hat position constants have been changed:
Old constant New constant
------------ ------------
0 SDL_HAT_CENTERED
1 SDL_HAT_UP
2 SDL_HAT_RIGHTUP
3 SDL_HAT_RIGHT
4 SDL_HAT_RIGHTDOWN
5 SDL_HAT_DOWN
6 SDL_HAT_LEFTDOWN
7 SDL_HAT_LEFT
8 SDL_HAT_LEFTUP
The new constants are bitmasks, so you can check for the
individual axes like this:
if ( hat_position & SDL_HAT_UP ) {
}
and you'll catch left-up, up, and right-up.
1.1.2:
Added multiple timer support:
SDL_AddTimer() and SDL_RemoveTimer()
SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL.
1.1.0:
Added initial OpenGL support.
First set GL attributes (such as RGB depth, alpha depth, etc.)
SDL_GL_SetAttribute()
Then call SDL_SetVideoMode() with the SDL_OPENGL flag.
Perform all of your normal GL drawing.
Finally swap the buffers with the new SDL function:
SDL_GL_SwapBuffers()
See the new 'testgl' test program for an example of using GL with SDL.
You can load GL extension functions by using the function:
SDL_GL_LoadProcAddress()
Added functions to initialize and cleanup specific SDL subsystems:
SDL_InitSubSystem() and SDL_QuitSubSystem()
Added user-defined event type:
typedef struct {
Uint8 type;
int code;
void *data1;
void *data2;
} SDL_UserEvent;
This structure is in the "user" member of an SDL_Event.
Added a function to push events into the event queue:
SDL_PushEvent()
Example of using the new SDL user-defined events:
{
SDL_Event event;
event.type = SDL_USEREVENT;
event.user.code = my_event_code;
event.user.data1 = significant_data;
event.user.data2 = 0;
SDL_PushEvent(&event);
}
Added a function to get mouse deltas since last query:
SDL_GetRelativeMouseState()
Added a boolean datatype to SDL_types.h:
SDL_bool = { SDL_TRUE, SDL_FALSE }
Added a function to get the current audio status:
SDL_GetAudioState();
It returns one of:
SDL_AUDIO_STOPPED,
SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED
Added an AAlib driver (ASCII Art) - by Stephane Peter.
1.0.6:
The input grab state is reset after each call to SDL_SetVideoMode().
The input is grabbed by default in fullscreen mode, and ungrabbed in
windowed mode. If you want to set input grab to a particular value,
you should set it after each call to SDL_SetVideoMode().
1.0.5:
Exposed SDL_AudioInit(), SDL_VideoInit()
Added SDL_AudioDriverName() and SDL_VideoDriverName()
Added new window manager function:
SDL_WM_ToggleFullScreen()
This is currently implemented only on Linux
The ALT-ENTER code has been removed - it's not appropriate for a
lib to bind keys when they aren't even emergency escape sequences.
ALT-ENTER functionality can be implemented with the following code:
int Handle_AltEnter(const SDL_Event *event)
{
if ( event->type == SDL_KEYDOWN ) {
if ( (event->key.keysym.sym == SDLK_RETURN) &&
(event->key.keysym.mod & KMOD_ALT) ) {
SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
return(0);
}
}
return(1);
}
SDL_SetEventFilter(Handle_AltEnter);
1.0.3:
Under X11, if you grab the input and hide the mouse cursor,
the mouse will go into a "relative motion" mode where you
will always get relative motion events no matter how far in
each direction you move the mouse - relative motion is not
bounded by the edges of the window (though the absolute values
of the mouse positions are clamped by the size of the window).
The SVGAlib, framebuffer console, and DirectInput drivers all
have this behavior naturally, and the GDI and BWindow drivers
never go into "relative motion" mode.
1.0.2:
Added a function to enable keyboard repeat:
SDL_EnableKeyRepeat()
Added a function to grab the mouse and keyboard input
SDL_WM_GrabInput()
Added a function to iconify the window.
SDL_WM_IconifyWindow()
If this function succeeds, the application will receive an event
signaling SDL_APPACTIVE event
1.0.1:
Added constants to SDL_audio.h for 16-bit native byte ordering:
AUDIO_U16SYS, AUDIO_S16SYS
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.
SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and
a new function SDL_CreateRGBSurfaceFrom() has been added to allow
creating an SDL surface from an existing pixel data buffer.
Added SDL_GetRGB() to the headers and documentation.
0.11.4:
SDL_SetLibraryPath() is no longer meaningful, and has been removed.
0.11.3:
A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from
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
cursor moves. To get smooth color cursor updates when the app
is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This
allows you to handle the mouse motion in another thread from an
event filter function, but is currently only supported by Linux
and BeOS. Note that you'll have to protect the display surface
from multi-threaded access by using mutexes if you do this.
Thread-safe surface support has been removed from SDL.
This makes blitting somewhat faster, by removing SDL_MiddleBlit().
Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead.
You can make your surfaces thread-safe by allocating your own
mutex and making lock/unlock calls around accesses to your surface.
0.9.14:
SDL_GetMouseState() now takes pointers to int rather than Uint16.
If you set the SDL_WINDOWID environment variable under UNIX X11,
SDL will use that as the main window instead of creating it's own.
This is an unsupported extension to SDL, and not portable at all.
0.9.13:
Added a function SDL_SetLibraryPath() which can be used to specify
the directory containing the SDL dynamic libraries. This is useful
for commercial applications which ship with particular versions
of the libraries, and for security on multi-user systems.
If this function is not used, the default system directories are
searched using the native dynamic object loading mechanism.
In order to support C linkage under Visual C++, you must declare
main() without any return type:
main(int argc, char *argv[]) {
/* Do the program... */
return(0);
}
C++ programs should also return a value if compiled under VC++.
The blit_endian member of the SDL_VideoInfo struct has been removed.
SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there
is now no longer any function to translate a keysym to a character.
The SDL_keysym structure has been extended with a 'scancode' and
'unicode' member. The 'scancode' is a hardware specific scancode
for the key that was pressed, and may be 0. The 'unicode' member
is a 16-bit UNICODE translation of the key that was pressed along
with any modifiers or compose keys that have been pressed.
If no UNICODE translation exists for the key, 'unicode' will be 0.
Added a function SDL_EnableUNICODE() to enable/disable UNICODE
translation of character keypresses. Translation defaults off.
To convert existing code to use the new API, change code which
uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(),
and change code which uses it to get the ASCII value of a sym to
use the 'unicode' member of the event keysym.
0.9.12:
There is partial support for 64-bit datatypes. I don't recommend
you use this if you have a choice, because 64-bit datatypes are not
supported on many platforms. On platforms for which it is supported,
the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and
you can use the Uint64 and Sint64 datatypes.
Added functions to SDL_endian.h to support 64-bit datatypes:
SDL_SwapLE64(), SDL_SwapBE64(),
SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64()
A new member "len_ratio" has been added to the SDL_AudioCVT structure,
and allows you to determine either the original buffer length or the
converted buffer length, given the other.
A new function SDL_FreeWAV() has been added to the API to free data
allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since
the gcc compiled DLL uses a different heap than VC++ compiled apps.
SDL now has initial support for international keyboards using the
Latin character set.
If a particular mapping is desired, you can set the DEFAULT_KEYBOARD
compile-time variable, or you can set the environment variable
"SDL_KEYBOARD" to a string identifying the keyboard mapping you desire.
The valid values for these variables can be found in SDL_keyboard.c
Full support for German and French keyboards under X11 is implemented.
0.9.11:
The THREADED_EVENTS compile-time define has been replaced with the
SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(),
SDL will create a separate thread to perform input event handling.
If this flag is passed to SDL_Init(), and the OS doesn't support
event handling in a separate thread, SDL_Init() will fail.
Be sure to add calls to SDL_Delay() in your main thread to allow
the OS to schedule your event thread, or it may starve, leading
to slow event delivery and/or dropped events.
Currently MacOS and Win32 do not support this flag, while BeOS
and Linux do support it. I recommend that your application only
use this flag if absolutely necessary.
The SDL thread function passed to SDL_CreateThread() now returns a
status. This status can be retrieved by passing a non-NULL pointer
as the 'status' argument to SDL_WaitThread().
The volume parameter to SDL_MixAudio() has been increased in range
from (0-8) to (0-128)
SDL now has a data source abstraction which can encompass a file,
an area of memory, or any custom object you can envision. It uses
these abstractions, SDL_RWops, in the endian read/write functions,
and the built-in WAV and BMP file loaders. This means you can load
WAV chunks from memory mapped files, compressed archives, network
pipes, or anything else that has a data read abstraction.
There are three built-in data source abstractions:
SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem()
along with a generic data source allocation function:
SDL_AllocRW()
These data sources can be used like stdio file pointers with the
following convenience functions:
SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose()
These functions are defined in the new header file "SDL_rwops.h"
The endian swapping functions have been turned into macros for speed
and SDL_CalculateEndian() has been removed. SDL_endian.h now defines
SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on
the endianness of the host system.
The endian read/write functions now take an SDL_RWops pointer
instead of a stdio FILE pointer, to support the new data source
abstraction.
The SDL_*LoadWAV() functions have been replaced with a single
SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's
first parameter, and a flag whether or not to automatically
free it as the second parameter. SDL_LoadWAV() is a macro for
backward compatibility and convenience:
SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced
with a single function that takes a SDL_RWops pointer as it's
first parameter, and a flag whether or not to automatically
free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP()
are macros for backward compatibility and convenience:
SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...);
SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...);
Note that these functions use SDL_RWseek() extensively, and should
not be used on pipes or other non-seekable data sources.
0.9.10:
The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been
extended to support multiple types of display drivers, as well as
safe access to the X11 display when THREADED_EVENTS is enabled.
The new structures are documented in the SDL_syswm.h header file.
Thanks to John Elliott <jce@seasip.demon.co.uk>, the UK keyboard
should now work properly, as well as the "Windows" keys on US
keyboards.
The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab
instead of trying to open each block device on the system.
The CD must be listed in /etc/fstab as using the iso9660 filesystem.
On Linux, if you define THREADED_EVENTS at compile time, a separate
thread will be spawned to gather X events asynchronously from the
graphics updates. This hasn't been extensively tested, but it does
provide a means of handling keyboard and mouse input in a separate
thread from the graphics thread. (This is now enabled by default.)
A special access function SDL_PeepEvents() allows you to manipulate
the event queue in a thread-safe manner, including peeking at events,
removing events of a specified type, and adding new events of arbitrary
type to the queue (use the new 'user' member of the SDL_Event type).
If you use SDL_PeepEvents() to gather events, then the main graphics
thread needs to call SDL_PumpEvents() periodically to drive the event
loop and generate input events. This is not necessary if SDL has been
compiled with THREADED_EVENTS defined, but doesn't hurt.
A new function SDL_ThreadID() returns the identifier associated with
the current thread.
0.9.9:
The AUDIO_STEREO format flag has been replaced with a new 'channels'
member of the SDL_AudioSpec structure. The channels are 1 for mono
audio, and 2 for stereo audio. In the future more channels may be
supported for 3D surround sound.
The SDL_MixAudio() function now takes an additional volume parameter,
which should be set to SDL_MIX_MAXVOLUME for compatibility with the
original function.
The CD-ROM functions which take a 'cdrom' parameter can now be
passed NULL, and will act on the last successfully opened CD-ROM.
0.9.8:
No changes, bugfixes only.
0.9.7:
No changes, bugfixes only.
0.9.6:
Added a fast rectangle fill function: SDL_FillRect()
Addition of a useful function for getting info on the video hardware:
const SDL_VideoInfo *SDL_GetVideoInfo(void)
This function replaces SDL_GetDisplayFormat().
Initial support for double-buffering:
Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode()
Update the screen with a new function: SDL_Flip()
SDL_AllocSurface() takes two new flags:
SDL_SRCCOLORKEY means that the surface will be used for colorkey blits
and if the hardware supports hardware acceleration of colorkey blits
between two surfaces in video memory, to place the surface in video
memory if possible, otherwise it will be placed in system memory.
SDL_SRCALPHA means that the surface will be used for alpha blits and
if the hardware supports hardware acceleration of alpha blits between
two surfaces in video memory, to place the surface in video memory
if possible, otherwise it will be placed in system memory.
SDL_HWSURFACE now means that the surface will be created with the
same format as the display surface, since having surfaces in video
memory is only useful for fast blitting to the screen, and you can't
blit surfaces with different surface formats in video memory.
0.9.5:
You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume
that the icon consists of the entire image.
SDL_LowerBlit() is back -- but don't use it on the display surface.
It is exactly the same as SDL_MiddleBlit(), but doesn't check for
thread safety.
Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take
a FILE pointer instead of a file name.
Added CD-ROM audio control API:
SDL_CDNumDrives()
SDL_CDName()
SDL_CDOpen()
SDL_CDStatus()
SDL_CDPlayTracks()
SDL_CDPlay()
SDL_CDPause()
SDL_CDResume()
SDL_CDStop()
SDL_CDEject()
SDL_CDClose()
0.9.4:
No changes, bugfixes only.
0.9.3:
Mouse motion event now includes relative motion information:
Sint16 event->motion.xrel, Sint16 event->motion.yrel
X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT
(Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile)
0.9.2:
No changes, bugfixes only.
0.9.1:
Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now
automatically mapped on blit.
0.8.0:
SDL stable release

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,316 +0,0 @@
#!/bin/sh
#
# Build a fat binary on Mac OS X, thanks Ryan!
# Number of CPUs (for make -j)
NCPU=`sysctl -n hw.ncpu`
NJOB=$NCPU
#NJOB=`expr $NCPU + 1`
# Generic, cross-platform CFLAGS you always want go here.
CFLAGS="-O3 -g -pipe"
# Locate Xcode SDK path
SDK_PATH=/Developer/SDKs
if [ ! -d $SDK_PATH ]; then
echo "Couldn't find SDK path"
exit 1
fi
# See if we can use 10.2 or 10.3 runtime compatibility
if [ -d "$SDK_PATH/MacOSX10.2.8.sdk" ]; then
# PowerPC configure flags (10.2 runtime compatibility)
# We dynamically load X11, so using the system X11 headers is fine.
CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
# PowerPC compiler flags
CC_PPC="gcc-3.3 -arch ppc"
CXX_PPC="g++-3.3 -arch ppc"
CFLAGS_PPC=""
CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
-nostdinc \
-F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
-I$SDK_PATH/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
-isystem $SDK_PATH/MacOSX10.2.8.sdk/usr/include"
# PowerPC linker flags
LFLAGS_PPC="-arch ppc \
-L$SDK_PATH/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
-F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
-Wl,-syslibroot,$SDK_PATH/MacOSX10.2.8.sdk"
else # 10.2 or 10.3 SDK
# PowerPC configure flags (10.3 runtime compatibility)
# We dynamically load X11, so using the system X11 headers is fine.
CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
# PowerPC compiler flags
CC_PPC="gcc-4.0 -arch ppc"
CXX_PPC="g++-4.0 -arch ppc"
CFLAGS_PPC=""
CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \
-nostdinc \
-F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
-I$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include \
-isystem $SDK_PATH/MacOSX10.3.9.sdk/usr/include"
# PowerPC linker flags
LFLAGS_PPC="-arch ppc -mmacosx-version-min=10.3 \
-L$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 \
-F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
-Wl,-syslibroot,$SDK_PATH/MacOSX10.3.9.sdk"
fi # 10.2 or 10.3 SDK
# Intel configure flags (10.4 runtime compatibility)
# We dynamically load X11, so using the system X11 headers is fine.
CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
# Intel compiler flags
CC_X86="gcc-4.0 -arch i386"
CXX_X86="g++-4.0 -arch i386"
CFLAGS_X86="-mmacosx-version-min=10.4"
CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
-nostdinc \
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
-I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \
-isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
# Intel linker flags
LFLAGS_X86="-arch i386 -mmacosx-version-min=10.4 \
-L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1 \
-Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
#
# Find the configure script
#
srcdir=`dirname $0`/..
auxdir=$srcdir/build-scripts
cd $srcdir
#
# Figure out which phase to build:
# all,
# configure, configure-ppc, configure-x86,
# make, make-ppc, make-x86, merge
# install
# clean
if test x"$1" = x; then
phase=all
else
phase="$1"
fi
case $phase in
all)
configure_ppc="yes"
configure_x86="yes"
make_ppc="yes"
make_x86="yes"
merge="yes"
;;
configure)
configure_ppc="yes"
configure_x86="yes"
;;
configure-ppc)
configure_ppc="yes"
;;
configure-x86)
configure_x86="yes"
;;
make)
make_ppc="yes"
make_x86="yes"
merge="yes"
;;
make-ppc)
make_ppc="yes"
;;
make-x86)
make_x86="yes"
;;
merge)
merge="yes"
;;
install)
install_bin="yes"
install_hdrs="yes"
install_lib="yes"
install_data="yes"
install_man="yes"
;;
install-bin)
install_bin="yes"
;;
install-hdrs)
install_hdrs="yes"
;;
install-lib)
install_lib="yes"
;;
install-data)
install_data="yes"
;;
install-man)
install_man="yes"
;;
clean)
clean_ppc="yes"
clean_x86="yes"
;;
clean-ppc)
clean_ppc="yes"
;;
clean-x86)
clean_x86="yes"
;;
*)
echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]"
exit 1
;;
esac
case `uname -p` in
powerpc)
native_path=ppc
;;
*86)
native_path=x86
;;
*)
echo "Couldn't figure out native architecture path"
exit 1
;;
esac
#
# Create the build directories
#
for dir in build build/ppc build/x86; do
if test -d $dir; then
:
else
mkdir $dir || exit 1
fi
done
#
# Build the PowerPC binary
#
if test x$configure_ppc = xyes; then
(cd build/ppc && \
sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2
fi
if test x$make_ppc = xyes; then
(cd build/ppc && ls include && make -j$NJOB) || exit 3
fi
#
# Build the Intel binary
#
if test x$configure_x86 = xyes; then
(cd build/x86 && \
sh ../../configure $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2
fi
if test x$make_x86 = xyes; then
(cd build/x86 && make -j$NJOB) || exit 3
fi
#
# Combine into fat binary
#
if test x$merge = xyes; then
output=.libs
sh $auxdir/mkinstalldirs build/$output
cd build
target=`find . -mindepth 3 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
(lipo -create -o $output/$target `find . -mindepth 3 -type f -name "*.dylib"` &&
ln -sf $target $output/libSDL-1.2.0.dylib &&
ln -sf $target $output/libSDL.dylib &&
lipo -create -o $output/libSDL.a */build/.libs/libSDL.a &&
cp $native_path/build/.libs/libSDL.la $output &&
cp $native_path/build/.libs/libSDL.lai $output &&
cp $native_path/build/libSDL.la . &&
lipo -create -o libSDLmain.a */build/libSDLmain.a &&
echo "Build complete!" &&
echo "Files can be found in the build directory.") || exit 4
cd ..
fi
#
# Install
#
do_install()
{
echo $*
$* || exit 5
}
if test x$prefix = x; then
prefix=/usr/local
fi
if test x$exec_prefix = x; then
exec_prefix=$prefix
fi
if test x$bindir = x; then
bindir=$exec_prefix/bin
fi
if test x$libdir = x; then
libdir=$exec_prefix/lib
fi
if test x$includedir = x; then
includedir=$prefix/include
fi
if test x$datadir = x; then
datadir=$prefix/share
fi
if test x$mandir = x; then
mandir=$prefix/man
fi
if test x$install_bin = xyes; then
do_install sh $auxdir/mkinstalldirs $bindir
do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config
fi
if test x$install_hdrs = xyes; then
do_install sh $auxdir/mkinstalldirs $includedir/SDL
for src in $srcdir/include/*.h; do \
file=`echo $src | sed -e 's|^.*/||'`; \
do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \
done
do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h
fi
if test x$install_lib = xyes; then
do_install sh $auxdir/mkinstalldirs $libdir
do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la
do_install /usr/bin/install -c -m 644 build/libSDLmain.a $libdir/libSDLmain.a
do_install ranlib $libdir/libSDLmain.a
fi
if test x$install_data = xyes; then
do_install sh $auxdir/mkinstalldirs $datadir/aclocal
do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4
fi
if test x$install_man = xyes; then
do_install sh $auxdir/mkinstalldirs $mandir/man3
for src in $srcdir/docs/man3/*.3; do \
file=`echo $src | sed -e 's|^.*/||'`; \
do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
done
fi
#
# Clean up
#
do_clean()
{
echo $*
$* || exit 6
}
if test x$clean_x86 = xyes; then
do_clean rm -r build/x86
fi
if test x$clean_ppc = xyes; then
do_clean rm -r build/ppc
fi

View file

@ -1,323 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-02-02.21
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load diff

View file

@ -1,93 +0,0 @@
#!/bin/sh
#
# Generate dependencies from a list of source files
# Check to make sure our environment variables are set
if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$output" = x; then
echo "SOURCES, INCLUDE, and output needs to be set"
exit 1
fi
cache_prefix=".#$$"
generate_var()
{
echo $1 | sed -e 's|^.*/||' -e 's|\.|_|g'
}
search_deps()
{
base=`echo $1 | sed 's|/[^/]*$||'`
grep '#include "' <$1 | sed -e 's|.*"\([^"]*\)".*|\1|' | \
while read file
do cache=${cache_prefix}_`generate_var $file`
if test -f $cache; then
: # We already ahve this cached
else
: >$cache
for path in $base `echo $INCLUDE | sed 's|-I||g'`
do dep="$path/$file"
if test -f "$dep"; then
echo " $dep \\" >>$cache
search_deps $dep >>$cache
break
fi
done
fi
cat $cache
done
}
:>${output}.new
for src in $SOURCES
do echo "Generating dependencies for $src"
ext=`echo $src | sed 's|.*\.\(.*\)|\1|'`
if test x"$ext" = x"rc"; then
obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.o|g"`
else
obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.lo|g"`
fi
echo "\$(objects)/$obj: $src \\" >>${output}.new
search_deps $src | sort | uniq >>${output}.new
case $ext in
c) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
cc) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
m) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
asm) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) $src -o \$@
__EOF__
;;
S) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
__EOF__
;;
rc) cat >>${output}.new <<__EOF__
\$(WINDRES) $src \$@
__EOF__
;;
*) echo "Unknown file extension: $ext";;
esac
echo "" >>${output}.new
done
mv ${output}.new ${output}
rm -f ${cache_prefix}*

View file

@ -1,99 +0,0 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* ) # -h for help
echo "${usage}" 1>&2; exit 0 ;;
-m ) # -m PERM arg
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
dirmode="${1}"
shift ;;
-- ) shift; break ;; # stop option processing
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
* ) break ;; # first non-opt arg
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi ;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi ;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 3
# End:
# mkinstalldirs ends here

View file

@ -1,21 +0,0 @@
#!/bin/sh
#
# libtool assumes that the compiler can handle the -fPIC flag
# This isn't always true (for example, nasm can't handle it)
command=""
while [ $# -gt 0 ]; do
case "$1" in
-?PIC)
# Ignore -fPIC and -DPIC options
;;
-fno-common)
# Ignore -fPIC and -DPIC options
;;
*)
command="$command $1"
;;
esac
shift
done
echo $command
exec $command

View file

@ -1,497 +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>
<H2> SDL 1.2.14 Release Notes </H2>
<P>
SDL 1.2.14 is a minor bug fix release.
</P>
<H3> General Notes </H3>
<BLOCKQUOTE>
<P>
Fixed flicker when resizing the SDL window
</P>
</BLOCKQUOTE>
<H3> Unix Notes </H3>
<BLOCKQUOTE>
<P>
Added configure option --enable-screensaver, to allow enabling the screensaver by default.
</P>
<P>
Use XResetScreenSaver() instead of disabling screensaver entirely.
</P>
</BLOCKQUOTE>
<H3> Windows Notes </H3>
<BLOCKQUOTE>
<P>
</P>
</BLOCKQUOTE>
<H3> Mac OS X Notes </H3>
<BLOCKQUOTE>
<P>
</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>

View file

@ -1,242 +0,0 @@
<HTML
><HEAD
><TITLE
>Audio</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><LINK
REL="PREVIOUS"
TITLE="SDL_JoystickClose"
HREF="sdljoystickclose.html"><LINK
REL="NEXT"
TITLE="SDL_AudioSpec"
HREF="sdlaudiospec.html"><META
NAME="KEYWORD"
CONTENT="audio"><META
NAME="KEYWORD"
CONTENT="function"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdljoystickclose.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlaudiospec.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="AUDIO"
></A
>Chapter 10. Audio</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="sdlaudiospec.html"
>SDL_AudioSpec</A
>&nbsp;--&nbsp;Audio Specification Structure</DT
><DT
><A
HREF="sdlopenaudio.html"
>SDL_OpenAudio</A
>&nbsp;--&nbsp;Opens the audio device with the desired parameters.</DT
><DT
><A
HREF="sdlpauseaudio.html"
>SDL_PauseAudio</A
>&nbsp;--&nbsp;Pauses and unpauses the audio callback processing</DT
><DT
><A
HREF="sdlgetaudiostatus.html"
>SDL_GetAudioStatus</A
>&nbsp;--&nbsp;Get the current audio state</DT
><DT
><A
HREF="sdlloadwav.html"
>SDL_LoadWAV</A
>&nbsp;--&nbsp;Load a WAVE file</DT
><DT
><A
HREF="sdlfreewav.html"
>SDL_FreeWAV</A
>&nbsp;--&nbsp;Frees previously opened WAV data</DT
><DT
><A
HREF="sdlaudiocvt.html"
>SDL_AudioCVT</A
>&nbsp;--&nbsp;Audio Conversion Structure</DT
><DT
><A
HREF="sdlbuildaudiocvt.html"
>SDL_BuildAudioCVT</A
>&nbsp;--&nbsp;Initializes a SDL_AudioCVT structure for conversion</DT
><DT
><A
HREF="sdlconvertaudio.html"
>SDL_ConvertAudio</A
>&nbsp;--&nbsp;Convert audio data to a desired audio format.</DT
><DT
><A
HREF="sdlmixaudio.html"
>SDL_MixAudio</A
>&nbsp;--&nbsp;Mix audio data</DT
><DT
><A
HREF="sdllockaudio.html"
>SDL_LockAudio</A
>&nbsp;--&nbsp;Lock out the callback function</DT
><DT
><A
HREF="sdlunlockaudio.html"
>SDL_UnlockAudio</A
>&nbsp;--&nbsp;Unlock the callback function</DT
><DT
><A
HREF="sdlcloseaudio.html"
>SDL_CloseAudio</A
>&nbsp;--&nbsp;Shuts down audio processing and closes the audio device.</DT
></DL
></DIV
><P
>Sound on the computer is translated from waves that you hear into a series of
values, or samples, each representing the amplitude of the wave. When these
samples are sent in a stream to a sound card, an approximation of the original
wave can be recreated. The more bits used to represent the amplitude, and the
greater frequency these samples are gathered, the closer the approximated
sound is to the original, and the better the quality of sound.</P
><P
>This library supports both 8 and 16 bit signed and unsigned sound samples,
at frequencies ranging from 11025 Hz to 44100 Hz, depending on the
underlying hardware. If the hardware doesn't support the desired audio
format or frequency, it can be emulated if desired (See
<A
HREF="sdlopenaudio.html"
><TT
CLASS="FUNCTION"
>SDL_OpenAudio()</TT
></A
>)</P
><P
>A commonly supported audio format is 16 bits per sample at 22050 Hz.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdljoystickclose.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlaudiospec.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_JoystickClose</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_AudioSpec</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,260 +0,0 @@
<HTML
><HEAD
><TITLE
>CD-ROM</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CloseAudio"
HREF="sdlcloseaudio.html"><LINK
REL="NEXT"
TITLE="SDL_CDNumDrives"
HREF="sdlcdnumdrives.html"><META
NAME="KEYWORD"
CONTENT="cdrom"><META
NAME="KEYWORD"
CONTENT="function"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcloseaudio.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdnumdrives.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="CDROM"
></A
>Chapter 11. CD-ROM</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="sdlcdnumdrives.html"
>SDL_CDNumDrives</A
>&nbsp;--&nbsp;Returns the number of CD-ROM drives on the system.</DT
><DT
><A
HREF="sdlcdname.html"
>SDL_CDName</A
>&nbsp;--&nbsp;Returns a human-readable, system-dependent identifier for the CD-ROM.</DT
><DT
><A
HREF="sdlcdopen.html"
>SDL_CDOpen</A
>&nbsp;--&nbsp;Opens a CD-ROM drive for access.</DT
><DT
><A
HREF="sdlcdstatus.html"
>SDL_CDStatus</A
>&nbsp;--&nbsp;Returns the current status of the given drive.</DT
><DT
><A
HREF="sdlcdplay.html"
>SDL_CDPlay</A
>&nbsp;--&nbsp;Play a CD</DT
><DT
><A
HREF="sdlcdplaytracks.html"
>SDL_CDPlayTracks</A
>&nbsp;--&nbsp;Play the given CD track(s)</DT
><DT
><A
HREF="sdlcdpause.html"
>SDL_CDPause</A
>&nbsp;--&nbsp;Pauses a CDROM</DT
><DT
><A
HREF="sdlcdresume.html"
>SDL_CDResume</A
>&nbsp;--&nbsp;Resumes a CDROM</DT
><DT
><A
HREF="sdlcdstop.html"
>SDL_CDStop</A
>&nbsp;--&nbsp;Stops a CDROM</DT
><DT
><A
HREF="sdlcdeject.html"
>SDL_CDEject</A
>&nbsp;--&nbsp;Ejects a CDROM</DT
><DT
><A
HREF="sdlcdclose.html"
>SDL_CDClose</A
>&nbsp;--&nbsp;Closes a SDL_CD handle</DT
><DT
><A
HREF="sdlcd.html"
>SDL_CD</A
>&nbsp;--&nbsp;CDROM Drive Information</DT
><DT
><A
HREF="sdlcdtrack.html"
>SDL_CDtrack</A
>&nbsp;--&nbsp;CD Track Information Structure</DT
></DL
></DIV
><P
>SDL supports audio control of up to 32 local CD-ROM drives at once.</P
><P
>You use this API to perform all the basic functions of a CD player,
including listing the tracks, playing, stopping, and ejecting the CD-ROM.
(Currently, multi-changer CD drives are not supported.)</P
><P
>Before you call any of the SDL CD-ROM functions, you must first call
"<TT
CLASS="FUNCTION"
>SDL_Init(SDL_INIT_CDROM)</TT
>", which scans the system for
CD-ROM drives, and sets the program up for audio control. Check the
return code, which should be <SPAN
CLASS="RETURNVALUE"
>0</SPAN
>, to see if there
were any errors in starting up.</P
><P
>After you have initialized the library, you can find out how many drives
are available using the <TT
CLASS="FUNCTION"
>SDL_CDNumDrives()</TT
> function.
The first drive listed is the system default CD-ROM drive. After you have
chosen a drive, and have opened it with <TT
CLASS="FUNCTION"
>SDL_CDOpen()</TT
>,
you can check the status and start playing if there's a CD in the drive.</P
><P
>A CD-ROM is organized into one or more tracks, each consisting of a certain
number of "frames". Each frame is ~2K in size, and at normal playing speed,
a CD plays 75 frames per second. SDL works with the number of frames on a
CD, but this can easily be converted to the more familiar minutes/seconds
format by using the <TT
CLASS="FUNCTION"
>FRAMES_TO_MSF()</TT
> macro.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcloseaudio.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdnumdrives.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CloseAudio</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDNumDrives</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,216 +0,0 @@
<HTML
><HEAD
><TITLE
>Events</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><LINK
REL="PREVIOUS"
TITLE="SDL_WM_GrabInput"
HREF="sdlwmgrabinput.html"><LINK
REL="NEXT"
TITLE="SDL Event Structures."
HREF="eventstructures.html"><META
NAME="KEYWORD"
CONTENT="events"><META
NAME="KEYWORD"
CONTENT="function"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlwmgrabinput.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="eventstructures.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="EVENT"
></A
>Chapter 8. Events</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="event.html#AEN3691"
>Introduction</A
></DT
><DT
><A
HREF="eventstructures.html"
>SDL Event Structures.</A
></DT
><DT
><A
HREF="eventfunctions.html"
>Event Functions.</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN3691"
></A
>Introduction</H1
><P
>Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to:
<PRE
CLASS="PROGRAMLISTING"
>SDL_Init(SDL_INIT_VIDEO);</PRE
>
Internally, SDL stores all the events waiting to be handled in an event queue. Using functions like <A
HREF="sdlpollevent.html"
><TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
></A
> and <A
HREF="sdlpeepevents.html"
><TT
CLASS="FUNCTION"
>SDL_PeepEvents</TT
></A
> you can observe and handle waiting input events.</P
><P
>The key to event handling in SDL is the <A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
> union. The event queue itself is composed of a series of <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> unions, one for each waiting event. <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> unions are read from the queue with the <TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
> function and it is then up to the application to process the information stored with them.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlwmgrabinput.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="eventstructures.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_WM_GrabInput</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL Event Structures.</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,481 +0,0 @@
<HTML
><HEAD
><TITLE
>Event Functions.</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Events"
HREF="event.html"><LINK
REL="PREVIOUS"
TITLE="SDLKey"
HREF="sdlkey.html"><LINK
REL="NEXT"
TITLE="SDL_PumpEvents"
HREF="sdlpumpevents.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlkey.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 8. Events</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlpumpevents.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="EVENTFUNCTIONS"
></A
>Event Functions.</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="sdlpumpevents.html"
>SDL_PumpEvents</A
>&nbsp;--&nbsp;Pumps the event loop, gathering events from the input devices.</DT
><DT
><A
HREF="sdlpeepevents.html"
>SDL_PeepEvents</A
>&nbsp;--&nbsp;Checks the event queue for messages and optionally returns them.</DT
><DT
><A
HREF="sdlpollevent.html"
>SDL_PollEvent</A
>&nbsp;--&nbsp;Polls for currently pending events.</DT
><DT
><A
HREF="sdlwaitevent.html"
>SDL_WaitEvent</A
>&nbsp;--&nbsp;Waits indefinitely for the next available event.</DT
><DT
><A
HREF="sdlpushevent.html"
>SDL_PushEvent</A
>&nbsp;--&nbsp;Pushes an event onto the event queue</DT
><DT
><A
HREF="sdlseteventfilter.html"
>SDL_SetEventFilter</A
>&nbsp;--&nbsp;Sets up a filter to process all events before they are posted
to the event queue.</DT
><DT
><A
HREF="sdlgeteventfilter.html"
>SDL_GetEventFilter</A
>&nbsp;--&nbsp;Retrieves a pointer to he event filter</DT
><DT
><A
HREF="sdleventstate.html"
>SDL_EventState</A
>&nbsp;--&nbsp;This function allows you to set the state of processing certain events.</DT
><DT
><A
HREF="sdlgetkeystate.html"
>SDL_GetKeyState</A
>&nbsp;--&nbsp;Get a snapshot of the current keyboard state</DT
><DT
><A
HREF="sdlgetmodstate.html"
>SDL_GetModState</A
>&nbsp;--&nbsp;Get the state of modifier keys.</DT
><DT
><A
HREF="sdlsetmodstate.html"
>SDL_SetModState</A
>&nbsp;--&nbsp;Set the current key modifier state</DT
><DT
><A
HREF="sdlgetkeyname.html"
>SDL_GetKeyName</A
>&nbsp;--&nbsp;Get the name of an SDL virtual keysym</DT
><DT
><A
HREF="sdlenableunicode.html"
>SDL_EnableUNICODE</A
>&nbsp;--&nbsp;Enable UNICODE translation</DT
><DT
><A
HREF="sdlenablekeyrepeat.html"
>SDL_EnableKeyRepeat</A
>&nbsp;--&nbsp;Set keyboard repeat rate.</DT
><DT
><A
HREF="sdlgetmousestate.html"
>SDL_GetMouseState</A
>&nbsp;--&nbsp;Retrieve the current state of the mouse</DT
><DT
><A
HREF="sdlgetrelativemousestate.html"
>SDL_GetRelativeMouseState</A
>&nbsp;--&nbsp;Retrieve the current state of the mouse</DT
><DT
><A
HREF="sdlgetappstate.html"
>SDL_GetAppState</A
>&nbsp;--&nbsp;Get the state of the application</DT
><DT
><A
HREF="sdljoystickeventstate.html"
>SDL_JoystickEventState</A
>&nbsp;--&nbsp;Enable/disable joystick event polling</DT
></DL
></DIV
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN5312"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlpumpevents.html"
>SDL_PumpEvents</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Pumps the event loop, gathering events from the input devices</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlpeepevents.html"
>SDL_PeepEvents</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Checks the event queue for messages and optionally returns them</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlpollevent.html"
>SDL_PollEvent</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Polls for currently pending events</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlwaitevent.html"
>SDL_WaitEvent</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Waits indefinitely for the next available event</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlpushevent.html"
>SDL_PushEvent</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Pushes an event onto the event queue</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlseteventfilter.html"
>SDL_SetEventFilter</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Sets up a filter to process all events</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdleventstate.html"
>SDL_EventState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Allows you to set the state of processing certain events</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlgetkeystate.html"
>SDL_GetKeyState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Get a snapshot of the current keyboard state</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlgetmodstate.html"
>SDL_GetModState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Get the state of modifier keys</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlsetmodstate.html"
>SDL_SetModState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Set the state of modifier keys</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlgetkeyname.html"
>SDL_GetKeyName</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Get the name of an SDL virtual keysym</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlenableunicode.html"
>SDL_EnableUNICODE</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Enable UNICODE translation</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlenablekeyrepeat.html"
>SDL_EnableKeyRepeat</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Set keyboard repeat rate</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlgetmousestate.html"
>SDL_GetMouseState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Retrieve the current state of the mouse</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlgetrelativemousestate.html"
>SDL_GetRelativeMouseState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Retrieve the current state of the mouse</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlgetappstate.html"
>SDL_GetAppState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Get the state of the application</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoystickeventstate.html"
>SDL_JoystickEventState</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Enable/disable joystick event polling</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlkey.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlpumpevents.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDLKey</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="event.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_PumpEvents</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,233 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL Event Structures.</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Events"
HREF="event.html"><LINK
REL="PREVIOUS"
TITLE="Events"
HREF="event.html"><LINK
REL="NEXT"
TITLE="SDL_Event"
HREF="sdlevent.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="event.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 8. Events</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="EVENTSTRUCTURES"
></A
>SDL Event Structures.</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="sdlevent.html"
>SDL_Event</A
>&nbsp;--&nbsp;General event structure</DT
><DT
><A
HREF="sdlactiveevent.html"
>SDL_ActiveEvent</A
>&nbsp;--&nbsp;Application visibility event structure</DT
><DT
><A
HREF="sdlkeyboardevent.html"
>SDL_KeyboardEvent</A
>&nbsp;--&nbsp;Keyboard event structure</DT
><DT
><A
HREF="sdlmousemotionevent.html"
>SDL_MouseMotionEvent</A
>&nbsp;--&nbsp;Mouse motion event structure</DT
><DT
><A
HREF="sdlmousebuttonevent.html"
>SDL_MouseButtonEvent</A
>&nbsp;--&nbsp;Mouse button event structure</DT
><DT
><A
HREF="sdljoyaxisevent.html"
>SDL_JoyAxisEvent</A
>&nbsp;--&nbsp;Joystick axis motion event structure</DT
><DT
><A
HREF="sdljoybuttonevent.html"
>SDL_JoyButtonEvent</A
>&nbsp;--&nbsp;Joystick button event structure</DT
><DT
><A
HREF="sdljoyhatevent.html"
>SDL_JoyHatEvent</A
>&nbsp;--&nbsp;Joystick hat position change event structure</DT
><DT
><A
HREF="sdljoyballevent.html"
>SDL_JoyBallEvent</A
>&nbsp;--&nbsp;Joystick trackball motion event structure</DT
><DT
><A
HREF="sdlresizeevent.html"
>SDL_ResizeEvent</A
>&nbsp;--&nbsp;Window resize event structure</DT
><DT
><A
HREF="sdlexposeevent.html"
>SDL_ExposeEvent</A
>&nbsp;--&nbsp;Quit requested event</DT
><DT
><A
HREF="sdlsyswmevent.html"
>SDL_SysWMEvent</A
>&nbsp;--&nbsp;Platform-dependent window manager event.</DT
><DT
><A
HREF="sdluserevent.html"
>SDL_UserEvent</A
>&nbsp;--&nbsp;A user-defined event type</DT
><DT
><A
HREF="sdlquitevent.html"
>SDL_QuitEvent</A
>&nbsp;--&nbsp;Quit requested event</DT
><DT
><A
HREF="sdlkeysym.html"
>SDL_keysym</A
>&nbsp;--&nbsp;Keysym structure</DT
><DT
><A
HREF="sdlkey.html"
>SDLKey</A
>&nbsp;--&nbsp;Keysym definitions.</DT
></DL
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="event.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Events</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="event.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_Event</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,225 +0,0 @@
<HTML
><HEAD
><TITLE
>General</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><LINK
REL="PREVIOUS"
TITLE="SDL Reference"
HREF="reference.html"><LINK
REL="NEXT"
TITLE="SDL_Init"
HREF="sdlinit.html"><META
NAME="KEYWORD"
CONTENT="general"><META
NAME="KEYWORD"
CONTENT="function"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="reference.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlinit.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="GENERAL"
></A
>Chapter 5. General</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="sdlinit.html"
>SDL_Init</A
>&nbsp;--&nbsp;Initializes SDL</DT
><DT
><A
HREF="sdlinitsubsystem.html"
>SDL_InitSubSystem</A
>&nbsp;--&nbsp;Initialize subsystems</DT
><DT
><A
HREF="sdlquitsubsystem.html"
>SDL_QuitSubSystem</A
>&nbsp;--&nbsp;Shut down a subsystem</DT
><DT
><A
HREF="sdlquit.html"
>SDL_Quit</A
>&nbsp;--&nbsp;Shut down SDL</DT
><DT
><A
HREF="sdlwasinit.html"
>SDL_WasInit</A
>&nbsp;--&nbsp;Check which subsystems are initialized</DT
><DT
><A
HREF="sdlgeterror.html"
>SDL_GetError</A
>&nbsp;--&nbsp;Get SDL error string</DT
><DT
><A
HREF="sdlenvvars.html"
>SDL_envvars</A
>&nbsp;--&nbsp;SDL environment variables</DT
></DL
></DIV
><P
>Before SDL can be used in a program it must be initialized with <A
HREF="sdlinit.html"
><TT
CLASS="FUNCTION"
>SDL_Init</TT
></A
>. <TT
CLASS="FUNCTION"
>SDL_Init</TT
> initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with <TT
CLASS="FUNCTION"
>SDL_Init</TT
> subsystems can be shut down and initialized as needed using <A
HREF="sdlinitsubsystem.html"
><TT
CLASS="FUNCTION"
>SDL_InitSubSystem</TT
></A
> and <A
HREF="sdlquitsubsystem.html"
><TT
CLASS="FUNCTION"
>SDL_QuitSubSystem</TT
></A
>.</P
><P
>SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling <A
HREF="sdlquit.html"
><TT
CLASS="FUNCTION"
>SDL_Quit</TT
></A
> shuts down all subsystems and frees any resources allocated to SDL.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlinit.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL Reference</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_Init</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,174 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL Guide</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="NEXT"
TITLE="Preface"
HREF="guidepreface.html"></HEAD
><BODY
CLASS="PART"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="index.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidepreface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="PART"
><A
NAME="GUIDE"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="TITLE"
>I. SDL Guide</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="guidepreface.html"
>Preface</A
></DT
><DT
>1. <A
HREF="guidethebasics.html"
>The Basics</A
></DT
><DT
>2. <A
HREF="guidevideo.html"
>Graphics and Video</A
></DT
><DT
>3. <A
HREF="guideinput.html"
>Input handling</A
></DT
><DT
>4. <A
HREF="guideexamples.html"
>Examples</A
></DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidepreface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL Library Documentation</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Preface</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,148 +0,0 @@
<HTML
><HEAD
><TITLE
>About SDLdoc</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Preface"
HREF="guidepreface.html"><LINK
REL="PREVIOUS"
TITLE="Preface"
HREF="guidepreface.html"><LINK
REL="NEXT"
TITLE="Credits"
HREF="guidecredits.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidepreface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Preface</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidecredits.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEABOUTSDLDOC"
></A
>About SDLdoc</H1
><P
>SDLdoc (The SDL Documentation Project) was formed to completely rewrite the SDL documentation and to keep it continually up to date. The team consists completely of volunteers ranging from people working with SDL in their spare time to people who use SDL in their everyday working lives.</P
><P
>The latest version of this documentation can always be found here: http://sdldoc.csn.ul.ie Downloadable PS, man pages and html tarballs are available at http://sdldoc.csn.ul.ie/pub/</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidepreface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidecredits.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Preface</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guidepreface.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Credits</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,228 +0,0 @@
<HTML
><HEAD
><TITLE
>Audio Examples</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Examples"
HREF="guideexamples.html"><LINK
REL="PREVIOUS"
TITLE="Event Examples"
HREF="guideeventexamples.html"><LINK
REL="NEXT"
TITLE="CDROM Examples"
HREF="guidecdromexamples.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guideeventexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 4. Examples</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidecdromexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEAUDIOEXAMPLES"
></A
>Audio Examples</H1
><P
></P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN382"
></A
>Opening the audio device</H2
><P
><PRE
CLASS="PROGRAMLISTING"
> SDL_AudioSpec wanted;
extern void fill_audio(void *udata, Uint8 *stream, int len);
/* Set the audio format */
wanted.freq = 22050;
wanted.format = AUDIO_S16;
wanted.channels = 2; /* 1 = mono, 2 = stereo */
wanted.samples = 1024; /* Good low-latency value for callback */
wanted.callback = fill_audio;
wanted.userdata = NULL;
/* Open the audio device, forcing the desired format */
if ( SDL_OpenAudio(&#38;wanted, NULL) &#60; 0 ) {
fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
return(-1);
}
return(0);</PRE
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN386"
></A
>Playing audio</H2
><P
><PRE
CLASS="PROGRAMLISTING"
> static Uint8 *audio_chunk;
static Uint32 audio_len;
static Uint8 *audio_pos;
/* The audio function callback takes the following parameters:
stream: A pointer to the audio buffer to be filled
len: The length (in bytes) of the audio buffer
*/
void fill_audio(void *udata, Uint8 *stream, int len)
{
/* Only play if we have data left */
if ( audio_len == 0 )
return;
/* Mix as much data as possible */
len = ( len &#62; audio_len ? audio_len : len );
SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
audio_pos += len;
audio_len -= len;
}
/* Load the audio data ... */
;;;;;
audio_pos = audio_chunk;
/* Let the callback function play the audio chunk */
SDL_PauseAudio(0);
/* Do some processing */
;;;;;
/* Wait for sound to complete */
while ( audio_len &#62; 0 ) {
SDL_Delay(100); /* Sleep 1/10 second */
}
SDL_CloseAudio();</PRE
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guideeventexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidecdromexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Event Examples</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guideexamples.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>CDROM Examples</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,240 +0,0 @@
<HTML
><HEAD
><TITLE
>Initializing SDL</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="The Basics"
HREF="guidethebasics.html"><LINK
REL="PREVIOUS"
TITLE="The Basics"
HREF="guidethebasics.html"><LINK
REL="NEXT"
TITLE="Graphics and Video"
HREF="guidevideo.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidethebasics.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 1. The Basics</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidevideo.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEBASICSINIT"
></A
>Initializing SDL</H1
><P
>SDL is composed of eight subsystems - Audio, CDROM, Event Handling, File I/O, Joystick Handling, Threading, Timers and Video. Before you can use any of these subsystems they must be initialized by calling <A
HREF="sdlinit.html"
><TT
CLASS="FUNCTION"
>SDL_Init</TT
></A
> (or <A
HREF="sdlinitsubsystem.html"
><TT
CLASS="FUNCTION"
>SDL_InitSubSystem</TT
></A
>). <TT
CLASS="FUNCTION"
>SDL_Init</TT
> must be called before any other SDL function. It automatically initializes the Event Handling, File I/O and Threading subsystems and it takes a parameter specifying which other subsystems to initialize. So, to initialize the default subsystems and the Video subsystems you would call:
<PRE
CLASS="PROGRAMLISTING"
> SDL_Init ( SDL_INIT_VIDEO );</PRE
>
To initialize the default subsystems, the Video subsystem and the Timers subsystem you would call:
<PRE
CLASS="PROGRAMLISTING"
> SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER );</PRE
></P
><P
><TT
CLASS="FUNCTION"
>SDL_Init</TT
> is complemented by <A
HREF="sdlquit.html"
><TT
CLASS="FUNCTION"
>SDL_Quit</TT
></A
> (and <A
HREF="sdlquitsubsystem.html"
><TT
CLASS="FUNCTION"
>SDL_QuitSubSystem</TT
></A
>). <TT
CLASS="FUNCTION"
>SDL_Quit</TT
> shuts down all subsystems, including the default ones. It should always be called before a SDL application exits.</P
><P
>With <TT
CLASS="FUNCTION"
>SDL_Init</TT
> and <TT
CLASS="FUNCTION"
>SDL_Quit</TT
> firmly embedded in your programmers toolkit you can write your first and most basic SDL application. However, we must be prepare to handle errors. Many SDL functions return a value and indicates whether the function has succeeded or failed, <TT
CLASS="FUNCTION"
>SDL_Init</TT
>, for instance, returns -1 if it could not initialize a subsystem. SDL provides a useful facility that allows you to determine exactly what the problem was, every time an error occurs within SDL an error message is stored which can be retrieved using <TT
CLASS="FUNCTION"
>SDL_GetError</TT
>. Use this often, you can never know too much about an error.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN60"
></A
><P
><B
>Example 1-1. Initializing SDL</B
></P
><PRE
CLASS="PROGRAMLISTING"
>#include "SDL.h" /* All SDL App's need this */
#include &#60;stdio.h&#62;
int main(int argc, char *argv[]) {
printf("Initializing SDL.\n");
/* Initialize defaults, Video and Audio */
if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
printf("Could not initialize SDL: %s.\n", SDL_GetError());
exit(-1);
}
printf("SDL initialized.\n");
printf("Quiting SDL.\n");
/* Shutdown all subsystems */
SDL_Quit();
printf("Quiting....\n");
exit(0);
}&#13;</PRE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidethebasics.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidevideo.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The Basics</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guidethebasics.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Graphics and Video</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,275 +0,0 @@
<HTML
><HEAD
><TITLE
>CDROM Examples</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Examples"
HREF="guideexamples.html"><LINK
REL="PREVIOUS"
TITLE="Audio Examples"
HREF="guideaudioexamples.html"><LINK
REL="NEXT"
TITLE="Time Examples"
HREF="guidetimeexamples.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guideaudioexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 4. Examples</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidetimeexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDECDROMEXAMPLES"
></A
>CDROM Examples</H1
><P
></P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN393"
></A
>Listing CD-ROM drives</H2
><P
><PRE
CLASS="PROGRAMLISTING"
> #include "SDL.h"
/* Initialize SDL first */
if ( SDL_Init(SDL_INIT_CDROM) &#60; 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
/* Find out how many CD-ROM drives are connected to the system */
printf("Drives available: %d\n", SDL_CDNumDrives());
for ( i=0; i&#60;SDL_CDNumDrives(); ++i ) {
printf("Drive %d: \"%s\"\n", i, SDL_CDName(i));
}</PRE
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN397"
></A
>Opening the default drive</H2
><P
><PRE
CLASS="PROGRAMLISTING"
> SDL_CD *cdrom;
CDstatus status;
char *status_str;
cdrom = SDL_CDOpen(0);
if ( cdrom == NULL ) {
fprintf(stderr, "Couldn't open default CD-ROM drive: %s\n",
SDL_GetError());
exit(2);
}
status = SDL_CDStatus(cdrom);
switch (status) {
case CD_TRAYEMPTY:
status_str = "tray empty";
break;
case CD_STOPPED:
status_str = "stopped";
break;
case CD_PLAYING:
status_str = "playing";
break;
case CD_PAUSED:
status_str = "paused";
break;
case CD_ERROR:
status_str = "error state";
break;
}
printf("Drive status: %s\n", status_str);
if ( status &#62;= CD_PLAYING ) {
int m, s, f;
FRAMES_TO_MSF(cdrom-&#62;cur_frame, &#38;m, &#38;s, &#38;f);
printf("Currently playing track %d, %d:%2.2d\n",
cdrom-&#62;track[cdrom-&#62;cur_track].id, m, s);
}</PRE
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN401"
></A
>Listing the tracks on a CD</H2
><P
><PRE
CLASS="PROGRAMLISTING"
> SDL_CD *cdrom; /* Assuming this has already been set.. */
int i;
int m, s, f;
SDL_CDStatus(cdrom);
printf("Drive tracks: %d\n", cdrom-&#62;numtracks);
for ( i=0; i&#60;cdrom-&#62;numtracks; ++i ) {
FRAMES_TO_MSF(cdrom-&#62;track[i].length, &#38;m, &#38;s, &#38;f);
if ( f &#62; 0 )
++s;
printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
cdrom-&#62;track[i].id, m, s);
}</PRE
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN405"
></A
>Play an entire CD</H2
><P
><PRE
CLASS="PROGRAMLISTING"
> SDL_CD *cdrom; /* Assuming this has already been set.. */
// 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-&#62;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, CD_FPS * 10);</PRE
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guideaudioexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidetimeexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Audio Examples</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guideexamples.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Time Examples</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,195 +0,0 @@
<HTML
><HEAD
><TITLE
>Credits</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Preface"
HREF="guidepreface.html"><LINK
REL="PREVIOUS"
TITLE="About SDLdoc"
HREF="guideaboutsdldoc.html"><LINK
REL="NEXT"
TITLE="The Basics"
HREF="guidethebasics.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guideaboutsdldoc.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Preface</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidethebasics.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDECREDITS"
></A
>Credits</H1
><P
><P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
>Sam Lantinga, slouken@libsdl.org</TD
></TR
><TR
><TD
>Martin Donlon, akawaka@skynet.ie</TD
></TR
><TR
><TD
>Mattias Engdegård</TD
></TR
><TR
><TD
>Julian Peterson</TD
></TR
><TR
><TD
>Ken Jordan</TD
></TR
><TR
><TD
>Maxim Sobolev</TD
></TR
><TR
><TD
>Wesley Poole</TD
></TR
><TR
><TD
>Michael Vance</TD
></TR
><TR
><TD
>Andreas Umbach</TD
></TR
><TR
><TD
>Andreas Hofmeister</TD
></TR
></TBODY
></TABLE
><P
></P
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guideaboutsdldoc.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidethebasics.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>About SDLdoc</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guidepreface.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The Basics</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,247 +0,0 @@
<HTML
><HEAD
><TITLE
>Event Examples</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Examples"
HREF="guideexamples.html"><LINK
REL="PREVIOUS"
TITLE="Examples"
HREF="guideexamples.html"><LINK
REL="NEXT"
TITLE="Audio Examples"
HREF="guideaudioexamples.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guideexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 4. Examples</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guideaudioexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEEVENTEXAMPLES"
></A
>Event Examples</H1
><P
></P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN375"
></A
>Filtering and Handling Events</H2
><P
><PRE
CLASS="PROGRAMLISTING"
>#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;
#include "SDL.h"
/* This function may run in a separate event thread */
int FilterEvents(const SDL_Event *event) {
static int boycott = 1;
/* This quit event signals the closing of the window */
if ( (event-&#62;type == SDL_QUIT) &#38;&#38; boycott ) {
printf("Quit event filtered out -- try again.\n");
boycott = 0;
return(0);
}
if ( event-&#62;type == SDL_MOUSEMOTION ) {
printf("Mouse moved to (%d,%d)\n",
event-&#62;motion.x, event-&#62;motion.y);
return(0); /* Drop it, we've handled it */
}
return(1);
}
int main(int argc, char *argv[])
{
SDL_Event event;
/* Initialize the SDL library (starts the event loop) */
if ( SDL_Init(SDL_INIT_VIDEO) &#60; 0 ) {
fprintf(stderr,
"Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}
/* Clean up on exit, exit on window close and interrupt */
atexit(SDL_Quit);
/* Ignore key events */
SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
SDL_EventState(SDL_KEYUP, SDL_IGNORE);
/* Filter quit and mouse motion events */
SDL_SetEventFilter(FilterEvents);
/* The mouse isn't much use unless we have a display for reference */
if ( SDL_SetVideoMode(640, 480, 8, 0) == NULL ) {
fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
SDL_GetError());
exit(1);
}
/* Loop waiting for ESC+Mouse_Button */
while ( SDL_WaitEvent(&#38;event) &#62;= 0 ) {
switch (event.type) {
case SDL_ACTIVEEVENT: {
if ( event.active.state &#38; SDL_APPACTIVE ) {
if ( event.active.gain ) {
printf("App activated\n");
} else {
printf("App iconified\n");
}
}
}
break;
case SDL_MOUSEBUTTONDOWN: {
Uint8 *keys;
keys = SDL_GetKeyState(NULL);
if ( keys[SDLK_ESCAPE] == SDL_PRESSED ) {
printf("Bye bye...\n");
exit(0);
}
printf("Mouse button pressed\n");
}
break;
case SDL_QUIT: {
printf("Quit requested, quitting.\n");
exit(0);
}
break;
}
}
/* This should never happen */
printf("SDL_WaitEvent error: %s\n", SDL_GetError());
exit(1);
}</PRE
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guideexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guideaudioexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Examples</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guideexamples.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Audio Examples</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,188 +0,0 @@
<HTML
><HEAD
><TITLE
>Examples</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Guide"
HREF="guide.html"><LINK
REL="PREVIOUS"
TITLE="Handling the Keyboard"
HREF="guideinputkeyboard.html"><LINK
REL="NEXT"
TITLE="Event Examples"
HREF="guideeventexamples.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guideinputkeyboard.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guideeventexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="GUIDEEXAMPLES"
></A
>Chapter 4. Examples</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="guideexamples.html#AEN369"
>Introduction</A
></DT
><DT
><A
HREF="guideeventexamples.html"
>Event Examples</A
></DT
><DT
><A
HREF="guideaudioexamples.html"
>Audio Examples</A
></DT
><DT
><A
HREF="guidecdromexamples.html"
>CDROM Examples</A
></DT
><DT
><A
HREF="guidetimeexamples.html"
>Time Examples</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN369"
></A
>Introduction</H1
><P
>For the moment these examples are taken directly from the old SDL documentation. By the 1.2 release these examples should hopefully deal with most common SDL programming problems.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guideinputkeyboard.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guideeventexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Handling the Keyboard</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Event Examples</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,739 +0,0 @@
<HTML
><HEAD
><TITLE
>Input handling</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Guide"
HREF="guide.html"><LINK
REL="PREVIOUS"
TITLE="Using OpenGL With SDL"
HREF="guidevideoopengl.html"><LINK
REL="NEXT"
TITLE="Handling the Keyboard"
HREF="guideinputkeyboard.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidevideoopengl.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guideinputkeyboard.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="GUIDEINPUT"
></A
>Chapter 3. Input handling</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="guideinput.html#GUIDEINPUTJOYSTICK"
>Handling Joysticks</A
></DT
><DT
><A
HREF="guideinputkeyboard.html"
>Handling the Keyboard</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEINPUTJOYSTICK"
></A
>Handling Joysticks</H1
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN135"
></A
>Initialization</H2
><P
>The first step in using a joystick in a SDL program is to initialize the Joystick subsystems of SDL. This done by passing the <TT
CLASS="LITERAL"
>SDL_INIT_JOYSTICK</TT
> flag to <A
HREF="sdlinit.html"
><TT
CLASS="FUNCTION"
>SDL_Init</TT
></A
>. The joystick flag will usually be used in conjunction with other flags (like the video flag) because the joystick is usually used to control something.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN141"
></A
><P
><B
>Example 3-1. Initializing SDL with Joystick Support</B
></P
><PRE
CLASS="PROGRAMLISTING"
> if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) &#60; 0)
{
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}</PRE
></DIV
><P
>This will attempt to start SDL with both the video and the joystick subsystems activated.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN145"
></A
>Querying</H2
><P
>If we have reached this point then we can safely assume that the SDL library has been initialized and that the Joystick subsystem is active. We can now call some video and/or sound functions to get things going before we need the joystick. Eventually we have to make sure that there is actually a joystick to work with. It's wise to always check even if you know a joystick will be present on the system because it can also help detect when the joystick is unplugged. The function used to check for joysticks is <A
HREF="sdlnumjoysticks.html"
><TT
CLASS="FUNCTION"
>SDL_NumJoysticks</TT
></A
>.</P
><P
>This function simply returns the number of joysticks available on the system. If it is at least one then we are in good shape. The next step is to determine which joystick the user wants to use. If the number of joysticks available is only one then it is safe to assume that one joystick is the one the user wants to use. SDL has a function to get the name of the joysticks as assigned by the operations system and that function is <A
HREF="sdljoystickname.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickName</TT
></A
>. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by <TT
CLASS="FUNCTION"
>SDL_NumJoysticks</TT
> - 1. In the demonstration a list of all available joysticks is printed to stdout.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN154"
></A
><P
><B
>Example 3-2. Querying the Number of Available Joysticks</B
></P
><PRE
CLASS="PROGRAMLISTING"
> printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
printf("The names of the joysticks are:\n");
for( i=0; i &#60; SDL_NumJoysticks(); i++ )
{
printf(" %s\n", SDL_JoystickName(i));
}</PRE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN157"
></A
>Opening a Joystick and Receiving Joystick Events</H2
><P
>SDL's event driven architecture makes working with joysticks a snap. Joysticks can trigger 4 different types of events:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="sdljoyaxisevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyAxisEvent</SPAN
></A
></TD
><TD
>Occurs when an axis changes</TD
></TR
><TR
><TD
><A
HREF="sdljoyballevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyBallEvent</SPAN
></A
></TD
><TD
>Occurs when a joystick trackball's position changes</TD
></TR
><TR
><TD
><A
HREF="sdljoyhatevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyHatEvent</SPAN
></A
></TD
><TD
>Occurs when a hat's position changes</TD
></TR
><TR
><TD
><A
HREF="sdljoybuttonevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyButtonEvent</SPAN
></A
></TD
><TD
>Occurs when a button is pressed or released</TD
></TR
></TBODY
></TABLE
><P
></P
></P
><P
>Events are received from all joysticks opened. The first thing that needs to be done in order to receive joystick events is to call <A
HREF="sdljoystickeventstate.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickEventState</TT
></A
> with the <TT
CLASS="LITERAL"
>SDL_ENABLE</TT
> flag. Next you must open the joysticks that you want to receive envents from. This is done with the <A
HREF="sdljoystickopen.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickOpen</TT
></A
> function. For the example we are only interested in events from the first joystick on the system, regardless of what it may be. To receive events from it we would do this:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN183"
></A
><P
><B
>Example 3-3. Opening a Joystick</B
></P
><PRE
CLASS="PROGRAMLISTING"
> SDL_Joystick *joystick;
SDL_JoystickEventState(SDL_ENABLE);
joystick = SDL_JoystickOpen(0);</PRE
></DIV
><P
>If we wanted to receive events for other joysticks we would open them with calls to <TT
CLASS="FUNCTION"
>SDL_JoystickOpen</TT
> just like we opened joystick 0, except we would store the <SPAN
CLASS="STRUCTNAME"
>SDL_Joystick</SPAN
> structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.</P
><P
>Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this:
<PRE
CLASS="PROGRAMLISTING"
> SDL_Event event;
/* Other initializtion code goes here */
/* Start main game loop here */
while(SDL_PollEvent(&#38;event))
{
switch(event.type)
{
case SDL_KEYDOWN:
/* handle keyboard stuff here */
break;
case SDL_QUIT:
/* Set whatever flags are necessary to */
/* end the main game loop here */
break;
}
}
/* End loop here */</PRE
>
To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN191"
></A
><P
><B
>Example 3-4. Joystick Axis Events</B
></P
><PRE
CLASS="PROGRAMLISTING"
> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
if ( ( event.jaxis.value &#60; -3200 ) || (event.jaxis.value &#62; 3200 ) )
{
/* code goes here */
}
break;</PRE
></DIV
><P
>Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN195"
></A
><P
><B
>Example 3-5. More Joystick Axis Events</B
></P
><PRE
CLASS="PROGRAMLISTING"
> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
if ( ( event.jaxis.value &#60; -3200 ) || (event.jaxis.value &#62; 3200 ) )
{
if( event.jaxis.axis == 0)
{
/* Left-right movement code goes here */
}
if( event.jaxis.axis == 1)
{
/* Up-Down movement code goes here */
}
}
break;</PRE
></DIV
><P
>Ideally the code here should use <TT
CLASS="STRUCTFIELD"
><I
>event.jaxis.value</I
></TT
> to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.</P
><P
>If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different <TT
CLASS="STRUCTFIELD"
><I
>event.jaxis.axis</I
></TT
> values.</P
><P
>Button handling is simple compared to the axis checking.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN203"
></A
><P
><B
>Example 3-6. Joystick Button Events</B
></P
><PRE
CLASS="PROGRAMLISTING"
> case SDL_JOYBUTTONDOWN: /* Handle Joystick Button Presses */
if ( event.jbutton.button == 0 )
{
/* code goes here */
}
break;</PRE
></DIV
><P
>Button checks are simpler than axis checks because a button can only be pressed or not pressed. The <TT
CLASS="LITERAL"
>SDL_JOYBUTTONDOWN</TT
> event is triggered when a button is pressed and the <TT
CLASS="LITERAL"
>SDL_JOYBUTTONUP</TT
> event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the <TT
CLASS="STRUCTFIELD"
><I
>event.jbutton.button</I
></TT
> field.</P
><P
>Lastly when we are through using our joysticks we should close them with a call to <A
HREF="sdljoystickclose.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickClose</TT
></A
>. To close our opened joystick 0 we would do this at the end of our program:
<PRE
CLASS="PROGRAMLISTING"
> SDL_JoystickClose(joystick);</PRE
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN214"
></A
>Advanced Joystick Functions</H2
><P
>That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN217"
></A
><P
><B
>Example 3-7. Joystick Ball Events</B
></P
><PRE
CLASS="PROGRAMLISTING"
> case SDL_JOYBALLMOTION: /* Handle Joyball Motion */
if( event.jball.ball == 0 )
{
/* ball handling */
}
break;</PRE
></DIV
><P
>The above checks the first joyball on the joystick. The change in position will be stored in <TT
CLASS="STRUCTFIELD"
><I
>event.jball.xrel</I
></TT
> and <TT
CLASS="STRUCTFIELD"
><I
>event.jball.yrel</I
></TT
>.</P
><P
>Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_CENTERED</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_UP</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_RIGHT</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_DOWN</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_LEFT</TT
></TD
></TR
></TBODY
></TABLE
><P
></P
>
Also there are some predefined combinations of the above:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_RIGHTUP</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_RIGHTDOWN</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_LEFTUP</TT
></TD
></TR
><TR
><TD
><TT
CLASS="LITERAL"
>SDL_HAT_LEFTDOWN</TT
></TD
></TR
></TBODY
></TABLE
><P
></P
>
Our case for the hat may resemble the following:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN244"
></A
><P
><B
>Example 3-8. Joystick Hat Events</B
></P
><PRE
CLASS="PROGRAMLISTING"
> case SDL_JOYHATMOTION: /* Handle Hat Motion */
if ( event.jhat.value &#38; SDL_HAT_UP )
{
/* Do up stuff here */
}
if ( event.jhat.value &#38; SDL_HAT_LEFT )
{
/* Do left stuff here */
}
if ( event.jhat.value &#38; SDL_HAT_RIGHTDOWN )
{
/* Do right and down together stuff here */
}
break;</PRE
></DIV
><P
>In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks:
<P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="sdljoysticknumaxes.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickNumAxes</TT
></A
></TD
><TD
>Returns the number of joysitck axes</TD
></TR
><TR
><TD
><A
HREF="sdljoysticknumbuttons.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickNumButtons</TT
></A
></TD
><TD
>Returns the number of joysitck buttons</TD
></TR
><TR
><TD
><A
HREF="sdljoysticknumballs.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickNumBalls</TT
></A
></TD
><TD
>Returns the number of joysitck balls</TD
></TR
><TR
><TD
><A
HREF="sdljoysticknumhats.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickNumHats</TT
></A
></TD
><TD
>Returns the number of joysitck hats</TD
></TR
></TBODY
></TABLE
><P
></P
>
To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN265"
></A
><P
><B
>Example 3-9. Querying Joystick Characteristics</B
></P
><PRE
CLASS="PROGRAMLISTING"
> int number_of_buttons;
SDL_Joystick *joystick;
joystick = SDL_JoystickOpen(0);
number_of_buttons = SDL_JoystickNumButtons(joystick);</PRE
></DIV
><P
>This block of code would get the number of buttons on the first joystick in the system. </P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidevideoopengl.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guideinputkeyboard.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Using OpenGL With SDL</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Handling the Keyboard</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,746 +0,0 @@
<HTML
><HEAD
><TITLE
>Handling the Keyboard</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Input handling"
HREF="guideinput.html"><LINK
REL="PREVIOUS"
TITLE="Input handling"
HREF="guideinput.html"><LINK
REL="NEXT"
TITLE="Examples"
HREF="guideexamples.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guideinput.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Input handling</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guideexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEINPUTKEYBOARD"
></A
>Handling the Keyboard</H1
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN271"
></A
>Keyboard Related Structures</H2
><P
>It should make it a lot easier to understand this tutorial is you are familiar with the data types involved in keyboard access, so I'll explain them first.</P
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN274"
></A
>SDLKey</H3
><P
><SPAN
CLASS="STRUCTNAME"
>SDLKey</SPAN
> is an enumerated type defined in SDL/include/SDL_keysym.h and detailed <A
HREF="sdlkey.html"
>here</A
>. Each <SPAN
CLASS="STRUCTNAME"
>SDLKey</SPAN
> symbol represents a key, <TT
CLASS="LITERAL"
>SDLK_a</TT
> corresponds to the 'a' key on a keyboard, <TT
CLASS="LITERAL"
>SDLK_SPACE</TT
> corresponds to the space bar, and so on.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN282"
></A
>SDLMod</H3
><P
>SDLMod is an enumerated type, similar to <SPAN
CLASS="STRUCTNAME"
>SDLKey</SPAN
>, however it enumerates keyboard modifiers (Control, Alt, Shift). The full list of modifier symbols is <A
HREF="sdlkey.html#SDLMOD"
>here</A
>. <SPAN
CLASS="STRUCTNAME"
>SDLMod</SPAN
> values can be AND'd together to represent several modifiers.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN288"
></A
>SDL_keysym</H3
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
Uint8 scancode;
SDLKey sym;
SDLMod mod;
Uint16 unicode;
} SDL_keysym;</PRE
><P
>The <SPAN
CLASS="STRUCTNAME"
>SDL_keysym</SPAN
> structure describes a key press or a key release. The <TT
CLASS="STRUCTFIELD"
><I
>scancode</I
></TT
> field is hardware specific and should be ignored unless you know what your doing. The <TT
CLASS="STRUCTFIELD"
><I
>sym</I
></TT
> field is the <SPAN
CLASS="STRUCTNAME"
>SDLKey</SPAN
> value of the key being pressed or released. The <TT
CLASS="STRUCTFIELD"
><I
>mod</I
></TT
> field describes the state of the keyboard modifiers at the time the key press or release occurred. So a value of <TT
CLASS="LITERAL"
>KMOD_NUM | KMOD_CAPS | KMOD_LSHIFT</TT
> would mean that Numlock, Capslock and the left shift key were all press (or enabled in the case of the lock keys). Finally, the <TT
CLASS="STRUCTFIELD"
><I
>unicode</I
></TT
> field stores the 16-bit unicode value of the key.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>It should be noted and understood that this field is only valid when the <SPAN
CLASS="STRUCTNAME"
>SDL_keysym</SPAN
> is describing a key press, not a key release. Unicode values only make sense on a key press because the unicode value describes an international character and only key presses produce characters. More information on Unicode can be found at <A
HREF="http://www.unicode.org"
TARGET="_top"
>www.unicode.org</A
></P
></BLOCKQUOTE
></DIV
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Unicode translation must be enabled using the <A
HREF="sdlenableunicode.html"
><TT
CLASS="FUNCTION"
>SDL_EnableUNICODE</TT
></A
> function.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN307"
></A
>SDL_KeyboardEvent</H3
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
Uint8 type;
Uint8 state;
SDL_keysym keysym;
} SDL_KeyboardEvent;</PRE
><P
>The <SPAN
CLASS="STRUCTNAME"
>SDL_KeyboardEvent</SPAN
> describes a keyboard event (obviously). The <TT
CLASS="STRUCTFIELD"
><I
>key</I
></TT
> member of the <A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
> union is a <SPAN
CLASS="STRUCTNAME"
>SDL_KeyboardEvent</SPAN
> structure. The <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
> field specifies whether the event is a key release (<TT
CLASS="LITERAL"
>SDL_KEYUP</TT
>) or a key press (<TT
CLASS="LITERAL"
>SDL_KEYDOWN</TT
>) event. The <TT
CLASS="STRUCTFIELD"
><I
>state</I
></TT
> is largely redundant, it reports the same information as the <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
> field but uses different values (<TT
CLASS="LITERAL"
>SDL_RELEASED</TT
> and <TT
CLASS="LITERAL"
>SDL_PRESSED</TT
>). The <TT
CLASS="STRUCTFIELD"
><I
>keysym</I
></TT
> contains information of the key press or release that this event represents (see above).</P
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN324"
></A
>Reading Keyboard Events</H2
><P
>Reading keybaord events from the event queue is quite simple (the event queue and using it is described <A
HREF="sdlevent.html"
>here</A
>). We read events using <A
HREF="sdlpollevent.html"
><TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
></A
> in a <TT
CLASS="LITERAL"
>while()</TT
> loop and check for <TT
CLASS="LITERAL"
>SDL_KEYUP</TT
> and <TT
CLASS="LITERAL"
>SDL_KEYDOWN</TT
> events using a <TT
CLASS="LITERAL"
>switch</TT
> statement, like so:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN334"
></A
><P
><B
>Example 3-10. Reading Keyboard Events</B
></P
><PRE
CLASS="PROGRAMLISTING"
> SDL_Event event;
.
.
/* Poll for events. SDL_PollEvent() returns 0 when there are no */
/* more events on the event queue, our while loop will exit when */
/* that occurs. */
while( SDL_PollEvent( &#38;event ) ){
/* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */
switch( event.type ){
case SDL_KEYDOWN:
printf( "Key press detected\n" );
break;
case SDL_KEYUP:
printf( "Key release detected\n" );
break;
default:
break;
}
}
.
.</PRE
></DIV
><P
>This is a very basic example. No information about the key press or release is interpreted. We will explore the other extreme out our first full example below - reporting all available information about a keyboard event.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN338"
></A
>A More Detailed Look</H2
><P
>Before we can read events SDL must be initialised with <A
HREF="sdlinit.html"
><TT
CLASS="FUNCTION"
>SDL_Init</TT
></A
> and a video mode must be set using <A
HREF="sdlsetvideomode.html"
><TT
CLASS="FUNCTION"
>SDL_SetVideoMode</TT
></A
>. There are, however, two other functions we must use to obtain all the information required. We must enable unicode translation by calling <TT
CLASS="FUNCTION"
>SDL_EnableUNICODE(1)</TT
> and we must convert <SPAN
CLASS="STRUCTNAME"
>SDLKey</SPAN
> values into something printable, using <A
HREF="sdlgetkeyname.html"
><TT
CLASS="FUNCTION"
>SDL_GetKeyName</TT
></A
></P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>It is useful to note that unicode values &#60; 0x80 translate directly a characters ASCII value. THis is used in the example below</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN351"
></A
><P
><B
>Example 3-11. Interpreting Key Event Information</B
></P
><PRE
CLASS="PROGRAMLISTING"
>&#13; #include "SDL.h"
/* Function Prototypes */
void PrintKeyInfo( SDL_KeyboardEvent *key );
void PrintModifiers( SDLMod mod );
/* main */
int main( int argc, char *argv[] ){
SDL_Event event;
int quit = 0;
/* Initialise SDL */
if( SDL_Init( SDL_INIT_VIDEO ) &#60; 0){
fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() );
exit( -1 );
}
/* Set a video mode */
if( !SDL_SetVideoMode( 320, 200, 0, 0 ) ){
fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() );
SDL_Quit();
exit( -1 );
}
/* Enable Unicode translation */
SDL_EnableUNICODE( 1 );
/* Loop until an SDL_QUIT event is found */
while( !quit ){
/* Poll for events */
while( SDL_PollEvent( &#38;event ) ){
switch( event.type ){
/* Keyboard event */
/* Pass the event data onto PrintKeyInfo() */
case SDL_KEYDOWN:
case SDL_KEYUP:
PrintKeyInfo( &#38;event.key );
break;
/* SDL_QUIT event (window close) */
case SDL_QUIT:
quit = 1;
break;
default:
break;
}
}
}
/* Clean up */
SDL_Quit();
exit( 0 );
}
/* Print all information about a key event */
void PrintKeyInfo( SDL_KeyboardEvent *key ){
/* Is it a release or a press? */
if( key-&#62;type == SDL_KEYUP )
printf( "Release:- " );
else
printf( "Press:- " );
/* Print the hardware scancode first */
printf( "Scancode: 0x%02X", key-&#62;keysym.scancode );
/* Print the name of the key */
printf( ", Name: %s", SDL_GetKeyName( key-&#62;keysym.sym ) );
/* We want to print the unicode info, but we need to make */
/* sure its a press event first (remember, release events */
/* don't have unicode info */
if( key-&#62;type == SDL_KEYDOWN ){
/* If the Unicode value is less than 0x80 then the */
/* unicode value can be used to get a printable */
/* representation of the key, using (char)unicode. */
printf(", Unicode: " );
if( key-&#62;keysym.unicode &#60; 0x80 &#38;&#38; key-&#62;keysym.unicode &#62; 0 ){
printf( "%c (0x%04X)", (char)key-&#62;keysym.unicode,
key-&#62;keysym.unicode );
}
else{
printf( "? (0x%04X)", key-&#62;keysym.unicode );
}
}
printf( "\n" );
/* Print modifier info */
PrintModifiers( key-&#62;keysym.mod );
}
/* Print modifier info */
void PrintModifiers( SDLMod mod ){
printf( "Modifers: " );
/* If there are none then say so and return */
if( mod == KMOD_NONE ){
printf( "None\n" );
return;
}
/* Check for the presence of each SDLMod value */
/* This looks messy, but there really isn't */
/* a clearer way. */
if( mod &#38; KMOD_NUM ) printf( "NUMLOCK " );
if( mod &#38; KMOD_CAPS ) printf( "CAPSLOCK " );
if( mod &#38; KMOD_LCTRL ) printf( "LCTRL " );
if( mod &#38; KMOD_RCTRL ) printf( "RCTRL " );
if( mod &#38; KMOD_RSHIFT ) printf( "RSHIFT " );
if( mod &#38; KMOD_LSHIFT ) printf( "LSHIFT " );
if( mod &#38; KMOD_RALT ) printf( "RALT " );
if( mod &#38; KMOD_LALT ) printf( "LALT " );
if( mod &#38; KMOD_CTRL ) printf( "CTRL " );
if( mod &#38; KMOD_SHIFT ) printf( "SHIFT " );
if( mod &#38; KMOD_ALT ) printf( "ALT " );
printf( "\n" );
}</PRE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN354"
></A
>Game-type Input</H2
><P
>I have found that people using keyboard events for games and other interactive applications don't always understand one fundemental point.</P
><A
NAME="AEN357"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>Keyboard events <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>only</I
></SPAN
> take place when a keys state changes from being unpressed to pressed, and vice versa.</P
></BLOCKQUOTE
><P
>Imagine you have an image of an alien that you wish to move around using the cursor keys: when you pressed the left arrow key you want him to slide over to the left, and when you press the down key you want him to slide down the screen. Examine the following code; it highlights an error that many people have made.
<PRE
CLASS="PROGRAMLISTING"
> /* Alien screen coordinates */
int alien_x=0, alien_y=0;
.
.
/* Initialise SDL and video modes and all that */
.
/* Main game loop */
/* Check for events */
while( SDL_PollEvent( &#38;event ) ){
switch( event.type ){
/* Look for a keypress */
case SDL_KEYDOWN:
/* Check the SDLKey values and move change the coords */
switch( event.key.keysym.sym ){
case SDLK_LEFT:
alien_x -= 1;
break;
case SDLK_RIGHT:
alien_x += 1;
break;
case SDLK_UP:
alien_y -= 1;
break;
case SDLK_DOWN:
alien_y += 1;
break;
default:
break;
}
}
}
}
.
.</PRE
>
At first glance you may think this is a perfectly reasonable piece of code for the task, but it isn't. Like I said keyboard events only occur when a key changes state, so the user would have to press and release the left cursor key 100 times to move the alien 100 pixels to the left.</P
><P
>To get around this problem we must not use the events to change the position of the alien, we use the events to set flags which are then used in a seperate section of code to move the alien. Something like this:</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN363"
></A
><P
><B
>Example 3-12. Proper Game Movement</B
></P
><PRE
CLASS="PROGRAMLISTING"
> /* Alien screen coordinates */
int alien_x=0, alien_y=0;
int alien_xvel=0, alien_yvel=0;
.
.
/* Initialise SDL and video modes and all that */
.
/* Main game loop */
/* Check for events */
while( SDL_PollEvent( &#38;event ) ){
switch( event.type ){
/* Look for a keypress */
case SDL_KEYDOWN:
/* Check the SDLKey values and move change the coords */
switch( event.key.keysym.sym ){
case SDLK_LEFT:
alien_xvel = -1;
break;
case SDLK_RIGHT:
alien_xvel = 1;
break;
case SDLK_UP:
alien_yvel = -1;
break;
case SDLK_DOWN:
alien_yvel = 1;
break;
default:
break;
}
break;
/* We must also use the SDL_KEYUP events to zero the x */
/* and y velocity variables. But we must also be */
/* careful not to zero the velocities when we shouldn't*/
case SDL_KEYUP:
switch( event.key.keysym.sym ){
case SDLK_LEFT:
/* We check to make sure the alien is moving */
/* to the left. If it is then we zero the */
/* velocity. If the alien is moving to the */
/* right then the right key is still press */
/* so we don't tocuh the velocity */
if( alien_xvel &#60; 0 )
alien_xvel = 0;
break;
case SDLK_RIGHT:
if( alien_xvel &#62; 0 )
alien_xvel = 0;
break;
case SDLK_UP:
if( alien_yvel &#60; 0 )
alien_yvel = 0;
break;
case SDLK_DOWN:
if( alien_yvel &#62; 0 )
alien_yvel = 0;
break;
default:
break;
}
break;
default:
break;
}
}
.
.
/* Update the alien position */
alien_x += alien_xvel;
alien_y += alien_yvel;</PRE
></DIV
><P
>As can be seen, we use two extra variables, alien_xvel and alien_yvel, which represent the motion of the ship, it is these variables that we update when we detect keypresses and releases.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guideinput.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guideexamples.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Input handling</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guideinput.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Examples</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,178 +0,0 @@
<HTML
><HEAD
><TITLE
>Preface</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Guide"
HREF="guide.html"><LINK
REL="PREVIOUS"
TITLE="SDL Guide"
HREF="guide.html"><LINK
REL="NEXT"
TITLE="About SDLdoc"
HREF="guideaboutsdldoc.html"></HEAD
><BODY
CLASS="PREFACE"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guide.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guideaboutsdldoc.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="PREFACE"
><H1
><A
NAME="GUIDEPREFACE"
></A
>Preface</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="guidepreface.html#GUIDEABOUTSDL"
>About SDL</A
></DT
><DT
><A
HREF="guideaboutsdldoc.html"
>About SDLdoc</A
></DT
><DT
><A
HREF="guidecredits.html"
>Credits</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEABOUTSDL"
></A
>About SDL</H1
><P
>The SDL library is designed to make it easy to write games that run on Linux, *BSD, MacOS, Win32 and BeOS using the various native high-performance media interfaces, (for video, audio, etc) and presenting a single source-code level API to your application. SDL is a fairly low level API, but using it, completely portable applications can be written with a great deal of flexibility.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guide.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guideaboutsdldoc.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL Guide</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>About SDLdoc</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,173 +0,0 @@
<HTML
><HEAD
><TITLE
>The Basics</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Guide"
HREF="guide.html"><LINK
REL="PREVIOUS"
TITLE="Credits"
HREF="guidecredits.html"><LINK
REL="NEXT"
TITLE="Initializing SDL"
HREF="guidebasicsinit.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidecredits.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidebasicsinit.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="GUIDETHEBASICS"
></A
>Chapter 1. The Basics</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="guidethebasics.html#GUIDEINTRODUCTION"
>Introduction</A
></DT
><DT
><A
HREF="guidebasicsinit.html"
>Initializing SDL</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEINTRODUCTION"
></A
>Introduction</H1
><P
>The SDL Guide section is pretty incomplete. If you feel you have anything to add mail akawaka@skynet.ie or visit http://akawaka.csn.ul.ie/tne/.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidecredits.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidebasicsinit.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Credits</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Initializing SDL</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,183 +0,0 @@
<HTML
><HEAD
><TITLE
>Time Examples</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Examples"
HREF="guideexamples.html"><LINK
REL="PREVIOUS"
TITLE="CDROM Examples"
HREF="guidecdromexamples.html"><LINK
REL="NEXT"
TITLE="SDL Reference"
HREF="reference.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidecdromexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 4. Examples</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="reference.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDETIMEEXAMPLES"
></A
>Time Examples</H1
><P
></P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN412"
></A
>Time based game loop</H2
><P
><PRE
CLASS="PROGRAMLISTING"
>#define TICK_INTERVAL 30
static Uint32 next_time;
Uint32 time_left(void)
{
Uint32 now;
now = SDL_GetTicks();
if(next_time &#60;= now)
return 0;
else
return next_time - now;
}
/* main game loop */
next_time = SDL_GetTicks() + TICK_INTERVAL;
while ( game_running ) {
update_game_state();
SDL_Delay(time_left());
next_time += TICK_INTERVAL;
}&#13;</PRE
></P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidecdromexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>CDROM Examples</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guideexamples.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL Reference</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,463 +0,0 @@
<HTML
><HEAD
><TITLE
>Graphics and Video</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Guide"
HREF="guide.html"><LINK
REL="PREVIOUS"
TITLE="Initializing SDL"
HREF="guidebasicsinit.html"><LINK
REL="NEXT"
TITLE="Using OpenGL With SDL"
HREF="guidevideoopengl.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidebasicsinit.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guidevideoopengl.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="GUIDEVIDEO"
></A
>Chapter 2. Graphics and Video</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="guidevideo.html#GUIDEVIDEOINTRO"
>Introduction to SDL Video</A
></DT
><DT
><A
HREF="guidevideoopengl.html"
>Using OpenGL With SDL</A
></DT
></DL
></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEVIDEOINTRO"
></A
>Introduction to SDL Video</H1
><P
>Video is probably the most common thing that SDL is used for, and
so it has the most complete subsystem. Here are a few
examples to demonstrate the basics.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN68"
></A
>Initializing the Video Display</H2
><P
>This is what almost all SDL programs have to do in one way or
another.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN71"
></A
><P
><B
>Example 2-1. Initializing the Video Display</B
></P
><PRE
CLASS="PROGRAMLISTING"
> SDL_Surface *screen;
/* Initialize the SDL library */
if( SDL_Init(SDL_INIT_VIDEO) &#60; 0 ) {
fprintf(stderr,
"Couldn't initialize SDL: %s\n", SDL_GetError());
exit(1);
}
/* Clean up on exit */
atexit(SDL_Quit);
/*
* Initialize the display in a 640x480 8-bit palettized mode,
* requesting a software surface
*/
screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
if ( screen == NULL ) {
fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
SDL_GetError());
exit(1);
}</PRE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN74"
></A
>Initializing the Best Video Mode</H2
><P
>If you have a preference for a certain pixel depth but will accept any
other, use SDL_SetVideoMode with SDL_ANYFORMAT as below. You can also
use SDL_VideoModeOK() to find the native video mode that is closest to
the mode you request.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN77"
></A
><P
><B
>Example 2-2. Initializing the Best Video Mode</B
></P
><PRE
CLASS="PROGRAMLISTING"
> /* Have a preference for 8-bit, but accept any depth */
screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE|SDL_ANYFORMAT);
if ( screen == NULL ) {
fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
SDL_GetError());
exit(1);
}
printf("Set 640x480 at %d bits-per-pixel mode\n",
screen-&#62;format-&#62;BitsPerPixel);</PRE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN80"
></A
>Loading and Displaying a BMP File</H2
><P
>The following function loads and displays a BMP file given as
argument, once SDL is initialised and a video mode has been set.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN83"
></A
><P
><B
>Example 2-3. Loading and Displaying a BMP File</B
></P
><PRE
CLASS="PROGRAMLISTING"
>void display_bmp(char *file_name)
{
SDL_Surface *image;
/* Load the BMP file into a surface */
image = SDL_LoadBMP(file_name);
if (image == NULL) {
fprintf(stderr, "Couldn't load %s: %s\n", file_name, SDL_GetError());
return;
}
/*
* Palettized screen modes will have a default palette (a standard
* 8*8*4 colour cube), but if the image is palettized as well we can
* use that palette for a nicer colour matching
*/
if (image-&#62;format-&#62;palette &#38;&#38; screen-&#62;format-&#62;palette) {
SDL_SetColors(screen, image-&#62;format-&#62;palette-&#62;colors, 0,
image-&#62;format-&#62;palette-&#62;ncolors);
}
/* Blit onto the screen surface */
if(SDL_BlitSurface(image, NULL, screen, NULL) &#60; 0)
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
SDL_UpdateRect(screen, 0, 0, image-&#62;w, image-&#62;h);
/* Free the allocated BMP surface */
SDL_FreeSurface(image);
}</PRE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN86"
></A
>Drawing Directly to the Display</H2
><P
>The following two functions can be used to get and set single
pixels of a surface. They are carefully written to work with any depth
currently supported by SDL. Remember to lock the surface before
calling them, and to unlock it before calling any other SDL
functions.</P
><P
>To convert between pixel values and their red, green, blue
components, use SDL_GetRGB() and SDL_MapRGB().</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN90"
></A
><P
><B
>Example 2-4. getpixel()</B
></P
><PRE
CLASS="PROGRAMLISTING"
>/*
* Return the pixel value at (x, y)
* NOTE: The surface must be locked before calling this!
*/
Uint32 getpixel(SDL_Surface *surface, int x, int y)
{
int bpp = surface-&#62;format-&#62;BytesPerPixel;
/* Here p is the address to the pixel we want to retrieve */
Uint8 *p = (Uint8 *)surface-&#62;pixels + y * surface-&#62;pitch + x * bpp;
switch(bpp) {
case 1:
return *p;
case 2:
return *(Uint16 *)p;
case 3:
if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
return p[0] &#60;&#60; 16 | p[1] &#60;&#60; 8 | p[2];
else
return p[0] | p[1] &#60;&#60; 8 | p[2] &#60;&#60; 16;
case 4:
return *(Uint32 *)p;
default:
return 0; /* shouldn't happen, but avoids warnings */
}
}</PRE
></DIV
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN93"
></A
><P
><B
>Example 2-5. putpixel()</B
></P
><PRE
CLASS="PROGRAMLISTING"
>/*
* Set the pixel at (x, y) to the given value
* NOTE: The surface must be locked before calling this!
*/
void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
{
int bpp = surface-&#62;format-&#62;BytesPerPixel;
/* Here p is the address to the pixel we want to set */
Uint8 *p = (Uint8 *)surface-&#62;pixels + y * surface-&#62;pitch + x * bpp;
switch(bpp) {
case 1:
*p = pixel;
break;
case 2:
*(Uint16 *)p = pixel;
break;
case 3:
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
p[0] = (pixel &#62;&#62; 16) &#38; 0xff;
p[1] = (pixel &#62;&#62; 8) &#38; 0xff;
p[2] = pixel &#38; 0xff;
} else {
p[0] = pixel &#38; 0xff;
p[1] = (pixel &#62;&#62; 8) &#38; 0xff;
p[2] = (pixel &#62;&#62; 16) &#38; 0xff;
}
break;
case 4:
*(Uint32 *)p = pixel;
break;
}
}</PRE
></DIV
><P
>The following code uses the putpixel() function above to set a
yellow pixel in the middle of the screen.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN97"
></A
><P
><B
>Example 2-6. Using putpixel()</B
></P
><PRE
CLASS="PROGRAMLISTING"
>&#13; /* Code to set a yellow pixel at the center of the screen */
int x, y;
Uint32 yellow;
/* Map the color yellow to this display (R=0xff, G=0xFF, B=0x00)
Note: If the display is palettized, you must set the palette first.
*/
yellow = SDL_MapRGB(screen-&#62;format, 0xff, 0xff, 0x00);
x = screen-&#62;w / 2;
y = screen-&#62;h / 2;
/* Lock the screen for direct access to the pixels */
if ( SDL_MUSTLOCK(screen) ) {
if ( SDL_LockSurface(screen) &#60; 0 ) {
fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError());
return;
}
}
putpixel(screen, x, y, yellow);
if ( SDL_MUSTLOCK(screen) ) {
SDL_UnlockSurface(screen);
}
/* Update just the part of the display that we've changed */
SDL_UpdateRect(screen, x, y, 1, 1);
return;&#13;</PRE
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidebasicsinit.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guidevideoopengl.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Initializing SDL</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guide.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Using OpenGL With SDL</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,730 +0,0 @@
<HTML
><HEAD
><TITLE
>Using OpenGL With SDL</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Graphics and Video"
HREF="guidevideo.html"><LINK
REL="PREVIOUS"
TITLE="Graphics and Video"
HREF="guidevideo.html"><LINK
REL="NEXT"
TITLE="Input handling"
HREF="guideinput.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidevideo.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Graphics and Video</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="guideinput.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="GUIDEVIDEOOPENGL"
></A
>Using OpenGL With SDL</H1
><P
>SDL has the ability to create and use OpenGL contexts on several platforms(Linux/X11, Win32, BeOS, MacOS Classic/Toolbox, Mac OS X, FreeBSD/X11 and Solaris/X11). This allows you to use SDL's audio, event handling, threads and times in your OpenGL applications (a function often performed by GLUT).</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN103"
></A
>Initialisation</H2
><P
>Initialising SDL to use OpenGL is not very different to initialising SDL normally. There are three differences; you must pass <TT
CLASS="LITERAL"
>SDL_OPENGL</TT
> to <A
HREF="sdlsetvideomode.html"
><TT
CLASS="FUNCTION"
>SDL_SetVideoMode</TT
></A
>, you must specify several GL attributes (depth buffer size, framebuffer sizes) using <A
HREF="sdlglsetattribute.html"
><TT
CLASS="FUNCTION"
>SDL_GL_SetAttribute</TT
></A
> and finally, if you wish to use double buffering you must specify it as a GL attribute, <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>not</I
></SPAN
> by passing the <TT
CLASS="LITERAL"
>SDL_DOUBLEBUF</TT
> flag to <TT
CLASS="FUNCTION"
>SDL_SetVideoMode</TT
>.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN114"
></A
><P
><B
>Example 2-7. Initializing SDL with OpenGL</B
></P
><PRE
CLASS="PROGRAMLISTING"
> /* Information about the current video settings. */
const SDL_VideoInfo* info = NULL;
/* Dimensions of our window. */
int width = 0;
int height = 0;
/* Color depth in bits of our window. */
int bpp = 0;
/* Flags we will pass into SDL_SetVideoMode. */
int flags = 0;
/* First, initialize SDL's video subsystem. */
if( SDL_Init( SDL_INIT_VIDEO ) &#60; 0 ) {
/* Failed, exit. */
fprintf( stderr, "Video initialization failed: %s\n",
SDL_GetError( ) );
quit_tutorial( 1 );
}
/* Let's get some video information. */
info = SDL_GetVideoInfo( );
if( !info ) {
/* This should probably never happen. */
fprintf( stderr, "Video query failed: %s\n",
SDL_GetError( ) );
quit_tutorial( 1 );
}
/*
* Set our width/height to 640/480 (you would
* of course let the user decide this in a normal
* app). We get the bpp we will request from
* the display. On X11, VidMode can't change
* resolution, so this is probably being overly
* safe. Under Win32, ChangeDisplaySettings
* can change the bpp.
*/
width = 640;
height = 480;
bpp = info-&#62;vfmt-&#62;BitsPerPixel;
/*
* Now, we want to setup our requested
* window attributes for our OpenGL window.
* We want *at least* 5 bits of red, green
* and blue. We also want at least a 16-bit
* depth buffer.
*
* The last thing we do is request a double
* buffered window. '1' turns on double
* buffering, '0' turns it off.
*
* Note that we do not use SDL_DOUBLEBUF in
* the flags to SDL_SetVideoMode. That does
* not affect the GL attribute state, only
* the standard 2D blitting setup.
*/
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
/*
* We want to request that SDL provide us
* with an OpenGL window, in a fullscreen
* video mode.
*
* EXERCISE:
* Make starting windowed an option, and
* handle the resize events properly with
* glViewport.
*/
flags = SDL_OPENGL | SDL_FULLSCREEN;
/*
* Set the video mode
*/
if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
/*
* This could happen for a variety of reasons,
* including DISPLAY not being set, the specified
* resolution not being available, etc.
*/
fprintf( stderr, "Video mode set failed: %s\n",
SDL_GetError( ) );
quit_tutorial( 1 );
}</PRE
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN117"
></A
>Drawing</H2
><P
>Apart from initialisation, using OpenGL within SDL is the same as using OpenGL
with any other API, e.g. GLUT. You still use all the same function calls and
data types. However if you are using a double-buffered display, then you must
use
<A
HREF="sdlglswapbuffers.html"
><TT
CLASS="FUNCTION"
>SDL_GL_SwapBuffers()</TT
></A
>
to swap the buffers and update the display. To request double-buffering
with OpenGL, use
<A
HREF="sdlglsetattribute.html"
><TT
CLASS="FUNCTION"
>SDL_GL_SetAttribute</TT
></A
>
with <TT
CLASS="LITERAL"
>SDL_GL_DOUBLEBUFFER</TT
>, and use
<A
HREF="sdlglgetattribute.html"
><TT
CLASS="FUNCTION"
>SDL_GL_GetAttribute</TT
></A
>
to see if you actually got it.</P
><P
>A full example code listing is now presented below.</P
><DIV
CLASS="EXAMPLE"
><A
NAME="AEN128"
></A
><P
><B
>Example 2-8. SDL and OpenGL</B
></P
><PRE
CLASS="PROGRAMLISTING"
>/*
* SDL OpenGL Tutorial.
* (c) Michael Vance, 2000
* briareos@lokigames.com
*
* Distributed under terms of the LGPL.
*/
#include &#60;SDL/SDL.h&#62;
#include &#60;GL/gl.h&#62;
#include &#60;GL/glu.h&#62;
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;
static GLboolean should_rotate = GL_TRUE;
static void quit_tutorial( int code )
{
/*
* Quit SDL so we can release the fullscreen
* mode and restore the previous video settings,
* etc.
*/
SDL_Quit( );
/* Exit program. */
exit( code );
}
static void handle_key_down( SDL_keysym* keysym )
{
/*
* We're only interested if 'Esc' has
* been presssed.
*
* EXERCISE:
* Handle the arrow keys and have that change the
* viewing position/angle.
*/
switch( keysym-&#62;sym ) {
case SDLK_ESCAPE:
quit_tutorial( 0 );
break;
case SDLK_SPACE:
should_rotate = !should_rotate;
break;
default:
break;
}
}
static void process_events( void )
{
/* Our SDL event placeholder. */
SDL_Event event;
/* Grab all the events off the queue. */
while( SDL_PollEvent( &#38;event ) ) {
switch( event.type ) {
case SDL_KEYDOWN:
/* Handle key presses. */
handle_key_down( &#38;event.key.keysym );
break;
case SDL_QUIT:
/* Handle quit requests (like Ctrl-c). */
quit_tutorial( 0 );
break;
}
}
}
static void draw_screen( void )
{
/* Our angle of rotation. */
static float angle = 0.0f;
/*
* EXERCISE:
* Replace this awful mess with vertex
* arrays and a call to glDrawElements.
*
* EXERCISE:
* After completing the above, change
* it to use compiled vertex arrays.
*
* EXERCISE:
* Verify my windings are correct here ;).
*/
static GLfloat v0[] = { -1.0f, -1.0f, 1.0f };
static GLfloat v1[] = { 1.0f, -1.0f, 1.0f };
static GLfloat v2[] = { 1.0f, 1.0f, 1.0f };
static GLfloat v3[] = { -1.0f, 1.0f, 1.0f };
static GLfloat v4[] = { -1.0f, -1.0f, -1.0f };
static GLfloat v5[] = { 1.0f, -1.0f, -1.0f };
static GLfloat v6[] = { 1.0f, 1.0f, -1.0f };
static GLfloat v7[] = { -1.0f, 1.0f, -1.0f };
static GLubyte red[] = { 255, 0, 0, 255 };
static GLubyte green[] = { 0, 255, 0, 255 };
static GLubyte blue[] = { 0, 0, 255, 255 };
static GLubyte white[] = { 255, 255, 255, 255 };
static GLubyte yellow[] = { 0, 255, 255, 255 };
static GLubyte black[] = { 0, 0, 0, 255 };
static GLubyte orange[] = { 255, 255, 0, 255 };
static GLubyte purple[] = { 255, 0, 255, 0 };
/* Clear the color and depth buffers. */
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
/* We don't want to modify the projection matrix. */
glMatrixMode( GL_MODELVIEW );
glLoadIdentity( );
/* Move down the z-axis. */
glTranslatef( 0.0, 0.0, -5.0 );
/* Rotate. */
glRotatef( angle, 0.0, 1.0, 0.0 );
if( should_rotate ) {
if( ++angle &#62; 360.0f ) {
angle = 0.0f;
}
}
/* Send our triangle data to the pipeline. */
glBegin( GL_TRIANGLES );
glColor4ubv( red );
glVertex3fv( v0 );
glColor4ubv( green );
glVertex3fv( v1 );
glColor4ubv( blue );
glVertex3fv( v2 );
glColor4ubv( red );
glVertex3fv( v0 );
glColor4ubv( blue );
glVertex3fv( v2 );
glColor4ubv( white );
glVertex3fv( v3 );
glColor4ubv( green );
glVertex3fv( v1 );
glColor4ubv( black );
glVertex3fv( v5 );
glColor4ubv( orange );
glVertex3fv( v6 );
glColor4ubv( green );
glVertex3fv( v1 );
glColor4ubv( orange );
glVertex3fv( v6 );
glColor4ubv( blue );
glVertex3fv( v2 );
glColor4ubv( black );
glVertex3fv( v5 );
glColor4ubv( yellow );
glVertex3fv( v4 );
glColor4ubv( purple );
glVertex3fv( v7 );
glColor4ubv( black );
glVertex3fv( v5 );
glColor4ubv( purple );
glVertex3fv( v7 );
glColor4ubv( orange );
glVertex3fv( v6 );
glColor4ubv( yellow );
glVertex3fv( v4 );
glColor4ubv( red );
glVertex3fv( v0 );
glColor4ubv( white );
glVertex3fv( v3 );
glColor4ubv( yellow );
glVertex3fv( v4 );
glColor4ubv( white );
glVertex3fv( v3 );
glColor4ubv( purple );
glVertex3fv( v7 );
glColor4ubv( white );
glVertex3fv( v3 );
glColor4ubv( blue );
glVertex3fv( v2 );
glColor4ubv( orange );
glVertex3fv( v6 );
glColor4ubv( white );
glVertex3fv( v3 );
glColor4ubv( orange );
glVertex3fv( v6 );
glColor4ubv( purple );
glVertex3fv( v7 );
glColor4ubv( green );
glVertex3fv( v1 );
glColor4ubv( red );
glVertex3fv( v0 );
glColor4ubv( yellow );
glVertex3fv( v4 );
glColor4ubv( green );
glVertex3fv( v1 );
glColor4ubv( yellow );
glVertex3fv( v4 );
glColor4ubv( black );
glVertex3fv( v5 );
glEnd( );
/*
* EXERCISE:
* Draw text telling the user that 'Spc'
* pauses the rotation and 'Esc' quits.
* Do it using vetors and textured quads.
*/
/*
* Swap the buffers. This this tells the driver to
* render the next frame from the contents of the
* back-buffer, and to set all rendering operations
* to occur on what was the front-buffer.
*
* Double buffering prevents nasty visual tearing
* from the application drawing on areas of the
* screen that are being updated at the same time.
*/
SDL_GL_SwapBuffers( );
}
static void setup_opengl( int width, int height )
{
float ratio = (float) width / (float) height;
/* Our shading model--Gouraud (smooth). */
glShadeModel( GL_SMOOTH );
/* Culling. */
glCullFace( GL_BACK );
glFrontFace( GL_CCW );
glEnable( GL_CULL_FACE );
/* Set the clear color. */
glClearColor( 0, 0, 0, 0 );
/* Setup our viewport. */
glViewport( 0, 0, width, height );
/*
* Change to the projection matrix and set
* our viewing volume.
*/
glMatrixMode( GL_PROJECTION );
glLoadIdentity( );
/*
* EXERCISE:
* Replace this with a call to glFrustum.
*/
gluPerspective( 60.0, ratio, 1.0, 1024.0 );
}
int main( int argc, char* argv[] )
{
/* Information about the current video settings. */
const SDL_VideoInfo* info = NULL;
/* Dimensions of our window. */
int width = 0;
int height = 0;
/* Color depth in bits of our window. */
int bpp = 0;
/* Flags we will pass into SDL_SetVideoMode. */
int flags = 0;
/* First, initialize SDL's video subsystem. */
if( SDL_Init( SDL_INIT_VIDEO ) &#60; 0 ) {
/* Failed, exit. */
fprintf( stderr, "Video initialization failed: %s\n",
SDL_GetError( ) );
quit_tutorial( 1 );
}
/* Let's get some video information. */
info = SDL_GetVideoInfo( );
if( !info ) {
/* This should probably never happen. */
fprintf( stderr, "Video query failed: %s\n",
SDL_GetError( ) );
quit_tutorial( 1 );
}
/*
* Set our width/height to 640/480 (you would
* of course let the user decide this in a normal
* app). We get the bpp we will request from
* the display. On X11, VidMode can't change
* resolution, so this is probably being overly
* safe. Under Win32, ChangeDisplaySettings
* can change the bpp.
*/
width = 640;
height = 480;
bpp = info-&#62;vfmt-&#62;BitsPerPixel;
/*
* Now, we want to setup our requested
* window attributes for our OpenGL window.
* We want *at least* 5 bits of red, green
* and blue. We also want at least a 16-bit
* depth buffer.
*
* The last thing we do is request a double
* buffered window. '1' turns on double
* buffering, '0' turns it off.
*
* Note that we do not use SDL_DOUBLEBUF in
* the flags to SDL_SetVideoMode. That does
* not affect the GL attribute state, only
* the standard 2D blitting setup.
*/
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
/*
* We want to request that SDL provide us
* with an OpenGL window, in a fullscreen
* video mode.
*
* EXERCISE:
* Make starting windowed an option, and
* handle the resize events properly with
* glViewport.
*/
flags = SDL_OPENGL | SDL_FULLSCREEN;
/*
* Set the video mode
*/
if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
/*
* This could happen for a variety of reasons,
* including DISPLAY not being set, the specified
* resolution not being available, etc.
*/
fprintf( stderr, "Video mode set failed: %s\n",
SDL_GetError( ) );
quit_tutorial( 1 );
}
/*
* At this point, we should have a properly setup
* double-buffered window for use with OpenGL.
*/
setup_opengl( width, height );
/*
* Now we want to begin our normal app process--
* an event loop with a lot of redrawing.
*/
while( 1 ) {
/* Process incoming events. */
process_events( );
/* Draw the screen. */
draw_screen( );
}
/*
* EXERCISE:
* Record timings using SDL_GetTicks() and
* and print out frames per second at program
* end.
*/
/* Never reached. */
return 0;
}</PRE
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidevideo.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="guideinput.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Graphics and Video</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="guidevideo.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Input handling</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

File diff suppressed because it is too large Load diff

View file

@ -1,296 +0,0 @@
<HTML
><HEAD
><TITLE
>Joystick</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Reference"
HREF="reference.html"><LINK
REL="PREVIOUS"
TITLE="SDL_JoystickEventState"
HREF="sdljoystickeventstate.html"><LINK
REL="NEXT"
TITLE="SDL_NumJoysticks"
HREF="sdlnumjoysticks.html"><META
NAME="KEYWORD"
CONTENT="joystick"><META
NAME="KEYWORD"
CONTENT="function"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdljoystickeventstate.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlnumjoysticks.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="JOYSTICK"
></A
>Chapter 9. Joystick</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="sdlnumjoysticks.html"
>SDL_NumJoysticks</A
>&nbsp;--&nbsp;Count available joysticks.</DT
><DT
><A
HREF="sdljoystickname.html"
>SDL_JoystickName</A
>&nbsp;--&nbsp;Get joystick name.</DT
><DT
><A
HREF="sdljoystickopen.html"
>SDL_JoystickOpen</A
>&nbsp;--&nbsp;Opens a joystick for use.</DT
><DT
><A
HREF="sdljoystickopened.html"
>SDL_JoystickOpened</A
>&nbsp;--&nbsp;Determine if a joystick has been opened</DT
><DT
><A
HREF="sdljoystickindex.html"
>SDL_JoystickIndex</A
>&nbsp;--&nbsp;Get the index of an SDL_Joystick.</DT
><DT
><A
HREF="sdljoysticknumaxes.html"
>SDL_JoystickNumAxes</A
>&nbsp;--&nbsp;Get the number of joystick axes</DT
><DT
><A
HREF="sdljoysticknumballs.html"
>SDL_JoystickNumBalls</A
>&nbsp;--&nbsp;Get the number of joystick trackballs</DT
><DT
><A
HREF="sdljoysticknumhats.html"
>SDL_JoystickNumHats</A
>&nbsp;--&nbsp;Get the number of joystick hats</DT
><DT
><A
HREF="sdljoysticknumbuttons.html"
>SDL_JoystickNumButtons</A
>&nbsp;--&nbsp;Get the number of joysitck buttons</DT
><DT
><A
HREF="sdljoystickupdate.html"
>SDL_JoystickUpdate</A
>&nbsp;--&nbsp;Updates the state of all joysticks</DT
><DT
><A
HREF="sdljoystickgetaxis.html"
>SDL_JoystickGetAxis</A
>&nbsp;--&nbsp;Get the current state of an axis</DT
><DT
><A
HREF="sdljoystickgethat.html"
>SDL_JoystickGetHat</A
>&nbsp;--&nbsp;Get the current state of a joystick hat</DT
><DT
><A
HREF="sdljoystickgetbutton.html"
>SDL_JoystickGetButton</A
>&nbsp;--&nbsp;Get the current state of a given button on a given joystick</DT
><DT
><A
HREF="sdljoystickgetball.html"
>SDL_JoystickGetBall</A
>&nbsp;--&nbsp;Get relative trackball motion</DT
><DT
><A
HREF="sdljoystickclose.html"
>SDL_JoystickClose</A
>&nbsp;--&nbsp;Closes a previously opened joystick</DT
></DL
></DIV
><P
>Joysticks, and other similar input devices, have a very strong role in game playing and SDL provides comprehensive support for them. Axes, Buttons, POV Hats and trackballs are all supported.</P
><P
>Joystick support is initialized by passed the <TT
CLASS="LITERAL"
>SDL_INIT_JOYSTICK</TT
> flag to <A
HREF="sdlinit.html"
><TT
CLASS="FUNCTION"
>SDL_Init</TT
></A
>. Once initilized joysticks must be opened using <A
HREF="sdljoystickopen.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickOpen</TT
></A
>.</P
><P
>While using the functions describe in this secton may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the <A
HREF="event.html"
>event</A
> system. To enable this, you must set the joystick event processing state with <A
HREF="sdljoystickeventstate.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickEventState</TT
></A
>. Joysticks must be <A
HREF="sdljoystickopen.html"
>opened</A
> before they can be used of course.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>If you are <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>not</I
></SPAN
> handling the joystick via the event queue then you must explicitly request a joystick update by calling <A
HREF="sdljoystickupdate.html"
><TT
CLASS="FUNCTION"
>SDL_JoystickUpdate</TT
></A
>.</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Force Feedback is not yet support. Sam (slouken@libsdl.org) is soliciting suggestions from people with force-feedback experience on the best wat to desgin the API.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdljoystickeventstate.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlnumjoysticks.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_JoystickEventState</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_NumJoysticks</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,194 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL Reference</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Time Examples"
HREF="guidetimeexamples.html"><LINK
REL="NEXT"
TITLE="General"
HREF="general.html"></HEAD
><BODY
CLASS="PART"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="guidetimeexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="general.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="PART"
><A
NAME="REFERENCE"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="TITLE"
>II. SDL Reference</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>5. <A
HREF="general.html"
>General</A
></DT
><DT
>6. <A
HREF="video.html"
>Video</A
></DT
><DT
>7. <A
HREF="wm.html"
>Window Management</A
></DT
><DT
>8. <A
HREF="event.html"
>Events</A
></DT
><DT
>9. <A
HREF="joystick.html"
>Joystick</A
></DT
><DT
>10. <A
HREF="audio.html"
>Audio</A
></DT
><DT
>11. <A
HREF="cdrom.html"
>CD-ROM</A
></DT
><DT
>12. <A
HREF="thread.html"
>Multi-threaded Programming</A
></DT
><DT
>13. <A
HREF="time.html"
>Time</A
></DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="guidetimeexamples.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="general.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Time Examples</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>General</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,335 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_ActiveEvent</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Event Structures."
HREF="eventstructures.html"><LINK
REL="PREVIOUS"
TITLE="SDL_Event"
HREF="sdlevent.html"><LINK
REL="NEXT"
TITLE="SDL_KeyboardEvent"
HREF="sdlkeyboardevent.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlevent.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlkeyboardevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLACTIVEEVENT"
></A
>SDL_ActiveEvent</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3955"
></A
><H2
>Name</H2
>SDL_ActiveEvent&nbsp;--&nbsp;Application visibility event structure</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3958"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
Uint8 type;
Uint8 gain;
Uint8 state;
} SDL_ActiveEvent;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3961"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN3963"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_ACTIVEEVENT.</TT
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>gain</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>0 if the event is a loss or 1 if it is a gain.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>state</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_APPMOUSEFOCUS</TT
> if mouse focus was gained or lost, <TT
CLASS="LITERAL"
>SDL_APPINPUTFOCUS</TT
> if input focus was gained or lost, or <TT
CLASS="LITERAL"
>SDL_APPACTIVE</TT
> if the application was iconified (<TT
CLASS="STRUCTFIELD"
><I
>gain</I
></TT
>=0) or restored(<TT
CLASS="STRUCTFIELD"
><I
>gain</I
></TT
>=1).</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3984"
></A
><H2
>Description</H2
><P
><SPAN
CLASS="STRUCTNAME"
>SDL_ActiveEvent</SPAN
> is a member of the <A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
> union and is used when an event of type <TT
CLASS="LITERAL"
>SDL_ACTIVEEVENT</TT
> is reported.</P
><P
>When the mouse leaves or enters the window area a <TT
CLASS="LITERAL"
>SDL_APPMOUSEFOCUS</TT
> type activation event occurs, if the mouse entered the window then <TT
CLASS="STRUCTFIELD"
><I
>gain</I
></TT
> will be 1, otherwise <TT
CLASS="STRUCTFIELD"
><I
>gain</I
></TT
> will be 0. A <TT
CLASS="LITERAL"
>SDL_APPINPUTFOCUS</TT
> type activation event occurs when the application loses or gains keyboard focus. This usually occurs when another application is made active. Finally, a <TT
CLASS="LITERAL"
>SDL_APPACTIVE</TT
> type event occurs when the application is either minimised/iconified (<TT
CLASS="STRUCTFIELD"
><I
>gain</I
></TT
>=0) or restored.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>This event does not occur when an application window is first created.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4000"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
>,
<A
HREF="sdlgetappstate.html"
><TT
CLASS="FUNCTION"
>SDL_GetAppState</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlevent.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlkeyboardevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_Event</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="eventstructures.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_KeyboardEvent</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,296 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_AddTimer</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Time"
HREF="time.html"><LINK
REL="PREVIOUS"
TITLE="SDL_Delay"
HREF="sdldelay.html"><LINK
REL="NEXT"
TITLE="SDL_RemoveTimer"
HREF="sdlremovetimer.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdldelay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlremovetimer.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLADDTIMER"
></A
>SDL_AddTimer</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8482"
></A
><H2
>Name</H2
>SDL_AddTimer&nbsp;--&nbsp;Add a timer which will call a callback after the specified number of milliseconds has
elapsed.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8485"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8486"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_TimerID <B
CLASS="FSFUNC"
>SDL_AddTimer</B
></CODE
>(Uint32 interval, SDL_NewTimerCallback callback, void *param);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="SDLNEWTIMERCALLBACK"
></A
><H2
>Callback</H2
><PRE
CLASS="PROGRAMLISTING"
>/* type definition for the "new" timer callback function */
typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8495"
></A
><H2
>Description</H2
><P
>Adds a callback function to be run after the specified number of
milliseconds has elapsed. The callback function is passed the current
timer interval and the user supplied parameter from the
<TT
CLASS="FUNCTION"
>SDL_AddTimer</TT
> call and returns the next timer
interval. If the returned value from the callback is the same as the one
passed in, the periodic alarm continues, otherwise a new alarm is
scheduled.</P
><P
>To cancel a currently running timer call
<A
HREF="sdlremovetimer.html"
>SDL_RemoveTimer</A
> with the
timer ID returned from
<TT
CLASS="FUNCTION"
>SDL_AddTimer</TT
>.</P
><P
>The timer callback function may run in a different thread than your
main program, and so shouldn't call any functions from within itself.
You may always call <A
HREF="sdlpushevent.html"
>SDL_PushEvent</A
>, however.</P
><P
>The granularity of the timer is platform-dependent, but you should count
on it being at least 10 ms as this is the most common number.
This 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 (see example below).
If you use this function, you need to pass <TT
CLASS="LITERAL"
>SDL_INIT_TIMER</TT
>
to <A
HREF="sdlinit.html"
>SDL_Init</A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8507"
></A
><H2
>Return Value</H2
><P
>Returns an ID value for the added timer or
<SPAN
CLASS="RETURNVALUE"
>NULL</SPAN
> if there was an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8511"
></A
><H2
>Examples</H2
><P
><PRE
CLASS="PROGRAMLISTING"
>my_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);</PRE
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8515"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlremovetimer.html"
><TT
CLASS="FUNCTION"
>SDL_RemoveTimer</TT
></A
>,
<A
HREF="sdlpushevent.html"
><TT
CLASS="FUNCTION"
>SDL_PushEvent</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdldelay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlremovetimer.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_Delay</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="time.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_RemoveTimer</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,556 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_AudioCVT</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Audio"
HREF="audio.html"><LINK
REL="PREVIOUS"
TITLE="SDL_FreeWAV"
HREF="sdlfreewav.html"><LINK
REL="NEXT"
TITLE="SDL_BuildAudioCVT"
HREF="sdlbuildaudiocvt.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlfreewav.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlbuildaudiocvt.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLAUDIOCVT"
></A
>SDL_AudioCVT</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6884"
></A
><H2
>Name</H2
>SDL_AudioCVT&nbsp;--&nbsp;Audio Conversion Structure</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6887"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
int needed;
Uint16 src_format;
Uint16 dest_format;
double rate_incr;
Uint8 *buf;
int len;
int len_cvt;
int len_mult;
double len_ratio;
void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
int filter_index;
} SDL_AudioCVT;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6890"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN6892"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>needed</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Set to one if the conversion is possible</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>src_format</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio format of the source</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>dest_format</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio format of the destination</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>rate_incr</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Rate conversion increment</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio buffer</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Length of the original audio buffer in bytes</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>len_cvt</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Length of converted audio buffer in bytes (calculated)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
> must be <TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
>*<TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
> bytes in size(calculated)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>len_ratio</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Final audio size is <TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
>*<TT
CLASS="STRUCTFIELD"
><I
>len_ratio</I
></TT
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>filters[10](..)</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Pointers to functions needed for this conversion</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>filter_index</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Current conversion function</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6944"
></A
><H2
>Description</H2
><P
>The <SPAN
CLASS="STRUCTNAME"
>SDL_AudioCVT</SPAN
> is used to convert audio data between different formats. A <SPAN
CLASS="STRUCTNAME"
>SDL_AudioCVT</SPAN
> structure is created with the <A
HREF="sdlbuildaudiocvt.html"
><TT
CLASS="FUNCTION"
>SDL_BuildAudioCVT</TT
></A
> function, while the actual conversion is done by the <A
HREF="sdlconvertaudio.html"
><TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
></A
> function.</P
><P
>Many of the fields in the <SPAN
CLASS="STRUCTNAME"
>SDL_AudioCVT</SPAN
> structure should be considered private and their function will not be discussed here.</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><SPAN
CLASS="TYPE"
>Uint8 *</SPAN
><TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
></DT
><DD
><P
>This points to the audio data that will be used in the conversion. It is both the source and the destination, which means the converted audio data overwrites the original data. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure <TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
> is large enough. See below.</P
></DD
><DT
><SPAN
CLASS="TYPE"
>int</SPAN
> <TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
></DT
><DD
><P
>This is the length of the original audio data in bytes.</P
></DD
><DT
><SPAN
CLASS="TYPE"
>int</SPAN
> <TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
></DT
><DD
><P
>As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data. The length of <TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
> should be <TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
>*<TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
>.</P
></DD
><DT
><SPAN
CLASS="TYPE"
>double</SPAN
> <TT
CLASS="STRUCTFIELD"
><I
>len_ratio</I
></TT
></DT
><DD
><P
>When you have finished converting your audio data, you need to know how much of your audio buffer is valid. <TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
>*<TT
CLASS="STRUCTFIELD"
><I
>len_ratio</I
></TT
> is the size of the converted audio data in bytes. This is very similar to <TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
>, however when the convert audio data is shorter than the original <TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
> would be 1. <TT
CLASS="STRUCTFIELD"
><I
>len_ratio</I
></TT
>, on the other hand, would be a fractional number between 0 and 1.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6989"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlbuildaudiocvt.html"
><TT
CLASS="FUNCTION"
>SDL_BuildAudioCVT</TT
></A
>,
<A
HREF="sdlconvertaudio.html"
><TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
></A
>,
<A
HREF="sdlaudiospec.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_AudioSpec</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlfreewav.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlbuildaudiocvt.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_FreeWAV</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_BuildAudioCVT</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,589 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_AudioSpec</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Audio"
HREF="audio.html"><LINK
REL="PREVIOUS"
TITLE="Audio"
HREF="audio.html"><LINK
REL="NEXT"
TITLE="SDL_OpenAudio"
HREF="sdlopenaudio.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="audio.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlopenaudio.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLAUDIOSPEC"
></A
>SDL_AudioSpec</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6507"
></A
><H2
>Name</H2
>SDL_AudioSpec&nbsp;--&nbsp;Audio Specification Structure</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6510"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
int freq;
Uint16 format;
Uint8 channels;
Uint8 silence;
Uint16 samples;
Uint32 size;
void (*callback)(void *userdata, Uint8 *stream, int len);
void *userdata;
} SDL_AudioSpec;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6513"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN6515"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>freq</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio frequency in samples per second</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>format</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio data format</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>channels</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Number of channels: 1 mono, 2 stereo</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>silence</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio buffer silence value (calculated)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>samples</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio buffer size in samples</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>size</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Audio buffer size in bytes (calculated)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>callback(..)</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Callback function for filling the audio buffer</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>userdata</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Pointer the user data which is passed to the callback function</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6550"
></A
><H2
>Description</H2
><P
>The <SPAN
CLASS="STRUCTNAME"
>SDL_AudioSpec</SPAN
> structure is used to describe the format of some audio data. This structure is used by <A
HREF="sdlopenaudio.html"
><TT
CLASS="FUNCTION"
>SDL_OpenAudio</TT
></A
> and <A
HREF="sdlloadwav.html"
><TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
></A
>. While all fields are used by <TT
CLASS="FUNCTION"
>SDL_OpenAudio</TT
> only <TT
CLASS="STRUCTFIELD"
><I
>freq</I
></TT
>, <TT
CLASS="STRUCTFIELD"
><I
>format</I
></TT
>, <TT
CLASS="STRUCTFIELD"
><I
>samples</I
></TT
> and <TT
CLASS="STRUCTFIELD"
><I
>channels</I
></TT
> are used by <TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
>. We will detail these common members here.</P
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN6564"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>freq</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>format</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Specifies the size and type of each sample element
<P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="LITERAL"
>AUDIO_U8</TT
></DT
><DD
><P
>Unsigned 8-bit samples</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_S8</TT
></DT
><DD
><P
>Signed 8-bit samples</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_U16</TT
> or <TT
CLASS="LITERAL"
>AUDIO_U16LSB</TT
></DT
><DD
><P
>Unsigned 16-bit little-endian samples</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_S16</TT
> or <TT
CLASS="LITERAL"
>AUDIO_S16LSB</TT
></DT
><DD
><P
>Signed 16-bit little-endian samples</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_U16MSB</TT
></DT
><DD
><P
>Unsigned 16-bit big-endian samples</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_S16MSB</TT
></DT
><DD
><P
>Signed 16-bit big-endian samples</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_U16SYS</TT
></DT
><DD
><P
>Either <TT
CLASS="LITERAL"
>AUDIO_U16LSB</TT
> or <TT
CLASS="LITERAL"
>AUDIO_U16MSB</TT
> depending on you systems endianness</P
></DD
><DT
><TT
CLASS="LITERAL"
>AUDIO_S16SYS</TT
></DT
><DD
><P
>Either <TT
CLASS="LITERAL"
>AUDIO_S16LSB</TT
> or <TT
CLASS="LITERAL"
>AUDIO_S16MSB</TT
> depending on you systems endianness</P
></DD
></DL
></DIV
></P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>channels</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>The number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>samples</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>When used with <A
HREF="sdlopenaudio.html"
><TT
CLASS="FUNCTION"
>SDL_OpenAudio</TT
></A
> this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in <TT
CLASS="PARAMETER"
><I
>format</I
></TT
> mulitplied by the number of channels. When the <SPAN
CLASS="STRUCTNAME"
>SDL_AudioSpec</SPAN
> is used with <A
HREF="sdlloadwav.html"
><TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
></A
> <TT
CLASS="STRUCTFIELD"
><I
>samples</I
></TT
> is set to 4096.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6639"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlopenaudio.html"
><TT
CLASS="FUNCTION"
>SDL_OpenAudio</TT
></A
>,
<A
HREF="sdlloadwav.html"
><TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlopenaudio.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Audio</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_OpenAudio</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,339 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_BlitSurface</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_ConvertSurface"
HREF="sdlconvertsurface.html"><LINK
REL="NEXT"
TITLE="SDL_FillRect"
HREF="sdlfillrect.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlconvertsurface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlfillrect.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLBLITSURFACE"
></A
>SDL_BlitSurface</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2299"
></A
><H2
>Name</H2
>SDL_BlitSurface&nbsp;--&nbsp;This performs a fast blit from the source surface to the destination surface.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2302"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2303"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_BlitSurface</B
></CODE
>(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2309"
></A
><H2
>Description</H2
><P
>This performs a fast blit from the source surface to the destination surface.</P
><P
>The width and height in <TT
CLASS="PARAMETER"
><I
>srcrect</I
></TT
> determine the
size of the copied rectangle. Only the position is used in the
<TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
> (the width and height are ignored).</P
><P
>If <TT
CLASS="PARAMETER"
><I
>srcrect</I
></TT
> is <TT
CLASS="LITERAL"
>NULL</TT
>, the
entire surface is copied. If <TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
> is
<TT
CLASS="LITERAL"
>NULL</TT
>, then the destination position (upper left
corner) is (0, 0).</P
><P
>The final blit rectangle is saved in
<TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
> after all clipping is performed
(<TT
CLASS="PARAMETER"
><I
>srcrect</I
></TT
> is not modified).</P
><P
>The blit function should not be called on a locked surface.</P
><P
>The results of blitting operations vary greatly depending on whether <TT
CLASS="LITERAL"
>SDL_SRCAPLHA</TT
> is set or not. See <A
HREF="sdlsetalpha.html"
>SDL_SetAlpha</A
> for an explaination of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain.
<PRE
CLASS="PROGRAMLISTING"
>if (source surface has SDL_SRCALPHA set) {
if (source surface has alpha channel (that is, format-&#62;Amask != 0))
blit using per-pixel alpha, ignoring any colour key
else {
if (source surface has SDL_SRCCOLORKEY set)
blit using the colour key AND the per-surface alpha value
else
blit using the per-surface alpha value
}
} else {
if (source surface has SDL_SRCCOLORKEY set)
blit using the colour key
else
ordinary opaque rectangular blit
}</PRE
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2328"
></A
><H2
>Return Value</H2
><P
>If the blit is successful, it returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
>,
otherwise it returns <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
>.</P
><P
>If either of the surfaces were in video memory, and the blit returns
<SPAN
CLASS="RETURNVALUE"
>-2</SPAN
>, the video memory was lost, so it should be
reloaded with artwork and re-blitted:
<PRE
CLASS="PROGRAMLISTING"
> while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
while ( SDL_LockSurface(image)) &#60; 0 )
SDL_Delay(10);
-- Write image pixels to image-&#62;pixels --
SDL_UnlockSurface(image);
}</PRE
>
This happens under DirectX 5.0 when the system switches away from your
fullscreen application. Locking the surface will also fail until you
have access to the video memory again.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2336"
></A
><H2
>See Also</H2
><P
><A
HREF="sdllocksurface.html"
><TT
CLASS="FUNCTION"
>SDL_LockSurface</TT
></A
>,
<A
HREF="sdlfillrect.html"
><TT
CLASS="FUNCTION"
>SDL_FillRect</TT
></A
>,
<A
HREF="sdlsurface.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
></A
>,
<A
HREF="sdlrect.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Rect</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlconvertsurface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlfillrect.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_ConvertSurface</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_FillRect</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,291 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_BuildAudioCVT</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Audio"
HREF="audio.html"><LINK
REL="PREVIOUS"
TITLE="SDL_AudioCVT"
HREF="sdlaudiocvt.html"><LINK
REL="NEXT"
TITLE="SDL_ConvertAudio"
HREF="sdlconvertaudio.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlaudiocvt.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlconvertaudio.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLBUILDAUDIOCVT"
></A
>SDL_BuildAudioCVT</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7002"
></A
><H2
>Name</H2
>SDL_BuildAudioCVT&nbsp;--&nbsp;Initializes a SDL_AudioCVT structure for conversion</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7005"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7006"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_BuildAudioCVT</B
></CODE
>(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7012"
></A
><H2
>Description</H2
><P
>Before an <A
HREF="sdlaudiocvt.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_AudioCVT</SPAN
></A
> structure can be used to convert audio data it must be initialized with source and destination information. </P
><P
><TT
CLASS="PARAMETER"
><I
>src_format</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>dst_format</I
></TT
> are the source and destination format of the conversion. (For information on audio formats see <A
HREF="sdlaudiospec.html"
><SPAN
CLASS="STRUCTNAME"
> SDL_AudioSpec</SPAN
></A
>). <TT
CLASS="PARAMETER"
><I
>src_channels</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>dst_channels</I
></TT
> are the number of channels in the source and destination formats. Finally, <TT
CLASS="PARAMETER"
><I
>src_rate</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>dst_rate</I
></TT
> are the frequency or samples-per-second of the source and destination formats. Once again, see <A
HREF="sdlaudiospec.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_AudioSpec</SPAN
></A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7028"
></A
><H2
>Return Values</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> if the filter could not be built or 1 if it could.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7032"
></A
><H2
>Examples</H2
><P
>See <A
HREF="sdlconvertaudio.html"
><TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
></A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7037"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlconvertaudio.html"
><TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
></A
>,
<A
HREF="sdlaudiocvt.html"
><TT
CLASS="FUNCTION"
>SDL_AudioCVT</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlaudiocvt.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlconvertaudio.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_AudioCVT</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_ConvertAudio</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,359 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CD</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDClose"
HREF="sdlcdclose.html"><LINK
REL="NEXT"
TITLE="SDL_CDtrack"
HREF="sdlcdtrack.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdclose.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdtrack.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCD"
></A
>SDL_CD</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7566"
></A
><H2
>Name</H2
>SDL_CD&nbsp;--&nbsp;CDROM Drive Information</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7569"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
int id;
CDstatus status;
int numtracks;
int cur_track;
int cur_frame;
SDL_CDtrack track[SDL_MAX_TRACKS+1];
} SDL_CD;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7572"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN7574"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>id</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Private drive identifier</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>status</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Drive <A
HREF="sdlcdstatus.html"
>status</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>numtracks</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Number of tracks on the CD</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>cur_track</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Current track</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>cur_frame</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Current frame offset within the track</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>track</I
></TT
>[SDL_MAX_TRACKS+1]</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Array of track descriptions. (see <A
HREF="sdlcdtrack.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CDtrack</SPAN
></A
>)</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7604"
></A
><H2
>Description</H2
><P
>An <SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
> structure is returned by <A
HREF="sdlcdopen.html"
><TT
CLASS="FUNCTION"
>SDL_CDOpen</TT
></A
>. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.</P
><P
>A frame is the base data unit of a CD. <TT
CLASS="LITERAL"
>CD_FPS</TT
> frames is equal to 1 second of music. SDL provides two macros for converting between time and frames: <TT
CLASS="LITERAL"
>FRAMES_TO_MSF(f, M,S,F)</TT
> and <TT
CLASS="LITERAL"
>MSF_TO_FRAMES</TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7614"
></A
><H2
>Examples</H2
><PRE
CLASS="PROGRAMLISTING"
>int min, sec, frame;
int frame_offset;
FRAMES_TO_MSF(cdrom-&#62;cur_frame, &#38;min, &#38;sec, &#38;frame);
printf("Current Position: %d minutes, %d seconds, %d frames\n", min, sec, frame);
frame_offset=MSF_TO_FRAMES(min, sec, frame);</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7617"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdopen.html"
><TT
CLASS="FUNCTION"
>SDL_CDOpen</TT
></A
>,
<A
HREF="sdlcdtrack.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CDtrack</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdclose.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdtrack.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDClose</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDtrack</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,217 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDClose</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDEject"
HREF="sdlcdeject.html"><LINK
REL="NEXT"
TITLE="SDL_CD"
HREF="sdlcd.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdeject.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcd.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDCLOSE"
></A
>SDL_CDClose</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7541"
></A
><H2
>Name</H2
>SDL_CDClose&nbsp;--&nbsp;Closes a SDL_CD handle</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7544"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7545"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_CDClose</B
></CODE
>(SDL_CD *cdrom);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7551"
></A
><H2
>Description</H2
><P
>Closes the given <TT
CLASS="PARAMETER"
><I
>cdrom</I
></TT
> handle.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7555"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdopen.html"
><TT
CLASS="FUNCTION"
>SDL_CDOpen</TT
></A
>,
<A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdeject.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcd.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDEject</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CD</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,226 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDEject</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDStop"
HREF="sdlcdstop.html"><LINK
REL="NEXT"
TITLE="SDL_CDClose"
HREF="sdlcdclose.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdstop.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdclose.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDEJECT"
></A
>SDL_CDEject</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7513"
></A
><H2
>Name</H2
>SDL_CDEject&nbsp;--&nbsp;Ejects a CDROM</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7516"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7517"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDEject</B
></CODE
>(SDL_CD *cdrom);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7523"
></A
><H2
>Description</H2
><P
>Ejects the given <TT
CLASS="PARAMETER"
><I
>cdrom</I
></TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7527"
></A
><H2
>Return Value</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7532"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdstop.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdclose.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDStop</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDClose</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,239 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDName</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDNumDrives"
HREF="sdlcdnumdrives.html"><LINK
REL="NEXT"
TITLE="SDL_CDOpen"
HREF="sdlcdopen.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdnumdrives.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdopen.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDNAME"
></A
>SDL_CDName</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7240"
></A
><H2
>Name</H2
>SDL_CDName&nbsp;--&nbsp;Returns a human-readable, system-dependent identifier for the CD-ROM.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7243"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7244"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>const char *<B
CLASS="FSFUNC"
>SDL_CDName</B
></CODE
>(int drive);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7250"
></A
><H2
>Description</H2
><P
>Returns a human-readable, system-dependent identifier for the CD-ROM. <TT
CLASS="PARAMETER"
><I
>drive</I
></TT
> is the index of the drive. Drive indices start to 0 and end at <TT
CLASS="FUNCTION"
>SDL_CDNumDrives()</TT
>-1.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7255"
></A
><H2
>Examples</H2
><P
><P
></P
><UL
><LI
><P
>"/dev/cdrom"</P
></LI
><LI
><P
>"E:"</P
></LI
><LI
><P
>"/dev/disk/ide/1/master"</P
></LI
></UL
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7265"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdnumdrives.html"
><TT
CLASS="FUNCTION"
>SDL_CDNumDrives</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdnumdrives.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdopen.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDNumDrives</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDOpen</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,205 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDNumDrives</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="NEXT"
TITLE="SDL_CDName"
HREF="sdlcdname.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="cdrom.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdname.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDNUMDRIVES"
></A
>SDL_CDNumDrives</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7218"
></A
><H2
>Name</H2
>SDL_CDNumDrives&nbsp;--&nbsp;Returns the number of CD-ROM drives on the system.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7221"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7222"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDNumDrives</B
></CODE
>(void);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7228"
></A
><H2
>Description</H2
><P
>Returns the number of CD-ROM drives on the system.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7231"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdopen.html"
><TT
CLASS="FUNCTION"
>SDL_CDOpen</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdname.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>CD-ROM</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDName</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,275 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDOpen</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDName"
HREF="sdlcdname.html"><LINK
REL="NEXT"
TITLE="SDL_CDStatus"
HREF="sdlcdstatus.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdname.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdstatus.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDOPEN"
></A
>SDL_CDOpen</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7274"
></A
><H2
>Name</H2
>SDL_CDOpen&nbsp;--&nbsp;Opens a CD-ROM drive for access.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7277"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7278"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_CD *<B
CLASS="FSFUNC"
>SDL_CDOpen</B
></CODE
>(int drive);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7284"
></A
><H2
>Description</H2
><P
>Opens a CD-ROM drive for access. It returns a <A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
> structure on success, or <TT
CLASS="LITERAL"
>NULL</TT
> if the drive was invalid or busy. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a <TT
CLASS="LITERAL"
>NULL</TT
> CD-ROM handle. </P
><P
>Drives are numbered starting with 0.
Drive 0 is the system default CD-ROM.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7292"
></A
><H2
>Examples</H2
><PRE
CLASS="PROGRAMLISTING"
>SDL_CD *cdrom;
int cur_track;
int min, sec, frame;
SDL_Init(SDL_INIT_CDROM);
atexit(SDL_Quit);
/* Check for CD drives */
if(!SDL_CDNumDrives()){
/* None found */
fprintf(stderr, "No CDROM devices available\n");
exit(-1);
}
/* Open the default drive */
cdrom=SDL_CDOpen(0);
/* Did if open? Check if cdrom is NULL */
if(!cdrom){
fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
exit(-1);
}
/* Print Volume info */
printf("Name: %s\n", SDL_CDName(0));
printf("Tracks: %d\n", cdrom-&#62;numtracks);
for(cur_track=0;cur_track &#60; cdrom-&#62;numtracks; cur_track++){
FRAMES_TO_MSF(cdrom-&#62;track[cur_track].length, &#38;min, &#38;sec, &#38;frame);
printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
}
SDL_CDClose(cdrom);</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7295"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
>,
<A
HREF="sdlcdtrack.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CDtrack</SPAN
></A
>,
<A
HREF="sdlcdclose.html"
><TT
CLASS="FUNCTION"
>SDL_CDClose</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdname.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdstatus.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDName</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDStatus</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,233 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDPause</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDPlayTracks"
HREF="sdlcdplaytracks.html"><LINK
REL="NEXT"
TITLE="SDL_CDResume"
HREF="sdlcdresume.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdplaytracks.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdresume.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDPAUSE"
></A
>SDL_CDPause</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7425"
></A
><H2
>Name</H2
>SDL_CDPause&nbsp;--&nbsp;Pauses a CDROM</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7428"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7429"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDPause</B
></CODE
>(SDL_CD *cdrom);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7435"
></A
><H2
>Description</H2
><P
>Pauses play on the given <TT
CLASS="PARAMETER"
><I
>cdrom</I
></TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7439"
></A
><H2
>Return Value</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7444"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdplay.html"
><TT
CLASS="FUNCTION"
>SDL_CDPlay</TT
></A
>,
<A
HREF="sdlcdresume.html"
><TT
CLASS="FUNCTION"
>SDL_CDResume</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdplaytracks.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdresume.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDPlayTracks</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDResume</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,243 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDPlay</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDStatus"
HREF="sdlcdstatus.html"><LINK
REL="NEXT"
TITLE="SDL_CDPlayTracks"
HREF="sdlcdplaytracks.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdstatus.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdplaytracks.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDPLAY"
></A
>SDL_CDPlay</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7343"
></A
><H2
>Name</H2
>SDL_CDPlay&nbsp;--&nbsp;Play a CD</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7346"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7347"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDPlay</B
></CODE
>(SDL_CD *cdrom, int start, int length);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7353"
></A
><H2
>Description</H2
><P
>Plays the given <TT
CLASS="PARAMETER"
><I
>cdrom</I
></TT
>, starting a frame <TT
CLASS="PARAMETER"
><I
>start</I
></TT
> for <TT
CLASS="PARAMETER"
><I
>length</I
></TT
> frames.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7359"
></A
><H2
>Return Values</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7364"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdplaytracks.html"
><TT
CLASS="FUNCTION"
>SDL_CDPlayTracks</TT
></A
>,
<A
HREF="sdlcdstop.html"
><TT
CLASS="FUNCTION"
>SDL_CDStop</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdstatus.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdplaytracks.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDStatus</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDPlayTracks</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,325 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDPlayTracks</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDPlay"
HREF="sdlcdplay.html"><LINK
REL="NEXT"
TITLE="SDL_CDPause"
HREF="sdlcdpause.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdplay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdpause.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDPLAYTRACKS"
></A
>SDL_CDPlayTracks</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7375"
></A
><H2
>Name</H2
>SDL_CDPlayTracks&nbsp;--&nbsp;Play the given CD track(s)</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7378"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7379"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDPlayTracks</B
></CODE
>(SDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes));</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7385"
></A
><H2
>Description</H2
><P
><TT
CLASS="FUNCTION"
>SDL_CDPlayTracks</TT
> plays the given CD starting at track
<TT
CLASS="PARAMETER"
><I
>start_track</I
></TT
>, for <TT
CLASS="PARAMETER"
><I
>ntracks</I
></TT
> tracks. </P
><P
><TT
CLASS="PARAMETER"
><I
>start_frame</I
></TT
> is the frame offset, from the beginning of the <TT
CLASS="PARAMETER"
><I
>start_track</I
></TT
>, at which to start. <TT
CLASS="PARAMETER"
><I
>nframes</I
></TT
> is the frame offset, from the beginning of the last track (<TT
CLASS="PARAMETER"
><I
>start_track</I
></TT
>+<TT
CLASS="PARAMETER"
><I
>ntracks</I
></TT
>), at which to end playing.</P
><P
><TT
CLASS="FUNCTION"
>SDL_CDPlayTracks</TT
> should only be called after calling
<A
HREF="sdlcdstatus.html"
><TT
CLASS="FUNCTION"
>SDL_CDStatus</TT
></A
>
to get track information about the CD.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Data tracks are ignored.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7403"
></A
><H2
>Return Value</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
>, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
>
if there was an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7408"
></A
><H2
>Examples</H2
><P
><PRE
CLASS="PROGRAMLISTING"
>/* assuming cdrom is a previously opened device */
/* Play the entire CD */
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
/* Play the first track */
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
/* Play first 15 seconds of the 2nd track */
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);</PRE
>
&#13;</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7412"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdplay.html"
><TT
CLASS="FUNCTION"
>SDL_CDPlay</TT
></A
>,
<A
HREF="sdlcdstatus.html"
><TT
CLASS="FUNCTION"
>SDL_CDStatus</TT
></A
>,
<A
HREF="sdlcd.html"
><TT
CLASS="FUNCTION"
>SDL_CD</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdplay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdpause.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDPlay</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDPause</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,233 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDResume</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDPause"
HREF="sdlcdpause.html"><LINK
REL="NEXT"
TITLE="SDL_CDStop"
HREF="sdlcdstop.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdpause.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdstop.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDRESUME"
></A
>SDL_CDResume</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7455"
></A
><H2
>Name</H2
>SDL_CDResume&nbsp;--&nbsp;Resumes a CDROM</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7458"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7459"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDResume</B
></CODE
>(SDL_CD *cdrom);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7465"
></A
><H2
>Description</H2
><P
>Resumes play on the given <TT
CLASS="PARAMETER"
><I
>cdrom</I
></TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7469"
></A
><H2
>Return Value</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7474"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdplay.html"
><TT
CLASS="FUNCTION"
>SDL_CDPlay</TT
></A
>,
<A
HREF="sdlcdpause.html"
><TT
CLASS="FUNCTION"
>SDL_CDPause</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdpause.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdstop.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDPause</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDStop</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,273 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDStatus</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDOpen"
HREF="sdlcdopen.html"><LINK
REL="NEXT"
TITLE="SDL_CDPlay"
HREF="sdlcdplay.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdopen.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdplay.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDSTATUS"
></A
>SDL_CDStatus</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7308"
></A
><H2
>Name</H2
>SDL_CDStatus&nbsp;--&nbsp;Returns the current status of the given drive.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7311"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7312"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>CDstatus <B
CLASS="FSFUNC"
>SDL_CDStatus</B
></CODE
>(SDL_CD *cdrom);</CODE
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>/* Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)status &#62; 0)</PRE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7319"
></A
><H2
>Description</H2
><P
>This function returns the current status of the given drive. Status is described like so:
<PRE
CLASS="PROGRAMLISTING"
>typedef enum {
CD_TRAYEMPTY,
CD_STOPPED,
CD_PLAYING,
CD_PAUSED,
CD_ERROR = -1
} CDstatus;</PRE
></P
><P
>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.</P
><P
>The macro <TT
CLASS="LITERAL"
>CD_INDRIVE</TT
> is provided for convenience,
and given a status returns true if there's a disk in the drive.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
><TT
CLASS="FUNCTION"
>SDL_CDStatus</TT
> also updates the <A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
> structure passed to it.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7331"
></A
><H2
>Example</H2
><PRE
CLASS="PROGRAMLISTING"
>int playTrack(int track)
{
int playing = 0;
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
/* clamp to the actual number of tracks on the CD */
if (track &#62;= cdrom-&#62;numtracks) {
track = cdrom-&#62;numtracks-1;
}
if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
playing = 1;
}
}
return playing;
}</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7334"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcd.html"
><TT
CLASS="FUNCTION"
>SDL_CD</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdopen.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdplay.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDOpen</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDPlay</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,226 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDStop</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CDResume"
HREF="sdlcdresume.html"><LINK
REL="NEXT"
TITLE="SDL_CDEject"
HREF="sdlcdeject.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcdresume.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcdeject.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDSTOP"
></A
>SDL_CDStop</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7485"
></A
><H2
>Name</H2
>SDL_CDStop&nbsp;--&nbsp;Stops a CDROM</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7488"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7489"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CDStop</B
></CODE
>(SDL_CD *cdrom);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7495"
></A
><H2
>Description</H2
><P
>Stops play on the given <TT
CLASS="PARAMETER"
><I
>cdrom</I
></TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7499"
></A
><H2
>Return Value</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7504"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcdplay.html"
><TT
CLASS="FUNCTION"
>SDL_CDPlay</TT
></A
>,</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcdresume.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcdeject.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CDResume</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CDEject</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,313 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CDtrack</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="CD-ROM"
HREF="cdrom.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CD"
HREF="sdlcd.html"><LINK
REL="NEXT"
TITLE="Multi-threaded Programming"
HREF="thread.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcd.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="thread.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCDTRACK"
></A
>SDL_CDtrack</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7628"
></A
><H2
>Name</H2
>SDL_CDtrack&nbsp;--&nbsp;CD Track Information Structure</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7631"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
Uint8 id;
Uint8 type;
Uint32 length;
Uint32 offset;
} SDL_CDtrack;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7634"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN7636"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>id</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Track number (0-99)</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_AUDIO_TRACK</TT
> or <TT
CLASS="LITERAL"
>SDL_DATA_TRACK</TT
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>length</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Length, in frames, of this track</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>offset</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Frame offset to the beginning of this track</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7657"
></A
><H2
>Description</H2
><P
><SPAN
CLASS="STRUCTNAME"
>SDL_CDtrack</SPAN
> stores data on each track on a CD, its fields should be pretty self explainatory. It is a member a the <A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
> structure.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Frames can be converted to standard timings. There are <TT
CLASS="LITERAL"
>CD_FPS</TT
> frames per second, so <SPAN
CLASS="STRUCTNAME"
>SDL_CDtrack</SPAN
>.<TT
CLASS="STRUCTFIELD"
><I
>length</I
></TT
>/<TT
CLASS="LITERAL"
>CD_FPS</TT
>=length_in_seconds.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7669"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcd.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_CD</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcd.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CD</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Multi-threaded Programming</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,205 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CloseAudio</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Audio"
HREF="audio.html"><LINK
REL="PREVIOUS"
TITLE="SDL_UnlockAudio"
HREF="sdlunlockaudio.html"><LINK
REL="NEXT"
TITLE="CD-ROM"
HREF="cdrom.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlunlockaudio.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="cdrom.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCLOSEAUDIO"
></A
>SDL_CloseAudio</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7180"
></A
><H2
>Name</H2
>SDL_CloseAudio&nbsp;--&nbsp;Shuts down audio processing and closes the audio device.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7183"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7184"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_CloseAudio</B
></CODE
>(void);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7190"
></A
><H2
>Description</H2
><P
>This function shuts down audio processing and closes the audio device.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7193"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlopenaudio.html"
><TT
CLASS="FUNCTION"
>SDL_OpenAudio</TT
></A
> </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlunlockaudio.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="cdrom.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_UnlockAudio</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>CD-ROM</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,300 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_Color</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_Rect"
HREF="sdlrect.html"><LINK
REL="NEXT"
TITLE="SDL_Palette"
HREF="sdlpalette.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlrect.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlpalette.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCOLOR"
></A
>SDL_Color</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3082"
></A
><H2
>Name</H2
>SDL_Color&nbsp;--&nbsp;Format independent color description</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3085"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
Uint8 r;
Uint8 g;
Uint8 b;
Uint8 unused;
} SDL_Color;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3088"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN3090"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>r</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Red intensity</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>g</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Green intensity</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>b</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Blue intensity</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>unused</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Unused</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3109"
></A
><H2
>Description</H2
><P
><SPAN
CLASS="STRUCTNAME"
>SDL_Color</SPAN
> describes a color in a format independent way. You can convert a <SPAN
CLASS="STRUCTNAME"
>SDL_Color</SPAN
> to a pixel value for a certain pixel format using <A
HREF="sdlmaprgb.html"
><TT
CLASS="FUNCTION"
>SDL_MapRGB</TT
></A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3116"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlpixelformat.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_PixelFormat</SPAN
></A
>,
<A
HREF="sdlsetcolors.html"
><TT
CLASS="FUNCTION"
>SDL_SetColors</TT
></A
>,
<A
HREF="sdlpalette.html"
><TT
CLASS="FUNCTION"
>SDL_Palette</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlrect.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlpalette.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_Rect</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_Palette</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,224 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CondBroadcast</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CondSignal"
HREF="sdlcondsignal.html"><LINK
REL="NEXT"
TITLE="SDL_CondWait"
HREF="sdlcondwait.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcondsignal.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcondwait.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCONDBROADCAST"
></A
>SDL_CondBroadcast</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8337"
></A
><H2
>Name</H2
>SDL_CondBroadcast&nbsp;--&nbsp;Restart all threads waiting on a condition variable</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8340"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8341"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CondBroadcast</B
></CODE
>(SDL_cond *cond);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8347"
></A
><H2
>Description</H2
><P
>Restarts all threads that are waiting on the condition variable, <TT
CLASS="PARAMETER"
><I
>cond</I
></TT
>. Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8353"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcondsignal.html"
><TT
CLASS="FUNCTION"
>SDL_CondSignal</TT
></A
>,
<A
HREF="sdlcondwait.html"
><TT
CLASS="FUNCTION"
>SDL_CondWait</TT
></A
>&#13;</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcondsignal.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcondwait.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CondSignal</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CondWait</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,224 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CondSignal</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_DestroyCond"
HREF="sdldestroycond.html"><LINK
REL="NEXT"
TITLE="SDL_CondBroadcast"
HREF="sdlcondbroadcast.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdldestroycond.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcondbroadcast.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCONDSIGNAL"
></A
>SDL_CondSignal</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8310"
></A
><H2
>Name</H2
>SDL_CondSignal&nbsp;--&nbsp;Restart a thread wait on a condition variable</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8313"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8314"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CondSignal</B
></CODE
>(SDL_cond *cond);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8320"
></A
><H2
>Description</H2
><P
>Restart one of the threads that are waiting on the condition variable, <TT
CLASS="PARAMETER"
><I
>cond</I
></TT
>. Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success of <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8326"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcondwait.html"
><TT
CLASS="FUNCTION"
>SDL_CondWait</TT
></A
>,
<A
HREF="sdlcondbroadcast.html"
><TT
CLASS="FUNCTION"
>SDL_CondBroadcast</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdldestroycond.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcondbroadcast.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_DestroyCond</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CondBroadcast</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,231 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CondWait</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CondBroadcast"
HREF="sdlcondbroadcast.html"><LINK
REL="NEXT"
TITLE="SDL_CondWaitTimeout"
HREF="sdlcondwaittimeout.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcondbroadcast.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcondwaittimeout.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCONDWAIT"
></A
>SDL_CondWait</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8364"
></A
><H2
>Name</H2
>SDL_CondWait&nbsp;--&nbsp;Wait on a condition variable</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8367"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8368"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CondWait</B
></CODE
>(SDL_cond *cond, SDL_mutex *mut);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8374"
></A
><H2
>Description</H2
><P
>Wait on the condition variable <TT
CLASS="PARAMETER"
><I
>cond</I
></TT
> and unlock the provided mutex. The mutex must the locked before entering this function. Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> when it is signalled, or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8380"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcondwaittimeout.html"
><TT
CLASS="FUNCTION"
>SDL_CondWaitTimeout</TT
></A
>,
<A
HREF="sdlcondsignal.html"
><TT
CLASS="FUNCTION"
>SDL_CondSignal</TT
></A
>,
<A
HREF="sdlmutexp.html"
><TT
CLASS="FUNCTION"
>SDL_mutexP</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcondbroadcast.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcondwaittimeout.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CondBroadcast</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CondWaitTimeout</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,230 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CondWaitTimeout</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CondWait"
HREF="sdlcondwait.html"><LINK
REL="NEXT"
TITLE="Time"
HREF="time.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcondwait.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="time.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCONDWAITTIMEOUT"
></A
>SDL_CondWaitTimeout</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8393"
></A
><H2
>Name</H2
>SDL_CondWaitTimeout&nbsp;--&nbsp;Wait on a condition variable, with timeout</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8396"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8397"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_CondWaitTimeout</B
></CODE
>(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8403"
></A
><H2
>Description</H2
><P
>Wait on the condition variable <TT
CLASS="PARAMETER"
><I
>cond</I
></TT
> for, at most, <TT
CLASS="PARAMETER"
><I
>ms</I
></TT
> milliseconds. <TT
CLASS="PARAMETER"
><I
>mut</I
></TT
> is unlocked so it must be locked when the function is called. Returns <TT
CLASS="LITERAL"
>SDL_MUTEX_TIMEDOUT</TT
> if the condition is not signalled in the allotted time, <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> if it was signalled or <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8412"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcondwait.html"
><TT
CLASS="FUNCTION"
>SDL_CondWait</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcondwait.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="time.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CondWait</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Time</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,407 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_ConvertAudio</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Audio"
HREF="audio.html"><LINK
REL="PREVIOUS"
TITLE="SDL_BuildAudioCVT"
HREF="sdlbuildaudiocvt.html"><LINK
REL="NEXT"
TITLE="SDL_MixAudio"
HREF="sdlmixaudio.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlbuildaudiocvt.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlmixaudio.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCONVERTAUDIO"
></A
>SDL_ConvertAudio</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7048"
></A
><H2
>Name</H2
>SDL_ConvertAudio&nbsp;--&nbsp;Convert audio data to a desired audio format.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7051"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7052"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_ConvertAudio</B
></CODE
>(SDL_AudioCVT *cvt);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7058"
></A
><H2
>Description</H2
><P
><TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
> takes one parameter, <TT
CLASS="PARAMETER"
><I
>cvt</I
></TT
>, which was previously initilized. Initilizing a <A
HREF="sdlaudiocvt.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_AudioCVT</SPAN
></A
> is a two step process. First of all, the structure must be passed to <A
HREF="sdlbuildaudiocvt.html"
><TT
CLASS="FUNCTION"
>SDL_BuildAudioCVT</TT
></A
> along with source and destination format parameters. Secondly, the <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
> and <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
> fields must be setup. <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
> should point to the audio data and <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
> should be set to the length of the audio data in bytes. Remember, the length of the buffer pointed to by <TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
> show be <TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
>*<TT
CLASS="STRUCTFIELD"
><I
>len_mult</I
></TT
> bytes in length.</P
><P
>Once the <SPAN
CLASS="STRUCTNAME"
>SDL_AudioCVT</SPAN
>structure is initilized then we can pass it to <TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
>, which will convert the audio data pointer to by <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
>. If <TT
CLASS="FUNCTION"
>SDL_ConvertAudio</TT
> returned <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> then the conversion was completed successfully, otherwise <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> is returned.</P
><P
>If the conversion completed successfully then the converted audio data can be read from <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>buf</I
></TT
>. The amount of valid, converted, audio data in the buffer is equal to <SPAN
CLASS="STRUCTNAME"
>cvt</SPAN
>-&#62;<TT
CLASS="STRUCTFIELD"
><I
>len</I
></TT
>*<TT
CLASS="STRUCTFIELD"
><I
>cvt</I
></TT
>-&#62;<SPAN
CLASS="STRUCTNAME"
>len_ratio</SPAN
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7093"
></A
><H2
>Examples</H2
><PRE
CLASS="PROGRAMLISTING"
>/* Converting some WAV data to hardware format */
void my_audio_callback(void *userdata, Uint8 *stream, int len);
SDL_AudioSpec *desired, *obtained;
SDL_AudioSpec wav_spec;
SDL_AudioCVT wav_cvt;
Uint32 wav_len;
Uint8 *wav_buf;
int ret;
/* Allocated audio specs */
desired = malloc(sizeof(SDL_AudioSpec));
obtained = malloc(sizeof(SDL_AudioSpec));
/* Set desired format */
desired-&#62;freq=22050;
desired-&#62;format=AUDIO_S16LSB;
desired-&#62;samples=8192;
desired-&#62;callback=my_audio_callback;
desired-&#62;userdata=NULL;
/* Open the audio device */
if ( SDL_OpenAudio(desired, obtained) &#60; 0 ){
fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
exit(-1);
}
free(desired);
/* Load the test.wav */
if( SDL_LoadWAV("test.wav", &#38;wav_spec, &#38;wav_buf, &#38;wav_len) == NULL ){
fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
SDL_CloseAudio();
free(obtained);
exit(-1);
}
/* Build AudioCVT */
ret = SDL_BuildAudioCVT(&#38;wav_cvt,
wav_spec.format, wav_spec.channels, wav_spec.freq,
obtained-&#62;format, obtained-&#62;channels, obtained-&#62;freq);
/* Check that the convert was built */
if(ret==-1){
fprintf(stderr, "Couldn't build converter!\n");
SDL_CloseAudio();
free(obtained);
SDL_FreeWAV(wav_buf);
}
/* Setup for conversion */
wav_cvt.buf = malloc(wav_len * wav_cvt.len_mult);
wav_cvt.len = wav_len;
memcpy(wav_cvt.buf, wav_buf, wav_len);
/* We can delete to original WAV data now */
SDL_FreeWAV(wav_buf);
/* And now we're ready to convert */
SDL_ConvertAudio(&#38;wav_cvt);
/* do whatever */
.
.
.
.
&#13;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7096"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlbuildaudiocvt.html"
><TT
CLASS="FUNCTION"
>SDL_BuildAudioCVT</TT
></A
>,
<A
HREF="sdlaudiocvt.html"
><TT
CLASS="FUNCTION"
>SDL_AudioCVT</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlbuildaudiocvt.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlmixaudio.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_BuildAudioCVT</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_MixAudio</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,271 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_ConvertSurface</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_GetClipRect"
HREF="sdlgetcliprect.html"><LINK
REL="NEXT"
TITLE="SDL_BlitSurface"
HREF="sdlblitsurface.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlgetcliprect.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlblitsurface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCONVERTSURFACE"
></A
>SDL_ConvertSurface</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2258"
></A
><H2
>Name</H2
>SDL_ConvertSurface&nbsp;--&nbsp;Converts a surface to the same format as another surface.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2261"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2262"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL/SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Surface *<B
CLASS="FSFUNC"
>SDL_ConvertSurface</B
></CODE
>(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2268"
></A
><H2
>Description</H2
><P
>Creates a new surface of the specified format, and then copies and maps
the given surface to it. If this function fails, it returns
<TT
CLASS="LITERAL"
>NULL</TT
>.</P
><P
>The <TT
CLASS="PARAMETER"
><I
>flags</I
></TT
> parameter is passed to
<A
HREF="sdlcreatergbsurface.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurface</TT
></A
>
and has those semantics.</P
><P
>This function is used internally by
<A
HREF="sdldisplayformat.html"
><TT
CLASS="FUNCTION"
>SDL_DisplayFormat</TT
></A
>.</P
><P
>This function can only be called after SDL_Init.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2280"
></A
><H2
>Return Value</H2
><P
>Returns either a pointer to the new surface, or
<TT
CLASS="LITERAL"
>NULL</TT
> on error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2284"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatergbsurface.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurface</TT
></A
>,
<A
HREF="sdldisplayformat.html"
><TT
CLASS="FUNCTION"
>SDL_DisplayFormat</TT
></A
>,
<A
HREF="sdlpixelformat.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_PixelFormat</SPAN
></A
>,
<A
HREF="sdlsurface.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlgetcliprect.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlblitsurface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_GetClipRect</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_BlitSurface</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,240 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateCond</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_SemValue"
HREF="sdlsemvalue.html"><LINK
REL="NEXT"
TITLE="SDL_DestroyCond"
HREF="sdldestroycond.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlsemvalue.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdldestroycond.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATECOND"
></A
>SDL_CreateCond</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8259"
></A
><H2
>Name</H2
>SDL_CreateCond&nbsp;--&nbsp;Create a condition variable</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8262"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8263"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_cond *<B
CLASS="FSFUNC"
>SDL_CreateCond</B
></CODE
>(void);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8269"
></A
><H2
>Description</H2
><P
>Creates a condition variable.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8272"
></A
><H2
>Examples</H2
><PRE
CLASS="PROGRAMLISTING"
>SDL_cond *cond;
cond=SDL_CreateCond();
.
.
/* Do stuff */
.
.
SDL_DestroyCond(cond);</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8275"
></A
><H2
>See Also</H2
><P
><A
HREF="sdldestroycond.html"
><TT
CLASS="FUNCTION"
>SDL_DestroyCond</TT
></A
>,
<A
HREF="sdlcondwait.html"
><TT
CLASS="FUNCTION"
>SDL_CondWait</TT
></A
>,
<A
HREF="sdlcondsignal.html"
><TT
CLASS="FUNCTION"
>SDL_CondSignal</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlsemvalue.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdldestroycond.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_SemValue</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_DestroyCond</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,398 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateCursor</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_WarpMouse"
HREF="sdlwarpmouse.html"><LINK
REL="NEXT"
TITLE="SDL_FreeCursor"
HREF="sdlfreecursor.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlwarpmouse.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlfreecursor.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATECURSOR"
></A
>SDL_CreateCursor</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2487"
></A
><H2
>Name</H2
>SDL_CreateCursor&nbsp;--&nbsp;Creates a new mouse cursor.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2490"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2491"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Cursor *<B
CLASS="FSFUNC"
>SDL_CreateCursor</B
></CODE
>(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2497"
></A
><H2
>Description</H2
><P
>Create a cursor using the specified <TT
CLASS="PARAMETER"
><I
>data</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>mask</I
></TT
> (in MSB format).
The cursor width must be a multiple of 8 bits.</P
><P
>The cursor is created in black and white according to the following:
<DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN2503"
></A
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Data / Mask</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Resulting pixel on screen</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>0 / 1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>White</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1 / 1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Black</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>0 / 0</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Transparent</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1 / 0</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Inverted color if possible, black if not.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></P
><P
>Cursors created with this function must be freed with
<A
HREF="sdlfreecursor.html"
>SDL_FreeCursor</A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2524"
></A
><H2
>Example</H2
><PRE
CLASS="PROGRAMLISTING"
>/* Stolen from the mailing list */
/* Creates a new mouse cursor from an XPM */
/* XPM */
static const char *arrow[] = {
/* width height num_colors chars_per_pixel */
" 32 32 3 1",
/* colors */
"X c #000000",
". c #ffffff",
" c None",
/* pixels */
"X ",
"XX ",
"X.X ",
"X..X ",
"X...X ",
"X....X ",
"X.....X ",
"X......X ",
"X.......X ",
"X........X ",
"X.....XXXXX ",
"X..X..X ",
"X.X X..X ",
"XX X..X ",
"X X..X ",
" X..X ",
" X..X ",
" X..X ",
" XX ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
"0,0"
};
static SDL_Cursor *init_system_cursor(const char *image[])
{
int i, row, col;
Uint8 data[4*32];
Uint8 mask[4*32];
int hot_x, hot_y;
i = -1;
for ( row=0; row&#60;32; ++row ) {
for ( col=0; col&#60;32; ++col ) {
if ( col % 8 ) {
data[i] &#60;&#60;= 1;
mask[i] &#60;&#60;= 1;
} else {
++i;
data[i] = mask[i] = 0;
}
switch (image[4+row][col]) {
case 'X':
data[i] |= 0x01;
mask[i] |= 0x01;
break;
case '.':
mask[i] |= 0x01;
break;
case ' ':
break;
}
}
}
sscanf(image[4+row], "%d,%d", &#38;hot_x, &#38;hot_y);
return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
}</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2527"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlfreecursor.html"
><TT
CLASS="FUNCTION"
>SDL_FreeCursor</TT
></A
>,
<A
HREF="sdlsetcursor.html"
><TT
CLASS="FUNCTION"
>SDL_SetCursor</TT
></A
>,
<A
HREF="sdlshowcursor.html"
><TT
CLASS="FUNCTION"
>SDL_ShowCursor</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlwarpmouse.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlfreecursor.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_WarpMouse</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_FreeCursor</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,249 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateMutex</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_KillThread"
HREF="sdlkillthread.html"><LINK
REL="NEXT"
TITLE="SDL_DestroyMutex"
HREF="sdldestroymutex.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlkillthread.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdldestroymutex.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATEMUTEX"
></A
>SDL_CreateMutex</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7820"
></A
><H2
>Name</H2
>SDL_CreateMutex&nbsp;--&nbsp;Create a mutex</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7823"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7824"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_mutex *<B
CLASS="FSFUNC"
>SDL_CreateMutex</B
></CODE
>(void);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7830"
></A
><H2
>Description</H2
><P
>Create a new, unlocked mutex.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7833"
></A
><H2
>Examples</H2
><PRE
CLASS="PROGRAMLISTING"
>SDL_mutex *mut;
mut=SDL_CreateMutex();
.
.
if(SDL_mutexP(mut)==-1){
fprintf(stderr, "Couldn't lock mutex\n");
exit(-1);
}
.
/* Do stuff while mutex is locked */
.
.
if(SDL_mutexV(mut)==-1){
fprintf(stderr, "Couldn't unlock mutex\n");
exit(-1);
}
SDL_DestroyMutex(mut);&#13;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7836"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlmutexp.html"
><TT
CLASS="FUNCTION"
>SDL_mutexP</TT
></A
>,
<A
HREF="sdlmutexv.html"
><TT
CLASS="FUNCTION"
>SDL_mutexV</TT
></A
>,
<A
HREF="sdldestroymutex.html"
><TT
CLASS="FUNCTION"
>SDL_DestroyMutex</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlkillthread.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdldestroymutex.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_KillThread</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_DestroyMutex</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,458 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateRGBSurface</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_GetRGBA"
HREF="sdlgetrgba.html"><LINK
REL="NEXT"
TITLE="SDL_CreateRGBSurfaceFrom"
HREF="sdlcreatergbsurfacefrom.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlgetrgba.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcreatergbsurfacefrom.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATERGBSURFACE"
></A
>SDL_CreateRGBSurface</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN1773"
></A
><H2
>Name</H2
>SDL_CreateRGBSurface&nbsp;--&nbsp;Create an empty SDL_Surface</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN1776"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN1777"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Surface *<B
CLASS="FSFUNC"
>SDL_CreateRGBSurface</B
></CODE
>(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1783"
></A
><H2
>Description</H2
><P
>Allocate an empty surface (must be called after <A
HREF="sdlsetvideomode.html"
>SDL_SetVideoMode</A
>)</P
><P
>If <TT
CLASS="PARAMETER"
><I
>depth</I
></TT
> is 8 bits an empty palette is allocated for the surface, otherwise a 'packed-pixel' <A
HREF="sdlpixelformat.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_PixelFormat</SPAN
></A
> is created using the <TT
CLASS="PARAMETER"
><I
>[RGBA]mask</I
></TT
>'s provided (see <A
HREF="sdlpixelformat.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_PixelFormat</SPAN
></A
>). The <TT
CLASS="PARAMETER"
><I
>flags</I
></TT
> specifies the type of surface that should be created, it is an OR'd combination of the following possible values.</P
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN1795"
></A
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_SWSURFACE</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SDL will create the surface in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_HWSURFACE</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>SDL will attempt to create the surface in video memory. This will allow SDL to take advantage of Video-&#62;Video blits (which are often accelerated).</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_SRCCOLORKEY</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>This flag turns on colourkeying for blits from this surface. If
<TT
CLASS="LITERAL"
>SDL_HWSURFACE</TT
> is also specified and colourkeyed blits
are hardware-accelerated, then SDL will attempt to place the surface in
video memory.
Use <A
HREF="sdlsetcolorkey.html"
><TT
CLASS="FUNCTION"
>SDL_SetColorKey</TT
></A
>
to set or clear this flag after surface creation.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_SRCALPHA</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>This flag turns on alpha-blending for blits from this surface. If
<TT
CLASS="LITERAL"
>SDL_HWSURFACE</TT
> is also specified and alpha-blending blits
are hardware-accelerated, then the surface will be placed in video memory if
possible.
Use <A
HREF="sdlsetalpha.html"
><TT
CLASS="FUNCTION"
>SDL_SetAlpha</TT
></A
> to
set or clear this flag after surface creation.</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>If an alpha-channel is specified (that is, if <TT
CLASS="PARAMETER"
><I
>Amask</I
></TT
> is
nonzero), then the <TT
CLASS="LITERAL"
>SDL_SRCALPHA</TT
> flag is automatically
set. You may remove this flag by calling
<A
HREF="sdlsetalpha.html"
><TT
CLASS="FUNCTION"
>SDL_SetAlpha</TT
></A
>
after surface creation.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1826"
></A
><H2
>Return Value</H2
><P
>Returns the created surface, or <SPAN
CLASS="RETURNVALUE"
>NULL</SPAN
> upon error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1830"
></A
><H2
>Example</H2
><PRE
CLASS="PROGRAMLISTING"
> /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order,
as expected by OpenGL for textures */
SDL_Surface *surface;
Uint32 rmask, gmask, bmask, amask;
/* SDL interprets each pixel as a 32-bit number, so our masks must depend
on the endianness (byte order) of the machine */
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
rmask = 0xff000000;
gmask = 0x00ff0000;
bmask = 0x0000ff00;
amask = 0x000000ff;
#else
rmask = 0x000000ff;
gmask = 0x0000ff00;
bmask = 0x00ff0000;
amask = 0xff000000;
#endif
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
rmask, gmask, bmask, amask);
if(surface == NULL) {
fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError());
exit(1);
}</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1833"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatergbsurfacefrom.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurfaceFrom</TT
></A
>,
<A
HREF="sdlfreesurface.html"
><TT
CLASS="FUNCTION"
>SDL_FreeSurface</TT
></A
>,
<A
HREF="sdlsetvideomode.html"
><TT
CLASS="FUNCTION"
>SDL_SetVideoMode</TT
></A
>,
<A
HREF="sdllocksurface.html"
><TT
CLASS="FUNCTION"
>SDL_LockSurface</TT
></A
>,
<A
HREF="sdlpixelformat.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_PixelFormat</SPAN
></A
>,
<A
HREF="sdlsurface.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
></A
>
<A
HREF="sdlsetalpha.html"
><TT
CLASS="FUNCTION"
>SDL_SetAlpha</TT
></A
>
<A
HREF="sdlsetcolorkey.html"
><TT
CLASS="FUNCTION"
>SDL_SetColorKey</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlgetrgba.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcreatergbsurfacefrom.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_GetRGBA</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CreateRGBSurfaceFrom</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,256 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateRGBSurfaceFrom</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CreateRGBSurface"
HREF="sdlcreatergbsurface.html"><LINK
REL="NEXT"
TITLE="SDL_FreeSurface"
HREF="sdlfreesurface.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcreatergbsurface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlfreesurface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATERGBSURFACEFROM"
></A
>SDL_CreateRGBSurfaceFrom</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN1856"
></A
><H2
>Name</H2
>SDL_CreateRGBSurfaceFrom&nbsp;--&nbsp;Create an SDL_Surface from pixel data</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN1859"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN1860"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Surface *<B
CLASS="FSFUNC"
>SDL_CreateRGBSurfaceFrom</B
></CODE
>(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1866"
></A
><H2
>Description</H2
><P
>Creates an SDL_Surface from the provided pixel data.</P
><P
>The data stored in <TT
CLASS="PARAMETER"
><I
>pixels</I
></TT
> is assumed to be of the <TT
CLASS="PARAMETER"
><I
>depth</I
></TT
> specified in the parameter list. The pixel data is not copied into the <SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
> structure so it should not be freed until the surface has been freed with a called to <A
HREF="sdlfreesurface.html"
>SDL_FreeSurface</A
>. <TT
CLASS="PARAMETER"
><I
>pitch</I
></TT
> is the length of each scanline in bytes. </P
><P
>See <A
HREF="sdlcreatergbsurface.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurface</TT
></A
> for a more detailed description of the other parameters.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1878"
></A
><H2
>Return Value</H2
><P
>Returns the created surface, or <SPAN
CLASS="RETURNVALUE"
>NULL</SPAN
> upon error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1882"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatergbsurface.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurface</TT
></A
>,
<A
HREF="sdlfreesurface.html"
><TT
CLASS="FUNCTION"
>SDL_FreeSurface</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcreatergbsurface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlfreesurface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CreateRGBSurface</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_FreeSurface</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,303 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateSemaphore</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_mutexV"
HREF="sdlmutexv.html"><LINK
REL="NEXT"
TITLE="SDL_DestroySemaphore"
HREF="sdldestroysemaphore.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlmutexv.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdldestroysemaphore.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATESEMAPHORE"
></A
>SDL_CreateSemaphore</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7936"
></A
><H2
>Name</H2
>SDL_CreateSemaphore&nbsp;--&nbsp;Creates a new semaphore and assigns an initial value to it.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7939"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7940"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_sem *<B
CLASS="FSFUNC"
>SDL_CreateSemaphore</B
></CODE
>(Uint32 initial_value);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7946"
></A
><H2
>Description</H2
><P
><TT
CLASS="FUNCTION"
>SDL_CreateSemaphore()</TT
> creates a new semaphore and
initializes it with the value <TT
CLASS="PARAMETER"
><I
>initial_value</I
></TT
>.
Each locking operation on the semaphore by
<A
HREF="sdlsemwait.html"
>SDL_SemWait</A
>,
<A
HREF="sdlsemtrywait.html"
>SDL_SemTryWait</A
> or
<A
HREF="sdlsemwaittimeout.html"
>SDL_SemWaitTimeout</A
>
will atomically decrement the semaphore value. The locking operation will be blocked
if the semaphore value is not positive (greater than zero). Each unlock operation by
<A
HREF="sdlsempost.html"
>SDL_SemPost</A
>
will atomically increment the semaphore value.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7955"
></A
><H2
>Return Value</H2
><P
>Returns a pointer to an initialized semaphore or
<SPAN
CLASS="RETURNVALUE"
>NULL</SPAN
> if there was an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7959"
></A
><H2
>Examples</H2
><P
><PRE
CLASS="PROGRAMLISTING"
>SDL_sem *my_sem;
my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
if (my_sem == NULL) {
return CREATE_SEM_FAILED;
}</PRE
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7963"
></A
><H2
>See Also</H2
><P
><A
HREF="sdldestroysemaphore.html"
><TT
CLASS="FUNCTION"
>SDL_DestroySemaphore</TT
></A
>,
<A
HREF="sdlsemwait.html"
><TT
CLASS="FUNCTION"
>SDL_SemWait</TT
></A
>,
<A
HREF="sdlsemtrywait.html"
><TT
CLASS="FUNCTION"
>SDL_SemTryWait</TT
></A
>,
<A
HREF="sdlsemwaittimeout.html"
><TT
CLASS="FUNCTION"
>SDL_SemWaitTimeout</TT
></A
>,
<A
HREF="sdlsempost.html"
><TT
CLASS="FUNCTION"
>SDL_SemPost</TT
></A
>,
<A
HREF="sdlsemvalue.html"
><TT
CLASS="FUNCTION"
>SDL_SemValue</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlmutexv.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdldestroysemaphore.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_mutexV</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_DestroySemaphore</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,223 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateThread</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="NEXT"
TITLE="SDL_ThreadID"
HREF="sdlthreadid.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="thread.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlthreadid.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATETHREAD"
></A
>SDL_CreateThread</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7701"
></A
><H2
>Name</H2
>SDL_CreateThread&nbsp;--&nbsp;Creates a new thread of execution that shares its parent's properties.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7704"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7705"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Thread *<B
CLASS="FSFUNC"
>SDL_CreateThread</B
></CODE
>(int (*fn)(void *), void *data);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7711"
></A
><H2
>Description</H2
><P
><TT
CLASS="FUNCTION"
>SDL_CreateThread</TT
> creates a new thread of execution
that shares all of its parent's global memory, signal handlers,
file descriptors, etc, and runs the function <TT
CLASS="PARAMETER"
><I
>fn</I
></TT
>
passed the void pointer <TT
CLASS="PARAMETER"
><I
>data</I
></TT
>
The thread quits when this function returns.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7717"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlkillthread.html"
><TT
CLASS="FUNCTION"
>SDL_KillThread</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlthreadid.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Multi-threaded Programming</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_ThreadID</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,256 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_CreateYUVOverlay</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_GL_SwapBuffers"
HREF="sdlglswapbuffers.html"><LINK
REL="NEXT"
TITLE="SDL_LockYUVOverlay"
HREF="sdllockyuvoverlay.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlglswapbuffers.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdllockyuvoverlay.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLCREATEYUVOVERLAY"
></A
>SDL_CreateYUVOverlay</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2808"
></A
><H2
>Name</H2
>SDL_CreateYUVOverlay&nbsp;--&nbsp;Create a YUV video overlay</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2811"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2812"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Overlay *<B
CLASS="FSFUNC"
>SDL_CreateYUVOverlay</B
></CODE
>(int width, int height, Uint32 format, SDL_Surface *display);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2818"
></A
><H2
>Description</H2
><P
><TT
CLASS="FUNCTION"
>SDL_CreateYUVOverlay</TT
> creates a YUV overlay of the specified <TT
CLASS="PARAMETER"
><I
>width</I
></TT
>, <TT
CLASS="PARAMETER"
><I
>height</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>format</I
></TT
> (see <A
HREF="sdloverlay.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Overlay</SPAN
></A
> for a list of available formats), for the provided <TT
CLASS="PARAMETER"
><I
>display</I
></TT
>. A <A
HREF="sdloverlay.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Overlay</SPAN
></A
> structure is returned.</P
><P
>The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2831"
></A
><H2
>See Also</H2
><P
><A
HREF="sdloverlay.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Overlay</SPAN
></A
>,
<A
HREF="sdldisplayyuvoverlay.html"
><TT
CLASS="FUNCTION"
>SDL_DisplayYUVOverlay</TT
></A
>,
<A
HREF="sdlfreeyuvoverlay.html"
><TT
CLASS="FUNCTION"
>SDL_FreeYUVOverlay</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlglswapbuffers.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdllockyuvoverlay.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_GL_SwapBuffers</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_LockYUVOverlay</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,231 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_Delay</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Time"
HREF="time.html"><LINK
REL="PREVIOUS"
TITLE="SDL_GetTicks"
HREF="sdlgetticks.html"><LINK
REL="NEXT"
TITLE="SDL_AddTimer"
HREF="sdladdtimer.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlgetticks.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdladdtimer.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDELAY"
></A
>SDL_Delay</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8455"
></A
><H2
>Name</H2
>SDL_Delay&nbsp;--&nbsp;Wait a specified number of milliseconds before returning.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8458"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8459"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_Delay</B
></CODE
>(Uint32 ms);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8465"
></A
><H2
>Description</H2
><P
>Wait a specified number of milliseconds before returning. <TT
CLASS="FUNCTION"
>SDL_Delay</TT
> will wait at <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>least</I
></SPAN
> the specified time, but possible longer due to OS scheduling.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Count on a delay granularity of <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>at least</I
></SPAN
> 10 ms.
Some platforms have shorter clock ticks but this is the most common.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8473"
></A
><H2
>See Also</H2
><P
><A
HREF="sdladdtimer.html"
><TT
CLASS="FUNCTION"
>SDL_AddTimer</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlgetticks.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdladdtimer.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_GetTicks</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="time.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_AddTimer</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,206 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_DestroyCond</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CreateCond"
HREF="sdlcreatecond.html"><LINK
REL="NEXT"
TITLE="SDL_CondSignal"
HREF="sdlcondsignal.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcreatecond.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlcondsignal.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDESTROYCOND"
></A
>SDL_DestroyCond</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8288"
></A
><H2
>Name</H2
>SDL_DestroyCond&nbsp;--&nbsp;Destroy a condition variable</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN8291"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN8292"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_DestroyCond</B
></CODE
>(SDL_cond *cond);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8298"
></A
><H2
>Description</H2
><P
>Destroys a condition variable.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8301"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatecond.html"
><TT
CLASS="FUNCTION"
>SDL_CreateCond</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcreatecond.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlcondsignal.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CreateCond</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_CondSignal</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,209 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_DestroyMutex</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CreateMutex"
HREF="sdlcreatemutex.html"><LINK
REL="NEXT"
TITLE="SDL_mutexP"
HREF="sdlmutexp.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcreatemutex.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlmutexp.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDESTROYMUTEX"
></A
>SDL_DestroyMutex</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7849"
></A
><H2
>Name</H2
>SDL_DestroyMutex&nbsp;--&nbsp;Destroy a mutex</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7852"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7853"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_DestroyMutex</B
></CODE
>(SDL_mutex *mutex);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7859"
></A
><H2
>Description</H2
><P
>Destroy a previously <A
HREF="sdlcreatemutex.html"
>created</A
> mutex.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7863"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatemutex.html"
><TT
CLASS="FUNCTION"
>SDL_CreateMutex</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcreatemutex.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlmutexp.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CreateMutex</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_mutexP</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,278 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_DestroySemaphore</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Multi-threaded Programming"
HREF="thread.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CreateSemaphore"
HREF="sdlcreatesemaphore.html"><LINK
REL="NEXT"
TITLE="SDL_SemWait"
HREF="sdlsemwait.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcreatesemaphore.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlsemwait.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDESTROYSEMAPHORE"
></A
>SDL_DestroySemaphore</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN7982"
></A
><H2
>Name</H2
>SDL_DestroySemaphore&nbsp;--&nbsp;Destroys a semaphore that was created by <A
HREF="sdlcreatesemaphore.html"
>SDL_CreateSemaphore</A
>.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN7986"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN7987"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"
#include "SDL_thread.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_DestroySemaphore</B
></CODE
>(SDL_sem *sem);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN7993"
></A
><H2
>Description</H2
><P
><TT
CLASS="FUNCTION"
>SDL_DestroySemaphore</TT
> destroys the semaphore pointed to
by <TT
CLASS="PARAMETER"
><I
>sem</I
></TT
> that was created by
<A
HREF="sdlcreatesemaphore.html"
><TT
CLASS="FUNCTION"
>SDL_CreateSemaphore</TT
></A
>.
It is not safe to destroy a semaphore if there are threads currently blocked
waiting on it.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8000"
></A
><H2
>Examples</H2
><P
><PRE
CLASS="PROGRAMLISTING"
>if (my_sem != NULL) {
SDL_DestroySemaphore(my_sem);
my_sem = NULL;
}</PRE
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN8004"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatesemaphore.html"
><TT
CLASS="FUNCTION"
>SDL_CreateSemaphore</TT
></A
>,
<A
HREF="sdlsemwait.html"
><TT
CLASS="FUNCTION"
>SDL_SemWait</TT
></A
>,
<A
HREF="sdlsemtrywait.html"
><TT
CLASS="FUNCTION"
>SDL_SemTryWait</TT
></A
>,
<A
HREF="sdlsemwaittimeout.html"
><TT
CLASS="FUNCTION"
>SDL_SemWaitTimeout</TT
></A
>,
<A
HREF="sdlsempost.html"
><TT
CLASS="FUNCTION"
>SDL_SemPost</TT
></A
>,
<A
HREF="sdlsemvalue.html"
><TT
CLASS="FUNCTION"
>SDL_SemValue</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcreatesemaphore.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlsemwait.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CreateSemaphore</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="thread.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_SemWait</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,262 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_DisplayFormat</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_FillRect"
HREF="sdlfillrect.html"><LINK
REL="NEXT"
TITLE="SDL_DisplayFormatAlpha"
HREF="sdldisplayformatalpha.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlfillrect.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdldisplayformatalpha.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDISPLAYFORMAT"
></A
>SDL_DisplayFormat</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2394"
></A
><H2
>Name</H2
>SDL_DisplayFormat&nbsp;--&nbsp;Convert a surface to the display format</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2397"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2398"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Surface *<B
CLASS="FSFUNC"
>SDL_DisplayFormat</B
></CODE
>(SDL_Surface *surface);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2404"
></A
><H2
>Description</H2
><P
>This function takes a surface and copies it to a new surface of the
pixel format and colors of the video framebuffer, suitable for fast
blitting onto the display surface. It calls
<A
HREF="sdlconvertsurface.html"
>SDL_ConvertSurface</A
></P
><P
>If you want to take advantage of hardware colorkey or alpha blit
acceleration, you should set the colorkey and alpha value before
calling this function.</P
><P
>If you want an alpha channel, see <A
HREF="sdldisplayformatalpha.html"
>SDL_DisplayFormatAlpha</A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2411"
></A
><H2
>Return Value</H2
><P
>If the conversion fails or runs out of memory, it returns
<SPAN
CLASS="RETURNVALUE"
>NULL</SPAN
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2415"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlconvertsurface.html"
><TT
CLASS="FUNCTION"
>SDL_ConvertSurface</TT
></A
>,
<A
HREF="sdldisplayformatalpha.html"
><TT
CLASS="FUNCTION"
>SDL_DisplayFormatAlpha</TT
></A
>
<A
HREF="sdlsetalpha.html"
><TT
CLASS="FUNCTION"
>SDL_SetAlpha</TT
></A
>,
<A
HREF="sdlsetcolorkey.html"
><TT
CLASS="FUNCTION"
>SDL_SetColorKey</TT
></A
>,
<A
HREF="sdlsurface.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlfillrect.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdldisplayformatalpha.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_FillRect</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_DisplayFormatAlpha</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,250 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_DisplayFormatAlpha</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_DisplayFormat"
HREF="sdldisplayformat.html"><LINK
REL="NEXT"
TITLE="SDL_WarpMouse"
HREF="sdlwarpmouse.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdldisplayformat.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlwarpmouse.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDISPLAYFORMATALPHA"
></A
>SDL_DisplayFormatAlpha</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2432"
></A
><H2
>Name</H2
>SDL_DisplayFormatAlpha&nbsp;--&nbsp;Convert a surface to the display format</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2435"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2436"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>SDL_Surface *<B
CLASS="FSFUNC"
>SDL_DisplayFormatAlpha</B
></CODE
>(SDL_Surface *surface);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2442"
></A
><H2
>Description</H2
><P
>This function takes a surface and copies it to a new surface of the
pixel format and colors of the video framebuffer plus an alpha channel,
suitable for fast blitting onto the display surface. It calls
<A
HREF="sdlconvertsurface.html"
>SDL_ConvertSurface</A
></P
><P
>If you want to take advantage of hardware colorkey or alpha blit
acceleration, you should set the colorkey and alpha value before
calling this function.</P
><P
>This function can be used to convert a colourkey to an alpha channel,
if the <TT
CLASS="LITERAL"
>SDL_SRCCOLORKEY</TT
> flag is set on the surface.
The generated surface will then be transparent (alpha=0) where the
pixels match the colourkey, and opaque (alpha=255) elsewhere.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2449"
></A
><H2
>Return Value</H2
><P
>If the conversion fails or runs out of memory, it returns
<SPAN
CLASS="RETURNVALUE"
>NULL</SPAN
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2453"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlconvertsurface.html"
>SDL_ConvertSurface</A
>,
<A
HREF="sdlsetalpha.html"
>SDL_SetAlpha</A
>,
<A
HREF="sdlsetcolorkey.html"
>SDL_SetColorKey</A
>,
<A
HREF="sdldisplayformat.html"
>SDL_DisplayFormat</A
>,
<A
HREF="sdlsurface.html"
>SDL_Surface</A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdldisplayformat.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlwarpmouse.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_DisplayFormat</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_WarpMouse</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,246 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_DisplayYUVOverlay</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_UnlockYUVOverlay"
HREF="sdlunlockyuvoverlay.html"><LINK
REL="NEXT"
TITLE="SDL_FreeYUVOverlay"
HREF="sdlfreeyuvoverlay.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlunlockyuvoverlay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlfreeyuvoverlay.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLDISPLAYYUVOVERLAY"
></A
>SDL_DisplayYUVOverlay</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2908"
></A
><H2
>Name</H2
>SDL_DisplayYUVOverlay&nbsp;--&nbsp;Blit the overlay to the display</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2911"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2912"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_DisplayYUVOverlay</B
></CODE
>(SDL_Overlay *overlay, SDL_Rect *dstrect);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2918"
></A
><H2
>Description</H2
><P
>Blit the <TT
CLASS="PARAMETER"
><I
>overlay</I
></TT
> to the surface specified when it was <A
HREF="sdlcreateyuvoverlay.html"
>created</A
>. The <A
HREF="sdlrect.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Rect</SPAN
></A
> structure, <TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
>, specifies the position and size of the destination. If the <TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
> is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2927"
></A
><H2
>Return Values</H2
><P
>Returns 0 on success</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2930"
></A
><H2
>See Also</H2
><P
><A
HREF="sdloverlay.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Overlay</SPAN
></A
>,
<A
HREF="sdlcreateyuvoverlay.html"
><TT
CLASS="FUNCTION"
>SDL_CreateYUVOverlay</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlunlockyuvoverlay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlfreeyuvoverlay.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_UnlockYUVOverlay</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_FreeYUVOverlay</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,238 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_EnableKeyRepeat</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Event Functions."
HREF="eventfunctions.html"><LINK
REL="PREVIOUS"
TITLE="SDL_EnableUNICODE"
HREF="sdlenableunicode.html"><LINK
REL="NEXT"
TITLE="SDL_GetMouseState"
HREF="sdlgetmousestate.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlenableunicode.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlgetmousestate.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLENABLEKEYREPEAT"
></A
>SDL_EnableKeyRepeat</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN5839"
></A
><H2
>Name</H2
>SDL_EnableKeyRepeat&nbsp;--&nbsp;Set keyboard repeat rate.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN5842"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN5843"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_EnableKeyRepeat</B
></CODE
>(int delay, int interval);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5849"
></A
><H2
>Description</H2
><P
>Enables or disables the keyboard repeat rate. <TT
CLASS="PARAMETER"
><I
>delay</I
></TT
> specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by <TT
CLASS="PARAMETER"
><I
>interval</I
></TT
>. Both <TT
CLASS="PARAMETER"
><I
>delay</I
></TT
> and <TT
CLASS="PARAMETER"
><I
>interval</I
></TT
> are expressed in milliseconds.</P
><P
>Setting <TT
CLASS="PARAMETER"
><I
>delay</I
></TT
> to 0 disables key repeating completely. Good default values are <TT
CLASS="LITERAL"
>SDL_DEFAULT_REPEAT_DELAY</TT
> and <SPAN
CLASS="SYMBOL"
>SDL_DEFAULT_REPEAT_INTERVAL</SPAN
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5860"
></A
><H2
>Return Value</H2
><P
>Returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success and <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on failure.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlenableunicode.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlgetmousestate.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_EnableUNICODE</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="eventfunctions.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_GetMouseState</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,252 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_EnableUNICODE</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Event Functions."
HREF="eventfunctions.html"><LINK
REL="PREVIOUS"
TITLE="SDL_GetKeyName"
HREF="sdlgetkeyname.html"><LINK
REL="NEXT"
TITLE="SDL_EnableKeyRepeat"
HREF="sdlenablekeyrepeat.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlgetkeyname.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlenablekeyrepeat.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLENABLEUNICODE"
></A
>SDL_EnableUNICODE</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN5805"
></A
><H2
>Name</H2
>SDL_EnableUNICODE&nbsp;--&nbsp;Enable UNICODE translation</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN5808"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN5809"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_EnableUNICODE</B
></CODE
>(int enable);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5815"
></A
><H2
>Description</H2
><P
>Enables/Disables Unicode keyboard translation.</P
><P
>To obtain the character codes corresponding to received keyboard events,
Unicode translation must first be turned on using this function. The
translation incurs a slight overhead for each keyboard event and is therefore
disabled by default. For each subsequently received key down event, the
<TT
CLASS="STRUCTFIELD"
><I
>unicode</I
></TT
> member of the
<A
HREF="sdlkeysym.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_keysym</SPAN
></A
> structure
will then contain the corresponding character code, or zero for keysyms that do
not correspond to any character code.</P
><P
>A value of 1 for <TT
CLASS="PARAMETER"
><I
>enable</I
></TT
> enables Unicode translation;
0 disables it, and -1 leaves it unchanged (useful for querying the current
translation mode).</P
><P
>Note that only key press events will be translated, not release events.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5825"
></A
><H2
>Return Value</H2
><P
>Returns the previous translation mode (<SPAN
CLASS="RETURNVALUE"
>0</SPAN
> or <SPAN
CLASS="RETURNVALUE"
>1</SPAN
>).</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5830"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlkeysym.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_keysym</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlgetkeyname.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlenablekeyrepeat.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_GetKeyName</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="eventfunctions.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_EnableKeyRepeat</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

File diff suppressed because it is too large Load diff

View file

@ -1,994 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_Event</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Event Structures."
HREF="eventstructures.html"><LINK
REL="PREVIOUS"
TITLE="SDL Event Structures."
HREF="eventstructures.html"><LINK
REL="NEXT"
TITLE="SDL_ActiveEvent"
HREF="sdlactiveevent.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="eventstructures.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlactiveevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLEVENT"
></A
>SDL_Event</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3711"
></A
><H2
>Name</H2
>SDL_Event&nbsp;--&nbsp;General event structure</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3714"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef union{
Uint8 type;
SDL_ActiveEvent active;
SDL_KeyboardEvent key;
SDL_MouseMotionEvent motion;
SDL_MouseButtonEvent button;
SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton;
SDL_ResizeEvent resize;
SDL_ExposeEvent expose;
SDL_QuitEvent quit;
SDL_UserEvent user;
SDL_SysWMEvent syswm;
} SDL_Event;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3717"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN3719"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>The type of event</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>active</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlactiveevent.html"
>Activation event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>key</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlkeyboardevent.html"
>Keyboard event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>motion</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlmousemotionevent.html"
>Mouse motion event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>button</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlmousebuttonevent.html"
>Mouse button event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>jaxis</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoyaxisevent.html"
>Joystick axis motion event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>jball</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoyballevent.html"
>Joystick trackball motion event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>jhat</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoyhatevent.html"
>Joystick hat motion event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>jbutton</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoybuttonevent.html"
>Joystick button event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>resize</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlresizeevent.html"
>Application window resize event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>expose</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlexposeevent.html"
>Application window expose event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>quit</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlquitevent.html"
>Application quit request event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>user</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdluserevent.html"
>User defined event</A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>syswm</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlsyswmevent.html"
>Undefined window manager event</A
></TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3791"
></A
><H2
>Description</H2
><P
>The <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> union is the core to all event handling is SDL, its probably the most important structure after <SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
>. <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
>.</P
><P
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN3799"
></A
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Event <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
></TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Event Structure</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
><TT
CLASS="LITERAL"
>SDL_ACTIVEEVENT</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
><A
HREF="sdlactiveevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_ActiveEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_KEYDOWN/UP</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlkeyboardevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_KeyboardEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_MOUSEMOTION</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlmousemotionevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_MouseMotionEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_MOUSEBUTTONDOWN/UP</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlmousebuttonevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_MouseButtonEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_JOYAXISMOTION</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoyaxisevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyAxisEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_JOYBALLMOTION</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoyballevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyBallEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_JOYHATMOTION</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoyhatevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyHatEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_JOYBUTTONDOWN/UP</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdljoybuttonevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_JoyButtonEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_QUIT</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlquitevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_QuitEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_SYSWMEVENT</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlsyswmevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_SysWMEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_VIDEORESIZE</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlresizeevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_ResizeEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_VIDEOEXPOSE</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdlexposeevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_ExposeEvent</SPAN
></A
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_USEREVENT</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
HREF="sdluserevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_UserEvent</SPAN
></A
></TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3885"
></A
><H2
>Use</H2
><P
>The <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> structure has two uses</P
><P
></P
><UL
COMPACT="COMPACT"
><LI
><P
>Reading events on the event queue</P
></LI
><LI
><P
>Placing events on the event queue</P
></LI
></UL
><P
>Reading events from the event queue is done with either <A
HREF="sdlpollevent.html"
><TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
></A
> or <A
HREF="sdlpeepevents.html"
><TT
CLASS="FUNCTION"
>SDL_PeepEvents</TT
></A
>. We'll use <TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
> and step through an example.</P
><P
>First off, we create an empty <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> structure.
<PRE
CLASS="PROGRAMLISTING"
>SDL_Event test_event;</PRE
>
<TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
> removes the next event from the event queue, if there are no events on the queue it returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> otherwise it returns <SPAN
CLASS="RETURNVALUE"
>1</SPAN
>. We use a <TT
CLASS="FUNCTION"
>while</TT
> loop to process each event in turn.
<PRE
CLASS="PROGRAMLISTING"
>while(SDL_PollEvent(&#38;test_event)) {</PRE
>
The <TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
> function take a pointer to an <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
> structure that is to be filled with event information. We know that if <TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
> removes an event from the queue then the event information will be placed in our <SPAN
CLASS="STRUCTNAME"
>test_event</SPAN
> structure, but we also know that the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>type</I
></SPAN
> of event will be placed in the <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
> member of <SPAN
CLASS="STRUCTNAME"
>test_event</SPAN
>. So to handle each event <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
> seperately we use a <TT
CLASS="FUNCTION"
>switch</TT
> statement.
<PRE
CLASS="PROGRAMLISTING"
> switch(test_event.type) {</PRE
>
We need to know what kind of events we're looking for <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>and</I
></SPAN
> the event <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
>'s of those events. So lets assume we want to detect where the user is moving the mouse pointer within our application. We look through our event types and notice that <TT
CLASS="LITERAL"
>SDL_MOUSEMOTION</TT
> is, more than likely, the event we're looking for. A little <A
HREF="sdlmousemotionevent.html"
>more</A
> research tells use that <TT
CLASS="LITERAL"
>SDL_MOUSEMOTION</TT
> events are handled within the <A
HREF="sdlmousemotionevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_MouseMotionEvent</SPAN
></A
> structure which is the <TT
CLASS="STRUCTFIELD"
><I
>motion</I
></TT
> member of <SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
>. We can check for the <TT
CLASS="LITERAL"
>SDL_MOUSEMOTION</TT
> event <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
> within our <TT
CLASS="FUNCTION"
>switch</TT
> statement like so:
<PRE
CLASS="PROGRAMLISTING"
> case SDL_MOUSEMOTION:</PRE
>
All we need do now is read the information out of the <TT
CLASS="STRUCTFIELD"
><I
>motion</I
></TT
> member of <SPAN
CLASS="STRUCTNAME"
>test_event</SPAN
>.
<PRE
CLASS="PROGRAMLISTING"
> printf("We got a motion event.\n");
printf("Current mouse position is: (%d, %d)\n", test_event.motion.x, test_event.motion.y);
break;
default:
printf("Unhandled Event!\n");
break;
}
}
printf("Event queue empty.\n");</PRE
></P
><P
>It is also possible to push events onto the event queue and so use it as a two-way communication path. Both <A
HREF="sdlpushevent.html"
><TT
CLASS="FUNCTION"
>SDL_PushEvent</TT
></A
> and <A
HREF="sdlpeepevents.html"
><TT
CLASS="FUNCTION"
>SDL_PeepEvents</TT
></A
> allow you to place events onto the event queue. This is usually used to place a <TT
CLASS="LITERAL"
>SDL_USEREVENT</TT
> on the event queue, however you could use it to post fake input events if you wished. Creating your own events is a simple matter of choosing the event type you want, setting the <TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
> member and filling the appropriate member structure with information.
<PRE
CLASS="PROGRAMLISTING"
>SDL_Event user_event;
user_event.type=SDL_USEREVENT;
user_event.user.code=2;
user_event.user.data1=NULL;
user_event.user.data2=NULL;
SDL_PushEvent(&#38;user_event);</PRE
></P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3942"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlpollevent.html"
><TT
CLASS="FUNCTION"
>SDL_PollEvent</TT
></A
>,
<A
HREF="sdlpushevent.html"
><TT
CLASS="FUNCTION"
>SDL_PushEvent</TT
></A
>,
<A
HREF="sdlpeepevents.html"
><TT
CLASS="FUNCTION"
>SDL_PeepEvents</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="eventstructures.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlactiveevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL Event Structures.</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="eventstructures.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_ActiveEvent</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,276 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_EventState</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Event Functions."
HREF="eventfunctions.html"><LINK
REL="PREVIOUS"
TITLE="SDL_GetEventFilter"
HREF="sdlgeteventfilter.html"><LINK
REL="NEXT"
TITLE="SDL_GetKeyState"
HREF="sdlgetkeystate.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlgeteventfilter.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlgetkeystate.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLEVENTSTATE"
></A
>SDL_EventState</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN5646"
></A
><H2
>Name</H2
>SDL_EventState&nbsp;--&nbsp;This function allows you to set the state of processing certain events.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN5649"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN5650"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>Uint8 <B
CLASS="FSFUNC"
>SDL_EventState</B
></CODE
>(Uint8 type, int state);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5656"
></A
><H2
>Description</H2
><P
>This function allows you to set the state of processing certain event <TT
CLASS="PARAMETER"
><I
>type</I
></TT
>'s.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>state</I
></TT
> is set to <TT
CLASS="LITERAL"
>SDL_IGNORE</TT
>,
that event <TT
CLASS="PARAMETER"
><I
>type</I
></TT
> will be automatically dropped from the event queue and will
not be filtered.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>state</I
></TT
> is set to <TT
CLASS="LITERAL"
>SDL_ENABLE</TT
>,
that event <TT
CLASS="PARAMETER"
><I
>type</I
></TT
> will be processed normally.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>state</I
></TT
> is set to <TT
CLASS="LITERAL"
>SDL_QUERY</TT
>,
<TT
CLASS="FUNCTION"
>SDL_EventState</TT
> will return the current processing
state of the specified event <TT
CLASS="PARAMETER"
><I
>type</I
></TT
>.</P
><P
>A list of event <TT
CLASS="PARAMETER"
><I
>type</I
></TT
>'s can be found in the <A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
> section.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN5677"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlgeteventfilter.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlgetkeystate.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_GetEventFilter</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="eventfunctions.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_GetKeyState</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,252 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_ExposeEvent</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SDL Event Structures."
HREF="eventstructures.html"><LINK
REL="PREVIOUS"
TITLE="SDL_ResizeEvent"
HREF="sdlresizeevent.html"><LINK
REL="NEXT"
TITLE="SDL_SysWMEvent"
HREF="sdlsyswmevent.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlresizeevent.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlsyswmevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLEXPOSEEVENT"
></A
>SDL_ExposeEvent</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN4503"
></A
><H2
>Name</H2
>SDL_ExposeEvent&nbsp;--&nbsp;Quit requested event</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4506"
></A
><H2
>Structure Definition</H2
><PRE
CLASS="PROGRAMLISTING"
>typedef struct{
Uint8 type
} SDL_ExposeEvent;</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4509"
></A
><H2
>Structure Data</H2
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN4511"
></A
><P
></P
><TABLE
BORDER="0"
CLASS="CALSTABLE"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="STRUCTFIELD"
><I
>type</I
></TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>SDL_VIDEOEXPOSE</TT
></TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4519"
></A
><H2
>Description</H2
><P
><SPAN
CLASS="STRUCTNAME"
>SDL_ExposeEvent</SPAN
> is a member of the <A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
> union and is used whan an event of type <TT
CLASS="LITERAL"
>SDL_VIDEOEXPOSE</TT
> is reported.</P
><P
>A VIDEOEXPOSE event is triggered when the screen has been modified
outside of the application, usually by the window manager and needs to
be redrawn.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4527"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlevent.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Event</SPAN
></A
>,
<A
HREF="sdlseteventfilter.html"
><TT
CLASS="FUNCTION"
>SDL_SetEventFilter</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlresizeevent.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlsyswmevent.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_ResizeEvent</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="eventstructures.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_SysWMEvent</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,291 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_FillRect</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_BlitSurface"
HREF="sdlblitsurface.html"><LINK
REL="NEXT"
TITLE="SDL_DisplayFormat"
HREF="sdldisplayformat.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlblitsurface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdldisplayformat.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLFILLRECT"
></A
>SDL_FillRect</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2351"
></A
><H2
>Name</H2
>SDL_FillRect&nbsp;--&nbsp;This function performs a fast fill of the given rectangle with some color</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2354"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2355"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_FillRect</B
></CODE
>(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2361"
></A
><H2
>Description</H2
><P
>This function performs a fast fill of the given rectangle with
<TT
CLASS="PARAMETER"
><I
>color</I
></TT
>. If <TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
>
is <TT
CLASS="LITERAL"
>NULL</TT
>, the whole surface will be filled with
<TT
CLASS="PARAMETER"
><I
>color</I
></TT
>.</P
><P
>The color should be a pixel of the format used by the surface, and
can be generated by the
<A
HREF="sdlmaprgb.html"
>SDL_MapRGB</A
> or <A
HREF="sdlmaprgba.html"
>SDL_MapRGBA</A
>
functions. If the color value contains an alpha value then the
destination is simply "filled" with that alpha information, no blending
takes place.</P
><P
>If there is a clip rectangle set on the destination (set via
<A
HREF="sdlsetcliprect.html"
>SDL_SetClipRect</A
>) then this
function will clip based on the intersection of the clip rectangle and
the <TT
CLASS="PARAMETER"
><I
>dstrect</I
></TT
> rectangle and the dstrect rectangle
will be modified to represent the area actually filled.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2374"
></A
><H2
>Return Value</H2
><P
>This function returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> on success, or
<SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> on error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2379"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlmaprgb.html"
><TT
CLASS="FUNCTION"
>SDL_MapRGB</TT
></A
>,
<A
HREF="sdlmaprgb.html"
><TT
CLASS="FUNCTION"
>SDL_MapRGBA</TT
></A
>,
<A
HREF="sdlblitsurface.html"
><TT
CLASS="FUNCTION"
>SDL_BlitSurface</TT
></A
>,
<A
HREF="sdlrect.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Rect</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlblitsurface.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdldisplayformat.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_BlitSurface</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_DisplayFormat</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,259 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_Flip</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_UpdateRects"
HREF="sdlupdaterects.html"><LINK
REL="NEXT"
TITLE="SDL_SetColors"
HREF="sdlsetcolors.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlupdaterects.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlsetcolors.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLFLIP"
></A
>SDL_Flip</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN1426"
></A
><H2
>Name</H2
>SDL_Flip&nbsp;--&nbsp;Swaps screen buffers</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN1429"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN1430"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="FSFUNC"
>SDL_Flip</B
></CODE
>(SDL_Surface *screen);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1436"
></A
><H2
>Description</H2
><P
>On hardware that supports double-buffering, this function sets up a flip
and returns. The hardware will wait for vertical retrace, and then swap
video buffers before the next video surface blit or lock will return.
On hardware that doesn't support double-buffering, this is equivalent
to calling <A
HREF="sdlupdaterect.html"
>SDL_UpdateRect</A
><TT
CLASS="PARAMETER"
><I
>(screen, 0, 0, 0, 0)</I
></TT
></P
><P
>The <TT
CLASS="LITERAL"
>SDL_DOUBLEBUF</TT
> flag must have been passed to
<A
HREF="sdlsetvideomode.html"
>SDL_SetVideoMode</A
>,
when
setting the video mode for this function to perform hardware flipping.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1444"
></A
><H2
>Return Value</H2
><P
>This function returns <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> if successful, or
<SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> if there was an error.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1449"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlsetvideomode.html"
><TT
CLASS="FUNCTION"
>SDL_SetVideoMode</TT
></A
>,
<A
HREF="sdlupdaterect.html"
><TT
CLASS="FUNCTION"
>SDL_UpdateRect</TT
></A
>,
<A
HREF="sdlsurface.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlupdaterects.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlsetcolors.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_UpdateRects</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_SetColors</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,209 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_FreeCursor</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CreateCursor"
HREF="sdlcreatecursor.html"><LINK
REL="NEXT"
TITLE="SDL_SetCursor"
HREF="sdlsetcursor.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcreatecursor.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlsetcursor.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLFREECURSOR"
></A
>SDL_FreeCursor</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2540"
></A
><H2
>Name</H2
>SDL_FreeCursor&nbsp;--&nbsp;Frees a cursor created with SDL_CreateCursor.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2543"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2544"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_FreeCursor</B
></CODE
>(SDL_Cursor *cursor);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2550"
></A
><H2
>Description</H2
><P
>Frees a <SPAN
CLASS="STRUCTNAME"
>SDL_Cursor</SPAN
> that was created using
<A
HREF="sdlcreatecursor.html"
>SDL_CreateCursor</A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2555"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatecursor.html"
>SDL_CreateCursor</A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcreatecursor.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlsetcursor.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CreateCursor</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_SetCursor</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,219 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_FreeSurface</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_CreateRGBSurfaceFrom"
HREF="sdlcreatergbsurfacefrom.html"><LINK
REL="NEXT"
TITLE="SDL_LockSurface"
HREF="sdllocksurface.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlcreatergbsurfacefrom.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdllocksurface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLFREESURFACE"
></A
>SDL_FreeSurface</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN1893"
></A
><H2
>Name</H2
>SDL_FreeSurface&nbsp;--&nbsp;Frees (deletes) a SDL_Surface</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN1896"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN1897"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_FreeSurface</B
></CODE
>(SDL_Surface *surface);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1903"
></A
><H2
>Description</H2
><P
>Frees the resources used by a previously created <SPAN
CLASS="STRUCTNAME"
>SDL_Surface</SPAN
>. If the surface was created using
<A
HREF="sdlcreatergbsurfacefrom.html"
>SDL_CreateRGBSurfaceFrom</A
> then the pixel data is not freed.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN1908"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlcreatergbsurface.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurface</TT
></A
>
<A
HREF="sdlcreatergbsurfacefrom.html"
><TT
CLASS="FUNCTION"
>SDL_CreateRGBSurfaceFrom</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlcreatergbsurfacefrom.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdllocksurface.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_CreateRGBSurfaceFrom</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_LockSurface</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,222 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_FreeWAV</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Audio"
HREF="audio.html"><LINK
REL="PREVIOUS"
TITLE="SDL_LoadWAV"
HREF="sdlloadwav.html"><LINK
REL="NEXT"
TITLE="SDL_AudioCVT"
HREF="sdlaudiocvt.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdlloadwav.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlaudiocvt.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLFREEWAV"
></A
>SDL_FreeWAV</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6857"
></A
><H2
>Name</H2
>SDL_FreeWAV&nbsp;--&nbsp;Frees previously opened WAV data</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN6860"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN6861"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_FreeWAV</B
></CODE
>(Uint8 *audio_buf);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6867"
></A
><H2
>Description</H2
><P
>After a WAVE file has been opened with <A
HREF="sdlloadwav.html"
><TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
></A
> its data can eventually be freed with <TT
CLASS="FUNCTION"
>SDL_FreeWAV</TT
>. <TT
CLASS="PARAMETER"
><I
>audio_buf</I
></TT
> is a pointer to the buffer created by <TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN6875"
></A
><H2
>See Also</H2
><P
><A
HREF="sdlloadwav.html"
><TT
CLASS="FUNCTION"
>SDL_LoadWAV</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdlloadwav.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlaudiocvt.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_LoadWAV</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="audio.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_AudioCVT</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

View file

@ -1,233 +0,0 @@
<HTML
><HEAD
><TITLE
>SDL_FreeYUVOverlay</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
REL="HOME"
TITLE="SDL Library Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Video"
HREF="video.html"><LINK
REL="PREVIOUS"
TITLE="SDL_DisplayYUVOverlay"
HREF="sdldisplayyuvoverlay.html"><LINK
REL="NEXT"
TITLE="SDL_GLattr"
HREF="sdlglattr.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sdldisplayyuvoverlay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sdlglattr.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SDLFREEYUVOVERLAY"
></A
>SDL_FreeYUVOverlay</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN2941"
></A
><H2
>Name</H2
>SDL_FreeYUVOverlay&nbsp;--&nbsp;Free a YUV video overlay</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN2944"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><A
NAME="AEN2945"
></A
><P
></P
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include "SDL.h"</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void <B
CLASS="FSFUNC"
>SDL_FreeYUVOverlay</B
></CODE
>(SDL_Overlay *overlay);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2951"
></A
><H2
>Description</H2
><P
>Frees and <A
HREF="sdloverlay.html"
><TT
CLASS="PARAMETER"
><I
>overlay</I
></TT
></A
> created by <A
HREF="sdlcreateyuvoverlay.html"
><TT
CLASS="FUNCTION"
>SDL_CreateYUVOverlay</TT
></A
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN2958"
></A
><H2
>See Also</H2
><P
><A
HREF="sdloverlay.html"
><SPAN
CLASS="STRUCTNAME"
>SDL_Overlay</SPAN
></A
>,
<A
HREF="sdldisplayyuvoverlay.html"
><TT
CLASS="FUNCTION"
>SDL_DisplayYUVOverlay</TT
></A
>,
<A
HREF="sdlcreateyuvoverlay.html"
><TT
CLASS="FUNCTION"
>SDL_FreeYUVOverlay</TT
></A
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sdldisplayyuvoverlay.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sdlglattr.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDL_DisplayYUVOverlay</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="video.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDL_GLattr</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

Some files were not shown because too many files have changed in this diff Show more