Initial revision
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401
This commit is contained in:
commit
2f110628a7
892 changed files with 170313 additions and 0 deletions
10
.cvsignore
Normal file
10
.cvsignore
Normal file
|
@ -0,0 +1,10 @@
|
|||
Makefile.in
|
||||
configure
|
||||
aclocal.m4
|
||||
config.log
|
||||
config.cache
|
||||
libtool
|
||||
config.status
|
||||
Makefile
|
||||
sdl-config
|
||||
SDL.spec
|
199
BUGS
Normal file
199
BUGS
Normal file
|
@ -0,0 +1,199 @@
|
|||
|
||||
All:
|
||||
Audio rate conversion is only implemented by multiplying or dividing
|
||||
by a power of two. This is a side-effect of the requirement that the
|
||||
raw audio buffer size be a power of two, and can hopefully be fixed.
|
||||
This means 8 KHz audio converted to 22 KHz ends up being 16 KHz. :-/
|
||||
|
||||
When the implementation is writing directly to video memory the mouse
|
||||
cursor doesn't work properly. Applications which do this should use
|
||||
their own mouse cursor and call SDL_ShowCursor(0) to hide the system
|
||||
cursor.
|
||||
|
||||
Linux:
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
The AAlib, GGI, and SVGAlib video drivers are not heavily tested.
|
||||
|
||||
Win32:
|
||||
The MCI driver can't tell if the CD-ROM drive is paused or stopped.
|
||||
|
||||
The SDL_INIT_EVENTTHREAD flag is not supported on Win32
|
||||
(Idea: create a separate DirectInput polling thread)
|
||||
The main purpose of this flag is for smooth cursor motion in
|
||||
fullscreen environments.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
This requires the ToUnicode() API which is only implemented on
|
||||
Windows NT/2000, not on Windows 95/98.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
Joysticks are only supported under the Win32 MultiMedia API,
|
||||
DirectInput support is not yet implemented.
|
||||
|
||||
BeOS:
|
||||
BePPC is not supported, apparently not even by Be Inc.
|
||||
|
||||
SDL_WM_GrabInput() is not implemented.
|
||||
Does anyone know how to do this? SDL_WM_GrabInput() is designed
|
||||
to prevent the user from switching input and mouse focus away from
|
||||
the SDL application.
|
||||
|
||||
Continuous relative mouse motion is not implemented.
|
||||
|
||||
The CD driver doesn't detect SCSI CD-ROMs yet.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) has not been tested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
MacOS:
|
||||
Palette handling isn't implemented in windowed mode yet.
|
||||
|
||||
Audio hasn't been extensively tested, in particular the locking
|
||||
isn't implemented and mixer routines may not call malloc() or free()
|
||||
because they are called at interrupt time.
|
||||
|
||||
SDL_WM_GrabInput() is not implemented.
|
||||
Does anyone know how to do this? SDL_WM_GrabInput() is designed
|
||||
to prevent the user from switching input and mouse focus away from
|
||||
the SDL application.
|
||||
|
||||
Continuous relative mouse motion is not implemented.
|
||||
|
||||
SDL_AddTimer() and SDL_RemoveTimer() haven't been implemented yet.
|
||||
|
||||
Not all of the keys are properly recognized on the keyboard.
|
||||
|
||||
MacOS X:
|
||||
Fullscreen mode doesn't work - it requires the QuickTime framework
|
||||
and that the new SDL window gets raised to the top of the Z order.
|
||||
|
||||
Palette handling isn't implemented in windowed mode yet.
|
||||
|
||||
Native sound and video routines are not finished, though Carbon
|
||||
seems to work fairly well.
|
||||
|
||||
Joysticks and CD-ROM functions are not implemented yet.
|
||||
|
||||
SDL_WM_GrabInput() is not implemented.
|
||||
Does anyone know how to do this? SDL_WM_GrabInput() is designed
|
||||
to prevent the user from switching input and mouse focus away from
|
||||
the SDL application.
|
||||
|
||||
Continuous relative mouse motion is not implemented.
|
||||
|
||||
Not all of the keys are properly recognized on the keyboard.
|
||||
|
||||
MacOS X seems to have a broken pthread_cancel() implementation.
|
||||
|
||||
FreeBSD:
|
||||
pthread_cancel() isn't supported by FreeBSD 3.X, so threads don't
|
||||
work on versions of FreeBSD earlier than 4.0.
|
||||
|
||||
The CD-ROM handling doesn't work completely.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
Solaris:
|
||||
The joystick functions are not implemented yet.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
IRIX:
|
||||
The CD-ROM handling doesn't work completely.
|
||||
|
||||
The joystick functions are not implemented yet.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
OpenBSD: -= NOT YET SUPPORTED =-
|
||||
This is reported to work, but I haven't verified this.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
OSF/Tru64: -= NOT YET SUPPORTED =-
|
||||
The audio functions are not implemented yet.
|
||||
|
||||
Joysticks and CD-ROM functions are not implemented yet.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
AIX: -= NOT YET SUPPORTED =-
|
||||
This port has only been tested with AIX 4.3.3
|
||||
|
||||
The OpenGL support doesn't work yet.
|
||||
|
||||
The joystick subsystem isn't implemented yet.
|
||||
|
||||
Endian detection doesn't work yet - needs a unique CPP symbol.
|
||||
|
||||
Wide UNICODE character input (Kanji, etc.) is not yet supported.
|
||||
It requires handling of keyboard mapping events and using the XIM
|
||||
input translation extension. I will implement it as requested.
|
||||
Latin-1 keyboard input works fine.
|
||||
|
||||
The AIX port was done by Carsten.Griwodz@KOM.tu-darmstadt.de
|
||||
More information on this port is available at:
|
||||
http://www.kom.e-technik.tu-darmstadt.de/~griff/SDL/
|
||||
|
||||
QNX: -= NOT YET SUPPORTED =-
|
||||
Configuration doesn't work right, Makefiles still need to be
|
||||
tweaked (need to add libraries to any apps that use sdl_config
|
||||
to figure out what libs they need).
|
||||
|
||||
Only static libraries are being made, no shared ones.
|
||||
|
||||
The only hardware surface is the primary view surface.
|
||||
|
||||
Mouse events don't seem to be working right.
|
||||
|
||||
Fullscreen doesn't display correctly.
|
||||
|
||||
The software surfaces could use some speed up.
|
||||
|
||||
Many of the test apps segment violate on exit, and I'm not sure
|
||||
they're all working either
|
||||
|
||||
It doesn't look like the OpenGL stuff is there. (did a grep for
|
||||
PdCreateOpenGLContext, nothing found).
|
||||
|
||||
The mouse cursor doesn't look right.
|
||||
|
||||
AmigaOS: -= NOT YET SUPPORTED =-
|
||||
The OpenGL support isn't implemented yet.
|
||||
|
||||
SDL_WM_GrabInput() is not implemented.
|
||||
Does anyone know how to do this? SDL_WM_GrabInput() is designed
|
||||
to prevent the user from switching input and mouse focus away from
|
||||
the SDL application.
|
||||
|
||||
Continuous relative mouse motion is not implemented.
|
||||
|
||||
Audio can work, but isn't completely integrated in the CVS
|
||||
version of SDL.
|
||||
|
||||
The joystick subsystem isn't implemented yet.
|
||||
|
||||
There's some confusion about the multi-threaded synchronization
|
||||
primitives on AmigaOS, so mutexes and semaphores aren't correctly
|
||||
implemented yet.
|
||||
|
||||
The AmigaOS port was done by Gabriele.Greco@galactica.it
|
437
COPYING
Normal file
437
COPYING
Normal file
|
@ -0,0 +1,437 @@
|
|||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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 library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
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 Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, 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 or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the 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 a program 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.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
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, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
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 compile 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) 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.
|
||||
|
||||
c) 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.
|
||||
|
||||
d) 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 source code 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 to
|
||||
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 Library 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
|
51
CREDITS
Normal file
51
CREDITS
Normal file
|
@ -0,0 +1,51 @@
|
|||
|
||||
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! :)
|
||||
|
||||
* Michael Samuel and Loki Entertainment Software, for the SDL mailing list
|
||||
|
||||
* Patrick Trainor and Jim Boucher, for the QNX Neutrino port
|
||||
|
||||
* Gabriele Greco, for the Amiga port
|
||||
|
||||
* Stan Shebs, for the initial MacOS X port
|
||||
|
||||
* Carsten Griwodz for the AIX port
|
||||
|
||||
* Mattias Engdegerd, for help with the Solaris port and lots of other code
|
||||
|
||||
* 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
|
||||
|
||||
* Max Watson, Matt Slot, and Kyle for help with the MacOS port
|
||||
|
||||
* 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
|
||||
|
||||
* Peter Wiklund, for the 1998 winning SDL logo,
|
||||
and Arto Hamara, Steven Wong, and Kent Mein for other logo entries.
|
||||
|
||||
* Stephane Peter, for the AAlib front-end and multi-threaded timer idea.
|
||||
|
||||
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>
|
||||
|
BIN
CWprojects.sea.bin
Normal file
BIN
CWprojects.sea.bin
Normal file
Binary file not shown.
22
INSTALL
Normal file
22
INSTALL
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
To compile and install SDL:
|
||||
|
||||
1. Run './configure; make; make install'
|
||||
|
||||
If you are cross-compiling from Linux to Win32, you should read
|
||||
the file README.Win32
|
||||
|
||||
If you are compiling using Visual C++ on Win32, you should read
|
||||
the file VisualC.html
|
||||
|
||||
2. Look at the example programs in ./test, and check out the HTML
|
||||
documentation in ./docs to see how to use the SDL library.
|
||||
|
||||
3. Join the SDL developer mailing list by sending E-mail to
|
||||
majordomo@lokigames.com
|
||||
and including the line "subscribe sdl" in the body.
|
||||
|
||||
|
||||
|
||||
That's it!
|
||||
Sam Lantinga <slouken@libsdl.org>
|
BIN
MPWmake.sea.bin
Normal file
BIN
MPWmake.sea.bin
Normal file
Binary file not shown.
85
Makefile.am
Normal file
85
Makefile.am
Normal file
|
@ -0,0 +1,85 @@
|
|||
# The top-level input Makefile for SDL
|
||||
|
||||
# require automake 1.4
|
||||
AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
## Any directories that you want built and installed should go here.
|
||||
SUBDIRS = src include docs
|
||||
|
||||
## Any directories you want a part of the distribution should be listed
|
||||
## here, as well as have a Makefile generated at the end of configure.in
|
||||
##
|
||||
## This only works for subdirectories one level deep.
|
||||
DIST_SUBDIRS = $(SUBDIRS) docs
|
||||
|
||||
# SDL runtime configuration script
|
||||
bin_SCRIPTS = sdl-config
|
||||
|
||||
# All the rest of the distributed files
|
||||
EXTRA_DIST = \
|
||||
BUGS \
|
||||
TODO \
|
||||
COPYING \
|
||||
CREDITS \
|
||||
INSTALL \
|
||||
README \
|
||||
README-SDL.txt \
|
||||
README.Win32 \
|
||||
README.WinCE \
|
||||
README.MacOS \
|
||||
README.MacOSX \
|
||||
VisualC.html \
|
||||
VisualC.zip \
|
||||
MPWmake.sea.bin \
|
||||
CWprojects.sea.bin \
|
||||
WhatsNew \
|
||||
docs.html \
|
||||
sdl.m4 \
|
||||
autogen.sh \
|
||||
strip_fPIC.sh
|
||||
|
||||
# M4 macro file for inclusion with autoconf
|
||||
m4datadir = $(datadir)/aclocal
|
||||
m4data_DATA = sdl.m4
|
||||
|
||||
# Rule to build tar-gzipped distribution package
|
||||
$(PACKAGE)-$(VERSION).tar.gz: dist
|
||||
|
||||
# Rule to build RPM distribution package
|
||||
rpm: $(PACKAGE)-$(VERSION).tar.gz
|
||||
cp $(PACKAGE)-$(VERSION).tar.gz /usr/src/redhat/SOURCES
|
||||
rpm -ba SDL.spec
|
||||
|
||||
# Rule to rebuild the export lists for BeOS, MacOS and Win32.
|
||||
exports:
|
||||
(cd src/main/beos/exports; $(MAKE))
|
||||
(cd src/main/macos/exports; $(MAKE))
|
||||
(cd src/main/win32/exports; $(MAKE))
|
||||
|
||||
# Rule to force automake to rebuild the library
|
||||
changed:
|
||||
@echo "This build target is no longer necessary"
|
||||
|
||||
# Rule to install the libraries only - prevent rebuilding apps
|
||||
install-lib:
|
||||
cd src && $(MAKE) install-libLTLIBRARIES
|
||||
|
||||
# Run ldconfig after installing the library:
|
||||
install-hook:
|
||||
-ldconfig
|
||||
|
||||
# Grab the test programs for the distribution:
|
||||
dist-hook:
|
||||
if test -f test/Makefile; then (cd test; make distclean); fi
|
||||
cp -rp test $(distdir)
|
||||
rm -rf `find $(distdir) -type d -name CVS -print`
|
||||
|
||||
# Create a CVS snapshot that people can run update -d on
|
||||
CVSROOT = :pserver:guest@cvs.lokigames.com:/cvs
|
||||
snapshot:
|
||||
cvs -d $(CVSROOT) login
|
||||
cvs -d $(CVSROOT) checkout -r devel_1_1_0 SDL
|
||||
(cd SDL && ./autogen.sh)
|
||||
mv SDL SDL-1.2
|
||||
tar zcvf $(HOME)/SDL-1.2.tar.gz SDL-1.2
|
||||
rm -rf SDL-1.2
|
44
README
Normal file
44
README
Normal file
|
@ -0,0 +1,44 @@
|
|||
|
||||
Simple DirectMedia Layer
|
||||
|
||||
(SDL)
|
||||
|
||||
Version 1.2
|
||||
|
||||
---
|
||||
http://www.libsdl.org/
|
||||
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
|
||||
and 2D framebuffer across multiple platforms.
|
||||
|
||||
SDL is written in C, but works with C++ natively, and has bindings to
|
||||
several other languages, including Ada, Eiffel, ML, Perl, and Python.
|
||||
|
||||
The current version supports Linux, Windows, BeOS, MacOS, MacOS X,
|
||||
FreeBSD, Solaris, and IRIX. The code contains support for Windows CE,
|
||||
OpenBSD, NetBSD, AIX, OSF/Tru64, and QNX, but these are not yet
|
||||
officially supported.
|
||||
|
||||
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"
|
||||
|
||||
The test programs in the "test" subdirectory are in the public domain.
|
||||
|
||||
Frequently asked questions are answered online:
|
||||
http://www.libsdl.org/faqs.html
|
||||
|
||||
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.html
|
||||
|
||||
Enjoy!
|
||||
Sam Lantinga (slouken@libsdl.org)
|
||||
|
13
README-SDL.txt
Normal file
13
README-SDL.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
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
|
||||
|
13
README.CVS
Normal file
13
README.CVS
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
The latest development version of SDL is available via CVS:
|
||||
|
||||
cvs -d :pserver:guest@cvs.lokigames.com:/cvs login
|
||||
# use the password "guest"
|
||||
cvs -d :pserver:guest@cvs.lokigames.com:/cvs checkout SDL
|
||||
|
||||
When you check a fresh copy of SDL out of CVS, you need to generate
|
||||
the files used by make by running the "autogen.sh" script, which will
|
||||
run aclocal, automake, autoconf and then run configure.
|
||||
|
||||
There is a web interface to cvs at http://cvs.lokigames.com/
|
||||
|
60
README.MacOS
Normal file
60
README.MacOS
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with MacOS 7,8,9 on PPC
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using the Apple MPW environment:
|
||||
http://developer.apple.com/tools/mpw-tools/
|
||||
|
||||
CodeWarrior projects are available in the CWprojects directory.
|
||||
|
||||
==============================================================================
|
||||
I. Building the Simple DirectMedia Layer libraries:
|
||||
(This step isn't necessary if you have the SDL binary distribution)
|
||||
|
||||
First, unpack the MPWmake.sea.hqx archive and move SDL.make into the
|
||||
SDL directory.
|
||||
|
||||
Start MPW
|
||||
|
||||
Set the current directory within MPW to the SDL toplevel directory.
|
||||
|
||||
Build "SDL" (Type Command-B and enter "SDL" in the dialog)
|
||||
|
||||
If everything compiles successfully, you now have the PPC libraries
|
||||
"SDL" and "SDLmain.o" in the 'lib' subdirectory.
|
||||
|
||||
==============================================================================
|
||||
II. Building the Simple DirectMedia Layer test programs:
|
||||
|
||||
First, unpack the MPWmake.sea.hqx archive, move the new rsrc directory to
|
||||
the main SDL directory, and move the makefiles in the new test subdirectory
|
||||
to the SDL 'test' subdirectory.
|
||||
|
||||
Start MPW
|
||||
|
||||
Set the current directory within MPW to the SDL 'test' subdirectory.
|
||||
|
||||
Build the programs that have an associated MPW makefile (file ending
|
||||
with .make), including "testwin", "testalpha", and "graywin".
|
||||
|
||||
Copy the SDL library file into the test directory, and run!
|
||||
|
||||
==============================================================================
|
||||
III. Building the Simple DirectMedia Layer demo programs:
|
||||
|
||||
Copy one of the test program Makefiles to the demo directory
|
||||
and modify it to match the sources in the demo.
|
||||
|
||||
==============================================================================
|
||||
IV. Enjoy! :)
|
||||
|
||||
If you have a project you'd like me to know about, or want to ask questions,
|
||||
go ahead and join the SDL developer's mailing list by sending e-mail to:
|
||||
|
||||
majordomo@lokigames.com
|
||||
|
||||
and put the line "subscribe sdl" in the body of the message.
|
||||
|
||||
==============================================================================
|
||||
|
44
README.MacOSX
Normal file
44
README.MacOSX
Normal file
|
@ -0,0 +1,44 @@
|
|||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Mac OS X
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using Apple's Mac OS X (pronounced
|
||||
"ten").
|
||||
|
||||
From the developer's point of view, OS X is a sort of hybrid Mac and
|
||||
Unix system, and you have the option of using either traditional
|
||||
command line tools or Apple's IDE ProjectBuilder (PB).
|
||||
|
||||
To build using the command line, use the standard configure and make
|
||||
process:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
(You may need to create the subdirs of /usr/local manually.)
|
||||
|
||||
For some reason, libtool doesn't run ranlib properly, so do this
|
||||
manually:
|
||||
|
||||
ranlib /usr/local/lib/libSDL.a
|
||||
|
||||
To use the library once it's built, you need to use the "Carbon
|
||||
framework", which is the port of the old Mac Toolbox to OS X.
|
||||
To do this, use the -F and -framework arguments for compiling
|
||||
and linking, respectively:
|
||||
|
||||
cc -c myprog.c -I/usr/local/include/SDL -F/System/Library/Frameworks/Carbon.framework
|
||||
cc myprog.o -L/usr/local/lib -lSDL -framework Carbon
|
||||
|
||||
sdl-config knows about the linking path and -framework, so it's
|
||||
recommended to use it to fill in your Makefile variables.
|
||||
|
||||
[Add instructions for how to build using PB]
|
||||
|
||||
As of this writing (Sep 2000), OS X is in public beta. This means
|
||||
that while most of the APIs are frozen, things are still subject to
|
||||
change, and many of the known problems will be resolved before the
|
||||
final release comes out.
|
||||
|
||||
Known bugs are listed in the file "BUGS"
|
53
README.Win32
Normal file
53
README.Win32
Normal file
|
@ -0,0 +1,53 @@
|
|||
|
||||
==============================================================================
|
||||
Using the Simple DirectMedia Layer with Windows 95,NT
|
||||
==============================================================================
|
||||
|
||||
These instructions are for people using the GNU free compilers.
|
||||
If you want to use Microsoft VC++ with SDL, read "VisualC.html"
|
||||
|
||||
==============================================================================
|
||||
I. Building the Simple DirectMedia Layer libraries:
|
||||
(This step isn't necessary if you have the SDL binary distribution)
|
||||
|
||||
First, get gcc compiler for Win32, which can be found at:
|
||||
http://www.libsdl.org/Xmingw32/index.html
|
||||
|
||||
Grab the cross configure and make scripts, and then run:
|
||||
sh cross-configure.sh
|
||||
sh cross-make.sh install
|
||||
If you have already built SDL natively, you must do "make distclean"
|
||||
before you build for Win32.
|
||||
|
||||
If everything compiles successfully, you now have SDL.dll and gcc archive
|
||||
libraries libSDLmain.a and libSDL.a installed in /usr/local/cross-tools/
|
||||
|
||||
==============================================================================
|
||||
II. Building the Simple DirectMedia Layer test programs:
|
||||
|
||||
This is easy once you have built the libraries:
|
||||
|
||||
cd test; sh ../cross-configure.sh; sh ../cross-make.sh
|
||||
|
||||
==============================================================================
|
||||
III. Building the Simple DirectMedia Layer demo programs:
|
||||
|
||||
Go to the directory containing the demo you want to build and type:
|
||||
|
||||
sh cross-configure.sh; sh cross-make.sh
|
||||
|
||||
Be sure to rename the demo to use the .exe extension, or Windows will
|
||||
not be able to execute it.
|
||||
|
||||
==============================================================================
|
||||
IV. Enjoy! :)
|
||||
|
||||
If you have a project you'd like me to know about, or want to ask questions,
|
||||
go ahead and join the SDL developer's mailing list by sending e-mail to:
|
||||
|
||||
majordomo@lokigames.com
|
||||
|
||||
and put the line "subscribe sdl" in the body of the message.
|
||||
|
||||
==============================================================================
|
||||
|
37
README.WinCE
Normal file
37
README.WinCE
Normal file
|
@ -0,0 +1,37 @@
|
|||
|
||||
NOTE:
|
||||
SDL is NOT SUPPORTED on the WinCE platform! This is for experimental
|
||||
purposes only.
|
||||
|
||||
There are several SDL features not available in the WinCE port of SDL.
|
||||
|
||||
- DirectX is not yet available
|
||||
- Semaphores are not available
|
||||
- Joystick support is not available
|
||||
- CD-ROM control is not available
|
||||
|
||||
In addition, there are several features that run in "degraded" mode:
|
||||
|
||||
Preprocessor Symbol Effect
|
||||
=================== =================================
|
||||
|
||||
SDL_systimer.c:
|
||||
USE_GETTICKCOUNT Less accurate values for SDL time functions
|
||||
USE_SETTIMER Use only a single marginally accurate timer
|
||||
|
||||
SDL_syswm.c:
|
||||
DISABLE_ICON_SUPPORT Can't set the runtime window icon
|
||||
|
||||
SDL_sysmouse.c:
|
||||
USE_STATIC_CURSOR Only the arrow cursor is available
|
||||
|
||||
SDL_sysevents.c:
|
||||
NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus
|
||||
|
||||
SDL_dibevents.c:
|
||||
NO_GETKEYBOARDSTATE Very limited keycode translation
|
||||
|
||||
SDL_dibvideo.c:
|
||||
NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp
|
||||
NO_CHANGEDISPLAYSETTINGS No fullscreen support
|
||||
NO_GAMMA_SUPPORT Gamma correction not available
|
90
SDL.spec.in
Normal file
90
SDL.spec.in
Normal file
|
@ -0,0 +1,90 @@
|
|||
%define name @PACKAGE@
|
||||
%define version @VERSION@
|
||||
%define release 1
|
||||
|
||||
Summary: Simple DirectMedia Layer
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
URL: http://www.libsdl.org/
|
||||
Copyright: LGPL
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: /var/tmp/%{name}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
|
||||
%description
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes and more to develop SDL applications.
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}
|
||||
|
||||
%description devel
|
||||
This is the Simple DirectMedia Layer, a generic API that provides low
|
||||
level access to audio, keyboard, mouse, and display framebuffer across
|
||||
multiple platforms.
|
||||
|
||||
This is the libraries, include files and other resources you can use
|
||||
to develop SDL applications.
|
||||
|
||||
|
||||
%prep
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-svga --disable-video-ggi --disable-video-aalib --disable-debug --enable-xfree86-glidehack
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install prefix=$RPM_BUILD_ROOT/%{prefix}
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc README-SDL.txt COPYING CREDITS BUGS
|
||||
%{prefix}/lib/lib*.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html
|
||||
%doc docs/index.html docs/html
|
||||
%{prefix}/bin/*-config
|
||||
%{prefix}/lib/lib*.a
|
||||
%{prefix}/lib/lib*.so
|
||||
%{prefix}/include/SDL/
|
||||
%{prefix}/man/man3/*
|
||||
%{prefix}/share/aclocal/*
|
||||
|
||||
%changelog
|
||||
* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
|
||||
- Re-integrated spec file into SDL distribution
|
||||
- 'name' and 'version' come from configure
|
||||
- Some of the documentation is devel specific
|
||||
- Removed SMP support from %build - it doesn't work with libtool anyway
|
||||
|
||||
* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
|
||||
- Hacked Mandrake sdl spec to build 1.1
|
||||
|
||||
* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Build Release
|
||||
|
||||
* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
|
||||
- Add symlink for libSDL-1.0.so.0 required by sdlbomber
|
||||
- Added docs
|
||||
|
||||
* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
|
||||
- v 1.0.0
|
||||
|
||||
* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
|
||||
- First spec file for Mandrake distribution.
|
||||
|
||||
# end of file
|
23
TODO
Normal file
23
TODO
Normal file
|
@ -0,0 +1,23 @@
|
|||
|
||||
TODO list for the 1.2 release:
|
||||
|
||||
* Use /etc/fb.modes, if available, like GGI does
|
||||
|
||||
Wish list for the 1.3 development branch:
|
||||
|
||||
* 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 MacOS 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
|
||||
* Use RDTSC for timer resolution on x86 hardware
|
||||
* Add audio input API
|
||||
|
||||
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.
|
235
VisualC.html
Normal file
235
VisualC.html
Normal file
|
@ -0,0 +1,235 @@
|
|||
<HTML>
|
||||
|
||||
|
||||
|
||||
<HEAD>
|
||||
|
||||
|
||||
|
||||
<TITLE> Using SDL with Microsoft Visual C++ 5 and 6 </TITLE>
|
||||
|
||||
|
||||
|
||||
</HEAD>
|
||||
|
||||
|
||||
|
||||
<BODY>
|
||||
|
||||
|
||||
|
||||
<H1> Using SDL with Microsoft Visual C++ 5 and 6 </H1>
|
||||
|
||||
<H3>
|
||||
by <A HREF="mailto:snowlion@sprynet.com"> Lion Kimbro </A>
|
||||
</H3>
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
You can either use the precompiled libraries from
|
||||
<A HREF="http://www.libsdl.org/download.html">
|
||||
the SDL Download web site </A>,
|
||||
or you can build SDL yourself.
|
||||
</p>
|
||||
|
||||
|
||||
<H3> Building SDL </H3>
|
||||
|
||||
<P>
|
||||
Unzip the <CODE>VisualC.zip</CODE> file into the directory
|
||||
that contains this file (<CODE>VisualC.html</CODE>).
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Be certain that you unzip <CODE> VisualC.zip </CODE>
|
||||
into <strong>this</strong> directory and not any other
|
||||
directory. If you are using WinZip, be careful to
|
||||
make sure that it extracts to <strong>this</strong>
|
||||
folder, because it's convenient feature of
|
||||
unzipping to a folder with the name of the
|
||||
file currently being unzipped will get you in
|
||||
trouble if you use it right now. And that's all
|
||||
I have to say about that.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Now that it's unzipped, go into the VisualC directory
|
||||
that is created, and double-click on the VC++
|
||||
workspace file "<CODE>SDL.dsw</CODE>".
|
||||
This should open up VisualC.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
You may be prompted at this point to upgrade the
|
||||
workspace, should you be using a more recent version
|
||||
of Visual C++. If so, allow the workspace to be
|
||||
upgraded.
|
||||
</P>
|
||||
|
||||
|
||||
<P>
|
||||
Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
This is done by right clicking on each project in turn
|
||||
(Projects are listed in the Workspace panel in the
|
||||
FileView tab), and selecting "Build".
|
||||
</P>
|
||||
|
||||
<P>
|
||||
You may get a few warnings, but you should not get
|
||||
any errors. You do have to have at least the DirectX
|
||||
5 SDK installed, however. (I believe...) The latest
|
||||
version of DirectX can be downloaded or purchased
|
||||
on a cheap CD (my recommendation) from
|
||||
<A HREF="http://www.microsoft.com"> Microsoft </A>.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Later, we will refer to the following .lib and .dll
|
||||
files that have just been generated:
|
||||
</P>
|
||||
|
||||
<list>
|
||||
<li> SDL.dll
|
||||
<li> SDL.lib
|
||||
<li> SDLmain.lib
|
||||
</list>
|
||||
|
||||
<P>
|
||||
Search for these using the Windows Find (Windows-F)
|
||||
utility, if you don't already know where they should be.
|
||||
For those of you with a clue, look inside the Debug
|
||||
or Release directories of the subdirectories of the
|
||||
VisualC folder. (It might be easier to just use
|
||||
Windows Find if this sounds confusing. And don't worry
|
||||
about needing a clue; we all need visits from the
|
||||
clue fairy frequently.)
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<H3> Creating a Project with SDL </H3>
|
||||
|
||||
<P>
|
||||
Create a project as a Win32 Application.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Create a C++ file for your project.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Set the C runtime to "Multi-threaded DLL" in the menu:
|
||||
<CODE> Project|Settings|C/C++ tab|Code Generation|Runtime Library </CODE>.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Add the SDL <CODE>include</CODE> directory to your list
|
||||
of includes in the menu:
|
||||
<CODE> Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The "include directory" I am referring to is the
|
||||
<CODE>include</CODE> folder within the main SDL
|
||||
directory (the one that this HTML file located
|
||||
within.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Now we're going to use the files that we had created
|
||||
earlier in the Build SDL step.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Copy the following files into your Project directory:
|
||||
</P>
|
||||
|
||||
<list>
|
||||
<li> SDL.dll </li>
|
||||
</list>
|
||||
|
||||
<P>
|
||||
Copy the following files into your Project directory,
|
||||
and <em>add them to your Project</em> as well:
|
||||
</P>
|
||||
|
||||
<list>
|
||||
<li> SDL.lib </li>
|
||||
<li> SDLmain.lib </li>
|
||||
</list>
|
||||
|
||||
<P>
|
||||
(To add them to your project, right click on your
|
||||
project, and select "Add files to project")
|
||||
</P>
|
||||
|
||||
<P>
|
||||
(I believe that it's not necessary to actually
|
||||
copy the .lib files into your directory; you only
|
||||
have to be certain that you add them to your Project.
|
||||
If someone is so inclined, correct this document, or
|
||||
<A HREF="mailto:snowlion@sprynet.com">
|
||||
e-mail me </A>,
|
||||
and I'll fix this document.)
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
<H3> SDL 101, First Day of Class </H3>
|
||||
|
||||
<P>
|
||||
Now create the basic body of your project.
|
||||
The body of your program should take the following form:
|
||||
|
||||
<CODE>
|
||||
<PRE>
|
||||
#include "SDL.h"
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
// Body of the program goes here.
|
||||
return 0;
|
||||
}
|
||||
</PRE>
|
||||
</CODE>
|
||||
</P>
|
||||
|
||||
<H3> That's it! </H3>
|
||||
|
||||
<P>
|
||||
I hope that this document has helped you get
|
||||
through the most difficult part of using the
|
||||
SDL: installing it. Suggestions for improvements
|
||||
to this document should be sent to the writers
|
||||
of this document.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
This document was originally called "VisualC.txt",
|
||||
and was written by
|
||||
<A HREF="mailto:slouken@libsdl.org">Sam Lantinga</A>.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Later, it was converted to HTML and expanded into
|
||||
the document that you see today by
|
||||
<A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
|
||||
</P>
|
||||
|
||||
|
||||
|
||||
</BODY>
|
||||
|
||||
|
||||
|
||||
</HTML>
|
||||
|
||||
|
BIN
VisualC.zip
Normal file
BIN
VisualC.zip
Normal file
Binary file not shown.
664
WhatsNew
Normal file
664
WhatsNew
Normal file
|
@ -0,0 +1,664 @@
|
|||
|
||||
This is a list of API changes in SDL's version history.
|
||||
|
||||
Version 1.0:
|
||||
|
||||
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
|
619
acinclude.m4
Normal file
619
acinclude.m4
Normal file
|
@ -0,0 +1,619 @@
|
|||
# Local macros for the SDL configure.in script
|
||||
|
||||
dnl Function to link an architecture specific file
|
||||
dnl LINK_ARCH_SRC(source_dir, arch, source_file)
|
||||
AC_DEFUN(COPY_ARCH_SRC,
|
||||
[
|
||||
echo "Copying $1/$2/$3 -> $1/$3"
|
||||
old="$srcdir/$1/$2/$3"
|
||||
new="$srcdir/$1/$3"
|
||||
cat >$new <<__EOF__
|
||||
/* WARNING: This file was automatically generated!
|
||||
* Original: $old
|
||||
*/
|
||||
__EOF__
|
||||
cat >>$new <$old
|
||||
])
|
||||
|
||||
#
|
||||
# --- esd.m4 ---
|
||||
#
|
||||
# Configure paths for ESD
|
||||
# Manish Singh 98-9-30
|
||||
# stolen back from Frank Belew
|
||||
# stolen from Manish Singh
|
||||
# Shamelessly stolen from Owen Taylor
|
||||
|
||||
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
|
||||
dnl
|
||||
AC_DEFUN(AM_PATH_ESD,
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the esd-config script
|
||||
dnl
|
||||
AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
|
||||
esd_prefix="$withval", esd_prefix="")
|
||||
AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
|
||||
esd_exec_prefix="$withval", esd_exec_prefix="")
|
||||
AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
|
||||
, enable_esdtest=yes)
|
||||
|
||||
if test x$esd_exec_prefix != x ; then
|
||||
esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
|
||||
if test x${ESD_CONFIG+set} != xset ; then
|
||||
ESD_CONFIG=$esd_exec_prefix/bin/esd-config
|
||||
fi
|
||||
fi
|
||||
if test x$esd_prefix != x ; then
|
||||
esd_args="$esd_args --prefix=$esd_prefix"
|
||||
if test x${ESD_CONFIG+set} != xset ; then
|
||||
ESD_CONFIG=$esd_prefix/bin/esd-config
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(ESD_CONFIG, esd-config, no)
|
||||
min_esd_version=ifelse([$1], ,0.2.7,$1)
|
||||
AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
|
||||
no_esd=""
|
||||
if test "$ESD_CONFIG" = "no" ; then
|
||||
no_esd=yes
|
||||
else
|
||||
ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
|
||||
ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
|
||||
|
||||
esd_major_version=`$ESD_CONFIG $esd_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
esd_minor_version=`$ESD_CONFIG $esd_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_esdtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $ESD_CFLAGS"
|
||||
LIBS="$LIBS $ESD_LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed ESD is sufficiently new. (Also sanity
|
||||
dnl checks the results of esd-config to some extent
|
||||
dnl
|
||||
rm -f conf.esdtest
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <esd.h>
|
||||
|
||||
char*
|
||||
my_strdup (char *str)
|
||||
{
|
||||
char *new_str;
|
||||
|
||||
if (str)
|
||||
{
|
||||
new_str = malloc ((strlen (str) + 1) * sizeof(char));
|
||||
strcpy (new_str, str);
|
||||
}
|
||||
else
|
||||
new_str = NULL;
|
||||
|
||||
return new_str;
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.esdtest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = my_strdup("$min_esd_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_esd_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (($esd_major_version > major) ||
|
||||
(($esd_major_version == major) && ($esd_minor_version > minor)) ||
|
||||
(($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
|
||||
printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
|
||||
printf("*** best to upgrade to the required version.\n");
|
||||
printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
|
||||
printf("*** to point to the correct copy of esd-config, and remove the file\n");
|
||||
printf("*** config.cache before re-running configure\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_esd" = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$ESD_CONFIG" = "no" ; then
|
||||
echo "*** The esd-config script installed by ESD could not be found"
|
||||
echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the ESD_CONFIG environment variable to the"
|
||||
echo "*** full path to esd-config."
|
||||
else
|
||||
if test -f conf.esdtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run ESD test program, checking why..."
|
||||
CFLAGS="$CFLAGS $ESD_CFLAGS"
|
||||
LIBS="$LIBS $ESD_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <esd.h>
|
||||
], [ return 0; ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding ESD or finding the wrong"
|
||||
echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means ESD was incorrectly installed"
|
||||
echo "*** or that you have moved ESD since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
ESD_CFLAGS=""
|
||||
ESD_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(ESD_CFLAGS)
|
||||
AC_SUBST(ESD_LIBS)
|
||||
rm -f conf.esdtest
|
||||
])
|
||||
|
||||
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
|
||||
## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
|
||||
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful, but
|
||||
## WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## As a special exception to the GNU General Public License, if you
|
||||
## distribute this file as part of a program that contains a
|
||||
## configuration script generated by Autoconf, you may include it under
|
||||
## the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# serial 40 AC_PROG_LIBTOOL
|
||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
||||
|
||||
# Save cache, so that ltconfig can load it
|
||||
AC_CACHE_SAVE
|
||||
|
||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|
||||
|| AC_MSG_ERROR([libtool configure failed])
|
||||
|
||||
# Reload cache, that may have been modified by ltconfig
|
||||
AC_CACHE_LOAD
|
||||
|
||||
# This can be used to rebuild libtool when needed
|
||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
||||
|
||||
# Always use our own libtool.
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
# Redirect the config.log output again, so that the ltconfig log is not
|
||||
# clobbered by the next message.
|
||||
exec 5>>./config.log
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
||||
[AC_PREREQ(2.13)dnl
|
||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
case "$target" in
|
||||
NONE) lt_target="$host" ;;
|
||||
*) lt_target="$target" ;;
|
||||
esac
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
libtool_flags="--cache-file=$cache_file"
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
case "$lt_target" in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
case "`/usr/bin/file conftest.o`" in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -32"
|
||||
;;
|
||||
*N32*)
|
||||
LD="${LD-ld} -n32"
|
||||
;;
|
||||
*64-bit*)
|
||||
LD="${LD-ld} -64"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
*-*-sco3.2v5*)
|
||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
;;
|
||||
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[*-*-cygwin* | *-*-mingw*)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(shared,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_SHARED(no)])
|
||||
|
||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(static,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_STATIC(no)])
|
||||
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
||||
# `yes'.
|
||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
||||
AC_ARG_ENABLE(fast-install,
|
||||
changequote(<<, >>)dnl
|
||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[p=${PACKAGE-default}
|
||||
case "$enableval" in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
||||
for pkg in $enableval; do
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
||||
])
|
||||
|
||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_ENABLE_FAST_INSTALL(no)])
|
||||
|
||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
||||
AC_DEFUN(AC_PROG_LD,
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
||||
ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
ac_prog=`($CC -print-prog-name=ld | tr -d '\r') 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
changequote(,)dnl
|
||||
[\\/]* | [A-Za-z]:[\\/]*)
|
||||
re_direlt='/[^/][^/]*/\.\./'
|
||||
changequote([,])dnl
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(ac_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
test "$with_gnu_ld" != no && break
|
||||
else
|
||||
test "$with_gnu_ld" != yes && break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$ac_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_PROG_LD_GNU
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_PROG_LD_GNU,
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
||||
ac_cv_prog_gnu_ld=yes
|
||||
else
|
||||
ac_cv_prog_gnu_ld=no
|
||||
fi])
|
||||
])
|
||||
|
||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
||||
AC_DEFUN(AC_PROG_NM,
|
||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
||||
AC_CACHE_VAL(ac_cv_path_NM,
|
||||
[if test -n "$NM"; then
|
||||
# Let the user override the test.
|
||||
ac_cv_path_NM="$NM"
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
ac_cv_path_NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
||||
fi])
|
||||
NM="$ac_cv_path_NM"
|
||||
AC_MSG_RESULT([$NM])
|
||||
])
|
||||
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
LIBM=
|
||||
case "$lt_target" in
|
||||
*-*-beos* | *-*-cygwin*)
|
||||
# These system don't have libm
|
||||
;;
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl convenience library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-convenience to the
|
||||
# configure arguments. Note that LIBLTDL and INCLTDL are not
|
||||
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
||||
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
||||
# with '${top_builddir}/' and INCLTDL will be prefixed with
|
||||
# '${top_srcdir}/' (note the single quotes!). If your package is not
|
||||
# flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
case "$enable_ltdl_convenience" in
|
||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
||||
"") enable_ltdl_convenience=yes
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
# the libltdl installable library and INCLTDL to the include flags for
|
||||
# the libltdl header and adds --enable-ltdl-install to the configure
|
||||
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
||||
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
||||
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
||||
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
||||
# with '${top_srcdir}/' (note the single quotes!). If your package is
|
||||
# not flat and you're not using automake, define top_builddir and
|
||||
# top_srcdir appropriately in the Makefiles.
|
||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
AC_CHECK_LIB(ltdl, main,
|
||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
||||
[if test x"$enable_ltdl_install" = xno; then
|
||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
||||
else
|
||||
enable_ltdl_install=yes
|
||||
fi
|
||||
])
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
INCLTDL=
|
||||
fi
|
||||
])
|
||||
|
||||
dnl old names
|
||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
|
||||
dnl This is just to silence aclocal about the macro not being used
|
||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
18
autogen.sh
Executable file
18
autogen.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
echo "Generating build information using aclocal, automake and autoconf"
|
||||
echo "This may take a while ..."
|
||||
|
||||
# Touch the timestamps on all the files since CVS messes them up
|
||||
directory=`dirname $0`
|
||||
touch $directory/configure.in
|
||||
|
||||
# Regenerate configuration files
|
||||
aclocal
|
||||
automake --foreign --include-deps
|
||||
autoconf
|
||||
(cd test; aclocal; automake --foreign --include-deps; autoconf)
|
||||
|
||||
# Run configure for this platform
|
||||
#./configure $*
|
||||
echo "Now you are ready to run ./configure"
|
1368
config.guess
vendored
Executable file
1368
config.guess
vendored
Executable file
File diff suppressed because it is too large
Load diff
1357
config.sub
vendored
Executable file
1357
config.sub
vendored
Executable file
File diff suppressed because it is too large
Load diff
1891
configure.in
Normal file
1891
configure.in
Normal file
File diff suppressed because it is too large
Load diff
498
docs.html
Normal file
498
docs.html
Normal file
|
@ -0,0 +1,498 @@
|
|||
<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 in development. It may contain API changes, and may not be
|
||||
fully tested on all supported platforms. The current stable release may
|
||||
be found at the <A HREF="http://www.libsdl.org/"> main SDL page</A>.
|
||||
<P>
|
||||
|
||||
<H2> <A HREF="docs/index.html">API Documentation</A> </H2>
|
||||
<P>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 1.0.0:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> 1.2.0: Added initial support for HP-UX (thanks Stephanie)
|
||||
<LI> 1.2.0: Added initial support for BSDI (thanks Kurt)
|
||||
<LI> 1.2.0: Fixed blitting 32-bit ARGB images to SDL_OPENGLBLIT screens
|
||||
<LI> 1.2.0: Fixed automake build dependencies (thanks Markus!)
|
||||
<LI> 1.2.0: Added 24 bpp support to software YUV display functions
|
||||
<LI> 1.2.0: Don't bomb trying to get DGA mouse on XFree86 4.0
|
||||
<LI> 1.2.0: Added initial support for OSF/Tru64 (thanks Anders)
|
||||
<LI> 1.1.8: Fixed joystick hat motion on MacOS
|
||||
<LI> 1.1.8: Don't detect mouse and keyboard as joystick on MacOS
|
||||
<LI> 1.1.8: Check for OpenGL 1.2 before using 16-bit SDL_OPENGLBLIT
|
||||
<LI> 1.1.8: Added support for /dev/sound/* in Linux 2.4
|
||||
<LI> 1.1.8: Fixed crash when blitting to RLE encoded surfaces
|
||||
<LI> 1.1.8: Fixed 8-bit audio on MacOS X
|
||||
<LI> 1.1.8: Fixed keyboard handling on MacOS X and MacOS classic
|
||||
<LI> 1.1.8: Fixed mouse cursor visibility when switching apps on MacOS
|
||||
<LI> 1.1.8: Implemented semaphore support on MacOS X
|
||||
<LI> 1.1.8: Worked around broken sem_getvalue() on MacOS X
|
||||
<LI> 1.1.8: Fixed 16-bit big-endian audio on MacOS X and MacOS classic
|
||||
<LI> 1.1.8: Fixed mutex locking on Linux glibc 2.0
|
||||
<LI> 1.1.8: SDL_Quit() removes the parachute signal handlers
|
||||
<LI> 1.1.8: Added NAS audio server support (thanks Erik!)
|
||||
<LI> 1.1.8: Added SDL_NOFRAME for frameless windows (thanks Andreas)
|
||||
<LI> 1.1.8: Added support for resizable windows on MacOS
|
||||
<LI> 1.1.8: Added a function to query the surface clip rectangle
|
||||
<LI> 1.1.8: Added a function to query the current event filter
|
||||
<LI> 1.1.8: The X11 XVideo adapter is now locked (thanks Jeffrey)
|
||||
<LI> 1.1.8: Improved the speed of fullscreen OpenGL on Windows
|
||||
<LI> 1.1.8: Added ELO touchscreen support for fbcon (thanks Alex)
|
||||
<LI> 1.1.8: Added accelerated MacOS X OpenGL support
|
||||
<LI> 1.1.8: Surface lock and unlock operations can now be nested
|
||||
<LI> 1.1.8: Optimized fillrect for PPC video memory (thanks Mattias)
|
||||
<LI> 1.1.8: Work around "blackout" problem with XVideo acceleration
|
||||
<LI> 1.1.8: Obtain correct key state on X11 focus (thanks Mattias)
|
||||
<LI> 1.1.8: Fixed keyboard handling on the framebuffer console
|
||||
<LI> 1.1.8: Added basic support for VGA16 framebuffer console
|
||||
<LI> 1.1.8: Open a new virtual terminal if possible on fbcon
|
||||
<LI> 1.1.8: Fixed default audio driver on FreeBSD (thanks Maxim)
|
||||
<LI> 1.1.8: Fixed joystick crash on Windows (thanks Pete)
|
||||
<LI> 1.1.7: Expanded documentation from the SDL Documentation Project
|
||||
<LI> 1.1.7: Report X11 client message events if SYSWMEVENTS enabled
|
||||
<LI> 1.1.7: Added support for a single hat on Windows joysticks
|
||||
<LI> 1.1.7: The gamma ramp routines now take arrays of Uint16 values
|
||||
<LI> 1.1.7: Added initial support for QNX RTP (thanks Patrick)
|
||||
<LI> 1.1.7: Added ALSA sound driver (thanks Patrick Trainor)
|
||||
<LI> 1.1.7: Added aRts UNIX sound driver (thanks Neil Stevens)
|
||||
<LI> 1.1.7: Get keyboard modifier state on input focus on Win32
|
||||
<LI> 1.1.7: SDL_ConvertSurface() now accepts SDL_RLEACCEL as a flag
|
||||
<LI> 1.1.7: Added initial UnixWare 7 support (thanks rr)
|
||||
<LI> 1.1.7: Added working YUY -> RGB conversion code (thanks Eugene)
|
||||
<LI> 1.1.7: Fixed video initialization crash on IRIX
|
||||
<LI> 1.1.7: Fixed MacOS fullscreen palette code (thanks Darrell)
|
||||
<LI> 1.1.7: Fixed background brush flicker on Win32 (thanks Gautier)
|
||||
<LI> 1.1.7: Fixed incorrect pitch when switching to window on Win32
|
||||
<LI> 1.1.7: Fixed memory leak when switching video modes on Win32
|
||||
<LI> 1.1.7: Init of fbcon shouldn't automatically set graphics mode
|
||||
<LI> 1.1.6: Allow SDL_VIDEO_INIT when built without thread support
|
||||
<LI> 1.1.6: Fixed palette problems with non-X11 fullscreen displays
|
||||
<LI> 1.1.6: Fixed Win32 crash with SDL_OPENGLBLIT and GL functions
|
||||
<LI> 1.1.6: Improved default MacOS millisecond time resolution
|
||||
<LI> 1.1.6: Fixed X11 overlapping endian blit bug (thanks Mattias)
|
||||
<LI> 1.1.6: Fixed starting directory on BeOS (thanks Samuel)
|
||||
<LI> 1.1.6: Integrated FreeBSD SVGAlib support (thanks folks)
|
||||
<LI> 1.1.6: Fixed middle-button handling on DirectInput
|
||||
<LI> 1.1.6: Added SDL_GetThreadID() to get a specific thread's ID
|
||||
<LI> 1.1.6: Worked around a crash in pthreads on RedHat 7
|
||||
<LI> 1.1.6: Fixed a brown-bag crash in clipping code
|
||||
<LI> 1.1.5: Convert from '/' to ':' opening files on MacOS
|
||||
<LI> 1.1.5: Clean up empty output files on Win32 and MacOS
|
||||
<LI> 1.1.5: Run command dialog if command key on startup on MacOS
|
||||
<LI> 1.1.5: Initial NetBSD support (thanks Krister Walfridsson)
|
||||
<LI> 1.1.5: Expanded the YUV overlay to handle odd (ATI) hardware
|
||||
<LI> 1.1.5: Fixed MacOS GL attribute selection (thanks Darrell)
|
||||
<LI> 1.1.5: Implemented gamma correction on 8-bit hardware displays
|
||||
<LI> 1.1.5: Performed logical/physical palette split (thanks Mattias)
|
||||
<LI> 1.1.5: Added initial MacOS X support (thanks Stan)
|
||||
<LI> 1.1.5: SDL_WarpMouse() now works on BeOS (thanks Christian)
|
||||
<LI> 1.1.5: Windows GDI driver now supports 565 modes (thanks Ben)
|
||||
<LI> 1.1.5: Correctly load OpenGL extensions on Win32 (thanks Beosil)
|
||||
<LI> 1.1.5: Fixed crash with some threaded audio drivers
|
||||
<LI> 1.1.5: Audio is now closed in SDL_Quit(), if necessary
|
||||
<LI> 1.1.5: Win32 version now uses MSVC multi-threaded DLL runtime
|
||||
<LI> 1.1.5: Replaced useless SDL_SetClipping() with SDL_SetClipRect()
|
||||
<LI> 1.1.5: Added a flag to YUV overlays to show hardware support
|
||||
<LI> 1.1.5: Added SDL_WasInit() to see what is currently initialized
|
||||
<LI> 1.1.5: YUV overlays can now be accelerated with DirectX
|
||||
<LI> 1.1.5: YUV overlays now have working pitch (thanks Vivien)
|
||||
<LI> 1.1.5: Prompt the user if MacOS mode change may damage hardware
|
||||
<LI> 1.1.5: Fixed DrawSprocket video mode lists and mode changes
|
||||
<LI> 1.1.5: Added DrawSprocket acceleration of colorkey blits
|
||||
<LI> 1.1.5: MacOS event handling is much more responsive by default
|
||||
<LI> 1.1.5: MacOS modifier keys now generate key events
|
||||
<LI> 1.1.5: Mattias Engdegård did the "Great Alpha Flip"
|
||||
<LI> 1.1.5: Added SDL_DisplayFormatAlpha() for fast alpha blits
|
||||
<LI> 1.1.5: Added SDL_MapRGBA() and SDL_GetRGBA() to handle alpha
|
||||
<LI> 1.1.5: SDL_SetAlpha() now accepts the SDL_RLEACCEL flag
|
||||
<LI> 1.1.5: Blit semantics involving alpha are now well defined
|
||||
<LI> 1.1.5: Added support for X11 DirectColor visuals for gamma API
|
||||
<LI> 1.1.5: Added initial AmigaOS support (thanks Gabriele Greco)
|
||||
<LI> 1.1.5: Added an initial gamma correction API (thanks Daniel)
|
||||
<LI> 1.1.5: Disable DGA mouse while X11 application is iconified
|
||||
<LI> 1.1.5: Allow 16-bit audio on Solaris (thanks Mattias)
|
||||
<LI> 1.1.5: Added RLE acceleration of alpha blits (thanks Mattias)
|
||||
<LI> 1.1.5: New documentation from the SDL Documentation Project
|
||||
<LI> 1.1.4: Work around window resize bug in KDE 1.2
|
||||
<LI> 1.1.4: Command-click is interpreted as right click on MacOS
|
||||
<LI> 1.1.4: Removed ESounD detection on Solaris
|
||||
<LI> 1.1.4: Updated to libtool 1.3.5 and latest config.guess
|
||||
<LI> 1.1.4: testgl now works on 8-bit displays under X11
|
||||
<LI> 1.1.4: SDL_WINDOWID hack now works with OpenGL on Linux
|
||||
<LI> 1.1.4: Builds correctly on UNIX without X11 installed
|
||||
<LI> 1.1.4: Fixed default GL driver loading on Win32
|
||||
<LI> 1.1.4: Implemented fullscreen toggle on BeOS (thanks David)
|
||||
<LI> 1.1.4: No longer use DirectDraw with OpenGL modes on Win32
|
||||
<LI> 1.1.4: Added support for 320x200x8 in SVGAlib (thanks Michele)
|
||||
<LI> 1.1.4: Implemented resizable windows on BeOS (thanks David)
|
||||
<LI> 1.1.4: RLE colorkey encoding reduces memory use (thanks Mattias)
|
||||
<LI> 1.1.4: The CD track length variable is now 32-bits (thanks Martin)
|
||||
<LI> 1.1.4: Fixed crashing bug in Win32 semaphores (thanks Markus)
|
||||
<LI> 1.1.4: Disabled aggresive gcc optimizations on X86
|
||||
<LI> 1.1.4: Added support for blitting with GL (thanks Daniel Vogel)
|
||||
<LI> 1.1.4: Improved the speed of the 16-bit colorkey copy blit
|
||||
<LI> 1.1.4: Fixed pthread condition variable timeout
|
||||
<LI> 1.1.3: Use timeGetTime() instead of GetTickCount() on Win32
|
||||
<LI> 1.1.3: Release mouse when popped out of fullscreen on X11
|
||||
<LI> 1.1.3: IRIX 6.5 and FreeBSD 4.0 are now officially supported
|
||||
<LI> 1.1.3: Added optimization flags when compiling on x86 with gcc
|
||||
<LI> 1.1.3: On BeOS, change to app directory when launched by Tracker
|
||||
<LI> 1.1.3: Hold the option key on launch to get dialog on MacOS
|
||||
<LI> 1.1.3: Added DrawSprockets on MacOS (thanks Darrell Walisser)
|
||||
<LI> 1.1.3: Added support for Linux 2.4 input interface (HID)
|
||||
<LI> 1.1.3: Fixed 24-bpp blits on big-endian systems (thanks Mattias)
|
||||
<LI> 1.1.3: Don't try to use DGA mouse support on XFree86 4.00
|
||||
<LI> 1.1.3: Don't create an X11 shared memory buffer for GL displays
|
||||
<LI> 1.1.3: Framebuffer console acceleration disabled (broken) on G200
|
||||
<LI> 1.1.3: Allow maximize on resizable Win32 surfaces (thanks Randi)
|
||||
<LI> 1.1.3: Much faster RLE colorkey blit (thanks Xark and Mattias)
|
||||
<LI> 1.1.3: Fixed some problems with iconification and focus in X11
|
||||
<LI> 1.1.3: Added IMPS/2 protocol support for framebuffer console
|
||||
<LI> 1.1.3: Added user-resizable video mode support
|
||||
<LI> 1.1.3: Added arbitrary scaling of YUV overlay surfaces
|
||||
<LI> 1.1.3: Added support for semaphores and condition variables
|
||||
<LI> 1.1.3: Added SDL_ASYNCBLIT flag for asynchronous video updates
|
||||
<LI> 1.1.3: Don't let the WM place window in X11 fullscreen mode
|
||||
<LI> 1.1.3: Unload GL library after X11 display has closed
|
||||
<LI> 1.1.3: Fixed X11 error when a clipped rectangle is updated
|
||||
<LI> 1.1.3: Fixed crash when surface memory can't be allocated
|
||||
<LI> 1.1.3: Added a check for DirectX 5 audio (thanks Markus)
|
||||
<LI> 1.1.3: Added inline MMX assembly for YUV -> RGB conversion
|
||||
<LI> 1.1.3: Fixed startup crash in X11_RefreshDisplay()
|
||||
<LI> 1.1.3: SDL_Init(SDL_INIT_AUDIO) no longer fails with no soundcard
|
||||
<LI> 1.1.3: Initial YUV video overlay support (supports XvImages)
|
||||
<LI> 1.1.3: Fixed BadMatch X11 error with GLX 1.3
|
||||
<LI> 1.1.3: Worked around incompatibilities with XFree86 4.0 vidmode
|
||||
<LI> 1.1.3: The audio Makefile no longer takes forever to create
|
||||
<LI> 1.1.3: The joystick hat positions changed to constants
|
||||
<LI> 1.1.3: Fixed overlapping copy blit with odd widths
|
||||
<LI> 1.1.3: Fix for SDL_WINDOWID crash contributed by Mattias
|
||||
<LI> 1.1.3: Speeded up 32-bit alpha channel blits by nearly 100%
|
||||
<LI> 1.1.3: Added experimental DGA 2.0 support (set SDL_VIDEODRIVER)
|
||||
<LI> 1.1.2: Fixed crash running on NT with a read-only filesystem
|
||||
<LI> 1.1.2: Re-use thread creation mutex on glibc-2.0 systems
|
||||
<LI> 1.1.2: SDL_WM_SetIcon() now uses icon colorkey if mask is NULL
|
||||
<LI> 1.1.2: Win32 relative mouse mode fixes (thanks Randi Relander)
|
||||
<LI> 1.1.2: Not being able to set audio frags is no longer fatal
|
||||
<LI> 1.1.2: Added support for multiple timers (thanks Stephane Peter)
|
||||
<LI> 1.1.2: Copy blits optimized using inline assembly on x86 Linux
|
||||
<LI> 1.1.2: Copy blit can now handle overlapping blits
|
||||
<LI> 1.1.2: Fixed GL direct rendering on Utah GLX (thanks John Fulmer)
|
||||
<LI> 1.1.2: Added unofficial support for AIX (thanks Carsten Griwodz)
|
||||
<LI> 1.1.2: Enabled X11 VidMode extension on remote displays
|
||||
<LI> 1.1.2: Load libGL.so.1 under X11 if an app isn't linked with GL
|
||||
<LI> 1.1.2: Don't restack windows in the X11 environment
|
||||
<LI> 1.1.2: Multiple X11 visual support (thanks Mattias Engdegård)
|
||||
<LI> 1.1.0: Internal event state is updated before filter is called
|
||||
<LI> 1.1.0: Worked around DGA mouse cursor bug in Voodoo X server
|
||||
<LI> 1.1.0: Added SDL OpenGL documentation (thanks Nicholas Vining)
|
||||
<LI> 1.1.0: Added AAlib video driver support (thanks Stephane Peter)
|
||||
<LI> 1.1.0: Added fullscreen support for Win32 GDI video driver
|
||||
<LI> 1.1.0: Added SDL_GetAudioState() to get current audio status
|
||||
<LI> 1.1.0: Added SDL_GetRelativeMouseState() to get relative motion
|
||||
<LI> 1.1.0: Added 32-bit PII MMX optimized blitters from Hermes
|
||||
<LI> 1.1.0: Added SDL_bool datatype for functions returning true/false
|
||||
<LI> 1.1.0: Improved alpha blend speed (thanks Alexandre Courbot)
|
||||
<LI> 1.1.0: Added function to queue events: SDL_PushEvent()
|
||||
<LI> 1.1.0: Added user-defined event type to SDL_Event structure
|
||||
<LI> 1.1.0: Added SDL_InitSubSystem() and SDL_QuitSubSystem()
|
||||
<LI> 1.1.0: Added BDirectWindow fullscreen support on BeOS
|
||||
<LI> 1.1.0: Added initial joystick support (Linux, Win32, BeOS, MacOS)
|
||||
<LI> 1.1.0: The timer now runs in a separate thread if possible
|
||||
<LI> 1.1.0: Added initial OpenGL support (Linux, Win32, BeOS, MacOS)
|
||||
<LI> 1.0.9: Avoid potential crash in Win32 mouse handling (thanks Cliff)
|
||||
<LI> 1.0.9: Fixed bug where /dev/dsp was incorrectly marked available
|
||||
<LI> 1.0.9: Fixed DirectX crash if video height is larger than width
|
||||
<LI> 1.0.9: Fixed win32 timer error message typo (thanks Martin Dvorak)
|
||||
<LI> 1.0.8: Fixed deadlock if SDL_LockAudio() called from audio thread
|
||||
<LI> 1.0.8: Fixed a race condition in thread creation
|
||||
<LI> 1.0.7: Added detection for Linux supermount CD-ROM drives
|
||||
<LI> 1.0.6: Added --static-libs option to sdl-config
|
||||
<LI> 1.0.6: Fixed a clipping bug in the RLE colorkey blitting
|
||||
<LI> 1.0.6: Mouse window manager routines implemented on MacOS
|
||||
<LI> 1.0.6: Fixed SDL_HWPALETTE in fullscreen X11 video driver
|
||||
<LI> 1.0.6: Improved relative mouse warping in X11 video driver
|
||||
<LI> 1.0.6: DGA mouse mode is now enabled by SDL_VIDEO_X11_DGAMOUSE
|
||||
<LI> 1.0.6: Grab input by default in fullscreen mode
|
||||
<LI> 1.0.6: Detect hanging (incorrectly configured) Linux soundcard
|
||||
<LI> 1.0.6: If ESPEAKER env variable is set, use ESD audio driver
|
||||
<LI> 1.0.5: Fixed audio structure alignment for packing compilers
|
||||
<LI> 1.0.5: Exposed SDL_AudioInit() and SDL_VideoInit()
|
||||
<LI> 1.0.5: Added SDL_WM_ToggleFullScreen(), implemented for X11
|
||||
<LI> 1.0.5: Removed ALT-Enter functionality - should be in apps
|
||||
<LI> 1.0.5: The DSP audio driver is used by default on Linux
|
||||
<LI> 1.0.4: Added optional DMA support for the Linux audio driver
|
||||
<LI> 1.0.4: Fixed CD-ROM opening on the iBook under MacOS
|
||||
<LI> 1.0.4: Fixed a crash in 8-bit mode when using X11 video
|
||||
<LI> 1.0.4: Initial audio support on MacOS (thanks Darrell Walisser)
|
||||
<LI> 1.0.4: The audio thread runs at high priority on Win32
|
||||
<LI> 1.0.4: ESD audio support is now a separate selectable driver
|
||||
<LI> 1.0.4: Initial OpenBSD support (thanks Federico Schwindt)
|
||||
<LI> 1.0.4: Fixed hang when closing audio on Windows 2000
|
||||
<LI> 1.0.4: Warn about monochrome X displays (thanks Christian Bauer)
|
||||
<LI> 1.0.4: Fixed spurious X11 mouse focus events at ALT-ENTER
|
||||
<LI> 1.0.4: Perform input ungrab at video quit, just in case
|
||||
<LI> 1.0.4: Corrected X11 depth reporting in SDL_VideoModeOK()
|
||||
<LI> 1.0.3: Disable mouse threshold when X11 mouse is in warp mode
|
||||
<LI> 1.0.3: Fixed black-screen on exit in fbcon video driver
|
||||
<LI> 1.0.3: Much improved console switching in fbcon video driver
|
||||
<LI> 1.0.3: Fixed X11 UNICODE translation bug (thanks Andreas Arens)
|
||||
<LI> 1.0.3: Fixed WaveOut mutex logic bug (thanks Markus Oberhum)
|
||||
<LI> 1.0.3: Use X11 mouse warping when cursor hidden and input grabbed
|
||||
<LI> 1.0.3: Doesn't try to use TrackMouseEvent() on Win95
|
||||
<LI> 1.0.3: DirectColor support in fbcon driver (thanks Adam Meyerowitz)
|
||||
<LI> 1.0.3: Fixed ALT-ENTER key state problem on X11
|
||||
<LI> 1.0.2: Fixed Win32 code to run on VMWare with DIB video driver
|
||||
<LI> 1.0.2: Added window manager function: SDL_WM_GrabInput()
|
||||
<LI> 1.0.2: Added window manager function: SDL_WM_IconifyWindow()
|
||||
<LI> 1.0.2: Added ALT-ENTER fullscreen toggle for X11 video driver
|
||||
<LI> 1.0.2: X11 fullscreen mode uses DGA mouse if cursor is hidden
|
||||
<LI> 1.0.2: New X11 fullscreen code doesn't require root
|
||||
<LI> 1.0.2: Mouse focus and position is now updated at video mode set
|
||||
<LI> 1.0.2: Mouse focus loss is now detected under Win32
|
||||
<LI> 1.0.2: Menubar hiding is more robust on MacOS (thanks Matt Slott)
|
||||
<LI> 1.0.2: Added CD-ROM support on MacOS (thanks Matt Slott)
|
||||
<LI> 1.0.2: Added non-root fullscreen modes under X11 (thanks Stephane)
|
||||
<LI> 1.0.2: Added docs for time functions (thanks Christian Biesinger)
|
||||
<LI> 1.0.2: Squeezed a little more speed out of blitters (Duff's device)
|
||||
<LI> 1.0.2: Added hardware acceleration for 3Dfx to fbcon driver.
|
||||
<LI> 1.0.2: Added hardware acceleration for Matrox to fbcon driver.
|
||||
<LI> 1.0.2: Windows mouse driver now recognizes the middle button.
|
||||
<LI> 1.0.2: X11 driver now recognizes the "unix:0" display as local.
|
||||
<LI> 1.0.2: Fixed a bug in DGA support which crashed some X servers.
|
||||
<LI> 1.0.2: Added GPM repeater support (gpm -R) to fbcon driver
|
||||
<LI> 1.0.2: Added support for hardware surfaces to fbcon driver
|
||||
<LI> 1.0.2: Implemented console switching in fbcon driver
|
||||
<LI> 1.0.2: Implemented graphics mode detection in fbcon driver
|
||||
<LI> 1.0.2: Added SDL_EnableKeyRepeat() (thanks Jim Kutter)
|
||||
<LI> 1.0.2: Enabled DirectSound on Windows 2000
|
||||
<LI> 1.0.1: Fixed the frame buffer video driver on LinuxPPC
|
||||
<LI> 1.0.1: Stopped using DirectSound on Windows NT.
|
||||
<LI> 1.0.1: Stopped using DirectX when DINPUT.DLL is not installed.
|
||||
<LI> 1.0.1: Added pthread detection to configure.in for FreeBSD.
|
||||
<LI> 1.0.1: Updated the Solaris audio code for the 1.0 API
|
||||
<LI> 1.0.1: Updated the MacOS code for the 1.0 internal API
|
||||
</UL>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 0.10.0:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> 0.11.5: Fixed mouse warping in fullscreen mode
|
||||
<LI> 0.11.5: Added a new function SDL_GetVideoSurface()
|
||||
<LI> 0.11.5: Renamed SDL_AllocSurface() SDL_CreateRGBSurface()
|
||||
<LI> 0.11.5: Added a new function SDL_CreateRGBSurfaceFrom()
|
||||
<LI> 0.11.4: Added support for multiple compiled-in video drivers
|
||||
<LI> 0.11.3: Fixed 16 --> 32 bpp blitting - using C instead of Hermes.
|
||||
<LI> 0.11.3: Fixed double-buffering bug in the DirectX driver
|
||||
<LI> 0.11.3: Added GGI video driver (thanks Jon Taylor)
|
||||
<LI> 0.11.2: Added automake/aclocal/autoconf support
|
||||
<LI> 0.11.1: Added an initial (buggy) MacOS CD-ROM driver
|
||||
<LI> 0.11.1: Improved Linux CD-ROM detection
|
||||
<LI> 0.11.1: Added a workaround for DGA mouse bug on Voodoo 3
|
||||
<LI> 0.11.1: Fixed 24bpp --> 8bpp blit crash
|
||||
<LI> 0.11.1: Fixed a bug in blit mapping when palette changed
|
||||
<LI> 0.11.1: Added a Linux SBLive beta driver workaround
|
||||
<LI> 0.11.1: Fixed Win32 cross-compile problem with mingw32
|
||||
<LI> 0.11.1: Loss of keyboard focus now causes keys to be reset
|
||||
<LI> 0.11.1: DGA DirectMouse is conditionally compiled (default off)
|
||||
</UL>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 0.8.0:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> 0.9.16: Made SDL error messages thread-safe
|
||||
<LI> 0.9.15: If you have r/w access to /dev/mem, DGA works on Linux
|
||||
<LI> 0.9.15: Added support for Linux on the ARM (Netwinder)
|
||||
<LI> 0.9.14: Removed color cursor support, fixed b/w cursors
|
||||
<LI> 0.9.14: Fixed long-standing X11 DGA colormap problem
|
||||
<LI> 0.9.13: Added dynamic load function: SDL_SetLibraryPath()
|
||||
<LI> 0.9.13: Added unofficial support for MacOS
|
||||
<LI> 0.9.13: Added unofficial support for FreeBSD
|
||||
<LI> 0.9.13: Added unofficial support for IRIX
|
||||
<LI> 0.9.13: Updated support for BeOS from R3 to R4.5
|
||||
<LI> 0.9.13: Added SDL_SetLibraryPath() function (thanks Karsten Laux)
|
||||
<LI> 0.9.13: Fixed 8-bit audio conversion when using SDL_MixAudio()
|
||||
<LI> 0.9.13: Fixed audio thread lingering when app dies on Linux
|
||||
<LI> 0.9.13: Fixed color problem in X display to other-endian systems
|
||||
<LI> 0.9.13: Finally able to detect X11 key repeat (thanks GII team!)
|
||||
<LI> 0.9.13: Added support for Visual C++ 5.0 development environment
|
||||
<LI> 0.9.13: Added support for Linux on the Alpha
|
||||
<LI> 0.9.13: Added support for international keyboards (see WhatsNew)
|
||||
<LI> 0.9.12: Added support for loading IMA ADPCM compressed WAV files
|
||||
<LI> 0.9.12: Fixed bug when mixing 8-bit audio in SDL_MixAudio()
|
||||
<LI> 0.9.12: Added Enlightenment Sound Daemon audio support on Linux
|
||||
<LI> 0.9.12: Added MTRR support for Linux/X11 (thanks David Barth)
|
||||
<LI> 0.9.12: Added support for LinuxPPC 5.0
|
||||
<LI> 0.9.12: Fixed place where some audio conversions aren't detected
|
||||
<LI> 0.9.12: Fixed serious bug in installation script
|
||||
<LI> 0.9.12: Added SDL_FreeWAV() function for freeing DLL memory
|
||||
<LI> 0.9.12: Fixed potential memory leak in SDL_LoadWAV_RW()
|
||||
<LI> 0.9.11: Freeing video surface has no longer crashes SDL_Quit()
|
||||
<LI> 0.9.11: Included new asm blitters from Hermes library 1.2.4
|
||||
<LI> 0.9.11: SDL_WaitThread() now gets the thread's return status
|
||||
<LI> 0.9.11: SDL_MixAudio() takes a larger volume range (0-128)
|
||||
<LI> 0.9.11: SDL no longer changes the X11 keyboard repeat
|
||||
<LI> 0.9.11: Added a data source abstraction for loading/saving data
|
||||
<LI> 0.9.11: Added three built in data abstractions:<BR>
|
||||
SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem()
|
||||
<LI> 0.9.11: Added stdio-like functions for using data sources:<BR>
|
||||
SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose()
|
||||
<LI> 0.9.11: Replaced SDL_CalculateEndian() with SDL_BYTEORDER macro
|
||||
<LI> 0.9.11: Endian swapping functions are now macros, for speed.
|
||||
<LI> 0.9.11: Endian read/write functions now use data sources
|
||||
<LI> 0.9.11: Added function SDL_LoadWAV_RW() for data sources
|
||||
<LI> 0.9.11: Added function SDL_LoadBMP_RW() for data sources
|
||||
<LI> 0.9.11: Added function SDL_SaveBMP_RW() for data sources
|
||||
<LI> 0.9.10: Mixer no longer fails if timidity isn't installed
|
||||
<LI> 0.9.10: Mixer restarts MOD files on play (thanks Bill Kendrick)
|
||||
<LI> 0.9.10: Fixed occasional crashing of the mixer library
|
||||
<LI> 0.9.10: Fixed icon display on Afterstep under Linux
|
||||
<LI> 0.9.10: Fixed occasional crash in mixer example
|
||||
<LI> 0.9.10: Linux cdrom list now comes from /etc/fstab
|
||||
<LI> 0.9.10: Fixed support for UK keyboard (thanks John Elliott)
|
||||
<LI> 0.9.10: The event queue is now thread-safe
|
||||
<LI> 0.9.10: Added event queue pump function: SDL_PumpEvents()
|
||||
<LI> 0.9.10: Added low level event function: SDL_PeepEvents()
|
||||
<LI> 0.9.10: Added a new thread function: SDL_ThreadID()
|
||||
<LI> 0.9.10: Fixed an audio rate conversion memory overrun
|
||||
<LI> 0.9.10: Fixed crash with RLE acceleration on big surfaces
|
||||
<LI> 0.9.10: Improved MacOS display driver - added fullscreen
|
||||
<LI> 0.9.10: Removed spurious warnings from Linux X11 driver
|
||||
<LI> 0.9.10: Fixed memory leak in SDL_InvalidateMap()
|
||||
<LI> 0.9.10: Fixed right button of 2-button mice on Win32
|
||||
<LI> 0.9.10: Enabled XFree86 mode changes on older servers
|
||||
<LI> 0.9.9: SDL_LoadBMP() handles BMP files created with GIMP
|
||||
<LI> 0.9.9: SDL_LoadWAV() handles WAV files with "LIST" chunks
|
||||
<LI> 0.9.9: Fixed problem with audio underflow on Solaris
|
||||
<LI> 0.9.9: Initial support for 4-speaker audio output devices
|
||||
<LI> 0.9.8: Fixed corrupt VC++ 5.0 desktop file
|
||||
<LI> 0.9.8: Now detects fixed version of Metro-X X11 server
|
||||
<LI> 0.9.8: Fixed XFree86 DGA banked mode update
|
||||
<LI> 0.9.8: Fixed mouse press viewport shift on XFree86 DGA
|
||||
<LI> 0.9.7: Fixed problem with displaying remotely via X11
|
||||
<LI> 0.9.7: Win32 uses software cursor when fullscreen
|
||||
<LI> 0.9.7: Win32 mouse uses DirectInput when fullscreen
|
||||
<LI> 0.9.7: Added OpenGL software rendering via Mesa (demos archive)
|
||||
<LI> 0.9.7: Fixed memory leak in ADPCM WAV decoding
|
||||
<LI> 0.9.6: Added CD-ROM audio API documentation
|
||||
<LI> 0.9.6: Fixed potential BeOS audio-related crash
|
||||
<LI> 0.9.6: Fixed crash when resetting the video mode in DirectX
|
||||
<LI> 0.9.6: Fixed errors compiling with the SparcWorks compiler
|
||||
<LI> 0.9.6: Replaced SDL_GetDisplayFormat() with SDL_GetVideoInfo()
|
||||
<LI> 0.9.6: Added a new fast fill function: SDL_FillRect()
|
||||
<LI> 0.9.6: Added blit acceleration flags to SDL_AllocSurface()
|
||||
<LI> 0.9.6: Added new double-buffering function: SDL_Flip()
|
||||
<LI> 0.9.6: Fixed problem with buggy Metro-X X11 server
|
||||
<LI> 0.9.6: Fixed 8-bit audio on Solaris with dbri hardware
|
||||
<LI> 0.9.6: Fixed alarm clock problem with Solaris pthreads
|
||||
<LI> 0.9.6: Fixed BeOS compilation problem
|
||||
<LI> 0.9.5: Added tools to create Win32 icons in directx/icon/
|
||||
<LI> 0.9.5: You can now pass a NULL mask to SDL_WM_SetIcon()
|
||||
<LI> 0.9.5: Added support files for compiling with VC++ 5.0
|
||||
<LI> 0.9.5: Fixed icon color bug under Win32
|
||||
<LI> 0.9.5: Re-added SDL_LowerBlit() - not safe for use on display
|
||||
<LI> 0.9.5: Fixed 0.9.x cursor blit deadlock
|
||||
<LI> 0.9.5: Added SDL_FPLoadWAV(), SDL_FPLoadBMP(), SDL_FPSaveBMP()
|
||||
<LI> 0.9.5: Added Linux, Win32, and BeOS CD audio support
|
||||
<LI> 0.9.5: MMX accelerated blit disabled -- temporarily broken
|
||||
<LI> 0.9.4: Fixed endianness issue with BeOS x86 blitting
|
||||
<LI> 0.9.4: Fixed quit interrupt delivery on BeOS
|
||||
<LI> 0.9.4: Fixed dynamic loading on BeOS
|
||||
<LI> 0.9.4: Fixed DirectX audio on Win98
|
||||
<LI> 0.9.4: Fixed possible sound-related crash on Linux PPC
|
||||
<LI> 0.9.3: Mouse motion arrives as absolute and relative coordinates
|
||||
<LI> 0.9.3: Fixed Visual C++ structure packing
|
||||
<LI> 0.9.3: Fixed UNIX dynamic link library installation
|
||||
<LI> 0.9.2: DirectX audio no longer hangs when app loses focus
|
||||
<LI> 0.9.2: Fixed DirectX HiColor crash (palette bug)
|
||||
<LI> 0.9.1: Fixed DirectX <ALT> key handling
|
||||
<LI> 0.9.1: Fixed DirectX windowed palette problems
|
||||
<LI> 0.9.1: Removed SDL_MapSurface() and SDL_UnmapSurface()
|
||||
<LI> 0.9.0: Initial port to IRIX 6.x
|
||||
<LI> 0.9.0: Initial port to OSF/1 3.2 (no sound yet)
|
||||
<LI> 0.9.0: MacOS port in progress
|
||||
</UL>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 0.7:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> Separated the demos and examples into a separate archive
|
||||
<LI> Added support for loading Microsoft compressed WAV files
|
||||
<LI> Added "soft" application crash recovery (signal handlers)
|
||||
<LI> Fixed POSIX signal handling interaction with threads
|
||||
<LI> Fixed audio output on MKLinux
|
||||
<LI> Added dynamic library version checking
|
||||
<LI> Updated for DirectX 6.0
|
||||
<LI> Cleaned up dynamic linking and added static linking
|
||||
<LI> Added automatic audio format and rate conversion
|
||||
<LI> Optimized some blitter cases (8 --> 16/32 and 32 --> 16/8)
|
||||
<LI> Removed precalculated alpha blending acceleration
|
||||
<LI> Key and mouse button events are split into up/down events
|
||||
<LI> It is now much easier to set an optimal video mode
|
||||
</UL>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 0.5:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> Ported to Solaris 2.6
|
||||
<LI> Added XFree86 Direct Graphic Access support
|
||||
<LI> Supports LinuxPPC without threads
|
||||
<LI> Completely rewritten video/surface API -- see SDL_video.h
|
||||
<LI> Completely rewritten event API
|
||||
<LI> Optimized black-white cursor creation
|
||||
<LI> Added support for run-length-encoded colorkeying
|
||||
<LI> Added support for hardware accelerated blits
|
||||
<LI> Added support for blitting from 1-bit surfaces (bitmaps)
|
||||
<LI> Added a function to simplify setting video modes
|
||||
<LI> Added support for loading WAV files
|
||||
<LI> Added endian swapping functions for memory values
|
||||
<LI> Added alpha blending using alpha value or channel
|
||||
<LI> Added precalculated alpha blending acceleration
|
||||
<LI> Added function to return current time in milliseconds
|
||||
<LI> New event type SDL_ACTIVEEVENT, to detect iconification
|
||||
<LI> New event type SDL_SYSWMEVENT, for custom window hooks
|
||||
<LI> Added a platform dependent function to get window handle
|
||||
<LI> Added a function to check the run-time version of SDL
|
||||
<LI> Added periodic timer support at 10 ms resolution
|
||||
<LI> Added support for the SDL_DEBUG environment variable
|
||||
<LI> Miscellaneous internal cleanups
|
||||
</UL>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 0.4:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> SDL library code is now dynamically loaded
|
||||
<LI> Added support for pthreads (Linux glibc2)
|
||||
<LI> Removed SDL_mutexN() and SDL_mutexIncr()
|
||||
</UL>
|
||||
|
||||
<H2>
|
||||
Major changes since SDL 0.3:
|
||||
</H2>
|
||||
<UL>
|
||||
<LI> Added support for DirectX 5.0
|
||||
<LI> Added support for surfaces in video memory
|
||||
<LI> Added support for source color-key blitting
|
||||
<LI> Added support for single-rectangle clipping
|
||||
<LI> Added support for warping (moving) the cursor
|
||||
<LI> Added support for color cursors
|
||||
<LI> Greatly simplified internal event queue
|
||||
<LI> Minor bug-fixes
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
2
docs/.cvsignore
Normal file
2
docs/.cvsignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
Makefile.in
|
||||
Makefile
|
4
docs/Makefile.am
Normal file
4
docs/Makefile.am
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
SUBDIRS = html man3
|
||||
|
||||
EXTRA_DIST = index.html
|
2
docs/html/.cvsignore
Normal file
2
docs/html/.cvsignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
Makefile.in
|
||||
Makefile
|
199
docs/html/Makefile.am
Normal file
199
docs/html/Makefile.am
Normal file
|
@ -0,0 +1,199 @@
|
|||
EXTRA_DIST = \
|
||||
audio.html \
|
||||
cdrom.html \
|
||||
event.html \
|
||||
eventfunctions.html \
|
||||
eventstructures.html \
|
||||
general.html \
|
||||
guide.html \
|
||||
guideaboutsdldoc.html \
|
||||
guideaudioexamples.html \
|
||||
guidebasicsinit.html \
|
||||
guidecdromexamples.html \
|
||||
guidecredits.html \
|
||||
guideeventexamples.html \
|
||||
guideexamples.html \
|
||||
guideinput.html \
|
||||
guideinputkeyboard.html \
|
||||
guidepreface.html \
|
||||
guidethebasics.html \
|
||||
guidetimeexamples.html \
|
||||
guidevideo.html \
|
||||
guidevideoexamples.html \
|
||||
index.html \
|
||||
joystick.html \
|
||||
reference.html \
|
||||
sdlactiveevent.html \
|
||||
sdladdtimer.html \
|
||||
sdlaudiocvt.html \
|
||||
sdlaudiospec.html \
|
||||
sdlblitsurface.html \
|
||||
sdlbuildaudiocvt.html \
|
||||
sdlcd.html \
|
||||
sdlcdclose.html \
|
||||
sdlcdeject.html \
|
||||
sdlcdname.html \
|
||||
sdlcdnumdrives.html \
|
||||
sdlcdopen.html \
|
||||
sdlcdpause.html \
|
||||
sdlcdplay.html \
|
||||
sdlcdplaytracks.html \
|
||||
sdlcdresume.html \
|
||||
sdlcdstatus.html \
|
||||
sdlcdstop.html \
|
||||
sdlcdtrack.html \
|
||||
sdlcloseaudio.html \
|
||||
sdlcolor.html \
|
||||
sdlcondbroadcast.html \
|
||||
sdlcondsignal.html \
|
||||
sdlcondwait.html \
|
||||
sdlcondwaittimeout.html \
|
||||
sdlconvertaudio.html \
|
||||
sdlconvertsurface.html \
|
||||
sdlcreatecond.html \
|
||||
sdlcreatecursor.html \
|
||||
sdlcreatemutex.html \
|
||||
sdlcreatergbsurface.html \
|
||||
sdlcreatergbsurfacefrom.html \
|
||||
sdlcreatesemaphore.html \
|
||||
sdlcreatethread.html \
|
||||
sdlcreateyuvoverlay.html \
|
||||
sdldelay.html \
|
||||
sdldestroycond.html \
|
||||
sdldestroymutex.html \
|
||||
sdldestroysemaphore.html \
|
||||
sdldisplayformat.html \
|
||||
sdldisplayformatalpha.html \
|
||||
sdldisplayyuvoverlay.html \
|
||||
sdlenablekeyrepeat.html \
|
||||
sdlenableunicode.html \
|
||||
sdlevent.html \
|
||||
sdleventstate.html \
|
||||
sdlfillrect.html \
|
||||
sdlflip.html \
|
||||
sdlfreecursor.html \
|
||||
sdlfreesurface.html \
|
||||
sdlfreewav.html \
|
||||
sdlfreeyuvoverlay.html \
|
||||
sdlgetappstate.html \
|
||||
sdlgetaudiostatus.html \
|
||||
sdlgetcliprect.html \
|
||||
sdlgetcursor.html \
|
||||
sdlgeteventfilter.html \
|
||||
sdlgetgammaramp.html \
|
||||
sdlgetkeyname.html \
|
||||
sdlgetkeystate.html \
|
||||
sdlgetmodstate.html \
|
||||
sdlgetmousestate.html \
|
||||
sdlgetrelativemousestate.html \
|
||||
sdlgetrgb.html \
|
||||
sdlgetrgba.html \
|
||||
sdlgetthreadid.html \
|
||||
sdlgetticks.html \
|
||||
sdlgetvideoinfo.html \
|
||||
sdlgetvideosurface.html \
|
||||
sdlglattr.html \
|
||||
sdlglgetattribute.html \
|
||||
sdlglgetprocaddress.html \
|
||||
sdlglloadlibrary.html \
|
||||
sdlglsetattribute.html \
|
||||
sdlglswapbuffers.html \
|
||||
sdlinit.html \
|
||||
sdlinitsubsystem.html \
|
||||
sdljoyaxisevent.html \
|
||||
sdljoyballevent.html \
|
||||
sdljoybuttonevent.html \
|
||||
sdljoyhatevent.html \
|
||||
sdljoystickclose.html \
|
||||
sdljoystickeventstate.html \
|
||||
sdljoystickgetaxis.html \
|
||||
sdljoystickgetball.html \
|
||||
sdljoystickgetbutton.html \
|
||||
sdljoystickgethat.html \
|
||||
sdljoystickindex.html \
|
||||
sdljoystickname.html \
|
||||
sdljoysticknumaxes.html \
|
||||
sdljoysticknumballs.html \
|
||||
sdljoysticknumbuttons.html \
|
||||
sdljoysticknumhats.html \
|
||||
sdljoystickopen.html \
|
||||
sdljoystickopened.html \
|
||||
sdljoystickupdate.html \
|
||||
sdlkey.html \
|
||||
sdlkeyboardevent.html \
|
||||
sdlkeysym.html \
|
||||
sdlkillthread.html \
|
||||
sdllistmodes.html \
|
||||
sdlloadbmp.html \
|
||||
sdlloadwav.html \
|
||||
sdllockaudio.html \
|
||||
sdllocksurface.html \
|
||||
sdllockyuvoverlay.html \
|
||||
sdlmaprgb.html \
|
||||
sdlmaprgba.html \
|
||||
sdlmixaudio.html \
|
||||
sdlmousebuttonevent.html \
|
||||
sdlmousemotionevent.html \
|
||||
sdlmutexp.html \
|
||||
sdlmutexv.html \
|
||||
sdlnumjoysticks.html \
|
||||
sdlopenaudio.html \
|
||||
sdloverlay.html \
|
||||
sdlpalette.html \
|
||||
sdlpauseaudio.html \
|
||||
sdlpeepevents.html \
|
||||
sdlpixelformat.html \
|
||||
sdlpollevent.html \
|
||||
sdlpumpevents.html \
|
||||
sdlpushevent.html \
|
||||
sdlquit.html \
|
||||
sdlquitevent.html \
|
||||
sdlquitsubsystem.html \
|
||||
sdlrect.html \
|
||||
sdlremovetimer.html \
|
||||
sdlresizeevent.html \
|
||||
sdlsavebmp.html \
|
||||
sdlsempost.html \
|
||||
sdlsemtrywait.html \
|
||||
sdlsemvalue.html \
|
||||
sdlsemwait.html \
|
||||
sdlsemwaittimeout.html \
|
||||
sdlsetalpha.html \
|
||||
sdlsetcliprect.html \
|
||||
sdlsetcolorkey.html \
|
||||
sdlsetcolors.html \
|
||||
sdlsetcursor.html \
|
||||
sdlseteventfilter.html \
|
||||
sdlsetgamma.html \
|
||||
sdlsetgammaramp.html \
|
||||
sdlsetmodstate.html \
|
||||
sdlsetpalette.html \
|
||||
sdlsettimer.html \
|
||||
sdlsetvideomode.html \
|
||||
sdlshowcursor.html \
|
||||
sdlsurface.html \
|
||||
sdlsyswmevent.html \
|
||||
sdlthreadid.html \
|
||||
sdlunlockaudio.html \
|
||||
sdlunlocksurface.html \
|
||||
sdlunlockyuvoverlay.html \
|
||||
sdlupdaterect.html \
|
||||
sdlupdaterects.html \
|
||||
sdluserevent.html \
|
||||
sdlvideodrivername.html \
|
||||
sdlvideoinfo.html \
|
||||
sdlvideomodeok.html \
|
||||
sdlwaitevent.html \
|
||||
sdlwaitthread.html \
|
||||
sdlwarpmouse.html \
|
||||
sdlwasinit.html \
|
||||
sdlwmgetcaption.html \
|
||||
sdlwmgrabinput.html \
|
||||
sdlwmiconifywindow.html \
|
||||
sdlwmsetcaption.html \
|
||||
sdlwmseticon.html \
|
||||
sdlwmtogglefullscreen.html \
|
||||
thread.html \
|
||||
time.html \
|
||||
video.html \
|
||||
wm.html
|
234
docs/html/audio.html
Normal file
234
docs/html/audio.html
Normal file
|
@ -0,0 +1,234 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Audio</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlaudiospec.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="AUDIO"
|
||||
>Chapter 10. Audio</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlaudiospec.html"
|
||||
>SDL_AudioSpec</A
|
||||
> — Audio Specification Structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlopenaudio.html"
|
||||
>SDL_OpenAudio</A
|
||||
> — Opens the audio device with the desired parameters.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlpauseaudio.html"
|
||||
>SDL_PauseAudio</A
|
||||
> — Pauses and unpauses the audio callback processing</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetaudiostatus.html"
|
||||
>SDL_GetAudioStatus</A
|
||||
> — Get the current audio state</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlloadwav.html"
|
||||
>SDL_LoadWAV</A
|
||||
> — Load a WAVE file</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlfreewav.html"
|
||||
>SDL_FreeWAV</A
|
||||
> — Frees previously opened WAV data</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlaudiocvt.html"
|
||||
>SDL_AudioCVT</A
|
||||
> — Audio Conversion Structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlbuildaudiocvt.html"
|
||||
>SDL_BuildAudioCVT</A
|
||||
> — Initializes a SDL_AudioCVT structure for conversion</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlconvertaudio.html"
|
||||
>SDL_ConvertAudio</A
|
||||
> — Convert audio data to a desired audio format.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlmixaudio.html"
|
||||
>SDL_MixAudio</A
|
||||
> — Mix audio data</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdllockaudio.html"
|
||||
>SDL_LockAudio</A
|
||||
> — Lock out the callback function</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlunlockaudio.html"
|
||||
>SDL_UnlockAudio</A
|
||||
> — Unlock the callback function</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcloseaudio.html"
|
||||
>SDL_CloseAudio</A
|
||||
> — 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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdljoystickclose.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlaudiospec.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_AudioSpec</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
252
docs/html/cdrom.html
Normal file
252
docs/html/cdrom.html
Normal file
|
@ -0,0 +1,252 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>CD-ROM</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdnumdrives.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="CDROM"
|
||||
>Chapter 11. CD-ROM</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdnumdrives.html"
|
||||
>SDL_CDNumDrives</A
|
||||
> — Returns the number of CD-ROM drives on the system.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdname.html"
|
||||
>SDL_CDName</A
|
||||
> — Returns a human-readable, system-dependent identifier for the CD-ROM.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdopen.html"
|
||||
>SDL_CDOpen</A
|
||||
> — Opens a CD-ROM drive for access.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdstatus.html"
|
||||
>SDL_CDStatus</A
|
||||
> — Returns the current status of the given drive.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdplay.html"
|
||||
>SDL_CDPlay</A
|
||||
> — Play a CD</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdplaytracks.html"
|
||||
>SDL_CDPlayTracks</A
|
||||
> — Play the given CD track(s)</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdpause.html"
|
||||
>SDL_CDPause</A
|
||||
> — Pauses a CDROM</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdresume.html"
|
||||
>SDL_CDResume</A
|
||||
> — Resumes a CDROM</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdstop.html"
|
||||
>SDL_CDStop</A
|
||||
> — Stops a CDROM</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdeject.html"
|
||||
>SDL_CDEject</A
|
||||
> — Ejects a CDROM</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdclose.html"
|
||||
>SDL_CDClose</A
|
||||
> — Closes a SDL_CD handle</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcd.html"
|
||||
>SDL_CD</A
|
||||
> — CDROM Drive Information</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlcdtrack.html"
|
||||
>SDL_CDtrack</A
|
||||
> — 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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcloseaudio.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdnumdrives.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDNumDrives</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
208
docs/html/event.html
Normal file
208
docs/html/event.html
Normal file
|
@ -0,0 +1,208 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Events</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="eventstructures.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="EVENT"
|
||||
>Chapter 8. Events</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="event.html#AEN3194"
|
||||
>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="AEN3194"
|
||||
>Introduction</A
|
||||
></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
|
||||
>
|
||||
Interally, 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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlwmgrabinput.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="eventstructures.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL Event Structures.</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
236
docs/html/eventfunctions.html
Normal file
236
docs/html/eventfunctions.html
Normal file
|
@ -0,0 +1,236 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Event Functions.</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="EVENTFUNCTIONS"
|
||||
>Event Functions.</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlpumpevents.html"
|
||||
>SDL_PumpEvents</A
|
||||
> — Pumps the event loop, gathering events from the input devices.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlpeepevents.html"
|
||||
>SDL_PeepEvents</A
|
||||
> — Checks the event queue for messages and optionally returns them.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlpollevent.html"
|
||||
>SDL_PollEvent</A
|
||||
> — Polls for currently pending events.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlwaitevent.html"
|
||||
>SDL_WaitEvent</A
|
||||
> — Waits indefinitely for the next available event.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlpushevent.html"
|
||||
>SDL_PushEvent</A
|
||||
> — Pushes an event onto the event queue</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlseteventfilter.html"
|
||||
>SDL_SetEventFilter</A
|
||||
> — 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
|
||||
> — Retrieves a pointer to he event filter</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdleventstate.html"
|
||||
>SDL_EventState</A
|
||||
> — This function allows you to set the state of processing certain events.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetkeystate.html"
|
||||
>SDL_GetKeyState</A
|
||||
> — Get a snapshot of the current keyboard state</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetmodstate.html"
|
||||
>SDL_GetModState</A
|
||||
> — Get the state of modifier keys.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlsetmodstate.html"
|
||||
>SDL_SetModState</A
|
||||
> — Set the current key modifier state</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetkeyname.html"
|
||||
>SDL_GetKeyName</A
|
||||
> — Get the name of an SDL virtual keysym</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlenableunicode.html"
|
||||
>SDL_EnableUNICODE</A
|
||||
> — Enable UNICODE translation</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlenablekeyrepeat.html"
|
||||
>SDL_EnableKeyRepeat</A
|
||||
> — Set keyboard repeat rate.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetmousestate.html"
|
||||
>SDL_GetMouseState</A
|
||||
> — Retrieve the current state of the mouse</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetrelativemousestate.html"
|
||||
>SDL_GetRelativeMouseState</A
|
||||
> — Retrieve the current state of the mouse</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlgetappstate.html"
|
||||
>SDL_GetAppState</A
|
||||
> — Get the state of the application</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickeventstate.html"
|
||||
>SDL_JoystickEventState</A
|
||||
> — Enable/disable joystick event polling</DT
|
||||
></DL
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlkey.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlpumpevents.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_PumpEvents</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
220
docs/html/eventstructures.html
Normal file
220
docs/html/eventstructures.html
Normal file
|
@ -0,0 +1,220 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL Event Structures.</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="EVENTSTRUCTURES"
|
||||
>SDL Event Structures.</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlevent.html"
|
||||
>SDL_Event</A
|
||||
> — General event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlactiveevent.html"
|
||||
>SDL_ActiveEvent</A
|
||||
> — Application visibility event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlkeyboardevent.html"
|
||||
>SDL_KeyboardEvent</A
|
||||
> — Keyboard event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlmousemotionevent.html"
|
||||
>SDL_MouseMotionEvent</A
|
||||
> — Mouse motion event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlmousebuttonevent.html"
|
||||
>SDL_MouseButtonEvent</A
|
||||
> — Mouse button event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoyaxisevent.html"
|
||||
>SDL_JoyAxisEvent</A
|
||||
> — Joystick axis motion event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoybuttonevent.html"
|
||||
>SDL_JoyButtonEvent</A
|
||||
> — Joystick button event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoyhatevent.html"
|
||||
>SDL_JoyHatEvent</A
|
||||
> — Joystick hat position change event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoyballevent.html"
|
||||
>SDL_JoyBallEvent</A
|
||||
> — Joystick trackball motion event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlresizeevent.html"
|
||||
>SDL_ResizeEvent</A
|
||||
> — Window resize event structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlsyswmevent.html"
|
||||
>SDL_SysWMEvent</A
|
||||
> — Platform-dependent window manager event.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdluserevent.html"
|
||||
>SDL_UserEvent</A
|
||||
> — A user-defined event type</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlquitevent.html"
|
||||
>SDL_QuitEvent</A
|
||||
> — Quit requested event</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlkeysym.html"
|
||||
>SDL_keysym</A
|
||||
> — Keysym structure</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlkey.html"
|
||||
>SDLKey</A
|
||||
> — Keysym definitions.</DT
|
||||
></DL
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="event.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlevent.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_Event</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
207
docs/html/general.html
Normal file
207
docs/html/general.html
Normal file
|
@ -0,0 +1,207 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>General</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlinit.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="GENERAL"
|
||||
>Chapter 5. General</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlinit.html"
|
||||
>SDL_Init</A
|
||||
> — Initializes SDL</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlinitsubsystem.html"
|
||||
>SDL_InitSubSystem</A
|
||||
> — Initialize subsystems</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlquitsubsystem.html"
|
||||
>SDL_QuitSubSystem</A
|
||||
> — Shut down a subsystem</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlquit.html"
|
||||
>SDL_Quit</A
|
||||
> — Shut down SDL</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlwasinit.html"
|
||||
>SDL_WasInit</A
|
||||
> — Check which subsystems are initialized</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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="reference.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlinit.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_Init</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
167
docs/html/guide.html
Normal file
167
docs/html/guide.html
Normal file
|
@ -0,0 +1,167 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL Guide</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guidepreface.html"
|
||||
>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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidepreface.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>SDL Library Documentation</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Preface</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
140
docs/html/guideaboutsdldoc.html
Normal file
140
docs/html/guideaboutsdldoc.html
Normal file
|
@ -0,0 +1,140 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>About SDLdoc</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Preface</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guidecredits.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEABOUTSDLDOC"
|
||||
>About SDLdoc</A
|
||||
></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 proplr 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 at the project homepage: http://sdldoc.sourceforge.net.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidepreface.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidecredits.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Credits</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
220
docs/html/guideaudioexamples.html
Normal file
220
docs/html/guideaudioexamples.html
Normal file
|
@ -0,0 +1,220 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Audio Examples</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEAUDIOEXAMPLES"
|
||||
>Audio Examples</A
|
||||
></H1
|
||||
><P
|
||||
></P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN343"
|
||||
>Opening the audio device</A
|
||||
></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(&wanted, NULL) < 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="AEN347"
|
||||
>Playing audio</A
|
||||
></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 > 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 > 0 ) {
|
||||
SDL_Delay(100); /* Sleep 1/10 second */
|
||||
}
|
||||
SDL_CloseAudio();</PRE
|
||||
></P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideeventexamples.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidecdromexamples.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>CDROM Examples</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
224
docs/html/guidebasicsinit.html
Normal file
224
docs/html/guidebasicsinit.html
Normal file
|
@ -0,0 +1,224 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Initializing SDL</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEBASICSINIT"
|
||||
>Initializing SDL</A
|
||||
></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
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include "SDL.h" /* All SDL App's need this */
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
|
||||
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);
|
||||
} </PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidethebasics.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidevideo.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Graphics and Video</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
267
docs/html/guidecdromexamples.html
Normal file
267
docs/html/guidecdromexamples.html
Normal file
|
@ -0,0 +1,267 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>CDROM Examples</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDECDROMEXAMPLES"
|
||||
>CDROM Examples</A
|
||||
></H1
|
||||
><P
|
||||
></P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN354"
|
||||
>Listing CD-ROM drives</A
|
||||
></H2
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> #include "SDL.h"
|
||||
|
||||
/* Initialize SDL first */
|
||||
if ( SDL_Init(SDL_INIT_CDROM) < 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<SDL_CDNumDrives(); ++i ) {
|
||||
printf("Drive %d: \"%s\"\n", i, SDL_CDName(i));
|
||||
}</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN358"
|
||||
>Opening the default drive</A
|
||||
></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 >= CD_PLAYING ) {
|
||||
int m, s, f;
|
||||
FRAMES_TO_MSF(cdrom->cur_frame, &m, &s, &f);
|
||||
printf("Currently playing track %d, %d:%2.2d\n",
|
||||
cdrom->track[cdrom->cur_track].id, m, s);
|
||||
}</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN362"
|
||||
>Listing the tracks on a CD</A
|
||||
></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->numtracks);
|
||||
for ( i=0; i<cdrom->numtracks; ++i ) {
|
||||
FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
|
||||
if ( f > 0 )
|
||||
++s;
|
||||
printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
|
||||
cdrom->track[i].id, m, s);
|
||||
}</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN366"
|
||||
>Play an entire CD</A
|
||||
></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->numtracks-1, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Play first and second track and 10 seconds of third track:
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);</PRE
|
||||
></P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideaudioexamples.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidetimeexamples.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Time Examples</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
179
docs/html/guidecredits.html
Normal file
179
docs/html/guidecredits.html
Normal file
|
@ -0,0 +1,179 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Credits</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Preface</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guidethebasics.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDECREDITS"
|
||||
>Credits</A
|
||||
></H1
|
||||
><P
|
||||
><P
|
||||
></P
|
||||
><TABLE
|
||||
BORDER="0"
|
||||
><TBODY
|
||||
><TR
|
||||
><TD
|
||||
>Martin Donlon, akawaka@skynet.ie</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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideaboutsdldoc.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidethebasics.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>The Basics</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
239
docs/html/guideeventexamples.html
Normal file
239
docs/html/guideeventexamples.html
Normal file
|
@ -0,0 +1,239 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Event Examples</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><LINK
|
||||
REL="HOME"
|
||||
TITLE="SDL Library Documentation"
|
||||
HREF="index.html"><LINK
|
||||
REL="UP"
|
||||
TITLE="Examples"
|
||||
HREF="guideexamples.html"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Video Examples"
|
||||
HREF="guidevideoexamples.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
|
||||
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="guidevideoexamples.html"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEEVENTEXAMPLES"
|
||||
>Event Examples</A
|
||||
></H1
|
||||
><P
|
||||
></P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN336"
|
||||
>Filtering and Handling Events</A
|
||||
></H2
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#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->type == SDL_QUIT) && boycott ) {
|
||||
printf("Quit event filtered out -- try again.\n");
|
||||
boycott = 0;
|
||||
return(0);
|
||||
}
|
||||
if ( event->type == SDL_MOUSEMOTION ) {
|
||||
printf("Mouse moved to (%d,%d)\n",
|
||||
event->motion.x, event->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) < 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(&event) >= 0 ) {
|
||||
switch (event.type) {
|
||||
case SDL_ACTIVEEVENT: {
|
||||
if ( event.active.state & 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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidevideoexamples.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideaudioexamples.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Video Examples</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideexamples.html"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Audio Examples</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
185
docs/html/guideexamples.html
Normal file
185
docs/html/guideexamples.html
Normal file
|
@ -0,0 +1,185 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Examples</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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="Video Examples"
|
||||
HREF="guidevideoexamples.html"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFF8DC"
|
||||
TEXT="#000000"
|
||||
LINK="#0000ee"
|
||||
VLINK="#551a8b"
|
||||
ALINK="#ff0000"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guidevideoexamples.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="GUIDEEXAMPLES"
|
||||
>Chapter 4. Examples</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="guideexamples.html#AEN297"
|
||||
>Introduction</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="guidevideoexamples.html"
|
||||
>Video Examples</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="AEN297"
|
||||
>Introduction</A
|
||||
></H1
|
||||
><P
|
||||
>For the moment these examples are taken directly from the old SDL documentation.</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideinputkeyboard.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidevideoexamples.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Video Examples</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
647
docs/html/guideinput.html
Normal file
647
docs/html/guideinput.html
Normal file
|
@ -0,0 +1,647 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Input handling</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><LINK
|
||||
REL="HOME"
|
||||
TITLE="SDL Library Documentation"
|
||||
HREF="index.html"><LINK
|
||||
REL="UP"
|
||||
TITLE="SDL Guide"
|
||||
HREF="guide.html"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Graphics and Video"
|
||||
HREF="guidevideo.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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guideinputkeyboard.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="GUIDEINPUT"
|
||||
>Chapter 3. Input handling</A
|
||||
></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"
|
||||
>Handling Joysticks</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN94"
|
||||
>Initialization</A
|
||||
></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.
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> if ( ! SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) )
|
||||
{
|
||||
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}</PRE
|
||||
>
|
||||
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="AEN101"
|
||||
>Querying</A
|
||||
></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.
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
|
||||
printf("The names of the joysticks are:\n");
|
||||
|
||||
for( i=0; i < SDL_NumJoysticks(); i++ )
|
||||
{
|
||||
printf(" %s\n", SDL_JoystickName(i));
|
||||
}</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN111"
|
||||
>Opening a Joystick and Receiving Joystick Events</A
|
||||
></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:
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> SDL_Joystick *joystick;
|
||||
|
||||
SDL_JoystickEventState(SDL_ENABLE);
|
||||
joystick = SDL_JoystickOpen(0);</PRE
|
||||
>
|
||||
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(&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:
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
|
||||
if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) )
|
||||
{
|
||||
/* code goes here */
|
||||
}
|
||||
break;</PRE
|
||||
>
|
||||
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:
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
|
||||
if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 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
|
||||
>
|
||||
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.
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> case SDL_JOYBUTTONDOWN: /* Handle Joystick Button Presses */
|
||||
if ( event.jbutton.button == 0 )
|
||||
{
|
||||
/* code goes here */
|
||||
}
|
||||
break;</PRE
|
||||
>
|
||||
|
||||
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="AEN156"
|
||||
>Advanced Joystick Functions</A
|
||||
></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 we 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:
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> case SDL_JOYBALLMOTION: /* Handle Joyball Motion */
|
||||
if( event.jball.ball == 0 )
|
||||
{
|
||||
/* ball handling */
|
||||
}
|
||||
break;</PRE
|
||||
>
|
||||
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:
|
||||
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> case SDL_JOYHATMOTION: /* Handle Hat Motion */
|
||||
if ( event.jhat.hat | SDL_HAT_UP )
|
||||
{
|
||||
/* Do up stuff here */
|
||||
}
|
||||
|
||||
if ( event.jhat.hat | SDL_HAT_LEFT )
|
||||
{
|
||||
/* Do left stuff here */
|
||||
}
|
||||
|
||||
if ( event.jhat.hat | SDL_HAT_RIGHTDOWN )
|
||||
{
|
||||
/* Do right and down together stuff here */
|
||||
}
|
||||
break;</PRE
|
||||
></P
|
||||
><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:
|
||||
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> int number_of_buttons;
|
||||
SDL_Joystick *joystick;
|
||||
|
||||
joystick = SDL_JoystickOpen(0);
|
||||
number_of_buttons = SDL_JoystickNumButtons(joystick);</PRE
|
||||
>
|
||||
|
||||
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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidevideo.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideinputkeyboard.html"
|
||||
>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="guide.html"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Handling the Keyboard</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
715
docs/html/guideinputkeyboard.html
Normal file
715
docs/html/guideinputkeyboard.html
Normal file
|
@ -0,0 +1,715 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Handling the Keyboard</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEINPUTKEYBOARD"
|
||||
>Handling the Keyboard</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN205"
|
||||
>Keyboard Related Structures</A
|
||||
></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="AEN208"
|
||||
>SDLKey</A
|
||||
></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="AEN216"
|
||||
>SDLMod</A
|
||||
></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="AEN222"
|
||||
>SDL_keysym</A
|
||||
></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="AEN241"
|
||||
>SDL_KeyboardEvent</A
|
||||
></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="AEN258"
|
||||
>Reading Keyboard Events</A
|
||||
></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:
|
||||
<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( &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
|
||||
>
|
||||
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="AEN269"
|
||||
>A More Detailed Look</A
|
||||
></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 < 0x80 translate directly a characters ASCII value. THis is used in the example below</P
|
||||
></BLOCKQUOTE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN282"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 3-1. keys.c - Key event information</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> #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 ) ){
|
||||
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( &event ) ){
|
||||
|
||||
switch( event.type ){
|
||||
/* Keyboard event */
|
||||
/* Pass the event data onto PrintKeyInfo() */
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
PrintKeyInfo( &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->type == SDL_KEYUP )
|
||||
printf( "Release:- " );
|
||||
else
|
||||
printf( "Press:- " );
|
||||
|
||||
/* Print the hardware scancode first */
|
||||
printf( "Scancode: 0x%02X", key->keysym.scancode );
|
||||
/* Print the name of the key */
|
||||
printf( ", Name: %s", SDL_GetKeyName( key->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->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->keysym.unicode < 0x80 && key->keysym.unicode > 0 ){
|
||||
printf( "%c (0x%04X)", (char)key->keysym.unicode,
|
||||
key->keysym.unicode );
|
||||
}
|
||||
else{
|
||||
printf( "? (0x%04X)", key->keysym.unicode );
|
||||
}
|
||||
}
|
||||
printf( "\n" );
|
||||
/* Print modifier info */
|
||||
PrintModifiers( key->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 & KMOD_NUM ) printf( "NUMLOCK " );
|
||||
if( mod & KMOD_CAPS ) printf( "CAPSLOCK " );
|
||||
if( mod & KMOD_LCTRL ) printf( "LCTRL " );
|
||||
if( mod & KMOD_RCTRL ) printf( "RCTRL " );
|
||||
if( mod & KMOD_RSHIFT ) printf( "RSHIFT " );
|
||||
if( mod & KMOD_LSHIFT ) printf( "LSHIFT " );
|
||||
if( mod & KMOD_RALT ) printf( "RALT " );
|
||||
if( mod & KMOD_LALT ) printf( "LALT " );
|
||||
if( mod & KMOD_CTRL ) printf( "CTRL " );
|
||||
if( mod & KMOD_SHIFT ) printf( "SHIFT " );
|
||||
if( mod & KMOD_ALT ) printf( "ALT " );
|
||||
printf( "\n" );
|
||||
}</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN285"
|
||||
>Game-type Input</A
|
||||
></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="AEN288"
|
||||
></A
|
||||
><BLOCKQUOTE
|
||||
CLASS="BLOCKQUOTE"
|
||||
><P
|
||||
>Keyboard events <I
|
||||
CLASS="EMPHASIS"
|
||||
>only</I
|
||||
> 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, when you press the down key you want him to slide down the screen. Examine the following code, it highlights and 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( &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:
|
||||
<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( &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 < 0 )
|
||||
alien_xvel = 0;
|
||||
break;
|
||||
case SDLK_RIGHT:
|
||||
if( alien_xvel > 0 )
|
||||
alien_xvel = 0;
|
||||
break;
|
||||
case SDLK_UP:
|
||||
if( alien_yvel < 0 )
|
||||
alien_yvel = 0;
|
||||
break;
|
||||
case SDLK_DOWN:
|
||||
if( alien_yvel > 0 )
|
||||
alien_yvel = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
.
|
||||
.
|
||||
/* Update the alien position */
|
||||
alien_x += alien_xvel;
|
||||
alien_y += alien_yvel;</PRE
|
||||
>
|
||||
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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideinput.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideexamples.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Examples</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
170
docs/html/guidepreface.html
Normal file
170
docs/html/guidepreface.html
Normal file
|
@ -0,0 +1,170 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Preface</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guideaboutsdldoc.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="PREFACE"
|
||||
><H1
|
||||
><A
|
||||
NAME="GUIDEPREFACE"
|
||||
>Preface</A
|
||||
></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"
|
||||
>About SDL</A
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guide.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideaboutsdldoc.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>About SDLdoc</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
165
docs/html/guidethebasics.html
Normal file
165
docs/html/guidethebasics.html
Normal file
|
@ -0,0 +1,165 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>The Basics</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guidebasicsinit.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="GUIDETHEBASICS"
|
||||
>Chapter 1. The Basics</A
|
||||
></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"
|
||||
>Introduction</A
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidecredits.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidebasicsinit.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Initializing SDL</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
173
docs/html/guidetimeexamples.html
Normal file
173
docs/html/guidetimeexamples.html
Normal file
|
@ -0,0 +1,173 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Time Examples</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>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"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDETIMEEXAMPLES"
|
||||
>Time Examples</A
|
||||
></H1
|
||||
><P
|
||||
></P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN373"
|
||||
>Time based game loop</A
|
||||
></H2
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#define TICK_INTERVAL 30
|
||||
|
||||
Uint32 TimeLeft(void)
|
||||
{
|
||||
static Uint32 next_time = 0;
|
||||
Uint32 now;
|
||||
|
||||
now = SDL_GetTicks();
|
||||
if ( next_time <= now ) {
|
||||
next_time = now+TICK_INTERVAL;
|
||||
return(0);
|
||||
}
|
||||
return(next_time-now);
|
||||
}
|
||||
|
||||
|
||||
/* main game loop
|
||||
|
||||
while ( game_running ) {
|
||||
UpdateGameState();
|
||||
SDL_Delay(TimeLeft());
|
||||
} </PRE
|
||||
></P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidecdromexamples.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="reference.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL Reference</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
705
docs/html/guidevideo.html
Normal file
705
docs/html/guidevideo.html
Normal file
|
@ -0,0 +1,705 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Graphics and Video</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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="Input handling"
|
||||
HREF="guideinput.html"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFF8DC"
|
||||
TEXT="#000000"
|
||||
LINK="#0000ee"
|
||||
VLINK="#551a8b"
|
||||
ALINK="#ff0000"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guideinput.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="GUIDEVIDEO"
|
||||
>Chapter 2. Graphics and Video</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEVIDEOOPENGL"
|
||||
>Using OpenGL With SDL</A
|
||||
></H1
|
||||
><P
|
||||
>SDL has the ability to create and use OpenGL contexts on several platforms(Linux/X11, Win32, BeOS, MacOS Classic/Toolbox, MacOS 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="AEN65"
|
||||
>Initialisation</A
|
||||
></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, <I
|
||||
CLASS="EMPHASIS"
|
||||
>not</I
|
||||
> by passing the <TT
|
||||
CLASS="LITERAL"
|
||||
>SDL_DOUBLEBUF</TT
|
||||
> flag to <TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_SetVideoMode</TT
|
||||
>.
|
||||
<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 ) < 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->vfmt->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
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN77"
|
||||
>Drawing</A
|
||||
></H2
|
||||
><P
|
||||
>Apart from initialisation, using OpenGL within SDL is the same as using. However if you have request a double buffered display (using <A
|
||||
HREF="sdlglsetattribute.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_GL_SetAttribute</TT
|
||||
></A
|
||||
>) and one (which can be checked by using <A
|
||||
HREF="sdlglgetattribute.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_GL_GetAttribute</TT
|
||||
></A
|
||||
>), then you must use <A
|
||||
HREF="sdlglswapbuffers.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_GL_SwapBuffers()</TT
|
||||
></A
|
||||
> to swap the buffers and update the display.</P
|
||||
><P
|
||||
>A full example code listing is now presented below.</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN87"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-1. gl.c - SDL OpenGL Example</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>/*
|
||||
* SDL OpenGL Tutorial.
|
||||
* (c) Michael Vance, 2000
|
||||
* briareos@lokigames.com
|
||||
*
|
||||
* Distributed under terms of the LGPL.
|
||||
*/
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
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->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( &event ) ) {
|
||||
|
||||
switch( event.type ) {
|
||||
case SDL_KEYDOWN:
|
||||
/* Handle key presses. */
|
||||
handle_key_down( &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 > 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 ) < 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->vfmt->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
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidebasicsinit.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideinput.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Input handling</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
473
docs/html/guidevideoexamples.html
Normal file
473
docs/html/guidevideoexamples.html
Normal file
|
@ -0,0 +1,473 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Video Examples</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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="Event Examples"
|
||||
HREF="guideeventexamples.html"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFF8DC"
|
||||
TEXT="#000000"
|
||||
LINK="#0000ee"
|
||||
VLINK="#551a8b"
|
||||
ALINK="#ff0000"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 4. Examples</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="guideeventexamples.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="GUIDEVIDEOEXAMPLES"
|
||||
>Video Examples</A
|
||||
></H1
|
||||
><P
|
||||
></P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN303"
|
||||
>Initializing the video display</A
|
||||
></H2
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> SDL_Surface *screen;
|
||||
|
||||
/* Initialize the SDL library */
|
||||
if( SDL_Init(SDL_INIT_VIDEO) < 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 */
|
||||
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
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN307"
|
||||
>Initializing the best video mode</A
|
||||
></H2
|
||||
><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->format->BitsPerPixel);</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN311"
|
||||
>Loading and displaying a BMP file</A
|
||||
></H2
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> SDL_Surface *image;
|
||||
SDL_Rect dest;
|
||||
int ncolors, i;
|
||||
SDL_Color *colors;
|
||||
|
||||
/* Load the BMP file into a surface */
|
||||
image = SDL_LoadBMP("sample.bmp");
|
||||
if ( image == NULL ) {
|
||||
fprintf(stderr, "Couldn't load sample.bmp: %s\n",
|
||||
SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set the display colors -- SDL_SetColors() only does something on
|
||||
palettized displays, but it doesn't hurt anything on HiColor or
|
||||
TrueColor displays.
|
||||
If the display colors have already been set, this step can be
|
||||
skipped, and the library will automatically map the image to
|
||||
the current display colors.
|
||||
*/
|
||||
if ( image->format->palette ) {
|
||||
ncolors = image->format->palette->ncolors;
|
||||
colors = (SDL_Color *)malloc(ncolors*sizeof(SDL_Color));
|
||||
memcpy(colors, image->format->palette->colors, ncolors);
|
||||
}
|
||||
else {
|
||||
int r, g, b;
|
||||
|
||||
/* Allocate 256 color palette */
|
||||
ncolors = 256;
|
||||
colors = (SDL_Color *)malloc(ncolors*sizeof(SDL_Color));
|
||||
|
||||
/* Set a 3,3,2 color cube */
|
||||
for ( r=0; r<8; ++r ) {
|
||||
for ( g=0; g<8; ++g ) {
|
||||
for ( b=0; b<4; ++b ) {
|
||||
i = ((r<<5)|(g<<2)|b);
|
||||
colors[i].r = r<<5;
|
||||
colors[i].g = g<<5;
|
||||
colors[i].b = b<<6;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Note: A better way of allocating the palette might be
|
||||
to calculate the frequency of colors in the image
|
||||
and create a palette based on that information.
|
||||
*/
|
||||
}
|
||||
/* Set colormap, try for all the colors, but don't worry about it */
|
||||
SDL_SetColors(screen, colors, 0, ncolors);
|
||||
free(colors);
|
||||
|
||||
/* Blit onto the screen surface */
|
||||
dest.x = 0;
|
||||
dest.y = 0;
|
||||
dest.w = image->w;
|
||||
dest.h = image->h;
|
||||
SDL_BlitSurface(image, NULL, screen, &dest);
|
||||
|
||||
SDL_UpdateRects(screen, 1, &dest);
|
||||
|
||||
/* Free the allocated BMP surface */
|
||||
SDL_FreeSurface(image);
|
||||
return;</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN315"
|
||||
>Drawing directly to the display</A
|
||||
></H2
|
||||
><P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
> /* Code to set a yellow pixel at the center of the screen */
|
||||
|
||||
Sint32 X, Y;
|
||||
Uint32 pixel;
|
||||
Uint8 *bits, bpp;
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
pixel = SDL_MapRGB(screen->format, 0xFF, 0xFF, 0x00);
|
||||
|
||||
/* Calculate the framebuffer offset of the center of the screen */
|
||||
if ( SDL_MUSTLOCK(screen) ) {
|
||||
if ( SDL_LockSurface(screen) < 0 )
|
||||
return;
|
||||
}
|
||||
bpp = screen->format->BytesPerPixel;
|
||||
X = screen->w/2;
|
||||
Y = screen->h/2;
|
||||
bits = ((Uint8 *)screen->pixels)+Y*screen->pitch+X*bpp;
|
||||
|
||||
/* Set the pixel */
|
||||
switch(bpp) {
|
||||
case 1:
|
||||
*((Uint8 *)(bits)) = (Uint8)pixel;
|
||||
break;
|
||||
case 2:
|
||||
*((Uint16 *)(bits)) = (Uint16)pixel;
|
||||
break;
|
||||
case 3: { /* Format/endian independent */
|
||||
Uint8 r, g, b;
|
||||
|
||||
r = (pixel>>screen->format->Rshift)&0xFF;
|
||||
g = (pixel>>screen->format->Gshift)&0xFF;
|
||||
b = (pixel>>screen->format->Bshift)&0xFF;
|
||||
*((bits)+screen->format->Rshift/8) = r;
|
||||
*((bits)+screen->format->Gshift/8) = g;
|
||||
*((bits)+screen->format->Bshift/8) = b;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
*((Uint32 *)(bits)) = (Uint32)pixel;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Update the display */
|
||||
if ( SDL_MUSTLOCK(screen) ) {
|
||||
SDL_UnlockSurface(screen);
|
||||
}
|
||||
SDL_UpdateRect(screen, X, Y, 1, 1);
|
||||
|
||||
return;</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN319"
|
||||
>Fastest possible surface blit</A
|
||||
></H2
|
||||
><P
|
||||
>There are three different ways you can draw an image to the screen:
|
||||
<P
|
||||
></P
|
||||
><TABLE
|
||||
BORDER="0"
|
||||
><TBODY
|
||||
><TR
|
||||
><TD
|
||||
>1.Create a surface and use <A
|
||||
HREF="sdlblitsurface.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_BlitSurface</TT
|
||||
></A
|
||||
> to blit it to the screen</TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
>2.Create the video surface in system memory and call <A
|
||||
HREF="sdlupdaterect.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_UpdateRect</TT
|
||||
></A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
>3.Create the video surface in video memory and call <A
|
||||
HREF="sdllocksurface.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_LockSurface</TT
|
||||
></A
|
||||
></TD
|
||||
></TR
|
||||
></TBODY
|
||||
></TABLE
|
||||
><P
|
||||
></P
|
||||
>
|
||||
The best way to do this is to combine methods:
|
||||
<PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "SDL.h"
|
||||
#include "SDL_timer.h"
|
||||
|
||||
void ComplainAndExit(void)
|
||||
{
|
||||
fprintf(stderr, "Problem: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_PixelFormat fmt;
|
||||
SDL_Surface *screen, *locked;
|
||||
SDL_Surface *imagebmp, *image;
|
||||
SDL_Rect dstrect;
|
||||
int i;
|
||||
Uint8 *buffer;
|
||||
|
||||
/* Initialize SDL */
|
||||
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
|
||||
ComplainAndExit();
|
||||
}
|
||||
atexit(SDL_Quit);
|
||||
|
||||
/* Load a BMP image into a surface */
|
||||
imagebmp = SDL_LoadBMP("image.bmp");
|
||||
if ( imagebmp == NULL ) {
|
||||
ComplainAndExit();
|
||||
}
|
||||
|
||||
/* Set the video mode (640x480 at native depth) */
|
||||
screen = SDL_SetVideoMode(640, 480, 0, SDL_HWSURFACE|SDL_FULLSCREEN);
|
||||
if ( screen == NULL ) {
|
||||
ComplainAndExit();
|
||||
}
|
||||
|
||||
/* Set the video colormap */
|
||||
if ( imagebmp->format->palette != NULL ) {
|
||||
SDL_SetColors(screen,
|
||||
imagebmp->format->palette->colors, 0,
|
||||
imagebmp->format->palette->ncolors);
|
||||
}
|
||||
|
||||
/* Convert the image to the video format (maps colors) */
|
||||
image = SDL_DisplayFormat(imagebmp);
|
||||
SDL_FreeSurface(imagebmp);
|
||||
if ( image == NULL ) {
|
||||
ComplainAndExit();
|
||||
}
|
||||
|
||||
/* Draw bands of color on the raw surface */
|
||||
if ( SDL_MUSTLOCK(screen) ) {
|
||||
if ( SDL_LockSurface(screen) < 0 )
|
||||
ComplainAndExit();
|
||||
}
|
||||
buffer=(Uint8 *)screen->pixels;
|
||||
for ( i=0; i<screen->h; ++i ) {
|
||||
memset(buffer,(i*255)/screen->h,
|
||||
screen->w*screen->format->BytesPerPixel);
|
||||
buffer += screen->pitch;
|
||||
}
|
||||
if ( SDL_MUSTLOCK(screen) ) {
|
||||
SDL_UnlockSurface(screen);
|
||||
}
|
||||
|
||||
/* Blit the image to the center of the screen */
|
||||
dstrect.x = (screen->w-image->w)/2;
|
||||
dstrect.y = (screen->h-image->h)/2;
|
||||
dstrect.w = image->w;
|
||||
dstrect.h = image->h;
|
||||
if ( SDL_BlitSurface(image, NULL, screen, &dstrect) < 0 ) {
|
||||
SDL_FreeSurface(image);
|
||||
ComplainAndExit();
|
||||
}
|
||||
SDL_FreeSurface(image);
|
||||
|
||||
/* Update the screen */
|
||||
SDL_UpdateRects(screen, 1, &dstrect);
|
||||
|
||||
SDL_Delay(5000); /* Wait 5 seconds */
|
||||
exit(0);
|
||||
}</PRE
|
||||
></P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideexamples.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guideeventexamples.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Event Examples</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
1049
docs/html/index.html
Normal file
1049
docs/html/index.html
Normal file
File diff suppressed because it is too large
Load diff
285
docs/html/joystick.html
Normal file
285
docs/html/joystick.html
Normal file
|
@ -0,0 +1,285 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Joystick</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlnumjoysticks.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="JOYSTICK"
|
||||
>Chapter 9. Joystick</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdlnumjoysticks.html"
|
||||
>SDL_NumJoysticks</A
|
||||
> — Count available joysticks.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickname.html"
|
||||
>SDL_JoystickName</A
|
||||
> — Get joystick name.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickopen.html"
|
||||
>SDL_JoystickOpen</A
|
||||
> — Opens a joystick for use.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickopened.html"
|
||||
>SDL_JoystickOpened</A
|
||||
> — Determine if a joystick has been opened</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickindex.html"
|
||||
>SDL_JoystickIndex</A
|
||||
> — Get the index of an SDL_Joystick.</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoysticknumaxes.html"
|
||||
>SDL_JoystickNumAxes</A
|
||||
> — Get the number of joystick axes</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoysticknumballs.html"
|
||||
>SDL_JoystickNumBalls</A
|
||||
> — Get the number of joystick trackballs</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoysticknumhats.html"
|
||||
>SDL_JoystickNumHats</A
|
||||
> — Get the number of joystick hats</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoysticknumbuttons.html"
|
||||
>SDL_JoystickNumButtons</A
|
||||
> — Get the number of joysitck buttons</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickupdate.html"
|
||||
>SDL_JoystickUpdate</A
|
||||
> — Updates the state of all joysticks</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickgetaxis.html"
|
||||
>SDL_JoystickGetAxis</A
|
||||
> — Get the current state of an axis</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickgethat.html"
|
||||
>SDL_JoystickGetHat</A
|
||||
> — Get the current state of a joystick hat</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickgetbutton.html"
|
||||
>SDL_JoystickGetButton</A
|
||||
> — Get the current state of a given button on a given joystick</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickgetball.html"
|
||||
>SDL_JoystickGetBall</A
|
||||
> — Get relative trackball motion</DT
|
||||
><DT
|
||||
><A
|
||||
HREF="sdljoystickclose.html"
|
||||
>SDL_JoystickClose</A
|
||||
> — 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 <I
|
||||
CLASS="EMPHASIS"
|
||||
>not</I
|
||||
> 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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdljoystickeventstate.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlnumjoysticks.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_NumJoysticks</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
187
docs/html/reference.html
Normal file
187
docs/html/reference.html
Normal file
|
@ -0,0 +1,187 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL Reference</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="general.html"
|
||||
>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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="guidetimeexamples.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="general.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Time Examples</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>General</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
327
docs/html/sdlactiveevent.html
Normal file
327
docs/html/sdlactiveevent.html
Normal file
|
@ -0,0 +1,327 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_ActiveEvent</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlkeyboardevent.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLACTIVEEVENT"
|
||||
>SDL_ActiveEvent</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN3447"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_ActiveEvent -- Application visibility event structure</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN3450"
|
||||
></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="AEN3453"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN3455"
|
||||
></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="AEN3476"
|
||||
></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="AEN3492"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlevent.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlkeyboardevent.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_KeyboardEvent</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
275
docs/html/sdladdtimer.html
Normal file
275
docs/html/sdladdtimer.html
Normal file
|
@ -0,0 +1,275 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_AddTimer</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlremovetimer.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLADDTIMER"
|
||||
>SDL_AddTimer</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7854"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has
|
||||
elapsed.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7857"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7858"
|
||||
></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="AEN7867"
|
||||
></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.</P
|
||||
><P
|
||||
>The maximum resolution of this timer is 10 ms, which means that if
|
||||
you request a 16 ms timer, your callback will run approximately 20 ms
|
||||
later on an unloaded system. If you wanted to set a flag signaling
|
||||
a frame update at 30 frames per second (every 33 ms), you might set a
|
||||
timer for 30 ms (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="AEN7878"
|
||||
></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="AEN7882"
|
||||
></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="AEN7886"
|
||||
></A
|
||||
><H2
|
||||
>See Also</H2
|
||||
><P
|
||||
><A
|
||||
HREF="sdlremovetimer.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_RemoveTimer</TT
|
||||
></A
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldelay.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlremovetimer.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_RemoveTimer</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
548
docs/html/sdlaudiocvt.html
Normal file
548
docs/html/sdlaudiocvt.html
Normal file
|
@ -0,0 +1,548 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_AudioCVT</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlbuildaudiocvt.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLAUDIOCVT"
|
||||
>SDL_AudioCVT</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6262"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_AudioCVT -- Audio Conversion Structure</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6265"
|
||||
></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="AEN6268"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN6270"
|
||||
></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="AEN6322"
|
||||
></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="AEN6367"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlfreewav.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlbuildaudiocvt.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_BuildAudioCVT</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
581
docs/html/sdlaudiospec.html
Normal file
581
docs/html/sdlaudiospec.html
Normal file
|
@ -0,0 +1,581 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_AudioSpec</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlopenaudio.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLAUDIOSPEC"
|
||||
>SDL_AudioSpec</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN5885"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_AudioSpec -- Audio Specification Structure</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN5888"
|
||||
></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="AEN5891"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN5893"
|
||||
></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="AEN5928"
|
||||
></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="AEN5942"
|
||||
></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="AEN6017"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="audio.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlopenaudio.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_OpenAudio</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
322
docs/html/sdlblitsurface.html
Normal file
322
docs/html/sdlblitsurface.html
Normal file
|
@ -0,0 +1,322 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_BlitSurface</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlfillrect.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLBLITSURFACE"
|
||||
>SDL_BlitSurface</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1806"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1809"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1810"
|
||||
></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="AEN1816"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>This performs a fast blit from the source surface to the destination surface.</P
|
||||
><P
|
||||
>Only the position is used in the <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>dstrect</I
|
||||
></TT
|
||||
> (the
|
||||
width and height are ignored).</P
|
||||
><P
|
||||
>If either <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>srcrect</I
|
||||
></TT
|
||||
> or
|
||||
<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>dstrect</I
|
||||
></TT
|
||||
> are <TT
|
||||
CLASS="LITERAL"
|
||||
>NULL</TT
|
||||
>, the entire
|
||||
surface (<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>src</I
|
||||
></TT
|
||||
> or <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>dst</I
|
||||
></TT
|
||||
>) is
|
||||
copied.</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
|
||||
><DIV
|
||||
CLASS="NOTE"
|
||||
><BLOCKQUOTE
|
||||
CLASS="NOTE"
|
||||
><P
|
||||
><B
|
||||
>Note: </B
|
||||
>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
|
||||
>.</P
|
||||
></BLOCKQUOTE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN1835"
|
||||
></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)) < 0 )
|
||||
Sleep(10);
|
||||
-- Write image pixels to image->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="AEN1843"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlconvertsurface.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlfillrect.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_FillRect</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
283
docs/html/sdlbuildaudiocvt.html
Normal file
283
docs/html/sdlbuildaudiocvt.html
Normal file
|
@ -0,0 +1,283 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_BuildAudioCVT</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlconvertaudio.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLBUILDAUDIOCVT"
|
||||
>SDL_BuildAudioCVT</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6380"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6383"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6384"
|
||||
></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="AEN6390"
|
||||
></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="AEN6406"
|
||||
></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="AEN6410"
|
||||
></A
|
||||
><H2
|
||||
>Examples</H2
|
||||
><P
|
||||
>See <A
|
||||
HREF="sdlconvertaudio.html"
|
||||
><TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_ConvertAudio</TT
|
||||
></A
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6415"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlaudiocvt.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlconvertaudio.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_ConvertAudio</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
351
docs/html/sdlcd.html
Normal file
351
docs/html/sdlcd.html
Normal file
|
@ -0,0 +1,351 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CD</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdtrack.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCD"
|
||||
>SDL_CD</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6941"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CD -- CDROM Drive Information</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6944"
|
||||
></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="AEN6947"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN6949"
|
||||
></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="AEN6979"
|
||||
></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="AEN6989"
|
||||
></A
|
||||
><H2
|
||||
>Examples</H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int min, sec, frame;
|
||||
int frame_offset;
|
||||
|
||||
FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &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="AEN6992"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdclose.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdtrack.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDtrack</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
209
docs/html/sdlcdclose.html
Normal file
209
docs/html/sdlcdclose.html
Normal file
|
@ -0,0 +1,209 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDClose</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcd.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDCLOSE"
|
||||
>SDL_CDClose</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6916"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDClose -- Closes a SDL_CD handle</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6919"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6920"
|
||||
></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="AEN6926"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Closes the given <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>cdrom</I
|
||||
></TT
|
||||
> handle.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6930"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdeject.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcd.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CD</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
218
docs/html/sdlcdeject.html
Normal file
218
docs/html/sdlcdeject.html
Normal file
|
@ -0,0 +1,218 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDEject</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdclose.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDEJECT"
|
||||
>SDL_CDEject</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6888"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDEject -- Ejects a CDROM</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6891"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6892"
|
||||
></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="AEN6898"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Ejects the given <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>cdrom</I
|
||||
></TT
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6902"
|
||||
></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="AEN6907"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdstop.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdclose.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDClose</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
231
docs/html/sdlcdname.html
Normal file
231
docs/html/sdlcdname.html
Normal file
|
@ -0,0 +1,231 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDName</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdopen.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDNAME"
|
||||
>SDL_CDName</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6615"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6618"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6619"
|
||||
></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="AEN6625"
|
||||
></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="AEN6630"
|
||||
></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="AEN6640"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdnumdrives.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdopen.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDOpen</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
197
docs/html/sdlcdnumdrives.html
Normal file
197
docs/html/sdlcdnumdrives.html
Normal file
|
@ -0,0 +1,197 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDNumDrives</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdname.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDNUMDRIVES"
|
||||
>SDL_CDNumDrives</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6593"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6596"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6597"
|
||||
></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="AEN6603"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Returns the number of CD-ROM drives on the system.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6606"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="cdrom.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdname.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDName</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
267
docs/html/sdlcdopen.html
Normal file
267
docs/html/sdlcdopen.html
Normal file
|
@ -0,0 +1,267 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDOpen</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdstatus.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDOPEN"
|
||||
>SDL_CDOpen</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6649"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDOpen -- Opens a CD-ROM drive for access.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6652"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6653"
|
||||
></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="AEN6659"
|
||||
></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="AEN6667"
|
||||
></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->numtracks);
|
||||
for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
|
||||
FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
|
||||
printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
|
||||
}
|
||||
|
||||
SDL_CDClose(cdrom);</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6670"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdname.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdstatus.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDStatus</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
225
docs/html/sdlcdpause.html
Normal file
225
docs/html/sdlcdpause.html
Normal file
|
@ -0,0 +1,225 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDPause</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdresume.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDPAUSE"
|
||||
>SDL_CDPause</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6800"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDPause -- Pauses a CDROM</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6803"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6804"
|
||||
></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="AEN6810"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Pauses play on the given <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>cdrom</I
|
||||
></TT
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6814"
|
||||
></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="AEN6819"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdplaytracks.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdresume.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDResume</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
235
docs/html/sdlcdplay.html
Normal file
235
docs/html/sdlcdplay.html
Normal file
|
@ -0,0 +1,235 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDPlay</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdplaytracks.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDPLAY"
|
||||
>SDL_CDPlay</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6718"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDPlay -- Play a CD</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6721"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6722"
|
||||
></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="AEN6728"
|
||||
></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="AEN6734"
|
||||
></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="AEN6739"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdstatus.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdplaytracks.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDPlayTracks</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
317
docs/html/sdlcdplaytracks.html
Normal file
317
docs/html/sdlcdplaytracks.html
Normal file
|
@ -0,0 +1,317 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDPlayTracks</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdpause.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDPLAYTRACKS"
|
||||
>SDL_CDPlayTracks</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6750"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDPlayTracks -- Play the given CD track(s)</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6753"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6754"
|
||||
></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="AEN6760"
|
||||
></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="AEN6778"
|
||||
></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="AEN6783"
|
||||
></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
|
||||
>
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6787"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdplay.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdpause.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDPause</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
225
docs/html/sdlcdresume.html
Normal file
225
docs/html/sdlcdresume.html
Normal file
|
@ -0,0 +1,225 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDResume</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdstop.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDRESUME"
|
||||
>SDL_CDResume</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6830"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDResume -- Resumes a CDROM</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6833"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6834"
|
||||
></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="AEN6840"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Resumes play on the given <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>cdrom</I
|
||||
></TT
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6844"
|
||||
></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="AEN6849"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdpause.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdstop.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDStop</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
265
docs/html/sdlcdstatus.html
Normal file
265
docs/html/sdlcdstatus.html
Normal file
|
@ -0,0 +1,265 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDStatus</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdplay.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDSTATUS"
|
||||
>SDL_CDStatus</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6683"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDStatus -- Returns the current status of the given drive.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6686"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6687"
|
||||
></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 > 0)</PRE
|
||||
><P
|
||||
></P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6694"
|
||||
></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="AEN6706"
|
||||
></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 >= cdrom->numtracks) {
|
||||
track = cdrom->numtracks-1;
|
||||
}
|
||||
|
||||
if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
|
||||
playing = 1;
|
||||
}
|
||||
}
|
||||
return playing;
|
||||
}</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6709"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdopen.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdplay.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDPlay</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
218
docs/html/sdlcdstop.html
Normal file
218
docs/html/sdlcdstop.html
Normal file
|
@ -0,0 +1,218 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDStop</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcdeject.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDSTOP"
|
||||
>SDL_CDStop</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6860"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDStop -- Stops a CDROM</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6863"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6864"
|
||||
></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="AEN6870"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Stops play on the given <TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>cdrom</I
|
||||
></TT
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6874"
|
||||
></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="AEN6879"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdresume.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcdeject.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CDEject</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
305
docs/html/sdlcdtrack.html
Normal file
305
docs/html/sdlcdtrack.html
Normal file
|
@ -0,0 +1,305 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CDtrack</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="thread.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCDTRACK"
|
||||
>SDL_CDtrack</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7003"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CDtrack -- CD Track Information Structure</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7006"
|
||||
></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="AEN7009"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN7011"
|
||||
></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="AEN7032"
|
||||
></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="AEN7044"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcd.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="thread.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Multi-threaded Programming</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
197
docs/html/sdlcloseaudio.html
Normal file
197
docs/html/sdlcloseaudio.html
Normal file
|
@ -0,0 +1,197 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CloseAudio</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="cdrom.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCLOSEAUDIO"
|
||||
>SDL_CloseAudio</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6555"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CloseAudio -- Shuts down audio processing and closes the audio device.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6558"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6559"
|
||||
></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="AEN6565"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>This function shuts down audio processing and closes the audio device.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6568"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlunlockaudio.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="cdrom.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>CD-ROM</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
292
docs/html/sdlcolor.html
Normal file
292
docs/html/sdlcolor.html
Normal file
|
@ -0,0 +1,292 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_Color</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlpalette.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCOLOR"
|
||||
>SDL_Color</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN2581"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_Color -- Format independent color description</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN2584"
|
||||
></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="AEN2587"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN2589"
|
||||
></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="AEN2608"
|
||||
></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="AEN2615"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlrect.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlpalette.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_Palette</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
216
docs/html/sdlcondbroadcast.html
Normal file
216
docs/html/sdlcondbroadcast.html
Normal file
|
@ -0,0 +1,216 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CondBroadcast</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcondwait.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCONDBROADCAST"
|
||||
>SDL_CondBroadcast</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7712"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CondBroadcast -- Restart all threads waiting on a condition variable</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7715"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7716"
|
||||
></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="AEN7722"
|
||||
></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="AEN7728"
|
||||
></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
|
||||
> </P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondsignal.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondwait.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CondWait</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
216
docs/html/sdlcondsignal.html
Normal file
216
docs/html/sdlcondsignal.html
Normal file
|
@ -0,0 +1,216 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CondSignal</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcondbroadcast.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCONDSIGNAL"
|
||||
>SDL_CondSignal</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7685"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CondSignal -- Restart a thread wait on a condition variable</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7688"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7689"
|
||||
></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="AEN7695"
|
||||
></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="AEN7701"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldestroycond.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondbroadcast.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CondBroadcast</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
223
docs/html/sdlcondwait.html
Normal file
223
docs/html/sdlcondwait.html
Normal file
|
@ -0,0 +1,223 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CondWait</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcondwaittimeout.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCONDWAIT"
|
||||
>SDL_CondWait</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7739"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CondWait -- Wait on a condition variable</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7742"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7743"
|
||||
></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="AEN7749"
|
||||
></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="AEN7755"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondbroadcast.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondwaittimeout.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CondWaitTimeout</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
222
docs/html/sdlcondwaittimeout.html
Normal file
222
docs/html/sdlcondwaittimeout.html
Normal file
|
@ -0,0 +1,222 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CondWaitTimeout</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="time.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCONDWAITTIMEOUT"
|
||||
>SDL_CondWaitTimeout</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7768"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CondWaitTimeout -- Wait on a condition variable, with timeout</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7771"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7772"
|
||||
></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="AEN7778"
|
||||
></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="AEN7787"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondwait.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="time.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Time</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
399
docs/html/sdlconvertaudio.html
Normal file
399
docs/html/sdlconvertaudio.html
Normal file
|
@ -0,0 +1,399 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_ConvertAudio</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlmixaudio.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCONVERTAUDIO"
|
||||
>SDL_ConvertAudio</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN6426"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_ConvertAudio -- Convert audio data to a desired audio format.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN6429"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN6430"
|
||||
></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="AEN6436"
|
||||
></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
|
||||
>-><TT
|
||||
CLASS="STRUCTFIELD"
|
||||
><I
|
||||
>buf</I
|
||||
></TT
|
||||
> and <SPAN
|
||||
CLASS="STRUCTNAME"
|
||||
>cvt</SPAN
|
||||
>-><TT
|
||||
CLASS="STRUCTFIELD"
|
||||
><I
|
||||
>len</I
|
||||
></TT
|
||||
> fields must be setup. <SPAN
|
||||
CLASS="STRUCTNAME"
|
||||
>cvt</SPAN
|
||||
>-><TT
|
||||
CLASS="STRUCTFIELD"
|
||||
><I
|
||||
>buf</I
|
||||
></TT
|
||||
> should point to the audio data and <SPAN
|
||||
CLASS="STRUCTNAME"
|
||||
>cvt</SPAN
|
||||
>-><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
|
||||
>-><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
|
||||
>-><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
|
||||
>-><TT
|
||||
CLASS="STRUCTFIELD"
|
||||
><I
|
||||
>len</I
|
||||
></TT
|
||||
>*<TT
|
||||
CLASS="STRUCTFIELD"
|
||||
><I
|
||||
>cvt</I
|
||||
></TT
|
||||
>-><SPAN
|
||||
CLASS="STRUCTNAME"
|
||||
>len_ratio</SPAN
|
||||
>.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6471"
|
||||
></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=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
|
||||
obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
|
||||
|
||||
/* Set desired format */
|
||||
desired->freq=22050;
|
||||
desired->format=AUDIO_S16LSB;
|
||||
desired->samples=8192;
|
||||
desired->callback=my_audio_callback;
|
||||
desired->userdata=NULL;
|
||||
|
||||
/* Open the audio device */
|
||||
if ( SDL_OpenAudio(desired, obtained) < 0 ){
|
||||
fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
free(desired);
|
||||
|
||||
/* Load the test.wav */
|
||||
if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buf, &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(&wav_cvt,
|
||||
wav_spec.format, wav_spec.channels, wav_spec.freq,
|
||||
obtained->format, obtained->channels, obtained->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=(Uint8 *)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(&wav_cvt);
|
||||
|
||||
/* do whatever */
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN6474"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlbuildaudiocvt.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlmixaudio.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_MixAudio</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
261
docs/html/sdlconvertsurface.html
Normal file
261
docs/html/sdlconvertsurface.html
Normal file
|
@ -0,0 +1,261 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_ConvertSurface</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlblitsurface.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCONVERTSURFACE"
|
||||
>SDL_ConvertSurface</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1766"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_ConvertSurface -- Converts a surface to the same format as another surface.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1769"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1770"
|
||||
></A
|
||||
><P
|
||||
></P
|
||||
><PRE
|
||||
CLASS="FUNCSYNOPSISINFO"
|
||||
>#include "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="AEN1776"
|
||||
></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
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN1787"
|
||||
></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="AEN1791"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgetcliprect.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlblitsurface.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_BlitSurface</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
232
docs/html/sdlcreatecond.html
Normal file
232
docs/html/sdlcreatecond.html
Normal file
|
@ -0,0 +1,232 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateCond</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdldestroycond.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATECOND"
|
||||
>SDL_CreateCond</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7634"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateCond -- Create a condition variable</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7637"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7638"
|
||||
></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="AEN7644"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Creates a condition variable.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7647"
|
||||
></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="AEN7650"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlsemvalue.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldestroycond.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_DestroyCond</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
390
docs/html/sdlcreatecursor.html
Normal file
390
docs/html/sdlcreatecursor.html
Normal file
|
@ -0,0 +1,390 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateCursor</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlfreecursor.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATECURSOR"
|
||||
>SDL_CreateCursor</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1989"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateCursor -- Creates a new mouse cursor.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1992"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1993"
|
||||
></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="AEN1999"
|
||||
></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="AEN2005"
|
||||
></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="AEN2026"
|
||||
></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<32; ++row ) {
|
||||
for ( col=0; col<32; ++col ) {
|
||||
if ( col % 8 ) {
|
||||
data[i] <<= 1;
|
||||
mask[i] <<= 1;
|
||||
} else {
|
||||
++i;
|
||||
data[i] = mask[i] = 0;
|
||||
}
|
||||
switch (image[4+row][col]) {
|
||||
case 'X':
|
||||
data[i] |= 0x01;
|
||||
k[i] |= 0x01;
|
||||
break;
|
||||
case '.':
|
||||
mask[i] |= 0x01;
|
||||
break;
|
||||
case ' ':
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
|
||||
return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
|
||||
}</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN2029"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlwarpmouse.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlfreecursor.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_FreeCursor</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
241
docs/html/sdlcreatemutex.html
Normal file
241
docs/html/sdlcreatemutex.html
Normal file
|
@ -0,0 +1,241 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateMutex</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdldestroymutex.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATEMUTEX"
|
||||
>SDL_CreateMutex</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7195"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateMutex -- Create a mutex</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7198"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7199"
|
||||
></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="AEN7205"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Create a new, unlocked mutex.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7208"
|
||||
></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); </PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7211"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlkillthread.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldestroymutex.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_DestroyMutex</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
332
docs/html/sdlcreatergbsurface.html
Normal file
332
docs/html/sdlcreatergbsurface.html
Normal file
|
@ -0,0 +1,332 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateRGBSurface</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcreatergbsurfacefrom.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATERGBSURFACE"
|
||||
>SDL_CreateRGBSurface</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1316"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateRGBSurface -- Create an empty SDL_Surface</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1319"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1320"
|
||||
></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="AEN1326"
|
||||
></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="AEN1338"
|
||||
></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->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"
|
||||
>With this flag SDL will attempt to find the best location for this surface, either in system memory or video memory, to obtain hardware colorkey blitting support.</TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="LEFT"
|
||||
VALIGN="TOP"
|
||||
><TT
|
||||
CLASS="LITERAL"
|
||||
>SDL_SRCALPHA</TT
|
||||
></TD
|
||||
><TD
|
||||
ALIGN="LEFT"
|
||||
VALIGN="TOP"
|
||||
>With this flag SDL will attempt to find the best location for this surface, either in system memory or video memory, to obtain hardware alpha support</TD
|
||||
></TR
|
||||
></TBODY
|
||||
></TABLE
|
||||
><P
|
||||
></P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN1357"
|
||||
></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
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgetrgba.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcreatergbsurfacefrom.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CreateRGBSurfaceFrom</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
235
docs/html/sdlcreatergbsurfacefrom.html
Normal file
235
docs/html/sdlcreatergbsurfacefrom.html
Normal file
|
@ -0,0 +1,235 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateRGBSurfaceFrom</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlfreesurface.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATERGBSURFACEFROM"
|
||||
>SDL_CreateRGBSurfaceFrom</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1376"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1379"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1380"
|
||||
></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="AEN1386"
|
||||
></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 no 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="AEN1398"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcreatergbsurface.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlfreesurface.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_FreeSurface</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
295
docs/html/sdlcreatesemaphore.html
Normal file
295
docs/html/sdlcreatesemaphore.html
Normal file
|
@ -0,0 +1,295 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateSemaphore</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdldestroysemaphore.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATESEMAPHORE"
|
||||
>SDL_CreateSemaphore</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7311"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7314"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7315"
|
||||
></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="AEN7321"
|
||||
></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="AEN7330"
|
||||
></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="AEN7334"
|
||||
></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="AEN7338"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlmutexv.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldestroysemaphore.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_DestroySemaphore</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
215
docs/html/sdlcreatethread.html
Normal file
215
docs/html/sdlcreatethread.html
Normal file
|
@ -0,0 +1,215 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateThread</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlthreadid.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATETHREAD"
|
||||
>SDL_CreateThread</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7076"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7079"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7080"
|
||||
></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="AEN7086"
|
||||
></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="AEN7092"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="thread.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlthreadid.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_ThreadID</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
248
docs/html/sdlcreateyuvoverlay.html
Normal file
248
docs/html/sdlcreateyuvoverlay.html
Normal file
|
@ -0,0 +1,248 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_CreateYUVOverlay</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdllockyuvoverlay.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLCREATEYUVOVERLAY"
|
||||
>SDL_CreateYUVOverlay</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN2310"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_CreateYUVOverlay -- Create a YUV video overlay</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN2313"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN2314"
|
||||
></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="AEN2320"
|
||||
></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="AEN2333"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlglswapbuffers.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdllockyuvoverlay.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_LockYUVOverlay</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
203
docs/html/sdldelay.html
Normal file
203
docs/html/sdldelay.html
Normal file
|
@ -0,0 +1,203 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_Delay</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdladdtimer.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDELAY"
|
||||
>SDL_Delay</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7830"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_Delay -- Wait a specified number of milliseconds before returning.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7833"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7834"
|
||||
></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="AEN7840"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Wait a specified number of milliseconds before returning. <TT
|
||||
CLASS="FUNCTION"
|
||||
>SDL_Delay</TT
|
||||
> will wait at <I
|
||||
CLASS="EMPHASIS"
|
||||
>least</I
|
||||
> the specified time, but possible longer due to OS scheduling.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7845"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgetticks.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdladdtimer.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_AddTimer</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
198
docs/html/sdldestroycond.html
Normal file
198
docs/html/sdldestroycond.html
Normal file
|
@ -0,0 +1,198 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_DestroyCond</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlcondsignal.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDESTROYCOND"
|
||||
>SDL_DestroyCond</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7663"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_DestroyCond -- Destroy a condition variable</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7666"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7667"
|
||||
></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="AEN7673"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Destroys a condition variable.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7676"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcreatecond.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcondsignal.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_CondSignal</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
201
docs/html/sdldestroymutex.html
Normal file
201
docs/html/sdldestroymutex.html
Normal file
|
@ -0,0 +1,201 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_DestroyMutex</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlmutexp.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDESTROYMUTEX"
|
||||
>SDL_DestroyMutex</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7224"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_DestroyMutex -- Destroy a mutex</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7227"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7228"
|
||||
></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="AEN7234"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Destroy a previously <A
|
||||
HREF="sdlcreatemutex.html"
|
||||
>created</A
|
||||
> mutex.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN7238"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcreatemutex.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlmutexp.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_mutexP</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
270
docs/html/sdldestroysemaphore.html
Normal file
270
docs/html/sdldestroysemaphore.html
Normal file
|
@ -0,0 +1,270 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_DestroySemaphore</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlsemwait.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDESTROYSEMAPHORE"
|
||||
>SDL_DestroySemaphore</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN7357"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_DestroySemaphore -- Destroys a semaphore that was created by <A
|
||||
HREF="sdlcreatesemaphore.html"
|
||||
>SDL_CreateSemaphore</A
|
||||
>.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN7361"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN7362"
|
||||
></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="AEN7368"
|
||||
></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="AEN7375"
|
||||
></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="AEN7379"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlcreatesemaphore.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlsemwait.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_SemWait</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
254
docs/html/sdldisplayformat.html
Normal file
254
docs/html/sdldisplayformat.html
Normal file
|
@ -0,0 +1,254 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_DisplayFormat</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdldisplayformatalpha.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDISPLAYFORMAT"
|
||||
>SDL_DisplayFormat</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1898"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_DisplayFormat -- Convert a surface to the display format</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1901"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1902"
|
||||
></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="AEN1908"
|
||||
></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="AEN1915"
|
||||
></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="AEN1919"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlfillrect.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldisplayformatalpha.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_DisplayFormatAlpha</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
234
docs/html/sdldisplayformatalpha.html
Normal file
234
docs/html/sdldisplayformatalpha.html
Normal file
|
@ -0,0 +1,234 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_DisplayFormatAlpha</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlwarpmouse.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDISPLAYFORMATALPHA"
|
||||
>SDL_DisplayFormatAlpha</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN1936"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_DisplayFormatAlpha -- Convert a surface to the display format</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN1939"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN1940"
|
||||
></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="AEN1946"
|
||||
></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
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN1951"
|
||||
></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="AEN1955"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdldisplayformat.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlwarpmouse.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_WarpMouse</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
228
docs/html/sdldisplayyuvoverlay.html
Normal file
228
docs/html/sdldisplayyuvoverlay.html
Normal file
|
@ -0,0 +1,228 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_DisplayYUVOverlay</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlfreeyuvoverlay.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLDISPLAYYUVOVERLAY"
|
||||
>SDL_DisplayYUVOverlay</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN2410"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_DisplayYUVOverlay -- Blit the overlay to the display</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN2413"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN2414"
|
||||
></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="AEN2420"
|
||||
></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="AEN2429"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlunlockyuvoverlay.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlfreeyuvoverlay.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_FreeYUVOverlay</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
230
docs/html/sdlenablekeyrepeat.html
Normal file
230
docs/html/sdlenablekeyrepeat.html
Normal file
|
@ -0,0 +1,230 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_EnableKeyRepeat</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlgetmousestate.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLENABLEKEYREPEAT"
|
||||
>SDL_EnableKeyRepeat</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN5217"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_EnableKeyRepeat -- Set keyboard repeat rate.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN5220"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN5221"
|
||||
></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="AEN5227"
|
||||
></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="AEN5238"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlenableunicode.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgetmousestate.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_GetMouseState</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
228
docs/html/sdlenableunicode.html
Normal file
228
docs/html/sdlenableunicode.html
Normal file
|
@ -0,0 +1,228 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_EnableUNICODE</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlenablekeyrepeat.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLENABLEUNICODE"
|
||||
>SDL_EnableUNICODE</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN5187"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_EnableUNICODE -- Enable UNICODE translation</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN5190"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN5191"
|
||||
></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="AEN5197"
|
||||
></A
|
||||
><H2
|
||||
>Description</H2
|
||||
><P
|
||||
>Enables/Disables UNICODE keyboard translation.</P
|
||||
><P
|
||||
>If you wish to translate a keysym to it's printable representation, you need to enable UNICODE translation
|
||||
using this function (<TT
|
||||
CLASS="PARAMETER"
|
||||
><I
|
||||
>enable</I
|
||||
></TT
|
||||
>=0) and then look in the <TT
|
||||
CLASS="STRUCTFIELD"
|
||||
><I
|
||||
>unicode</I
|
||||
></TT
|
||||
> member
|
||||
of the <A
|
||||
HREF="sdlkeysym.html"
|
||||
><SPAN
|
||||
CLASS="STRUCTNAME"
|
||||
>SDL_keysym</SPAN
|
||||
></A
|
||||
> structure. This value will be zero for keysyms
|
||||
that do not have a printable representation. UNICODE translation is disabled by default as the conversion can cause a slight overhead.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN5205"
|
||||
></A
|
||||
><H2
|
||||
>Return Value</H2
|
||||
><P
|
||||
>Returns the previous translation mode.</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN5208"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgetkeyname.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlenablekeyrepeat.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_EnableKeyRepeat</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
942
docs/html/sdlevent.html
Normal file
942
docs/html/sdlevent.html
Normal file
|
@ -0,0 +1,942 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_Event</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlactiveevent.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLEVENT"
|
||||
>SDL_Event</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN3214"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_Event -- General event structure</DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN3217"
|
||||
></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_QuitEvent quit;
|
||||
SDL_UserEvent user;
|
||||
SDL_SywWMEvent syswm;
|
||||
} SDL_Event;</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN3220"
|
||||
></A
|
||||
><H2
|
||||
>Structure Data</H2
|
||||
><DIV
|
||||
CLASS="INFORMALTABLE"
|
||||
><A
|
||||
NAME="AEN3222"
|
||||
></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
|
||||
>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="AEN3289"
|
||||
></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="AEN3297"
|
||||
></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_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="AEN3377"
|
||||
></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(&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 <I
|
||||
CLASS="EMPHASIS"
|
||||
>type</I
|
||||
> 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 <I
|
||||
CLASS="EMPHASIS"
|
||||
>and</I
|
||||
> 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(&user_event);</PRE
|
||||
></P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="REFSECT1"
|
||||
><A
|
||||
NAME="AEN3434"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="eventstructures.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlactiveevent.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_ActiveEvent</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
268
docs/html/sdleventstate.html
Normal file
268
docs/html/sdleventstate.html
Normal file
|
@ -0,0 +1,268 @@
|
|||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>SDL_EventState</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
||||
"><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
|
||||
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"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="sdlgetkeystate.html"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><H1
|
||||
><A
|
||||
NAME="SDLEVENTSTATE"
|
||||
>SDL_EventState</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="REFNAMEDIV"
|
||||
><A
|
||||
NAME="AEN5028"
|
||||
></A
|
||||
><H2
|
||||
>Name</H2
|
||||
>SDL_EventState -- This function allows you to set the state of processing certain events.</DIV
|
||||
><DIV
|
||||
CLASS="REFSYNOPSISDIV"
|
||||
><A
|
||||
NAME="AEN5031"
|
||||
></A
|
||||
><H2
|
||||
>Synopsis</H2
|
||||
><DIV
|
||||
CLASS="FUNCSYNOPSIS"
|
||||
><A
|
||||
NAME="AEN5032"
|
||||
></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="AEN5038"
|
||||
></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="AEN5059"
|
||||
></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
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgeteventfilter.html"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="index.html"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="sdlgetkeystate.html"
|
||||
>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"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>SDL_GetKeyState</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue