/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/LICENSE |
---|
0,0 → 1,504 |
GNU LESSER GENERAL PUBLIC LICENSE |
Version 2.1, February 1999 |
Copyright (C) 1991, 1999 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 Lesser GPL. It also counts |
as the successor of the GNU Library Public License, version 2, hence |
the version number 2.1.] |
Preamble |
The licenses for most software are designed to take away your |
freedom to share and change it. By contrast, the GNU General Public |
Licenses are intended to guarantee your freedom to share and change |
free software--to make sure the software is free for all its users. |
This license, the Lesser General Public License, applies to some |
specially designated software packages--typically libraries--of the |
Free Software Foundation and other authors who decide to use it. You |
can use it too, but we suggest you first think carefully about whether |
this license or the ordinary General Public License is the better |
strategy to use in any particular case, based on the explanations below. |
When we speak of free software, we are referring to freedom of use, |
not price. Our General Public Licenses are designed to make sure that |
you have the freedom to distribute copies of free software (and charge |
for this service if you wish); that you receive source code or can get |
it if you want it; that you can change the software and use pieces of |
it in new free programs; and that you are informed that you can do |
these things. |
To protect your rights, we need to make restrictions that forbid |
distributors to deny you these rights or to ask you to surrender these |
rights. These restrictions translate to certain responsibilities for |
you if you distribute copies of the library or if you modify it. |
For example, if you distribute copies of the library, whether gratis |
or for a fee, you must give the recipients all the rights that we gave |
you. You must make sure that they, too, receive or can get the source |
code. If you link other code with the library, you must provide |
complete object files to the recipients, so that they can relink them |
with the library after making changes to the library and recompiling |
it. And you must show them these terms so they know their rights. |
We protect your rights with a two-step method: (1) we copyright the |
library, and (2) we offer you this license, which gives you legal |
permission to copy, distribute and/or modify the library. |
To protect each distributor, we want to make it very clear that |
there is no warranty for the free library. Also, if the library is |
modified by someone else and passed on, the recipients should know |
that what they have is not the original version, so that the original |
author's reputation will not be affected by problems that might be |
introduced by others. |
Finally, software patents pose a constant threat to the existence of |
any free program. We wish to make sure that a company cannot |
effectively restrict the users of a free program by obtaining a |
restrictive license from a patent holder. Therefore, we insist that |
any patent license obtained for a version of the library must be |
consistent with the full freedom of use specified in this license. |
Most GNU software, including some libraries, is covered by the |
ordinary GNU General Public License. This license, the GNU Lesser |
General Public License, applies to certain designated libraries, and |
is quite different from the ordinary General Public License. We use |
this license for certain libraries in order to permit linking those |
libraries into non-free programs. |
When a program is linked with a library, whether statically or using |
a shared library, the combination of the two is legally speaking a |
combined work, a derivative of the original library. The ordinary |
General Public License therefore permits such linking only if the |
entire combination fits its criteria of freedom. The Lesser General |
Public License permits more lax criteria for linking other code with |
the library. |
We call this license the "Lesser" General Public License because it |
does Less to protect the user's freedom than the ordinary General |
Public License. It also provides other free software developers Less |
of an advantage over competing non-free programs. These disadvantages |
are the reason we use the ordinary General Public License for many |
libraries. However, the Lesser license provides advantages in certain |
special circumstances. |
For example, on rare occasions, there may be a special need to |
encourage the widest possible use of a certain library, so that it becomes |
a de-facto standard. To achieve this, non-free programs must be |
allowed to use the library. A more frequent case is that a free |
library does the same job as widely used non-free libraries. In this |
case, there is little to gain by limiting the free library to free |
software only, so we use the Lesser General Public License. |
In other cases, permission to use a particular library in non-free |
programs enables a greater number of people to use a large body of |
free software. For example, permission to use the GNU C Library in |
non-free programs enables many more people to use the whole GNU |
operating system, as well as its variant, the GNU/Linux operating |
system. |
Although the Lesser General Public License is Less protective of the |
users' freedom, it does ensure that the user of a program that is |
linked with the Library has the freedom and the wherewithal to run |
that program using a modified version of the Library. |
The precise terms and conditions for copying, distribution and |
modification follow. Pay close attention to the difference between a |
"work based on the library" and a "work that uses the library". The |
former contains code derived from the library, whereas the latter must |
be combined with the library in order to run. |
GNU LESSER GENERAL PUBLIC LICENSE |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
0. This License Agreement applies to any software library or other |
program which contains a notice placed by the copyright holder or |
other authorized party saying it may be distributed under the terms of |
this Lesser General Public License (also called "this License"). |
Each licensee is addressed as "you". |
A "library" means a collection of software functions and/or data |
prepared so as to be conveniently linked with application programs |
(which use some of those functions and data) to form executables. |
The "Library", below, refers to any such software library or work |
which has been distributed under these terms. A "work based on the |
Library" means either the Library or any derivative work under |
copyright law: that is to say, a work containing the Library or a |
portion of it, either verbatim or with modifications and/or translated |
straightforwardly into another language. (Hereinafter, translation is |
included without limitation in the term "modification".) |
"Source code" for a work means the preferred form of the work for |
making modifications to it. For a library, complete source code means |
all the source code for all modules it contains, plus any associated |
interface definition files, plus the scripts used to control compilation |
and installation of the library. |
Activities other than copying, distribution and modification are not |
covered by this License; they are outside its scope. The act of |
running a program using the Library is not restricted, and output from |
such a program is covered only if its contents constitute a work based |
on the Library (independent of the use of the Library in a tool for |
writing it). Whether that is true depends on what the Library does |
and what the program that uses the Library does. |
1. You may copy and distribute verbatim copies of the Library's |
complete source code as you receive it, in any medium, provided that |
you conspicuously and appropriately publish on each copy an |
appropriate copyright notice and disclaimer of warranty; keep intact |
all the notices that refer to this License and to the absence of any |
warranty; and distribute a copy of this License along with the |
Library. |
You may charge a fee for the physical act of transferring a copy, |
and you may at your option offer warranty protection in exchange for a |
fee. |
2. You may modify your copy or copies of the Library or any portion |
of it, thus forming a work based on the Library, and copy and |
distribute such modifications or work under the terms of Section 1 |
above, provided that you also meet all of these conditions: |
a) The modified work must itself be a software library. |
b) You must cause the files modified to carry prominent notices |
stating that you changed the files and the date of any change. |
c) You must cause the whole of the work to be licensed at no |
charge to all third parties under the terms of this License. |
d) If a facility in the modified Library refers to a function or a |
table of data to be supplied by an application program that uses |
the facility, other than as an argument passed when the facility |
is invoked, then you must make a good faith effort to ensure that, |
in the event an application does not supply such function or |
table, the facility still operates, and performs whatever part of |
its purpose remains meaningful. |
(For example, a function in a library to compute square roots has |
a purpose that is entirely well-defined independent of the |
application. Therefore, Subsection 2d requires that any |
application-supplied function or table used by this function must |
be optional: if the application does not supply it, the square |
root function must still compute square roots.) |
These requirements apply to the modified work as a whole. If |
identifiable sections of that work are not derived from the Library, |
and can be reasonably considered independent and separate works in |
themselves, then this License, and its terms, do not apply to those |
sections when you distribute them as separate works. But when you |
distribute the same sections as part of a whole which is a work based |
on the Library, the distribution of the whole must be on the terms of |
this License, whose permissions for other licensees extend to the |
entire whole, and thus to each and every part regardless of who wrote |
it. |
Thus, it is not the intent of this section to claim rights or contest |
your rights to work written entirely by you; rather, the intent is to |
exercise the right to control the distribution of derivative or |
collective works based on the Library. |
In addition, mere aggregation of another work not based on the Library |
with the Library (or with a work based on the Library) on a volume of |
a storage or distribution medium does not bring the other work under |
the scope of this License. |
3. You may opt to apply the terms of the ordinary GNU General Public |
License instead of this License to a given copy of the Library. To do |
this, you must alter all the notices that refer to this License, so |
that they refer to the ordinary GNU General Public License, version 2, |
instead of to this License. (If a newer version than version 2 of the |
ordinary GNU General Public License has appeared, then you can specify |
that version instead if you wish.) Do not make any other change in |
these notices. |
Once this change is made in a given copy, it is irreversible for |
that copy, so the ordinary GNU General Public License applies to all |
subsequent copies and derivative works made from that copy. |
This option is useful when you wish to copy part of the code of |
the Library into a program that is not a library. |
4. You may copy and distribute the Library (or a portion or |
derivative of it, under Section 2) in object code or executable form |
under the terms of Sections 1 and 2 above provided that you accompany |
it with the complete corresponding machine-readable source code, which |
must be distributed under the terms of Sections 1 and 2 above on a |
medium customarily used for software interchange. |
If distribution of object code is made by offering access to copy |
from a designated place, then offering equivalent access to copy the |
source code from the same place satisfies the requirement to |
distribute the source code, even though third parties are not |
compelled to copy the source along with the object code. |
5. A program that contains no derivative of any portion of the |
Library, but is designed to work with the Library by being compiled or |
linked with it, is called a "work that uses the Library". Such a |
work, in isolation, is not a derivative work of the Library, and |
therefore falls outside the scope of this License. |
However, linking a "work that uses the Library" with the Library |
creates an executable that is a derivative of the Library (because it |
contains portions of the Library), rather than a "work that uses the |
library". The executable is therefore covered by this License. |
Section 6 states terms for distribution of such executables. |
When a "work that uses the Library" uses material from a header file |
that is part of the Library, the object code for the work may be a |
derivative work of the Library even though the source code is not. |
Whether this is true is especially significant if the work can be |
linked without the Library, or if the work is itself a library. The |
threshold for this to be true is not precisely defined by law. |
If such an object file uses only numerical parameters, data |
structure layouts and accessors, and small macros and small inline |
functions (ten lines or less in length), then the use of the object |
file is unrestricted, regardless of whether it is legally a derivative |
work. (Executables containing this object code plus portions of the |
Library will still fall under Section 6.) |
Otherwise, if the work is a derivative of the Library, you may |
distribute the object code for the work under the terms of Section 6. |
Any executables containing that work also fall under Section 6, |
whether or not they are linked directly with the Library itself. |
6. As an exception to the Sections above, you may also combine or |
link a "work that uses the Library" with the Library to produce a |
work containing portions of the Library, and distribute that work |
under terms of your choice, provided that the terms permit |
modification of the work for the customer's own use and reverse |
engineering for debugging such modifications. |
You must give prominent notice with each copy of the work that the |
Library is used in it and that the Library and its use are covered by |
this License. You must supply a copy of this License. If the work |
during execution displays copyright notices, you must include the |
copyright notice for the Library among them, as well as a reference |
directing the user to the copy of this License. Also, you must do one |
of these things: |
a) Accompany the work with the complete corresponding |
machine-readable source code for the Library including whatever |
changes were used in the work (which must be distributed under |
Sections 1 and 2 above); and, if the work is an executable linked |
with the Library, with the complete machine-readable "work that |
uses the Library", as object code and/or source code, so that the |
user can modify the Library and then relink to produce a modified |
executable containing the modified Library. (It is understood |
that the user who changes the contents of definitions files in the |
Library will not necessarily be able to recompile the application |
to use the modified definitions.) |
b) Use a suitable shared library mechanism for linking with the |
Library. A suitable mechanism is one that (1) uses at run time a |
copy of the library already present on the user's computer system, |
rather than copying library functions into the executable, and (2) |
will operate properly with a modified version of the library, if |
the user installs one, as long as the modified version is |
interface-compatible with the version that the work was made with. |
c) Accompany the work with a written offer, valid for at |
least three years, to give the same user the materials |
specified in Subsection 6a, above, for a charge no more |
than the cost of performing this distribution. |
d) If distribution of the work is made by offering access to copy |
from a designated place, offer equivalent access to copy the above |
specified materials from the same place. |
e) Verify that the user has already received a copy of these |
materials or that you have already sent this user a copy. |
For an executable, the required form of the "work that uses the |
Library" must include any data and utility programs needed for |
reproducing the executable from it. However, as a special exception, |
the materials to be distributed need not include anything that is |
normally distributed (in either source or binary form) with the major |
components (compiler, kernel, and so on) of the operating system on |
which the executable runs, unless that component itself accompanies |
the executable. |
It may happen that this requirement contradicts the license |
restrictions of other proprietary libraries that do not normally |
accompany the operating system. Such a contradiction means you cannot |
use both them and the Library together in an executable that you |
distribute. |
7. You may place library facilities that are a work based on the |
Library side-by-side in a single library together with other library |
facilities not covered by this License, and distribute such a combined |
library, provided that the separate distribution of the work based on |
the Library and of the other library facilities is otherwise |
permitted, and provided that you do these two things: |
a) Accompany the combined library with a copy of the same work |
based on the Library, uncombined with any other library |
facilities. This must be distributed under the terms of the |
Sections above. |
b) Give prominent notice with the combined library of the fact |
that part of it is a work based on the Library, and explaining |
where to find the accompanying uncombined form of the same work. |
8. You may not copy, modify, sublicense, link with, or distribute |
the Library except as expressly provided under this License. Any |
attempt otherwise to copy, modify, sublicense, link with, or |
distribute the Library is void, and will automatically terminate your |
rights under this License. However, parties who have received copies, |
or rights, from you under this License will not have their licenses |
terminated so long as such parties remain in full compliance. |
9. You are not required to accept this License, since you have not |
signed it. However, nothing else grants you permission to modify or |
distribute the Library or its derivative works. These actions are |
prohibited by law if you do not accept this License. Therefore, by |
modifying or distributing the Library (or any work based on the |
Library), you indicate your acceptance of this License to do so, and |
all its terms and conditions for copying, distributing or modifying |
the Library or works based on it. |
10. Each time you redistribute the Library (or any work based on the |
Library), the recipient automatically receives a license from the |
original licensor to copy, distribute, link with or modify the Library |
subject to these terms and conditions. You may not impose any further |
restrictions on the recipients' exercise of the rights granted herein. |
You are not responsible for enforcing compliance by third parties with |
this License. |
11. If, as a consequence of a court judgment or allegation of patent |
infringement or for any other reason (not limited to patent issues), |
conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot |
distribute so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you |
may not distribute the Library at all. For example, if a patent |
license would not permit royalty-free redistribution of the Library by |
all those who receive copies directly or indirectly through you, then |
the only way you could satisfy both it and this License would be to |
refrain entirely from distribution of the Library. |
If any portion of this section is held invalid or unenforceable under any |
particular circumstance, the balance of the section is intended to apply, |
and the section as a whole is intended to apply in other circumstances. |
It is not the purpose of this section to induce you to infringe any |
patents or other property right claims or to contest validity of any |
such claims; this section has the sole purpose of protecting the |
integrity of the free software distribution system which is |
implemented by public license practices. Many people have made |
generous contributions to the wide range of software distributed |
through that system in reliance on consistent application of that |
system; it is up to the author/donor to decide if he or she is willing |
to distribute software through any other system and a licensee cannot |
impose that choice. |
This section is intended to make thoroughly clear what is believed to |
be a consequence of the rest of this License. |
12. If the distribution and/or use of the Library is restricted in |
certain countries either by patents or by copyrighted interfaces, the |
original copyright holder who places the Library under this License may add |
an explicit geographical distribution limitation excluding those countries, |
so that distribution is permitted only in or among countries not thus |
excluded. In such case, this License incorporates the limitation as if |
written in the body of this License. |
13. The Free Software Foundation may publish revised and/or new |
versions of the Lesser General Public License from time to time. |
Such new versions will be similar in spirit to the present version, |
but may differ in detail to address new problems or concerns. |
Each version is given a distinguishing version number. If the Library |
specifies a version number of this License which applies to it and |
"any later version", you have the option of following the terms and |
conditions either of that version or of any later version published by |
the Free Software Foundation. If the Library does not specify a |
license version number, you may choose any version ever published by |
the Free Software Foundation. |
14. If you wish to incorporate parts of the Library into other free |
programs whose distribution conditions are incompatible with these, |
write to the author to ask for permission. For software which is |
copyrighted by the Free Software Foundation, write to the Free |
Software Foundation; we sometimes make exceptions for this. Our |
decision will be guided by the two goals of preserving the free status |
of all derivatives of our free software and of promoting the sharing |
and reuse of software generally. |
NO WARRANTY |
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO |
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. |
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR |
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY |
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE |
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME |
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN |
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY |
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU |
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR |
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE |
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
DAMAGES. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Libraries |
If you develop a new library, and you want it to be of the greatest |
possible use to the public, we recommend making it free software that |
everyone can redistribute and change. You can do so by permitting |
redistribution under these terms (or, alternatively, under the terms of the |
ordinary General Public License). |
To apply these terms, attach the following notices to the library. It is |
safest to attach them to the start of each source file to most effectively |
convey the exclusion of warranty; and each file should have at least the |
"copyright" line and a pointer to where the full notice is found. |
<one line to give the library's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with this library; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Also add information on how to contact you by electronic and paper mail. |
You should also get your employer (if you work as a programmer) or your |
school, if any, to sign a "copyright disclaimer" for the library, if |
necessary. Here is a sample; alter the names: |
Yoyodyne, Inc., hereby disclaims all copyright interest in the |
library `Frob' (a library for tweaking knobs) written by James Random Hacker. |
<signature of Ty Coon>, 1 April 1990 |
Ty Coon, President of Vice |
That's all there is to it! |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/Makefile |
---|
0,0 → 1,5 |
OUTFILE = libSDL_anim.a |
OBJS = anim.o |
CFLAGS = -I$(MENUETDEV)/include/SDL |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/Makefile.demo |
---|
0,0 → 1,6 |
OUTFILE = showanim |
OBJS = showanim.o |
CFLAGS = -I. -I$(MENUETDEV)/include/SDL |
LIBS = -L. -lSDL -lpng -lz -lSDL_anim -lpng -lz |
include $(MENUETDEV)/makefiles/Makefile_for_program |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/README |
---|
0,0 → 1,35 |
SDL_anim 0.2 |
The latest version of this library is available from: |
http://tamale.net/SDL_anim/ |
This is a simple library to load animations and blit them to SDL surfaces. |
This library supports PNG anim files. |
API: |
#include "SDL_anim.h" |
SDL_Animation *Anim_Load( const char *file ); |
int Anim_Free( SDL_Animation *anim ); |
int Anim_GetFrameNum( float start, float now ); |
int Anim_GetFrameRect( int frame, SDL_Rect *rect ); |
int Anim_BlitFrame( SDL_Surface dest, float start, float now ); |
int Anim_BlitFrameNum( SDL_Surface dest, int frame ); |
int Anim_DisplayFormat( SDL_Animation *anim ); |
Two programs are included: |
`showanim' is an example program that uses SDL_anim. |
`makeanim' creates PNG anim files. |
SDL_anim requires: |
libpng http://www.cdrom.com/pub/png/ |
zlib http://www.cdrom.com/pub/infozip/zlib/ |
This library is under the GNU Library General Public License, see the file |
"LICENSE" for details. |
To build under unix: |
gcc -I/home/mike/include/SDL/ -L/home/mike/lib Anim.c makeanim.c -o makeanim -lpng -lz -lSDL -lSDLmain -lpthread |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/SDL_anim.h |
---|
0,0 → 1,60 |
/* |
SDL_anim: an animation library for SDL |
Copyright (C) 2001, 2002 Michael Leonhard |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Michael Leonhard |
mike@tamale.net |
*/ |
#ifndef _SDLanim_h |
#define _SDLanim_h |
#include "SDL.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
struct SDL_Animation; |
typedef struct SDL_Animation { |
SDL_Surface *surface; |
int frames, w, h; |
Uint32 duration; |
} SDL_Animation; |
extern DECLSPEC struct SDL_Animation *Anim_Load( const char *file ); |
extern DECLSPEC void Anim_Free( SDL_Animation *anim ); |
extern DECLSPEC int Anim_GetFrameNum( SDL_Animation *anim, Uint32 start, Uint32 now ); |
extern DECLSPEC int Anim_BlitFrame( SDL_Animation *anim, Uint32 start, Uint32 now, SDL_Surface *dest, SDL_Rect *dr ); |
extern DECLSPEC void Anim_GetFrameRect( SDL_Animation *anim, int frame, SDL_Rect *rect ); |
extern DECLSPEC int Anim_BlitFrameNum( SDL_Animation *anim, int frame, SDL_Surface *dest, SDL_Rect *dr ); |
extern DECLSPEC int Anim_DisplayFormat( SDL_Animation *anim ); |
/* We'll use SDL for reporting errors */ |
#define Anim_SetError SDL_SetError |
#define Anim_GetError SDL_GetError |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
}; |
#endif |
#include "SDL/close_code.h" |
#endif /* _SDL_anim_h */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/anim.c |
---|
0,0 → 1,362 |
/* |
SDL_anim: an animation library for SDL |
Copyright (C) 2001, 2002 Michael Leonhard |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Michael Leonhard |
mike@tamale.net |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include <png.h> |
#include "SDL_anim.h" |
/* deal with MSVC++ crappiness */ |
#ifdef WIN32UNDEFINED |
#define strcasecmp _strcmpi |
#endif |
void Anim_Free( SDL_Animation *anim ) { |
SDL_FreeSurface( anim->surface ); |
free( anim ); |
} |
int Anim_GetFrameNum( SDL_Animation *anim, Uint32 start, Uint32 now ) { |
int mspf, ms, frame; |
if( now < start ) return 0; |
mspf = anim->duration / anim->frames; |
ms = now - start; |
if( mspf == 0 ) frame = 0; |
else frame = ms / mspf; |
return frame; |
} |
void Anim_GetFrameRect( SDL_Animation *anim, int frame, SDL_Rect *rect ) { |
rect->x = anim->w * (frame % anim->frames); |
rect->y = 0; |
rect->w = anim->w; |
rect->h = anim->h; |
} |
int Anim_BlitFrame( SDL_Animation *anim, Uint32 start, Uint32 now, SDL_Surface *dest, SDL_Rect *dr ) { |
int frame; |
frame = Anim_GetFrameNum( anim, start, now ); |
return Anim_BlitFrameNum( anim, frame, dest, dr ); |
} |
int Anim_BlitFrameNum( SDL_Animation *anim, int frame, SDL_Surface *dest, SDL_Rect *dr ) { |
SDL_Rect rect; |
Anim_GetFrameRect( anim, frame, &rect ); |
return SDL_BlitSurface( anim->surface, &rect, dest, dr ); |
} |
int Anim_DisplayFormat( SDL_Animation *anim ) { |
struct SDL_Surface *newsurface; |
if( SDL_WasInit( SDL_INIT_VIDEO ) == 0 ) return 0;/*"Video is not initialized.\n"*/ |
newsurface = SDL_DisplayFormatAlpha( anim->surface ); |
if( !newsurface ) return 0; |
anim->surface = newsurface; |
return 1; |
} |
int DoAnimFormat( char *text, int *duration, int *framewidth, int *numframes ) { |
char *tok; |
SDL_printf( "file is \"%s\"\n", text ); |
/* SDL_anim */ |
tok = strtok( text, " " ); |
if( !tok ) return 0; |
if( strcasecmp( tok, "SDL_anim" ) != 0 ) { |
SDL_printf( "no SDL_anim\n" ); |
return 0; |
} |
/* duration */ |
tok = strtok( NULL, " " ); |
if( !tok ) return 0; |
*duration = atoi( tok ); |
if( *duration < 1 ) { |
SDL_printf( "no duration\n" ); |
return 0; |
} |
/* framewidth */ |
tok = strtok( NULL, " " ); |
if( !tok ) return 0; |
*framewidth = atoi( tok ); |
if( *framewidth < 1 ) { |
SDL_printf( "no framewidth\n" ); |
return 0; |
} |
/* numframes */ |
tok = strtok( NULL, " " ); |
if( !tok ) return 0; |
*numframes = atoi( tok ); |
if( *numframes < 1 ) { |
SDL_printf( "no numframes\n" ); |
return 0; |
} |
return 1; |
} |
struct SDL_Animation *Anim_Load( const char *file ) { |
int ckey = -1, i; |
char buf[8]; |
static FILE *fp; /* "static" prevents setjmp corruption */ |
png_structp read_ptr; |
png_infop read_info_ptr, end_info_ptr; |
png_bytep *row_pointers; |
png_textp text_ptr; |
int num_text, t; |
int interlace_type, compression_type, filter_type, bit_depth, color_type; |
png_uint_32 width, height, row; |
int duration, framewidth, numframes; |
png_color_16p background; |
double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; |
double gamma; |
int intent; |
png_uint_16p hist; |
png_uint_32 offset_x, offset_y; |
int unit_type; |
png_charp purpose, units; |
png_charpp params; |
png_int_32 X0, X1; |
int type, nparams; |
png_uint_32 res_x, res_y; |
/* png_colorp palette; |
int num_palette; |
*/ png_color_8p sig_bit; |
png_bytep trans; |
int num_trans; |
png_color_16p trans_values; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
Uint32 Amask; |
SDL_Animation *anim; |
SDL_Surface *surface; |
SDL_Palette *palette; |
if( !file ) return NULL; |
/* printf( "opening file \"%s\"\n", file ); |
*/ |
/* open the file handle */ |
fp = fopen( file, "rb" ); |
if( fp == NULL ) { |
SDL_printf( "fopen() failed\n" ); |
return NULL; |
} |
/* check if it's PNG */ |
if( fread( buf, 1, 8, fp ) != 8 ) { |
SDL_printf( "fread() failed\n" ); |
return NULL; |
} |
if( png_sig_cmp( buf, (png_size_t)0, 8 ) ) { |
SDL_printf( "not a PNG file\n" ); |
return NULL; |
} |
fseek( fp, 0, SEEK_SET ); |
/* allocate read structure */ |
read_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL ); |
if( read_ptr == NULL ) { |
SDL_printf( "png_create_read_struct() failed\n" ); |
return NULL; |
} |
/* allocate read info structure */ |
read_info_ptr = png_create_info_struct( read_ptr ); |
if( read_info_ptr == NULL ) { |
SDL_printf( "png_create_info_struct() failed\n" ); |
return NULL; |
} |
end_info_ptr = png_create_info_struct( read_ptr ); |
if( end_info_ptr == NULL ) { |
SDL_printf( "png_create_info_struct() failed\n" ); |
return NULL; |
} |
/* set error handler code */ |
if( setjmp( read_ptr->jmpbuf ) ) { |
SDL_printf( "libpng read error\n" ); |
return NULL; |
} |
/* initialize stream */ |
png_init_io( read_ptr, fp ); |
png_set_read_status_fn( read_ptr, NULL ); |
/* read png info struct */ |
png_read_info( read_ptr, read_info_ptr ); |
/* get the info */ |
if( !png_get_IHDR( read_ptr, read_info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, &compression_type, &filter_type ) ) { |
SDL_printf( "png_get_IHDR() failed\n" ); |
return NULL; |
} |
/* background color */ |
png_get_bKGD( read_ptr, read_info_ptr, &background ); |
png_get_cHRM( read_ptr, read_info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y ); |
/* gamma */ |
png_get_gAMA( read_ptr, read_info_ptr, &gamma ); |
/* rendering intent */ |
png_get_sRGB( read_ptr, read_info_ptr, &intent ); |
/* Histogram */ |
png_get_hIST( read_ptr, read_info_ptr, &hist ); |
/* offsets */ |
png_get_oFFs( read_ptr, read_info_ptr, &offset_x, &offset_y, &unit_type ); |
png_get_pCAL( read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, &nparams, &units, ¶ms ); |
/* pixel density */ |
png_get_pHYs( read_ptr, read_info_ptr, &res_x, &res_y, &unit_type ); |
/* png_get_PLTE( read_ptr, read_info_ptr, &palette, &num_palette ); |
*/ |
/* significant bits */ |
png_get_sBIT( read_ptr, read_info_ptr, &sig_bit ); |
/* transparency */ |
if( png_get_tRNS( read_ptr, read_info_ptr, &trans, &num_trans, &trans_values ) ) { |
if( color_type == PNG_COLOR_TYPE_PALETTE ) { |
if( num_trans == 1 ) ckey = trans[0]; |
else png_set_expand( read_ptr ); |
} |
else ckey = 0; /* actual value will be set later */ |
} |
/* text chunks */ |
num_text = 0; |
if( !png_get_text( read_ptr, read_info_ptr, &text_ptr, &num_text ) ) { |
SDL_printf( "file has no text chunks\n" ); |
return NULL; |
} |
for( t = 0; t < num_text; t++ ) { |
if( strcasecmp( text_ptr[t].key, "format" ) == 0 ) { |
if( DoAnimFormat( text_ptr[t].text, &duration, &framewidth, &numframes ) ) break; |
} |
} |
if( t == num_text ) { |
SDL_printf( "file is not an SDL_anim PNG\n" ); |
return NULL; |
} |
png_set_strip_16( read_ptr ); |
png_set_packing( read_ptr ); |
if(color_type == PNG_COLOR_TYPE_GRAY) |
png_set_expand( read_ptr ); |
/* Allocate the SDL surface to hold the image */ |
Rmask = Gmask = Bmask = Amask = 0; |
if( color_type != PNG_COLOR_TYPE_PALETTE ) { |
if( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { |
Rmask = 0x000000FF; |
Gmask = 0x0000FF00; |
Bmask = 0x00FF0000; |
Amask = (read_info_ptr->channels == 4)? 0xFF000000 : 0; |
} |
else { |
int s = (read_info_ptr->channels == 4) ? 0 : 8; |
Rmask = 0xFF000000 >> s; |
Gmask = 0x00FF0000 >> s; |
Bmask = 0x0000FF00 >> s; |
Amask = 0x000000FF >> s; |
} |
} |
surface = SDL_AllocSurface( SDL_SWSURFACE, width, height, bit_depth * read_info_ptr->channels, Rmask, Gmask, Bmask, Amask ); |
if( surface == NULL ) { |
Anim_SetError("Out of memory"); |
return NULL; |
} |
if(ckey != -1) { |
if( color_type != PNG_COLOR_TYPE_PALETTE ) ckey = SDL_MapRGB( surface->format, (Uint8)trans_values->red, (Uint8)trans_values->green, (Uint8)trans_values->blue ); |
SDL_SetColorKey( surface, SDL_SRCCOLORKEY, ckey ); |
} |
/* allocate row pointers */ |
row_pointers = (png_bytep *)malloc( sizeof( png_bytep ) * height ); |
if( row_pointers == NULL ) { |
SDL_printf( "malloc() failed\n" ); |
return NULL; |
} |
for( row = 0; row < height; row++ ) { |
row_pointers[row] = (Uint8 *)surface->pixels + row * surface->pitch; |
} |
png_read_image( read_ptr, row_pointers ); |
/* end io */ |
/* printf( "done\n" ); |
*/ png_read_end( read_ptr, end_info_ptr ); |
/* cleanup */ |
png_destroy_read_struct( &read_ptr, &read_info_ptr, &end_info_ptr); |
fclose( fp ); |
/* Load the palette, if any */ |
palette = surface->format->palette; |
if( palette ) { |
if(color_type == PNG_COLOR_TYPE_GRAY) { |
palette->ncolors = 256; |
for( i = 0; i < 256; i++ ) { |
palette->colors[i].r = i; |
palette->colors[i].g = i; |
palette->colors[i].b = i; |
} |
} |
else if( read_info_ptr->num_palette > 0 ) { |
palette->ncolors = read_info_ptr->num_palette; |
for( i = 0; i < read_info_ptr->num_palette; ++i ) { |
palette->colors[i].b = read_info_ptr->palette[i].blue; |
palette->colors[i].g = read_info_ptr->palette[i].green; |
palette->colors[i].r = read_info_ptr->palette[i].red; |
} |
} |
} |
anim = (struct SDL_Animation *)malloc( sizeof( struct SDL_Animation ) ); |
if( !anim ) { |
SDL_printf( "malloc() failed\n" ); |
return NULL; |
} |
anim->surface = surface; |
anim->w = framewidth; |
anim->h = height; |
anim->frames = numframes; |
anim->duration = duration; |
return anim; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/anim.c.BAK |
---|
0,0 → 1,362 |
/* |
SDL_anim: an animation library for SDL |
Copyright (C) 2001, 2002 Michael Leonhard |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Michael Leonhard |
mike@tamale.net |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include <png.h> |
#include "SDL_anim.h" |
/* deal with MSVC++ crappiness */ |
#ifdef WIN32 |
#define strcasecmp _strcmpi |
#endif |
void Anim_Free( SDL_Animation *anim ) { |
SDL_FreeSurface( anim->surface ); |
free( anim ); |
} |
int Anim_GetFrameNum( SDL_Animation *anim, Uint32 start, Uint32 now ) { |
int mspf, ms, frame; |
if( now < start ) return 0; |
mspf = anim->duration / anim->frames; |
ms = now - start; |
if( mspf == 0 ) frame = 0; |
else frame = ms / mspf; |
return frame; |
} |
void Anim_GetFrameRect( SDL_Animation *anim, int frame, SDL_Rect *rect ) { |
rect->x = anim->w * (frame % anim->frames); |
rect->y = 0; |
rect->w = anim->w; |
rect->h = anim->h; |
} |
int Anim_BlitFrame( SDL_Animation *anim, Uint32 start, Uint32 now, SDL_Surface *dest, SDL_Rect *dr ) { |
int frame; |
frame = Anim_GetFrameNum( anim, start, now ); |
return Anim_BlitFrameNum( anim, frame, dest, dr ); |
} |
int Anim_BlitFrameNum( SDL_Animation *anim, int frame, SDL_Surface *dest, SDL_Rect *dr ) { |
SDL_Rect rect; |
Anim_GetFrameRect( anim, frame, &rect ); |
return SDL_BlitSurface( anim->surface, &rect, dest, dr ); |
} |
int Anim_DisplayFormat( SDL_Animation *anim ) { |
struct SDL_Surface *newsurface; |
if( SDL_WasInit( SDL_INIT_VIDEO ) == 0 ) return 0;/*"Video is not initialized.\n"*/ |
newsurface = SDL_DisplayFormatAlpha( anim->surface ); |
if( !newsurface ) return 0; |
anim->surface = newsurface; |
return 1; |
} |
int DoAnimFormat( char *text, int *duration, int *framewidth, int *numframes ) { |
char *tok; |
SDL_printf( "file is \"%s\"\n", text ); |
/* SDL_anim */ |
tok = strtok( text, " " ); |
if( !tok ) return 0; |
if( strcasecmp( tok, "SDL_anim" ) != 0 ) { |
SDL_printf( "no SDL_anim\n" ); |
return 0; |
} |
/* duration */ |
tok = strtok( NULL, " " ); |
if( !tok ) return 0; |
*duration = atoi( tok ); |
if( *duration < 1 ) { |
SDL_printf( "no duration\n" ); |
return 0; |
} |
/* framewidth */ |
tok = strtok( NULL, " " ); |
if( !tok ) return 0; |
*framewidth = atoi( tok ); |
if( *framewidth < 1 ) { |
SDL_printf( "no framewidth\n" ); |
return 0; |
} |
/* numframes */ |
tok = strtok( NULL, " " ); |
if( !tok ) return 0; |
*numframes = atoi( tok ); |
if( *numframes < 1 ) { |
SDL_printf( "no numframes\n" ); |
return 0; |
} |
return 1; |
} |
struct SDL_Animation *Anim_Load( const char *file ) { |
int ckey = -1, i; |
char buf[8]; |
static FILE *fp; /* "static" prevents setjmp corruption */ |
png_structp read_ptr; |
png_infop read_info_ptr, end_info_ptr; |
png_bytep *row_pointers; |
png_textp text_ptr; |
int num_text, t; |
int interlace_type, compression_type, filter_type, bit_depth, color_type; |
png_uint_32 width, height, row; |
int duration, framewidth, numframes; |
png_color_16p background; |
double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; |
double gamma; |
int intent; |
png_uint_16p hist; |
png_uint_32 offset_x, offset_y; |
int unit_type; |
png_charp purpose, units; |
png_charpp params; |
png_int_32 X0, X1; |
int type, nparams; |
png_uint_32 res_x, res_y; |
/* png_colorp palette; |
int num_palette; |
*/ png_color_8p sig_bit; |
png_bytep trans; |
int num_trans; |
png_color_16p trans_values; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
Uint32 Amask; |
SDL_Animation *anim; |
SDL_Surface *surface; |
SDL_Palette *palette; |
if( !file ) return NULL; |
/* printf( "opening file \"%s\"\n", file ); |
*/ |
/* open the file handle */ |
fp = fopen( file, "rb" ); |
if( fp == NULL ) { |
SDL_printf( "fopen() failed\n" ); |
return NULL; |
} |
/* check if it's PNG */ |
if( fread( buf, 1, 8, fp ) != 8 ) { |
SDL_printf( "fread() failed\n" ); |
return NULL; |
} |
if( png_sig_cmp( buf, (png_size_t)0, 8 ) ) { |
SDL_printf( "not a PNG file\n" ); |
return NULL; |
} |
fseek( fp, 0, SEEK_SET ); |
/* allocate read structure */ |
read_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL ); |
if( read_ptr == NULL ) { |
SDL_printf( "png_create_read_struct() failed\n" ); |
return NULL; |
} |
/* allocate read info structure */ |
read_info_ptr = png_create_info_struct( read_ptr ); |
if( read_info_ptr == NULL ) { |
SDL_printf( "png_create_info_struct() failed\n" ); |
return NULL; |
} |
end_info_ptr = png_create_info_struct( read_ptr ); |
if( end_info_ptr == NULL ) { |
SDL_printf( "png_create_info_struct() failed\n" ); |
return NULL; |
} |
/* set error handler code */ |
if( setjmp( read_ptr->jmpbuf ) ) { |
SDL_printf( "libpng read error\n" ); |
return NULL; |
} |
/* initialize stream */ |
png_init_io( read_ptr, fp ); |
png_set_read_status_fn( read_ptr, NULL ); |
/* read png info struct */ |
png_read_info( read_ptr, read_info_ptr ); |
/* get the info */ |
if( !png_get_IHDR( read_ptr, read_info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, &compression_type, &filter_type ) ) { |
SDL_printf( "png_get_IHDR() failed\n" ); |
return NULL; |
} |
/* background color */ |
png_get_bKGD( read_ptr, read_info_ptr, &background ); |
png_get_cHRM( read_ptr, read_info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y ); |
/* gamma */ |
png_get_gAMA( read_ptr, read_info_ptr, &gamma ); |
/* rendering intent */ |
png_get_sRGB( read_ptr, read_info_ptr, &intent ); |
/* Histogram */ |
png_get_hIST( read_ptr, read_info_ptr, &hist ); |
/* offsets */ |
png_get_oFFs( read_ptr, read_info_ptr, &offset_x, &offset_y, &unit_type ); |
png_get_pCAL( read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, &nparams, &units, ¶ms ); |
/* pixel density */ |
png_get_pHYs( read_ptr, read_info_ptr, &res_x, &res_y, &unit_type ); |
/* png_get_PLTE( read_ptr, read_info_ptr, &palette, &num_palette ); |
*/ |
/* significant bits */ |
png_get_sBIT( read_ptr, read_info_ptr, &sig_bit ); |
/* transparency */ |
if( png_get_tRNS( read_ptr, read_info_ptr, &trans, &num_trans, &trans_values ) ) { |
if( color_type == PNG_COLOR_TYPE_PALETTE ) { |
if( num_trans == 1 ) ckey = trans[0]; |
else png_set_expand( read_ptr ); |
} |
else ckey = 0; /* actual value will be set later */ |
} |
/* text chunks */ |
num_text = 0; |
if( !png_get_text( read_ptr, read_info_ptr, &text_ptr, &num_text ) ) { |
SDL_printf( "file has no text chunks\n" ); |
return NULL; |
} |
for( t = 0; t < num_text; t++ ) { |
if( strcasecmp( text_ptr[t].key, "format" ) == 0 ) { |
if( DoAnimFormat( text_ptr[t].text, &duration, &framewidth, &numframes ) ) break; |
} |
} |
if( t == num_text ) { |
SDL_printf( "file is not an SDL_anim PNG\n" ); |
return NULL; |
} |
png_set_strip_16( read_ptr ); |
png_set_packing( read_ptr ); |
if(color_type == PNG_COLOR_TYPE_GRAY) |
png_set_expand( read_ptr ); |
/* Allocate the SDL surface to hold the image */ |
Rmask = Gmask = Bmask = Amask = 0; |
if( color_type != PNG_COLOR_TYPE_PALETTE ) { |
if( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { |
Rmask = 0x000000FF; |
Gmask = 0x0000FF00; |
Bmask = 0x00FF0000; |
Amask = (read_info_ptr->channels == 4)? 0xFF000000 : 0; |
} |
else { |
int s = (read_info_ptr->channels == 4) ? 0 : 8; |
Rmask = 0xFF000000 >> s; |
Gmask = 0x00FF0000 >> s; |
Bmask = 0x0000FF00 >> s; |
Amask = 0x000000FF >> s; |
} |
} |
surface = SDL_AllocSurface( SDL_SWSURFACE, width, height, bit_depth * read_info_ptr->channels, Rmask, Gmask, Bmask, Amask ); |
if( surface == NULL ) { |
Anim_SetError("Out of memory"); |
return NULL; |
} |
if(ckey != -1) { |
if( color_type != PNG_COLOR_TYPE_PALETTE ) ckey = SDL_MapRGB( surface->format, (Uint8)trans_values->red, (Uint8)trans_values->green, (Uint8)trans_values->blue ); |
SDL_SetColorKey( surface, SDL_SRCCOLORKEY, ckey ); |
} |
/* allocate row pointers */ |
row_pointers = (png_bytep *)malloc( sizeof( png_bytep ) * height ); |
if( row_pointers == NULL ) { |
SDL_printf( "malloc() failed\n" ); |
return NULL; |
} |
for( row = 0; row < height; row++ ) { |
row_pointers[row] = (Uint8 *)surface->pixels + row * surface->pitch; |
} |
png_read_image( read_ptr, row_pointers ); |
/* end io */ |
/* printf( "done\n" ); |
*/ png_read_end( read_ptr, end_info_ptr ); |
/* cleanup */ |
png_destroy_read_struct( &read_ptr, &read_info_ptr, &end_info_ptr); |
fclose( fp ); |
/* Load the palette, if any */ |
palette = surface->format->palette; |
if( palette ) { |
if(color_type == PNG_COLOR_TYPE_GRAY) { |
palette->ncolors = 256; |
for( i = 0; i < 256; i++ ) { |
palette->colors[i].r = i; |
palette->colors[i].g = i; |
palette->colors[i].b = i; |
} |
} |
else if( read_info_ptr->num_palette > 0 ) { |
palette->ncolors = read_info_ptr->num_palette; |
for( i = 0; i < read_info_ptr->num_palette; ++i ) { |
palette->colors[i].b = read_info_ptr->palette[i].blue; |
palette->colors[i].g = read_info_ptr->palette[i].green; |
palette->colors[i].r = read_info_ptr->palette[i].red; |
} |
} |
} |
anim = (struct SDL_Animation *)malloc( sizeof( struct SDL_Animation ) ); |
if( !anim ) { |
SDL_printf( "malloc() failed\n" ); |
return NULL; |
} |
anim->surface = surface; |
anim->w = framewidth; |
anim->h = height; |
anim->frames = numframes; |
anim->duration = duration; |
return anim; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/makeanim.c |
---|
0,0 → 1,328 |
/* |
SDL_anim: an animation library for SDL |
Copyright (C) 2001, 2002 Michael Leonhard |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Michael Leonhard |
mike@tamale.net |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <png.h> |
/* deal with MSVC++ crappiness */ |
#ifdef WIN32UNDEFINED |
#define snprintf _snprintf |
#endif |
typedef struct inputstruct { |
FILE *file; |
char *name; |
png_structp read_ptr; |
png_infop read_info_ptr; |
}; |
int numfiles; |
struct inputstruct *input; |
int main( int argc, char *argv[] ) { |
int f, rowbytes; |
char buf[256]; |
static FILE *fpout; /* "static" prevents setjmp corruption */ |
png_structp write_ptr; |
png_infop write_info_ptr, end_info_ptr; |
png_bytep row_buf, here; |
png_uint_32 y; |
png_textp text_ptr, new_text_ptr; |
int num_text; |
int interlace_type, compression_type, filter_type, bit_depth, color_type; |
int it, ct, ft, bd, clrt; |
png_uint_32 width, height, w, h; |
int duration; |
if( argc < 4 ) { |
printf( "makeanim v0.2\nusage: makeanim <duration in milliseconds> <input files ...> <output file>\n" ); |
printf( "example: makeanim 1500 a00.png a01.png a02.png a03.png a04.png a.anim\n" ); |
return 1; |
} |
duration = atoi( argv[1] ); |
if( duration < 1 ) { |
printf( "duration is incorrect\n" ); |
return 1; |
} |
numfiles = argc - 3; |
input = (struct inputstruct *)malloc( sizeof( struct inputstruct ) * numfiles ); |
if( !input ) return 1; |
for( f = 0; f < numfiles; f++ ) { |
input[f].name = argv[f + 2]; |
printf( "opening file %d, \"%s\"\n", f, input[f].name ); |
/* open the file handle */ |
input[f].file = fopen( input[f].name, "rb" ); |
if( input[f].file == NULL ) { |
printf( "fopen() failed\n" ); |
return 1; |
} |
/* check if it's PNG */ |
if( fread( buf, 1, 8, input[f].file ) != 8 ) { |
printf( "fread() failed for file \"%s\"\n", input[f].name ); |
return 1; |
} |
if( png_sig_cmp( buf, (png_size_t)0, 8 ) ) { |
printf( "not a PNG file\n" ); |
return 1; |
} |
fseek( input[f].file, 0, SEEK_SET ); |
/* allocate read structure */ |
input[f].read_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL ); |
if( input[f].read_ptr == NULL ) { |
printf( "png_create_read_struct() failed\n" ); |
return 1; |
} |
/* allocate read info structure */ |
input[f].read_info_ptr = png_create_info_struct( input[f].read_ptr ); |
if( input[f].read_info_ptr == NULL ) { |
printf( "png_create_info_struct() failed\n" ); |
return 1; |
} |
/* set error handler code */ |
if( setjmp( input[f].read_ptr->jmpbuf ) ) { |
printf( "libpng read error\n" ); |
return 1; |
} |
/* initialize stream */ |
png_init_io( input[f].read_ptr, input[f].file ); |
png_set_read_status_fn( input[f].read_ptr, NULL ); |
/* read png info struct */ |
png_read_info( input[f].read_ptr, input[f].read_info_ptr ); |
/* get the info */ |
if( !png_get_IHDR( input[f].read_ptr, input[f].read_info_ptr, &w, &h, &bd, &clrt, &it, &ct, &ft ) ) { |
printf( "png_get_IHDR() failed\n" ); |
return 1; |
} |
/* save the info of the first frame */ |
if( f == 0 ) { |
width = w; |
height = h; |
bit_depth = bd; |
color_type = clrt; |
interlace_type = it; |
compression_type = ct; |
filter_type = ft; |
} |
/* compare all other frames to first frame */ |
else if( (w != width) || |
(h != height) || |
(bd != bit_depth) || |
(clrt != color_type) || |
(it != interlace_type) || |
(ct != compression_type) || |
(ft != filter_type) ) { |
if( w != width ) printf( "width is different\n" ); |
if( h != height ) printf( "height is different\n" ); |
if( bd != bit_depth ) printf( "bit depth is different\n" ); |
if( clrt != color_type ) printf( "color type is different\n" ); |
if( it != interlace_type ) printf( "interlace type is different\n" ); |
if( ct != compression_type ) printf( "compression type is different\n" ); |
if( ft != filter_type ) printf( "filter type is different\n" ); |
return 1; |
} |
} |
row_buf = (png_bytep)NULL; |
/* open output file */ |
printf( "opening file \"%s\"\n", argv[numfiles + 2] ); |
fpout = fopen( argv[numfiles + 2], "wb" ); |
if( fpout == NULL ) { |
printf( "fopen() failed\n" ); |
return 1; |
} |
/* allocate write structure */ |
write_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL ); |
/* allocate info structures */ |
write_info_ptr = png_create_info_struct( write_ptr ); |
end_info_ptr = png_create_info_struct( write_ptr ); |
/* error handling */ |
if( setjmp( write_ptr->jmpbuf ) ) { |
printf( "libpng write error\n" ); |
return 1; |
} |
/* initialize output stream */ |
png_init_io( write_ptr, fpout ); |
png_set_write_status_fn( write_ptr, NULL ); |
/* set info */ |
png_set_IHDR( write_ptr, write_info_ptr, width * numfiles, height, bit_depth, color_type, PNG_INTERLACE_NONE, compression_type, filter_type); |
/* image characteristics */ |
{ |
png_color_16p background; |
double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; |
double gamma; |
int intent; |
png_uint_16p hist; |
png_uint_32 offset_x, offset_y; |
int unit_type; |
png_charp purpose, units; |
png_charpp params; |
png_int_32 X0, X1; |
int type, nparams; |
png_uint_32 res_x, res_y; |
png_colorp palette; |
int num_palette; |
png_color_8p sig_bit; |
png_bytep trans; |
int num_trans; |
png_color_16p trans_values; |
/* background color */ |
if( png_get_bKGD( input[0].read_ptr, input[0].read_info_ptr, &background ) ) { |
png_set_bKGD( write_ptr, write_info_ptr, background ); |
} |
if( png_get_cHRM( input[0].read_ptr, input[0].read_info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y ) ) { |
png_set_cHRM( write_ptr, write_info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y ); |
} |
/* gamma */ |
if( png_get_gAMA( input[0].read_ptr, input[0].read_info_ptr, &gamma ) ) { |
png_set_gAMA( write_ptr, write_info_ptr, gamma ); |
} |
/* rendering intent */ |
if( png_get_sRGB( input[0].read_ptr, input[0].read_info_ptr, &intent ) ) { |
png_set_sRGB( write_ptr, write_info_ptr, intent ); |
} |
/* Histogram */ |
if( png_get_hIST( input[0].read_ptr, input[0].read_info_ptr, &hist ) ) { |
png_set_hIST( write_ptr, write_info_ptr, hist ); |
} |
/* offsets */ |
if( png_get_oFFs( input[0].read_ptr, input[0].read_info_ptr, &offset_x, &offset_y, &unit_type ) ) { |
png_set_oFFs( write_ptr, write_info_ptr, offset_x, offset_y, unit_type ); |
} |
if( png_get_pCAL( input[0].read_ptr, input[0].read_info_ptr, &purpose, &X0, &X1, &type, &nparams, &units, ¶ms ) ) { |
png_set_pCAL( write_ptr, write_info_ptr, purpose, X0, X1, type, nparams, units, params ); |
} |
/* pixel density */ |
if( png_get_pHYs( input[0].read_ptr, input[0].read_info_ptr, &res_x, &res_y, &unit_type ) ) { |
png_set_pHYs( write_ptr, write_info_ptr, res_x, res_y, unit_type ); |
} |
/* text chunks */ |
/* if( png_get_text( input[0].read_ptr, input[0].read_info_ptr, &text_ptr, &num_text ) > 0 ) { |
printf( "Handling %d tEXt/zTXt chunks\n", num_text ); |
png_set_text( write_ptr, write_info_ptr, text_ptr, num_text ); |
} |
*/ |
/* palette */ |
if( png_get_PLTE( input[0].read_ptr, input[0].read_info_ptr, &palette, &num_palette ) ) { |
png_set_PLTE( write_ptr, write_info_ptr, palette, num_palette ); |
} |
/* significant bits */ |
if( png_get_sBIT( input[0].read_ptr, input[0].read_info_ptr, &sig_bit ) ) { |
png_set_sBIT( write_ptr, write_info_ptr, sig_bit ); |
} |
/* transparency */ |
if( png_get_tRNS( input[0].read_ptr, input[0].read_info_ptr, &trans, &num_trans, &trans_values ) ) { |
png_set_tRNS( write_ptr, write_info_ptr, trans, num_trans, trans_values ); |
} |
} |
/* text chunks */ |
num_text = 0; |
if( !png_get_text( input[0].read_ptr, input[0].read_info_ptr, &text_ptr, &num_text ) ) num_text = 0; |
new_text_ptr = (struct png_text_struct *)malloc( sizeof( struct png_text_struct ) * num_text + 1 ); |
if( !new_text_ptr ) { |
printf( "malloc() failed\n" ); |
return 1; |
} |
memcpy( new_text_ptr, text_ptr, sizeof( struct png_text_struct ) * num_text ); |
snprintf( buf, 255, "SDL_anim %d %d %d", duration, width, numfiles ); |
buf[255] = 0; |
new_text_ptr[num_text].compression = PNG_TEXT_COMPRESSION_NONE; |
new_text_ptr[num_text].key = "format"; |
new_text_ptr[num_text].text = buf; |
new_text_ptr[num_text].text_length = strlen( buf ); |
num_text++; |
png_set_text( write_ptr, write_info_ptr, new_text_ptr, num_text ); |
/* write info */ |
png_write_info( write_ptr, write_info_ptr ); |
/* allocate buffer */ |
rowbytes = png_get_rowbytes( input[0].read_ptr, input[0].read_info_ptr ); |
row_buf = (png_bytep)png_malloc( write_ptr, rowbytes * numfiles ); |
if( row_buf == NULL ) { |
printf( "png_malloc() failed\n" ); |
return 1; |
} |
/* copy raw data */ |
for( y = 0; y < height; y++ ) { |
/* grab a scanline from each file */ |
here = row_buf; |
for( f = 0; f < numfiles; f++ ) { |
png_read_rows( input[f].read_ptr, (png_bytepp)&here, (png_bytepp)NULL, 1 ); |
here += rowbytes; |
} |
/* write the long scanline */ |
png_write_rows( write_ptr, (png_bytepp)&row_buf, 1 ); |
} |
/* end io */ |
for( f = 0; f < numfiles; f++ ) png_read_end( input[f].read_ptr, end_info_ptr ); |
png_write_end( write_ptr, end_info_ptr ); |
/* cleanup */ |
png_free( write_ptr, row_buf ); |
for( f = 0; f < numfiles; f++ ) { |
png_destroy_read_struct( &input[f].read_ptr, &input[f].read_info_ptr, &end_info_ptr); |
fclose( input[f].file ); |
} |
png_destroy_write_struct( &write_ptr, &write_info_ptr ); |
fclose( fpout ); |
return 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/makeanim.c.BAK |
---|
0,0 → 1,328 |
/* |
SDL_anim: an animation library for SDL |
Copyright (C) 2001, 2002 Michael Leonhard |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Michael Leonhard |
mike@tamale.net |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <png.h> |
/* deal with MSVC++ crappiness */ |
#ifdef WIN32 |
#define snprintf _snprintf |
#endif |
typedef struct inputstruct { |
FILE *file; |
char *name; |
png_structp read_ptr; |
png_infop read_info_ptr; |
}; |
int numfiles; |
struct inputstruct *input; |
int main( int argc, char *argv[] ) { |
int f, rowbytes; |
char buf[256]; |
static FILE *fpout; /* "static" prevents setjmp corruption */ |
png_structp write_ptr; |
png_infop write_info_ptr, end_info_ptr; |
png_bytep row_buf, here; |
png_uint_32 y; |
png_textp text_ptr, new_text_ptr; |
int num_text; |
int interlace_type, compression_type, filter_type, bit_depth, color_type; |
int it, ct, ft, bd, clrt; |
png_uint_32 width, height, w, h; |
int duration; |
if( argc < 4 ) { |
printf( "makeanim v0.2\nusage: makeanim <duration in milliseconds> <input files ...> <output file>\n" ); |
printf( "example: makeanim 1500 a00.png a01.png a02.png a03.png a04.png a.anim\n" ); |
return 1; |
} |
duration = atoi( argv[1] ); |
if( duration < 1 ) { |
printf( "duration is incorrect\n" ); |
return 1; |
} |
numfiles = argc - 3; |
input = (struct inputstruct *)malloc( sizeof( struct inputstruct ) * numfiles ); |
if( !input ) return 1; |
for( f = 0; f < numfiles; f++ ) { |
input[f].name = argv[f + 2]; |
printf( "opening file %d, \"%s\"\n", f, input[f].name ); |
/* open the file handle */ |
input[f].file = fopen( input[f].name, "rb" ); |
if( input[f].file == NULL ) { |
printf( "fopen() failed\n" ); |
return 1; |
} |
/* check if it's PNG */ |
if( fread( buf, 1, 8, input[f].file ) != 8 ) { |
printf( "fread() failed for file \"%s\"\n", input[f].name ); |
return 1; |
} |
if( png_sig_cmp( buf, (png_size_t)0, 8 ) ) { |
printf( "not a PNG file\n" ); |
return 1; |
} |
fseek( input[f].file, 0, SEEK_SET ); |
/* allocate read structure */ |
input[f].read_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL ); |
if( input[f].read_ptr == NULL ) { |
printf( "png_create_read_struct() failed\n" ); |
return 1; |
} |
/* allocate read info structure */ |
input[f].read_info_ptr = png_create_info_struct( input[f].read_ptr ); |
if( input[f].read_info_ptr == NULL ) { |
printf( "png_create_info_struct() failed\n" ); |
return 1; |
} |
/* set error handler code */ |
if( setjmp( input[f].read_ptr->jmpbuf ) ) { |
printf( "libpng read error\n" ); |
return 1; |
} |
/* initialize stream */ |
png_init_io( input[f].read_ptr, input[f].file ); |
png_set_read_status_fn( input[f].read_ptr, NULL ); |
/* read png info struct */ |
png_read_info( input[f].read_ptr, input[f].read_info_ptr ); |
/* get the info */ |
if( !png_get_IHDR( input[f].read_ptr, input[f].read_info_ptr, &w, &h, &bd, &clrt, &it, &ct, &ft ) ) { |
printf( "png_get_IHDR() failed\n" ); |
return 1; |
} |
/* save the info of the first frame */ |
if( f == 0 ) { |
width = w; |
height = h; |
bit_depth = bd; |
color_type = clrt; |
interlace_type = it; |
compression_type = ct; |
filter_type = ft; |
} |
/* compare all other frames to first frame */ |
else if( (w != width) || |
(h != height) || |
(bd != bit_depth) || |
(clrt != color_type) || |
(it != interlace_type) || |
(ct != compression_type) || |
(ft != filter_type) ) { |
if( w != width ) printf( "width is different\n" ); |
if( h != height ) printf( "height is different\n" ); |
if( bd != bit_depth ) printf( "bit depth is different\n" ); |
if( clrt != color_type ) printf( "color type is different\n" ); |
if( it != interlace_type ) printf( "interlace type is different\n" ); |
if( ct != compression_type ) printf( "compression type is different\n" ); |
if( ft != filter_type ) printf( "filter type is different\n" ); |
return 1; |
} |
} |
row_buf = (png_bytep)NULL; |
/* open output file */ |
printf( "opening file \"%s\"\n", argv[numfiles + 2] ); |
fpout = fopen( argv[numfiles + 2], "wb" ); |
if( fpout == NULL ) { |
printf( "fopen() failed\n" ); |
return 1; |
} |
/* allocate write structure */ |
write_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL ); |
/* allocate info structures */ |
write_info_ptr = png_create_info_struct( write_ptr ); |
end_info_ptr = png_create_info_struct( write_ptr ); |
/* error handling */ |
if( setjmp( write_ptr->jmpbuf ) ) { |
printf( "libpng write error\n" ); |
return 1; |
} |
/* initialize output stream */ |
png_init_io( write_ptr, fpout ); |
png_set_write_status_fn( write_ptr, NULL ); |
/* set info */ |
png_set_IHDR( write_ptr, write_info_ptr, width * numfiles, height, bit_depth, color_type, PNG_INTERLACE_NONE, compression_type, filter_type); |
/* image characteristics */ |
{ |
png_color_16p background; |
double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; |
double gamma; |
int intent; |
png_uint_16p hist; |
png_uint_32 offset_x, offset_y; |
int unit_type; |
png_charp purpose, units; |
png_charpp params; |
png_int_32 X0, X1; |
int type, nparams; |
png_uint_32 res_x, res_y; |
png_colorp palette; |
int num_palette; |
png_color_8p sig_bit; |
png_bytep trans; |
int num_trans; |
png_color_16p trans_values; |
/* background color */ |
if( png_get_bKGD( input[0].read_ptr, input[0].read_info_ptr, &background ) ) { |
png_set_bKGD( write_ptr, write_info_ptr, background ); |
} |
if( png_get_cHRM( input[0].read_ptr, input[0].read_info_ptr, &white_x, &white_y, &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y ) ) { |
png_set_cHRM( write_ptr, write_info_ptr, white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y ); |
} |
/* gamma */ |
if( png_get_gAMA( input[0].read_ptr, input[0].read_info_ptr, &gamma ) ) { |
png_set_gAMA( write_ptr, write_info_ptr, gamma ); |
} |
/* rendering intent */ |
if( png_get_sRGB( input[0].read_ptr, input[0].read_info_ptr, &intent ) ) { |
png_set_sRGB( write_ptr, write_info_ptr, intent ); |
} |
/* Histogram */ |
if( png_get_hIST( input[0].read_ptr, input[0].read_info_ptr, &hist ) ) { |
png_set_hIST( write_ptr, write_info_ptr, hist ); |
} |
/* offsets */ |
if( png_get_oFFs( input[0].read_ptr, input[0].read_info_ptr, &offset_x, &offset_y, &unit_type ) ) { |
png_set_oFFs( write_ptr, write_info_ptr, offset_x, offset_y, unit_type ); |
} |
if( png_get_pCAL( input[0].read_ptr, input[0].read_info_ptr, &purpose, &X0, &X1, &type, &nparams, &units, ¶ms ) ) { |
png_set_pCAL( write_ptr, write_info_ptr, purpose, X0, X1, type, nparams, units, params ); |
} |
/* pixel density */ |
if( png_get_pHYs( input[0].read_ptr, input[0].read_info_ptr, &res_x, &res_y, &unit_type ) ) { |
png_set_pHYs( write_ptr, write_info_ptr, res_x, res_y, unit_type ); |
} |
/* text chunks */ |
/* if( png_get_text( input[0].read_ptr, input[0].read_info_ptr, &text_ptr, &num_text ) > 0 ) { |
printf( "Handling %d tEXt/zTXt chunks\n", num_text ); |
png_set_text( write_ptr, write_info_ptr, text_ptr, num_text ); |
} |
*/ |
/* palette */ |
if( png_get_PLTE( input[0].read_ptr, input[0].read_info_ptr, &palette, &num_palette ) ) { |
png_set_PLTE( write_ptr, write_info_ptr, palette, num_palette ); |
} |
/* significant bits */ |
if( png_get_sBIT( input[0].read_ptr, input[0].read_info_ptr, &sig_bit ) ) { |
png_set_sBIT( write_ptr, write_info_ptr, sig_bit ); |
} |
/* transparency */ |
if( png_get_tRNS( input[0].read_ptr, input[0].read_info_ptr, &trans, &num_trans, &trans_values ) ) { |
png_set_tRNS( write_ptr, write_info_ptr, trans, num_trans, trans_values ); |
} |
} |
/* text chunks */ |
num_text = 0; |
if( !png_get_text( input[0].read_ptr, input[0].read_info_ptr, &text_ptr, &num_text ) ) num_text = 0; |
new_text_ptr = (struct png_text_struct *)malloc( sizeof( struct png_text_struct ) * num_text + 1 ); |
if( !new_text_ptr ) { |
printf( "malloc() failed\n" ); |
return 1; |
} |
memcpy( new_text_ptr, text_ptr, sizeof( struct png_text_struct ) * num_text ); |
snprintf( buf, 255, "SDL_anim %d %d %d", duration, width, numfiles ); |
buf[255] = 0; |
new_text_ptr[num_text].compression = PNG_TEXT_COMPRESSION_NONE; |
new_text_ptr[num_text].key = "format"; |
new_text_ptr[num_text].text = buf; |
new_text_ptr[num_text].text_length = strlen( buf ); |
num_text++; |
png_set_text( write_ptr, write_info_ptr, new_text_ptr, num_text ); |
/* write info */ |
png_write_info( write_ptr, write_info_ptr ); |
/* allocate buffer */ |
rowbytes = png_get_rowbytes( input[0].read_ptr, input[0].read_info_ptr ); |
row_buf = (png_bytep)png_malloc( write_ptr, rowbytes * numfiles ); |
if( row_buf == NULL ) { |
printf( "png_malloc() failed\n" ); |
return 1; |
} |
/* copy raw data */ |
for( y = 0; y < height; y++ ) { |
/* grab a scanline from each file */ |
here = row_buf; |
for( f = 0; f < numfiles; f++ ) { |
png_read_rows( input[f].read_ptr, (png_bytepp)&here, (png_bytepp)NULL, 1 ); |
here += rowbytes; |
} |
/* write the long scanline */ |
png_write_rows( write_ptr, (png_bytepp)&row_buf, 1 ); |
} |
/* end io */ |
for( f = 0; f < numfiles; f++ ) png_read_end( input[f].read_ptr, end_info_ptr ); |
png_write_end( write_ptr, end_info_ptr ); |
/* cleanup */ |
png_free( write_ptr, row_buf ); |
for( f = 0; f < numfiles; f++ ) { |
png_destroy_read_struct( &input[f].read_ptr, &input[f].read_info_ptr, &end_info_ptr); |
fclose( input[f].file ); |
} |
png_destroy_write_struct( &write_ptr, &write_info_ptr ); |
fclose( fpout ); |
return 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/ship.ani |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2/SDL_anim-0.2.1/showanim.c |
---|
0,0 → 1,149 |
/* |
SDL_anim: an animation library for SDL |
Copyright (C) 2001, 2002 Michael Leonhard |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Michael Leonhard |
mike@tamale.net |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include <SDL/SDL.h> |
#include "SDL_anim.h" |
/* Draw a Gimpish background pattern to show transparency in the anim */ |
void draw_background( SDL_Surface *screen ) { |
Uint8 *dst = screen->pixels; |
int x, y; |
int bpp = screen->format->BytesPerPixel; |
Uint32 col[2]; |
col[0] = SDL_MapRGB(screen->format, 0x66, 0x66, 0x66); |
col[1] = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99); |
for(y = 0; y < screen->h; y++) { |
for(x = 0; x < screen->w; x++) { |
/* use an 8x8 checkerboard pattern */ |
Uint32 c = col[((x ^ y) >> 3) & 1]; |
switch(bpp) { |
case 1: |
dst[x] = c; |
break; |
case 2: |
((Uint16 *)dst)[x] = c; |
break; |
case 3: |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { |
dst[x * 3] = c; |
dst[x * 3 + 1] = c >> 8; |
dst[x * 3 + 2] = c >> 16; |
} |
else { |
dst[x * 3] = c >> 16; |
dst[x * 3 + 1] = c >> 8; |
dst[x * 3 + 2] = c; |
} |
break; |
case 4: |
((Uint32 *)dst)[x] = c; |
break; |
} |
} |
dst += screen->pitch; |
} |
} |
int app_main(int argc, char *argv[]) { |
SDL_Surface *screen; |
SDL_Animation *anim; |
SDL_Rect rect; |
SDL_Event event; |
SDL_KeyboardEvent *key; |
int depth, done; |
Uint32 start; |
argv[1]="ship.ani"; |
/* Initialize the SDL library */ |
if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) { |
fprintf( stderr, "Couldn't initialize SDL: %s\n", SDL_GetError() ); |
return 2; |
} |
/* Open the anim file */ |
anim = Anim_Load(argv[1]); |
if( anim == NULL ) { |
fprintf( stderr, "Couldn't load %s: %s\n", argv[1], SDL_GetError() ); |
SDL_Quit(); |
return 3; |
} |
SDL_WM_SetCaption( argv[1], "showanim" ); |
/* Create a display for the anim */ |
depth = SDL_VideoModeOK( anim->w + 1, anim->h, 32, SDL_HWPALETTE ); |
/* Use the deepest native mode, except that we emulate 32bpp for */ |
/* viewing non-indexed anims on 8bpp screens */ |
if( (anim->surface->format->BytesPerPixel > 1) && (depth == 8) ) { |
depth = 32; |
} |
screen = SDL_SetVideoMode( anim->w + 10, anim->h, 16, SDL_HWPALETTE ); |
if( screen == NULL ) { |
fprintf( stderr, "Couldn't set %dx%dx%d video mode: %s\n", |
anim->w, anim->h, depth, SDL_GetError() ); |
SDL_Quit(); |
return 4; |
} |
/* Set the palette, if one exists */ |
if( anim->surface->format->palette ) { |
SDL_SetColors( screen, anim->surface->format->palette->colors, |
0, anim->surface->format->palette->ncolors ); |
} |
if( !Anim_DisplayFormat( anim ) ) { |
fprintf( stderr, "Anim_DisplayFormat() failed\n" ); |
return 5; |
} |
done = 0; |
start = SDL_GetTicks(); |
while( !done ) { |
while( SDL_PollEvent( &event ) ) { |
switch( event.type ) { |
case SDL_QUIT: |
done = 1; |
break; |
case SDL_KEYDOWN: |
key = (SDL_KeyboardEvent *)&event; |
if( key->keysym.sym == SDLK_ESCAPE ) done = 1; |
start = SDL_GetTicks(); |
break; |
} |
} |
draw_background( screen ); |
rect.x = 0; |
rect.y = 0; |
Anim_BlitFrame( anim, start, SDL_GetTicks(), screen, &rect ); |
SDL_UpdateRect( screen, 0, 0, 0, 0 ); |
SDL_Delay( 100 ); |
} |
Anim_Free( anim ); |
SDL_Quit(); |
return 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/Makefile |
---|
0,0 → 1,5 |
CFLAGS = -DUSE_RWOPS=1 -I. -I$(MENUETDEV)/include/SDL |
OUTFILE = libSDL_bdf.a |
OBJS = SDL_bdf.o |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/README.txt |
---|
0,0 → 1,46 |
SDL_bdf version 1.2 |
http://www.geocities.com/andre_leiradella/ |
For copyright information see the source files. |
SDL_bdf is a small library that renders BDF fonts. As of version 1.2, SDL_bdf |
doesn't depend on SDL anymore, you can use it with any graphics library throgh |
it's API, but the bundled exampled uses SDL to show a text with a BDF font on |
the screen. |
The library has been tested with SDL under Windows but should work on any |
platform/graphics library. The functions provided are: |
. BDF_Font *BDF_OpenFont(BDF_ReadByte getbyte, void *info, int *error): Opens a |
BDF font, it receives the function that will produce the stream of bytes, the |
user defined void pointer that will be passed to getbyte and a pointer to an |
int that will receive the error code. Returns the BDF font. |
. void BDF_CloseFont(BDF_Font *font): Closes the font and frees all associated |
memory. |
. void BDF_SizeH(BDF_Font *font, char *text, int *x0, int *y0, int *width, |
int *height): Determines the size of the horizontal text, returns the width |
and height of the smallest rectangle that can acomodate the rendered text and |
the start position in x0 and y0 on where the text must be rendered to exactly |
fit the rectangle. This is because the render functions take the y parameter |
as the baseline of the text to allow different fonts (e.g. normal and italic) |
to be mixed in the same line. It handles NULL pointers for pieces of |
information you don't want. |
. void BDF_SizeEntitiesH(BDF_Font *font, char *text, int *x0, int *y0, |
int *width, int *height): Same as above but accepts entities in the |
form &...; (e.g. André) |
. int BDF_DrawH(void *surface, BDF_PutPixel putpixel, BDF_Font *font, |
char *text, int x, int y, unsigned int color): Draws the text at the given |
surface starting at position (x, y). It calls putpixel with the surface, |
coordinates and color to draw the pixel (doesn't clip). Returns the next x |
coordinate to continue to render more text. Only accepts characters in the |
range [0..255]. |
. int BDF_DrawEntitiesH(void *, BDF_PutPixel, BDF_Font *, char *, int, int, |
unsigned int): Same as above but accepts entities in the form &...; |
TODO: |
. Handle vertical writing. |
. Use a hash table instead of an ordered array to access the glyphs by name. |
. What else? Tell me: leiradella@bigfoot.com |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/SDL_bdf.c |
---|
0,0 → 1,588 |
/* |
SDL_bdf - renders BDF fonts |
Copyright (C) 2002-2003 Andre de Leiradella |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with this library; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For information about SDL_bdf contact leiradella@bigfoot.com |
Version 1.0: first public release. |
Version 1.1: removed SDL dependecies, now SDL_bdf can be used with any graphics |
library. |
Version 1.2: fixed BDF_SizeH and BDF_SizeEntitiesH to return the correct sizes. |
*/ |
#include <stdio.h> |
#include <string.h> |
#include <ctype.h> |
#include <stdarg.h> |
#include <stdlib.h> |
#include <limits.h> |
#include <SDL_bdf.h> |
/* |
BDF fonts are encoded in ascii. Each line of the file begins with a keyword, |
has zero or more arguments which can be integers, numbers (floats), strings and |
quoted string, and ends with an eol. Some keywords are optional or |
user-defined, unquoted strings can begin with any character which means that it |
can start with a minus sign making it hard to distinguish them from negative |
integers or numbers (and it do happen in some places). Adobe's spec isn't clear |
sometimes so we have to be cautious (eg it doesn't say how eols are encoded so |
we have to accept MSDOS (cr lf), Unix (lf) and Mac (cr) styles. I implemented a |
*very* relaxed parser which won't stop on some errors. The parser reads the |
font line by line and for each one verifies which is the keyword (using a hash |
table generated by gperf) and takes the appropriate action through a switch |
statement. |
*/ |
/* BDF keywords. */ |
#define BBX 1 |
#define BITMAP 2 |
#define CHARS 3 |
#define COMMENT 4 |
#define CONTENTVERSION 5 |
#define DWIDTH 6 |
#define DWIDTH1 7 |
#define ENCODING 8 |
#define ENDCHAR 9 |
#define ENDFONT 10 |
#define ENDPROPERTIES 11 |
#define FONT 12 |
#define FONTBOUNDINGBOX 13 |
#define METRICSSET 14 |
#define SIZE 15 |
#define STARTCHAR 16 |
#define STARTFONT 17 |
#define STARTPROPERTIES 18 |
#define SWIDTH 19 |
#define SWIDTH1 20 |
#define VVECTOR 21 |
/* Include GPERF hash function generated from bdf.in. */ |
#include "bdf.gperf" |
/* Reads a line from rwops up to 65536 characters. */ |
static int readline(BDF_ReadByte getbyte, void *info, char *data) { |
int k, i = 65536; |
for (;;) { |
k = getbyte(info); |
if (k == -1) |
return 0; |
switch (k) { |
default: |
*data++=k; |
if (--i==0) { |
case '\n': |
*data='\0'; |
return 1; |
} |
case '\r': |
; |
} |
} |
} |
/* Parse an integer updating the pointer. */ |
static int readinteger(char **data, int *integer) { |
char *aux; |
int i, signal; |
aux = *data; |
signal = 1; |
/* Adobe's spec doesn't say numbers can be preceeded by '+' but we never know. */ |
switch (*aux) { |
case '-': |
signal = -1; |
case '+': |
aux++; |
break; |
} |
/* Skip spaces between signal and first digit. */ |
while (isspace(*aux)) aux++; |
if (!isdigit(*aux)) return 0; |
/* Now we start reading digits. */ |
i = 0; |
while (isdigit(*aux)) i = i * 10 + *aux++ - '0'; |
/* We're done, update pointer and return value. */ |
*data = aux; |
if (integer != NULL) *integer = signal * i; |
return 1; |
} |
/* Parse a double updating the pointer. */ |
static int readnumber(char **data, double *number) { |
register char *aux; |
double n, d; |
int signal; |
aux = *data; |
signal = 1; |
/* Adobe's spec doesn't say numbers can be preceeded by '+' but we never know. */ |
switch (*aux) { |
case '-': |
signal = -1; |
case '+': |
aux++; |
break; |
} |
/* Skip spaces between signal and first digit. */ |
while (isspace(*aux)) aux++; |
if (!isdigit(*aux)) return 0; |
/* Now we start reading digits */ |
n = 0; |
while (isdigit(*aux)) n = n * 10 + *aux++ - '0'; |
d = 10; |
/* If next character is a dot then we have a decimal part. */ |
if (*aux == '.') { |
aux++; |
/* Decimal point must be succeeded by one or more digits. */ |
if (!isdigit(*aux)) return 0; |
while (isdigit(*aux)) n += (*aux++ - '0') / d, d /= 10; |
} |
/* We're done, update pointer and return value. */ |
*data = aux; |
if (number != NULL) *number = signal*n; |
return 1; |
} |
/* Parse a string updating the pointer. */ |
static int readstring(char **data, char **string) { |
int len; |
len = strlen(*data); |
if (string != NULL) { |
/* Malloc the required space. */ |
*string=(char *)malloc(len + 1); |
if (*string == NULL) |
return 0; |
/* Copy everything. */ |
strcpy(*string, *data); |
} |
/* We're done, update pointer. */ |
*data += len; |
return 1; |
} |
/* Scan the line (just after the keyword) for elements listed in format. */ |
static int scan(char *data, char *format, ...) { |
va_list args; |
int *i; |
double *n; |
char **s; |
/* Keyword already skipped, skip spaces. */ |
while (*data != '\0' && isspace(*data)) data++; |
/* Scan the data for the pattern in format. */ |
va_start(args, format); |
while (*format != '\0') { |
switch (*format++) { |
case 'i': /* integer. */ |
i = va_arg(args, int *); |
if (!readinteger(&data, i)) { |
va_end(args); |
return 0; |
} |
break; |
case 'n': /* number. */ |
n = va_arg(args, double *); |
if (!readnumber(&data, n)) { |
va_end(args); |
return 0; |
} |
break; |
case 's': /* string. */ |
s = va_arg(args, char **); |
if (!readstring(&data, s)) { |
va_end(args); |
return 0; |
} |
break; |
} |
/* Skip spaces between elements. */ |
while (*data != '\0' && isspace(*data)) data++; |
} |
va_end(args); |
return *data == '\0'; |
} |
/* Compare function to sort characters by their names. */ |
static int compare(const void *c1, const void *c2) { |
return strcmp(((BDF_Char *)c1)->name, ((BDF_Char *)c2)->name); |
} |
#define XVAL(x) (isdigit((x)) ? (x) - '0' : toupper((x)) - 'A' + 10) |
BDF_Font *BDF_OpenFont(BDF_ReadByte getbyte, void *info, int *error) { |
BDF_Font *font; |
BDF_Char *chr; |
char *data; |
register char *aux; |
struct bdfword *word; |
unsigned char *bits; |
double n; |
int numChars; |
int dwx0, dwy0; |
int dwx1, dwy1; |
int bbw, bbh, bbxoff0x, bbyoff0y, i; |
/* Malloc the font. */ |
font = (BDF_Font *)malloc(sizeof(BDF_Font)); |
if (font == NULL) { |
if (error != NULL) *error = BDF_MEMORYERROR; |
goto error; |
} |
/* Null array of characters. */ |
font->chars = NULL; |
/* Looks ugly but I'm lazy... */ |
data = (char *)malloc(65537 * sizeof(char)); |
if (data == NULL) { |
if (error != NULL) *error = BDF_MEMORYERROR; |
goto error; |
} |
/* Zero the structure. */ |
font->metricsSet = font->numChars = 0; |
dwx0 = dwy0 = 0; |
dwx1 = dwy1 = 0; |
bbw = bbh = 0; |
bbxoff0x = bbyoff0y = 0; |
/* chr holds the current character or NULL if we're not inside a character definition. */ |
chr = NULL; |
for (;;) { |
/* Read one line at a time. */ |
if (!readline(getbyte, info, data)) { |
if (*error != NULL) *error = BDF_READERROR; |
goto error; |
} |
/* Find end of keyword. */ |
aux = data; |
while (*aux != '\0' && !isspace(*aux)) aux++; |
/* Find which keyword it is using gperf's hash function. */ |
word = (struct bdfword *)in_word_set(data, aux - data); |
switch (word == NULL ? 0 : word->code) { |
case STARTFONT: |
/* Issue an error on versions higher than 2.2. */ |
if (!scan(aux, "n", &n)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
if (n > 2.2) { |
if (error != NULL) *error = BDF_WRONGVERSION; |
goto error; |
} |
break; |
case FONTBOUNDINGBOX: |
/* The FONTBOUNDINGBOX values seems to be defaults for BBX values. */ |
if (!scan(aux, "iiii", &bbw, &bbh, &bbxoff0x, &bbyoff0y)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
break; |
case METRICSSET: |
/* We only handle horizontal writing by now. */ |
if (!scan(aux, "i", &font->metricsSet)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
if (font->metricsSet != 0) { |
if (error != NULL) *error = BDF_CANNOTHANDLEVERTICAL; |
goto error; |
} |
break; |
case DWIDTH: |
/* This is the character's width in pixels. */ |
if (chr != NULL) |
if (!scan(aux, "ii", &chr->dwx0, &chr->dwy0)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
else |
if (!scan(aux, "ii", &dwx0, &dwy0)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
break; |
case DWIDTH1: |
/* This is the character's width in pixels for vertical writing. */ |
if (chr != NULL) |
if (!scan(aux, "ii", &chr->dwx1, &chr->dwy1)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
else |
if (!scan(aux, "ii", &dwx1, &dwy1)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
break; |
case CHARS: |
/* We read the number of chars in this font and malloc the required memory. */ |
if (!scan(aux, "i", &font->numChars)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
font->chars = (BDF_Char *)malloc(font->numChars * sizeof(BDF_Char)); |
if (font->chars == NULL) { |
if (error != NULL) *error = BDF_MEMORYERROR; |
goto error; |
} |
/* Zero all characters' info. */ |
for (i = font->numChars, chr = font->chars; i != 0; i--, chr++) { |
chr->name = NULL; |
chr->code = -1; |
chr->dwx0 = chr->dwy0 = 0; |
chr->dwx1 = chr->dwy1 = 0; |
chr->bbw = chr->bbh = 0; |
chr->bbxoff0x = chr->bbyoff0y = 0; |
chr->bits = NULL; |
} |
/* chr points to the current character. */ |
chr = font->chars; |
break; |
case STARTCHAR: |
/* If chr is NULL there are more characters in the font then expected. */ |
if (chr == NULL) { |
if (error != NULL) *error = BDF_TOOMANYCHARACTERS; |
goto error; |
} |
if (!scan(aux, "s", &chr->name)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
/* Copy default values. */ |
chr->code = -1; |
chr->dwx0 = dwx0; |
chr->dwy0 = dwy0; |
chr->dwx1 = dwx1; |
chr->dwy1 = dwy1; |
chr->bbw = bbw; |
chr->bbh = bbh; |
chr->bbxoff0x = bbxoff0x; |
chr->bbyoff0y = bbyoff0y; |
break; |
case ENCODING: |
/* Read character's code, it can be -1. */ |
if (chr != NULL) |
if (!scan(aux, "i", &chr->code)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
break; |
case BBX: |
/* The bounding box around the character's black pixels. */ |
if (chr != NULL) |
if (!scan(aux, "iiii", &chr->bbw, &chr->bbh, &chr->bbxoff0x, &chr->bbyoff0y)) { |
if (error != NULL) *error = BDF_PARSEERROR; |
goto error; |
} |
break; |
case BITMAP: |
/* BITMAP signals the start of the hex data. */ |
if (chr != NULL) { |
/* wbytes is the width of the char in bytes. */ |
chr->wbytes = (chr->bbw + 7) / 8; |
/* Malloc the memory for the pixels. */ |
chr->bits = (unsigned char *)malloc(chr->wbytes * chr->bbh); |
if (chr->bits == NULL) { |
if (error != NULL) *error = BDF_MEMORYERROR; |
goto error; |
} |
/* Read all pixels from file. */ |
for (i = chr->bbh, bits = chr->bits; i != 0; i--) { |
if (!readline(getbyte, info, data)) { |
if (error != NULL) *error = BDF_READERROR; |
goto error; |
} |
aux = data; |
while (aux[0] != '\0' && aux[1] != '\0') { |
*bits++ = XVAL(aux[0]) * 16 + XVAL(aux[1]); |
aux += 2; |
} |
} |
} |
break; |
case ENDCHAR: |
/* Skip to the next character, makes a bound check. */ |
chr++; |
if ((chr-font->chars) >= font->numChars) |
chr = NULL; |
break; |
case ENDFONT: |
/* Ends the font, if chr is not NULL then we are short on characters. */ |
if (chr != NULL) { |
if (error != NULL) *error = BDF_TOOFEWCHARACTERS; |
goto error; |
} |
/* Sort font by character names, should be an hash table. */ |
qsort(font->chars, font->numChars, sizeof(BDF_Char), compare); |
/* Fast pointers to characters encoded between [0..255]. */ |
for (i = 0; i < 256; i++) |
font->code[i] = NULL; |
for (i = font->numChars, chr = font->chars; i != 0; i--, chr++) |
if (chr->code >= 0 && chr->code <= 255) |
font->code[chr->code] = chr; |
if (error != NULL) *error = BDF_OK; |
free(data); |
return font; |
} |
} |
error: |
/* Free everything. */ |
free(data); |
BDF_CloseFont(font); |
return NULL; |
} |
void BDF_CloseFont(BDF_Font *font) { |
int i; |
BDF_Char *chr; |
/* Free everything. */ |
if (font != NULL) { |
if (font->chars != NULL) { |
for (i = font->numChars, chr = font->chars; i != 0; i--, chr++) { |
free(chr->name); |
free(chr->bits); |
} |
free(font->chars); |
} |
free(font); |
} |
} |
/* Finds a char in the font, if entities is not zero then handle entities. */ |
static BDF_Char *findchar(BDF_Font *font, char **text, int entities) { |
char *aux; |
BDF_Char key, *chr; |
/* Handle entities. */ |
if (entities != 0 && **text == '&') { |
if ((*text)[1] != '&') { |
key.name = *text + 1; |
aux = strchr(*text, ';'); |
if (aux == NULL) { |
*text = *text + strlen(*text); |
return NULL; |
} |
*aux = '\0'; |
*text = aux + 1; |
chr = (BDF_Char *)bsearch(&key, font->chars, font->numChars, sizeof(BDF_Char), compare); |
*aux = ';'; |
return chr; |
} else |
(*text)++; |
} |
/* Return the character in the range [0..255]. */ |
return font->code[*(unsigned char *)(*text)++]; |
} |
/* Determines the size of the horizontal text. */ |
static void sizeh(BDF_Font *font, char *text, int entities, int *x0, int *y0, int *width, int *height) { |
BDF_Char *chr; |
int first, y, h, minh, maxh; |
first = 1; |
minh = *y0 = INT_MAX; |
maxh = INT_MIN; |
y = 0; |
while (*text != '\0') { |
chr = findchar(font, &text, entities); |
if (first != 0) { |
first = 0; |
*x0 = *width = -chr->bbxoff0x; |
} |
if (chr != NULL) { |
h = y - (chr->bbyoff0y + chr->bbh); |
if (h < minh) |
minh = h; |
h += chr->bbh - 1; |
if (h > maxh) |
maxh = h; |
*width += chr->dwx0; |
if (chr->bbyoff0y < *y0) |
*y0 = chr->bbyoff0y; |
y += chr->dwy0; |
} |
} |
*height = maxh - minh + 1; |
*y0 += *height; |
} |
void BDF_SizeH(BDF_Font *font, char *text, int *x0, int *y0, int *width, int *height) { |
int _x0, _y0, _width, _height; |
sizeh(font, text, 0, &_x0, &_y0, &_width, &_height); |
if (x0 != NULL) *x0 = _x0; |
if (y0 != NULL) *y0 = _y0; |
if (width != NULL) *width = _width; |
if (height != NULL) *height = _height; |
} |
void BDF_SizeEntitiesH(BDF_Font *font, char *text, int *x0, int *y0, int *width, int *height) { |
int _x0, _y0, _width, _height; |
sizeh(font, text, 1, &_x0, &_y0, &_width, &_height); |
if (x0 != NULL) *x0 = _x0; |
if (y0 != NULL) *y0 = _y0; |
if (width != NULL) *width = _width; |
if (height != NULL) *height = _height; |
} |
/* Draws a char on the surface. */ |
static void drawchar(void *surface, BDF_PutPixel putpixel, BDF_Char *chr, int x, int y, unsigned int color) { |
int xx; |
unsigned char *bits, *endfont, *endline; |
/* Calculate the position of the first pixel. */ |
x += chr->bbxoff0x; |
y -= (chr->bbyoff0y + chr->bbh); |
bits = chr->bits; |
/* Put them! */ |
for (endfont = bits + chr->wbytes * chr->bbh; bits < endfont; y++) |
for (endline = bits + chr->wbytes, xx = x; bits < endline; xx += 8, bits++) { |
if ((*bits) & 0x80) putpixel(surface, xx, y, color); |
if ((*bits) & 0x40) putpixel(surface, xx + 1, y, color); |
if ((*bits) & 0x20) putpixel(surface, xx + 2, y, color); |
if ((*bits) & 0x10) putpixel(surface, xx + 3, y, color); |
if ((*bits) & 0x08) putpixel(surface, xx + 4, y, color); |
if ((*bits) & 0x04) putpixel(surface, xx + 5, y, color); |
if ((*bits) & 0x02) putpixel(surface, xx + 6, y, color); |
if ((*bits) & 0x01) putpixel(surface, xx + 7, y, color); |
} |
} |
/* Draws an entire line of text. */ |
static int drawh(void *surface, BDF_PutPixel putpixel, BDF_Font *font, char *text, int entities, int x, int y, unsigned int color) { |
BDF_Char *chr; |
/* For each character... */ |
while (*text != '\0') { |
chr = findchar(font, &text, entities); |
if (chr != NULL) { |
/* ... draw it. */ |
drawchar(surface, putpixel, chr, x, y, color); |
x += chr->dwx0; |
y += chr->dwy0; |
} |
} |
return x; |
} |
int BDF_DrawH(void *surface, BDF_PutPixel putpixel, BDF_Font *font, char *text, int x, int y, unsigned int color) { |
return drawh(surface, putpixel, font, text, 0, x, y, color); |
} |
int BDF_DrawEntitiesH(void *surface, BDF_PutPixel putpixel, BDF_Font *font, char *text, int x, int y,unsigned int color) { |
return drawh(surface, putpixel, font, text, 1, x, y, color); |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/SDL_bdf.h |
---|
0,0 → 1,120 |
/* |
SDL_bdf - renders BDF fonts |
Copyright (C) 2002-2003 Andre de Leiradella |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with this library; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For information about SDL_bdf contact leiradella@bigfoot.com |
Version 1.0: first public release. |
Version 1.1: removed SDL dependecies, now SDL_bdf can be used with any graphics |
library. |
Version 1.2: fixed BDF_SizeH and BDF_SizeEntitiesH to return the correct sizes. |
*/ |
#ifndef __SDL_bdf_h__ |
#define __SDL_bdf_h__ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Error codes. */ |
/* No error. */ |
#define BDF_OK 0 |
/* Not enough memory reading BDF font. */ |
#define BDF_MEMORYERROR 1 |
/* Error reading BDF font. */ |
#define BDF_READERROR 2 |
/* Can only handle BDF font varsions up to 2.2. */ |
#define BDF_WRONGVERSION 3 |
/* Can only handle horizontal BDF fonts. */ |
#define BDF_CANNOTHANDLEVERTICAL 4 |
/* Character found past end of BDF font. */ |
#define BDF_TOOMANYCHARACTERS 5 |
/* BDF font is missing characters. */ |
#define BDF_TOOFEWCHARACTERS 6 |
/* Error parsing BDF font. */ |
#define BDF_PARSEERROR 7 |
/* A BDF character. */ |
typedef struct { |
char *name; |
int code; |
int dwx0, dwy0; |
int dwx1, dwy1; |
int bbw, bbh, bbxoff0x, bbyoff0y, wbytes; |
unsigned char *bits; |
} BDF_Char; |
/* A BDF font. */ |
typedef struct { |
int metricsSet, numChars; |
BDF_Char *chars; |
BDF_Char *code[256]; |
} BDF_Font; |
/* |
Function to put a pixel on the surface, it receives a pointer to the surface |
(whatever format it may be), the x and y coordinates and the color. |
*/ |
typedef void (*BDF_PutPixel)(void *, int, int, unsigned int); |
/* |
Function to read a byte, it receives an user defined void pointer and must |
return a value in the range [0..255] or -1 to indicate EOF. |
*/ |
typedef int (*BDF_ReadByte)(void *); |
/* |
Opens a BDF font, it receives the function that will produce the stream of |
bytes, the user defined void pointer that will be passed to getbyte and a |
pointer to an int that will receive the error code. Returns the BDF font. |
*/ |
extern BDF_Font *BDF_OpenFont(BDF_ReadByte getbyte, void *info, int *error); |
/* |
Closes the font and frees all associated memory. |
*/ |
extern void BDF_CloseFont(BDF_Font *font); |
/* |
Determines the size of the horizontal text, returns the width and height of the |
smallest rectangle that can acomodate the rendered text and the start position |
in x0 and y0 on where the text must be rendered to exactly fit the rectangle. |
This is because the render functions take the y parameter as the baseline of |
the text to allow different fonts (e.g. normal and italic) to be mixed in the |
same line. It handles NULL pointers for pieces of information you don't want. |
*/ |
extern void BDF_SizeH(BDF_Font *font, char *text, int *x0, int *y0, int *width, int *height); |
/* |
Same as above but accepts entities in the form &...; |
*/ |
extern void BDF_SizeEntitiesH(BDF_Font *font, char *text, int *x0, int *y0, int *width, int *height); |
/* |
Draws the text at the given surface starting at position (x, y). It calls |
putpixel with the surface, coordinates and color to draw the pixel (doesn't |
clip). Returns the next x coordinate to continue to render more text. Only |
accepts characters in the range [0..255]. |
*/ |
extern int BDF_DrawH(void *surface, BDF_PutPixel putpixel, BDF_Font *font, char *text, int x, int y, unsigned int color); |
/* |
Same as above but accepts entities in the form &...; |
*/ |
extern int BDF_DrawEntitiesH(void *, BDF_PutPixel, BDF_Font *, char *, int, int, unsigned int); |
#ifdef __cplusplus |
}; |
#endif |
#endif |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/bdf.gperf |
---|
0,0 → 1,112 |
/* ANSI-C code produced by gperf version 2.7 */ |
/* Command-line: gperf -c -C -l -L ANSI-C -f 0 -G -t bdf.in */ |
struct bdfword { char *name; int code; }; |
#define TOTAL_KEYWORDS 21 |
#define MIN_WORD_LENGTH 3 |
#define MAX_WORD_LENGTH 15 |
#define MIN_HASH_VALUE 3 |
#define MAX_HASH_VALUE 37 |
/* maximum key range = 35, duplicates = 0 */ |
#ifdef __GNUC__ |
__inline |
#endif |
static unsigned int |
hash (register const char *str, register unsigned int len) |
{ |
static const unsigned char asso_values[] = |
{ |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 5, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 0, 20, 5, 0, |
15, 0, 0, 38, 38, 38, 38, 0, 0, 38, |
10, 38, 15, 0, 0, 38, 15, 38, 0, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38, 38, 38, 38, 38, |
38, 38, 38, 38, 38, 38 |
}; |
return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; |
} |
static const unsigned char lengthtable[] = |
{ |
0, 0, 0, 3, 4, 0, 6, 7, 8, 9, 10, 6, 7, 13, |
0, 15, 6, 7, 0, 4, 0, 0, 7, 0, 9, 5, 0, 7, |
0, 0, 15, 0, 0, 0, 14, 0, 0, 7 |
}; |
static const struct bdfword wordlist[] = |
{ |
{""}, {""}, {""}, |
{"BBX",BBX}, |
{"SIZE",SIZE}, |
{""}, |
{"SWIDTH",SWIDTH}, |
{"ENDFONT",ENDFONT}, |
{"ENCODING",ENCODING}, |
{"STARTFONT",STARTFONT}, |
{"METRICSSET",METRICSSET}, |
{"DWIDTH",DWIDTH}, |
{"SWIDTH1",SWIDTH1}, |
{"ENDPROPERTIES",ENDPROPERTIES}, |
{""}, |
{"STARTPROPERTIES",STARTPROPERTIES}, |
{"BITMAP",BITMAP}, |
{"DWIDTH1",DWIDTH1}, |
{""}, |
{"FONT",FONT}, |
{""}, {""}, |
{"ENDCHAR",ENDCHAR}, |
{""}, |
{"STARTCHAR",STARTCHAR}, |
{"CHARS",CHARS}, |
{""}, |
{"COMMENT",COMMENT}, |
{""}, {""}, |
{"FONTBOUNDINGBOX",FONTBOUNDINGBOX}, |
{""}, {""}, {""}, |
{"CONTENTVERSION",CONTENTVERSION}, |
{""}, {""}, |
{"VVECTOR",VVECTOR} |
}; |
#ifdef __GNUC__ |
__inline |
#endif |
const struct bdfword * |
in_word_set (register const char *str, register unsigned int len) |
{ |
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
{ |
register int key = hash (str, len); |
if (key <= MAX_HASH_VALUE && key >= 0) |
if (len == lengthtable[key]) |
{ |
register const char *s = wordlist[key].name; |
if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) |
return &wordlist[key]; |
} |
} |
return 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/bdf.in |
---|
0,0 → 1,23 |
struct bdfword { char *name; int code; }; |
%% |
STARTFONT,STARTFONT |
COMMENT,COMMENT |
CONTENTVERSION,CONTENTVERSION |
FONT,FONT |
SIZE,SIZE |
FONTBOUNDINGBOX,FONTBOUNDINGBOX |
METRICSSET,METRICSSET |
SWIDTH,SWIDTH |
DWIDTH,DWIDTH |
SWIDTH1,SWIDTH1 |
DWIDTH1,DWIDTH1 |
VVECTOR,VVECTOR |
STARTPROPERTIES,STARTPROPERTIES |
ENDPROPERTIES,ENDPROPERTIES |
CHARS,CHARS |
STARTCHAR,STARTCHAR |
ENCODING,ENCODING |
BBX,BBX |
BITMAP,BITMAP |
ENDCHAR,ENDCHAR |
ENDFONT,ENDFONT |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/dustismo36.bdf |
---|
0,0 → 1,20131 |
STARTFONT 2.1 |
COMMENT |
COMMENT Converted from TrueType font "c:\windows\desktop\dustismo\dustismo_roman.ttf" by "TTF2BDF 2.6". |
COMMENT |
FONT -FreeType-Dustismo Roman-Medium-R-Normal--50-360-100-100-P-233-ISO10646-1 |
SIZE 36 100 100 |
FONTBOUNDINGBOX 53 66 -6 -13 |
STARTPROPERTIES 20 |
FOUNDRY "FreeType" |
FAMILY_NAME "Dustismo Roman" |
WEIGHT_NAME "Medium" |
SLANT "R" |
SETWIDTH_NAME "Normal" |
ADD_STYLE_NAME "" |
PIXEL_SIZE 50 |
POINT_SIZE 360 |
RESOLUTION_X 100 |
RESOLUTION_Y 100 |
SPACING "P" |
AVERAGE_WIDTH 233 |
CHARSET_REGISTRY "ISO10646" |
CHARSET_ENCODING "1" |
FONT_ASCENT 46 |
FONT_DESCENT 12 |
COPYRIGHT "Copyright (c) Dustin Norlander, 2003. 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 any later " |
_TTF_FONTFILE "c:\windows\desktop\dustismo\dustismo_roman.ttf" |
_TTF_PSNAME "DustismoRoman" |
_XFREE86_GLYPH_RANGES "32_126 160_172 174_271 274_289 292_305 308_310 313_314 317_324 327_341 344_369 372_382 402 461_476 482_483 486_487 508_512 562 710_711 713 728 730_733 894 902 904_906 908 910_911 913_929 931_942 945_974 8211_8212 8216_8218 8220_8222 8224_8226 8230 8240 8249_8250 8260 8364 8482 8706 8710 8719_8722 8725 8729_8730 8734_8735 8747 8776_8777 8800_8802 8804_8805 8814_8815 8976 9472 9474 9484 9488 9492 9496 9500 9508 9516 9524 9532 9552_9580 9786 9792_9794 9827 9829_9830 9833_9836 64257_64258" |
ENDPROPERTIES |
CHARS 496 |
STARTCHAR 0020 |
ENCODING 32 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 1 1 0 0 |
BITMAP |
00 |
ENDCHAR |
STARTCHAR 0021 |
ENCODING 33 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 37 2 0 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
00 |
00 |
00 |
00 |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 0022 |
ENCODING 34 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 9 2 27 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
783E |
783C |
783C |
703C |
701C |
ENDCHAR |
STARTCHAR 0023 |
ENCODING 35 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 36 1 0 |
BITMAP |
003010 |
003030 |
003030 |
002030 |
002020 |
006020 |
006060 |
006060 |
004060 |
004040 |
3FFFFF |
3FFFFF |
00C0C0 |
0080C0 |
008080 |
018080 |
018180 |
018180 |
010180 |
010100 |
030100 |
030300 |
030300 |
020300 |
FFFFFC |
FFFFFC |
060200 |
060600 |
040600 |
040400 |
040400 |
0C0400 |
0C0C00 |
080C00 |
080C00 |
080800 |
ENDCHAR |
STARTCHAR 0024 |
ENCODING 36 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 45 1 -5 |
BITMAP |
003000 |
003000 |
003000 |
003000 |
00FC00 |
07FFE0 |
1F31E0 |
3E3060 |
7C3060 |
7C3060 |
F83020 |
F83000 |
F83000 |
F83000 |
F83000 |
FC3000 |
FC3000 |
7E3000 |
7F3000 |
3FF000 |
1FFC00 |
0FFF00 |
03FFC0 |
00FFE0 |
001FF0 |
0013F8 |
0031FC |
0030FC |
00307E |
00303E |
00303E |
C0303E |
C0303E |
C0303E |
C0307C |
C0307C |
E030F8 |
7031F0 |
3C37E0 |
0FFFC0 |
03FE00 |
003000 |
003000 |
003000 |
001000 |
ENDCHAR |
STARTCHAR 0025 |
ENCODING 37 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 21 36 2 0 |
BITMAP |
1E00C0 |
7F80C0 |
738080 |
E1C180 |
E1C180 |
E1C100 |
E1C300 |
E1C300 |
E1C600 |
738600 |
7F8400 |
1E0C00 |
000C00 |
001800 |
001800 |
001000 |
003000 |
003000 |
006000 |
006000 |
004000 |
00C000 |
00C000 |
018000 |
018000 |
0187E0 |
030FF0 |
030E70 |
021C38 |
061C38 |
061C38 |
0C1C38 |
0C1C38 |
080E70 |
180FF0 |
1807E0 |
ENDCHAR |
STARTCHAR 0026 |
ENCODING 38 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 37 2 0 |
BITMAP |
01F80000 |
03FC0000 |
0F860000 |
0F030000 |
1F030000 |
1F010000 |
1F010000 |
1F010000 |
0F030000 |
0F830000 |
0F870000 |
07C60000 |
07CC0000 |
03FC0000 |
03F80000 |
01F00000 |
01F00000 |
01F80000 |
03780000 |
067C0000 |
0C3E0000 |
181F01F8 |
381F01F8 |
700F8060 |
7007C040 |
F007C0C0 |
F003E0C0 |
F001F180 |
F000F900 |
F000FB00 |
F8007E00 |
F8003E00 |
7C003F00 |
3F00EF80 |
3FFF8FC0 |
0FFF1FF8 |
03F81FF8 |
ENDCHAR |
STARTCHAR 0027 |
ENCODING 39 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 9 2 27 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
F0 |
F0 |
F0 |
70 |
ENDCHAR |
STARTCHAR 0028 |
ENCODING 40 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 12 48 2 -12 |
BITMAP |
0010 |
0070 |
00E0 |
01C0 |
0380 |
0780 |
0F00 |
0E00 |
1E00 |
1E00 |
3C00 |
3C00 |
7C00 |
7C00 |
7800 |
7800 |
7800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
7800 |
7800 |
7800 |
7C00 |
7C00 |
3C00 |
3C00 |
1E00 |
1E00 |
0E00 |
0F00 |
0780 |
0380 |
01C0 |
00E0 |
0070 |
0010 |
ENDCHAR |
STARTCHAR 0029 |
ENCODING 41 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 12 48 2 -12 |
BITMAP |
8000 |
C000 |
7000 |
3800 |
1C00 |
1E00 |
0F00 |
0700 |
0780 |
0780 |
03C0 |
03C0 |
03C0 |
03E0 |
01E0 |
01E0 |
01E0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01E0 |
01E0 |
03E0 |
03E0 |
03E0 |
03C0 |
03C0 |
0780 |
0780 |
0700 |
0F00 |
1E00 |
1C00 |
3800 |
7000 |
E000 |
8000 |
ENDCHAR |
STARTCHAR 002A |
ENCODING 42 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 21 1 10 |
BITMAP |
003800 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
70383C |
FC38FC |
FF11FC |
7F83FC |
1F83F0 |
000000 |
000000 |
00C400 |
01C700 |
03C780 |
0787C0 |
0F83E0 |
1F03E0 |
1F01E0 |
0E00C0 |
ENDCHAR |
STARTCHAR 002B |
ENCODING 43 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 21 21 0 3 |
BITMAP |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
FFFFF8 |
FFFFF8 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
ENDCHAR |
STARTCHAR 002C |
ENCODING 44 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 10 2 -5 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
38 |
18 |
30 |
60 |
C0 |
ENDCHAR |
STARTCHAR 002D |
ENCODING 45 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 17 2 2 17 |
BITMAP |
FFFF80 |
FFFF80 |
ENDCHAR |
STARTCHAR 002E |
ENCODING 46 |
SWIDTH 200 0 |
DWIDTH 10 0 |
BBX 5 5 2 0 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 002F |
ENCODING 47 |
SWIDTH 340 0 |
DWIDTH 17 0 |
BBX 15 36 1 0 |
BITMAP |
0002 |
0006 |
0004 |
000C |
000C |
0008 |
0018 |
0010 |
0030 |
0030 |
0020 |
0060 |
0040 |
00C0 |
00C0 |
0080 |
0180 |
0100 |
0300 |
0300 |
0200 |
0600 |
0600 |
0400 |
0C00 |
0800 |
1800 |
1800 |
1000 |
3000 |
2000 |
6000 |
6000 |
4000 |
C000 |
8000 |
ENDCHAR |
STARTCHAR 0030 |
ENCODING 48 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 25 37 2 -1 |
BITMAP |
007F0000 |
03FFE000 |
07C1F000 |
0F80F800 |
1F007C00 |
1E007C00 |
3E003E00 |
3E003E00 |
7C001F00 |
7C001F00 |
7C001F00 |
7C001F00 |
FC001F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
F8000F80 |
78000F00 |
7C001F00 |
7C001F00 |
7C001F00 |
3C001E00 |
3E003E00 |
1E003C00 |
1F007C00 |
0F80F800 |
07C1F000 |
03FFE000 |
007F0000 |
ENDCHAR |
STARTCHAR 0031 |
ENCODING 49 |
SWIDTH 240 0 |
DWIDTH 12 0 |
BBX 9 36 1 0 |
BITMAP |
FE00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
3E00 |
FF80 |
FF80 |
ENDCHAR |
STARTCHAR 0032 |
ENCODING 50 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 36 2 0 |
BITMAP |
00FE00 |
03FF80 |
0E0FC0 |
1803E0 |
3001F0 |
2001F0 |
6001F8 |
4000F8 |
4000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F0 |
0001F0 |
0001E0 |
0003E0 |
0007C0 |
000780 |
000F00 |
001E00 |
003C00 |
007800 |
00F000 |
01E000 |
03C000 |
078000 |
0F0000 |
1E0000 |
3C0000 |
7C0000 |
780000 |
F8000C |
F8000C |
F8000C |
FFFFFC |
FFFFFC |
ENDCHAR |
STARTCHAR 0033 |
ENCODING 51 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 37 1 -1 |
BITMAP |
01FC00 |
07FF00 |
0E1F80 |
1807C0 |
1003E0 |
3003E0 |
0003F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001E0 |
0003E0 |
0003C0 |
0007C0 |
000F80 |
00FE00 |
00FF00 |
000FC0 |
0003E0 |
0003E0 |
0001F0 |
0001F0 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
C001F0 |
C001F0 |
E003E0 |
F007E0 |
F80FC0 |
FFFF00 |
01FC00 |
ENDCHAR |
STARTCHAR 0034 |
ENCODING 52 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 22 36 0 0 |
BITMAP |
0001C0 |
0003C0 |
0007C0 |
0007C0 |
000FC0 |
000FC0 |
001FC0 |
0037C0 |
0037C0 |
0067C0 |
0047C0 |
00C7C0 |
0187C0 |
0187C0 |
0307C0 |
0207C0 |
0607C0 |
0C07C0 |
0C07C0 |
1807C0 |
1007C0 |
3007C0 |
2007C0 |
7FFFFC |
FFFFFC |
FFFFFC |
FFFFFC |
FFFFFC |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
ENDCHAR |
STARTCHAR 0035 |
ENCODING 53 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 37 1 -1 |
BITMAP |
0FFFF8 |
0FFFF8 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1FFE00 |
1FFFC0 |
1F07E0 |
1C03F0 |
0001F8 |
0000F8 |
00007C |
00007C |
00007E |
00003E |
00003E |
40003E |
C0003E |
C0003E |
E0003E |
60007C |
70007C |
3000FC |
1800F8 |
1C01F0 |
0F07E0 |
03FF80 |
00FE00 |
ENDCHAR |
STARTCHAR 0036 |
ENCODING 54 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 37 2 -1 |
BITMAP |
00FE00 |
03FF00 |
0FC180 |
0F80C0 |
1F0000 |
3E0000 |
3E0000 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
780000 |
780000 |
F8FE00 |
FBFFC0 |
FE07E0 |
F803F0 |
F801F8 |
F800F8 |
F8007C |
F8007C |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
7C003E |
7C007C |
7C007C |
3E00FC |
3E00F8 |
1F01F0 |
0F87E0 |
07FFC0 |
00FE00 |
ENDCHAR |
STARTCHAR 0037 |
ENCODING 55 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 21 36 1 0 |
BITMAP |
FFFFF8 |
FFFFF8 |
0000F8 |
0001F0 |
0001F0 |
0003E0 |
0003C0 |
0007C0 |
000F80 |
000F80 |
001F00 |
001F00 |
003E00 |
003E00 |
007C00 |
007800 |
00F800 |
00F800 |
01F000 |
01F000 |
03E000 |
03E000 |
03C000 |
07C000 |
07C000 |
0F8000 |
0F8000 |
0F8000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
3E0000 |
3E0000 |
3E0000 |
3E0000 |
ENDCHAR |
STARTCHAR 0038 |
ENCODING 56 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 37 2 -1 |
BITMAP |
01FE00 |
07FF80 |
0F87C0 |
1F03E0 |
3E01F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3E01F0 |
1F03E0 |
0F87C0 |
03FF00 |
03FF00 |
0F87C0 |
1F03E0 |
3E01F0 |
7C00F8 |
7C00F8 |
7800F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
FC00FC |
7C00F8 |
7C00F8 |
3E01F0 |
1F03E0 |
0F87C0 |
07FF80 |
01FE00 |
ENDCHAR |
STARTCHAR 0039 |
ENCODING 57 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 37 1 -1 |
BITMAP |
01FE00 |
07FFC0 |
0FC3E0 |
1F01F0 |
3E00F8 |
7E00F8 |
7C007C |
7C007C |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
7C003E |
7C003E |
3E003E |
3F007E |
0FC1FE |
07FFFC |
01FE7C |
00007C |
00007C |
000078 |
0000F8 |
0000F8 |
0000F0 |
0001F0 |
0001E0 |
0003E0 |
0007C0 |
000F80 |
001F00 |
007E00 |
0FF000 |
0F0000 |
ENDCHAR |
STARTCHAR 003A |
ENCODING 58 |
SWIDTH 160 0 |
DWIDTH 8 0 |
BBX 5 24 2 0 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 003B |
ENCODING 59 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 29 2 -5 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
F8 |
F8 |
F8 |
F8 |
F8 |
38 |
18 |
30 |
60 |
C0 |
ENDCHAR |
STARTCHAR 003C |
ENCODING 60 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 24 1 6 |
BITMAP |
000020 |
0000E0 |
0001E0 |
0007C0 |
001F80 |
003E00 |
00F800 |
03F000 |
07C000 |
1F8000 |
3E0000 |
F80000 |
F80000 |
7E0000 |
1F0000 |
0FC000 |
03F000 |
00F800 |
007E00 |
001F80 |
0007C0 |
0003E0 |
0000E0 |
000020 |
ENDCHAR |
STARTCHAR 003D |
ENCODING 61 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 18 13 1 13 |
BITMAP |
FFFFC0 |
FFFFC0 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
FFFFC0 |
FFFFC0 |
ENDCHAR |
STARTCHAR 003E |
ENCODING 62 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 23 2 6 |
BITMAP |
800000 |
E00000 |
F80000 |
7C0000 |
3F0000 |
0FC000 |
03E000 |
01F800 |
007E00 |
001F00 |
000FC0 |
0003E0 |
0007C0 |
001F80 |
007E00 |
00F800 |
03E000 |
0FC000 |
1F0000 |
7C0000 |
F80000 |
E00000 |
800000 |
ENDCHAR |
STARTCHAR 003F |
ENCODING 63 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 23 36 1 0 |
BITMAP |
01FE00 |
0FFFC0 |
3F83E0 |
7E00F8 |
7C007C |
FC007C |
F8003E |
F8003E |
7C003E |
7C007C |
3C007C |
0000F8 |
0001F0 |
0001E0 |
0007C0 |
000F80 |
001E00 |
001C00 |
003800 |
007000 |
007000 |
006000 |
006000 |
006000 |
006000 |
006000 |
006000 |
006000 |
006000 |
000000 |
000000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
ENDCHAR |
STARTCHAR 0040 |
ENCODING 64 |
SWIDTH 720 0 |
DWIDTH 36 0 |
BBX 32 35 2 0 |
BITMAP |
0000FC00 |
0007FF80 |
001F03C0 |
007800E0 |
00F00030 |
01C00018 |
0380000C |
0700000C |
0E000006 |
0C03F806 |
180F07C7 |
381E03C3 |
303C03C3 |
307C07C3 |
60F80783 |
60F80783 |
60F00783 |
C1F00783 |
C1F00F87 |
C1F00F86 |
C1F00F06 |
C1F00F0C |
C1F00F0C |
C1F81F18 |
C0F83F38 |
E07EFE70 |
603FDFE0 |
701F0F80 |
70000000 |
38000200 |
1C000600 |
1F001C00 |
07C07800 |
03FFE000 |
007F8000 |
ENDCHAR |
STARTCHAR 0041 |
ENCODING 65 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 36 1 0 |
BITMAP |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 0042 |
ENCODING 66 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 36 1 0 |
BITMAP |
FFFFC000 |
FFFFF000 |
1F01F800 |
1F007C00 |
1F003E00 |
1F003E00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F003E00 |
1F003E00 |
1F007C00 |
1F01F800 |
1FFFF000 |
1FFFFC00 |
1F007E00 |
1F003F00 |
1F001F80 |
1F000F80 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F000F80 |
1F001F00 |
1F003F00 |
1F007E00 |
FFFFF800 |
FFFFE000 |
ENDCHAR |
STARTCHAR 0043 |
ENCODING 67 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 37 2 -1 |
BITMAP |
001FF0 |
00FFFE |
03F03F |
07C00F |
0F8007 |
1F0003 |
3E0003 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
3E0000 |
3E0003 |
1F0003 |
0F8007 |
07C00F |
03F03F |
00FFFE |
001FF0 |
ENDCHAR |
STARTCHAR 0044 |
ENCODING 68 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 28 36 1 0 |
BITMAP |
FFFFE000 |
FFFFFC00 |
1F00FE00 |
1F003F00 |
1F001F80 |
1F000FC0 |
1F0007C0 |
1F0007E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0003F0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007E0 |
1F0007C0 |
1F000FC0 |
1F001F80 |
1F003F00 |
1F007E00 |
FFFFFC00 |
FFFFE000 |
ENDCHAR |
STARTCHAR 0045 |
ENCODING 69 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 36 1 0 |
BITMAP |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 0046 |
ENCODING 70 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 36 1 0 |
BITMAP |
FFFFFE |
FFFFFE |
1F0006 |
1F0006 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFE000 |
FFE000 |
ENDCHAR |
STARTCHAR 0047 |
ENCODING 71 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 37 2 -1 |
BITMAP |
007F8000 |
03FFF000 |
07E07C00 |
0F801E00 |
1F000F00 |
3F000700 |
3E000700 |
7E000300 |
7C000300 |
7C000300 |
7C000300 |
FC000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F800FFF8 |
F800FFF8 |
F80007C0 |
F80007C0 |
F80007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
3E000FC0 |
3E000F80 |
1F000F80 |
1F801F00 |
0FC03E00 |
07E07C00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 0048 |
ENCODING 72 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 31 36 1 0 |
BITMAP |
FFE007FE |
FFE007FE |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1FFFFFF0 |
1FFFFFF0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
FFE007FE |
FFE007FE |
ENDCHAR |
STARTCHAR 0049 |
ENCODING 73 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 11 36 1 0 |
BITMAP |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 004A |
ENCODING 74 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 22 37 1 -1 |
BITMAP |
000FFC |
000FFC |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
3003E0 |
F003E0 |
F003E0 |
7007E0 |
7807C0 |
3C0FC0 |
1E1F80 |
0FFF00 |
01F800 |
ENDCHAR |
STARTCHAR 004B |
ENCODING 75 |
SWIDTH 680 0 |
DWIDTH 34 0 |
BBX 30 36 1 0 |
BITMAP |
FFE003F0 |
FFE003F0 |
1F000180 |
1F000700 |
1F000E00 |
1F001C00 |
1F003000 |
1F006000 |
1F00C000 |
1F038000 |
1F070000 |
1F0E0000 |
1F1C0000 |
1F300000 |
1F600000 |
1FE00000 |
1FF00000 |
1FF80000 |
1FFC0000 |
1FFE0000 |
1F7F0000 |
1F3F8000 |
1F1F8000 |
1F1FC000 |
1F0FE000 |
1F07F000 |
1F03F800 |
1F01FC00 |
1F00FE00 |
1F007F00 |
1F003F80 |
1F001FC0 |
1F000FC0 |
1F000FE0 |
FFE00FFC |
FFE00FFC |
ENDCHAR |
STARTCHAR 004C |
ENCODING 76 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 36 1 0 |
BITMAP |
FFC000 |
FFC000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0006 |
1F0006 |
1F0006 |
FFFFFE |
FFFFFE |
ENDCHAR |
STARTCHAR 004D |
ENCODING 77 |
SWIDTH 740 0 |
DWIDTH 37 0 |
BBX 35 36 1 0 |
BITMAP |
FF80003FE0 |
FF80003FE0 |
1F80003F00 |
1FC0007F00 |
1FC0007F00 |
1FC0007F00 |
1FE000FF00 |
1FE000FF00 |
1BE000FF00 |
1BF001DF00 |
1BF001DF00 |
19F001DF00 |
19F8039F00 |
19F8039F00 |
18F8039F00 |
18FC071F00 |
18FC071F00 |
187C071F00 |
187E0E1F00 |
187E0E1F00 |
183E0E1F00 |
183F1C1F00 |
183F1C1F00 |
181F1C1F00 |
181FB81F00 |
181FB81F00 |
180FB01F00 |
180FF01F00 |
180FF01F00 |
1807E01F00 |
1807E01F00 |
1807E01F00 |
1803C01F00 |
1803C01F00 |
FF03C07FE0 |
FF01807FE0 |
ENDCHAR |
STARTCHAR 004E |
ENCODING 78 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
FF8007F8 |
FF8007F8 |
1FC000C0 |
1FC000C0 |
1FE000C0 |
1BF000C0 |
1BF000C0 |
19F800C0 |
19F800C0 |
18FC00C0 |
187E00C0 |
187E00C0 |
183F00C0 |
183F00C0 |
181F80C0 |
180FC0C0 |
180FC0C0 |
1807E0C0 |
1807E0C0 |
1803F0C0 |
1801F8C0 |
1801F8C0 |
1800FCC0 |
1800FEC0 |
18007EC0 |
18003FC0 |
18003FC0 |
18001FC0 |
18001FC0 |
18000FC0 |
180007C0 |
180007C0 |
180003C0 |
180003C0 |
FE0001C0 |
FE0000C0 |
ENDCHAR |
STARTCHAR 004F |
ENCODING 79 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 27 37 2 -1 |
BITMAP |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 0050 |
ENCODING 80 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 36 1 0 |
BITMAP |
FFFFE000 |
FFFFFC00 |
1F007E00 |
1F001F80 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F001F80 |
1F007E00 |
1FFFFC00 |
1FFFE000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
FFE00000 |
FFE00000 |
ENDCHAR |
STARTCHAR 0051 |
ENCODING 81 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 32 43 1 -7 |
BITMAP |
007FC000 |
03FFF800 |
0FF0FE00 |
1FC03F00 |
1F801F00 |
3F000F80 |
3F000FC0 |
7E0007C0 |
7E0007E0 |
7C0003E0 |
7C0003E0 |
FC0003E0 |
FC0003F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
F80001F0 |
FC0003F0 |
7C0003E0 |
7C0003E0 |
7C0003E0 |
7E0007E0 |
3E0007C0 |
3F000FC0 |
1F000F80 |
1F801F00 |
0FC03F00 |
03F0FC00 |
00FFF000 |
000FF800 |
0000FE00 |
00003F00 |
00001F80 |
00000FE0 |
000007FF |
000001FC |
ENDCHAR |
STARTCHAR 0052 |
ENCODING 82 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 31 36 1 0 |
BITMAP |
FFFFE000 |
FFFFFC00 |
1F007E00 |
1F001F00 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F001F80 |
1F007F00 |
1FFFFC00 |
1FFFF000 |
1F07E000 |
1F03E000 |
1F03F000 |
1F03F000 |
1F01F800 |
1F00F800 |
1F00FC00 |
1F007C00 |
1F007E00 |
1F003F00 |
1F003F80 |
1F001F80 |
1F000FC0 |
1F000FE0 |
1F0007F0 |
FFE003FE |
FFE001FE |
ENDCHAR |
STARTCHAR 0053 |
ENCODING 83 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 37 2 -1 |
BITMAP |
01FE00 |
0FFFE0 |
1F83F0 |
3F00F0 |
7E0070 |
7C0070 |
F80030 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
FC0000 |
7E0000 |
7F0000 |
3FC000 |
1FF800 |
0FFF00 |
03FFC0 |
00FFE0 |
001FF0 |
0003F8 |
0000FC |
00007C |
00007E |
00003E |
00003E |
C0003E |
C0003E |
E0003E |
E0007C |
E0007C |
F000F8 |
7801F0 |
3E07E0 |
0FFFC0 |
03FE00 |
ENDCHAR |
STARTCHAR 0054 |
ENCODING 84 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 36 1 0 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
C03E0380 |
C03E0380 |
C03E0380 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
01FF8000 |
01FF8000 |
ENDCHAR |
STARTCHAR 0055 |
ENCODING 85 |
SWIDTH 720 0 |
DWIDTH 36 0 |
BBX 34 37 1 -1 |
BITMAP |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 0056 |
ENCODING 86 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 36 1 0 |
BITMAP |
FFC003F8 |
FFC003F8 |
3F0000C0 |
1F0001C0 |
1F800180 |
1F800180 |
0F800380 |
0FC00300 |
0FC00300 |
07C00700 |
07E00600 |
07E00600 |
03E00600 |
03F00E00 |
03F00C00 |
01F00C00 |
01F81C00 |
01F81800 |
00F81800 |
00F83800 |
00FC3000 |
007C3000 |
007C7000 |
007E6000 |
007E6000 |
003EE000 |
003FC000 |
003FC000 |
001FC000 |
001FC000 |
001F8000 |
000F8000 |
000F8000 |
000F0000 |
00070000 |
00070000 |
ENDCHAR |
STARTCHAR 0057 |
ENCODING 87 |
SWIDTH 860 0 |
DWIDTH 43 0 |
BBX 41 36 1 0 |
BITMAP |
FFCFFFF83F80 |
FFCFFFF83F80 |
1F03F0C00C00 |
1F81F0C01C00 |
1F81F9C01800 |
0F81F9801800 |
0FC0F9803800 |
0FC0FF803000 |
07C0FF003000 |
07E07F007000 |
07E07F006000 |
03E07F006000 |
03F03E00E000 |
03F03E00C000 |
01F03F00C000 |
01F83F01C000 |
01F81F018000 |
00F81F818000 |
00FC1F818000 |
00FC1F838000 |
007C3FC30000 |
007C3FC30000 |
007E37C70000 |
003E77E60000 |
003E67E60000 |
003F63EE0000 |
003FE3FC0000 |
001FC3FC0000 |
001FC1FC0000 |
001FC1F80000 |
000FC1F80000 |
000F80F80000 |
000F80F00000 |
000780F00000 |
000700700000 |
000700700000 |
ENDCHAR |
STARTCHAR 0058 |
ENCODING 88 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 29 36 2 0 |
BITMAP |
FFC01FC0 |
FFC01FC0 |
1F000600 |
1F800E00 |
0F800C00 |
0FC01800 |
07C03800 |
07E03000 |
03F07000 |
01F06000 |
01F8E000 |
00F9C000 |
00FD8000 |
007F8000 |
003F0000 |
003F0000 |
001F0000 |
001F8000 |
001F8000 |
001FC000 |
003FE000 |
0033E000 |
0063F000 |
00E1F000 |
00C1F800 |
01C0FC00 |
01807C00 |
03007E00 |
03003E00 |
06003F00 |
0E001F00 |
0C000F80 |
1C000FC0 |
180007C0 |
FC001FF8 |
FC001FF8 |
ENDCHAR |
STARTCHAR 0059 |
ENCODING 89 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 005A |
ENCODING 90 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 36 1 0 |
BITMAP |
7FFFFFC0 |
7FFFFF80 |
60001F80 |
60001F00 |
60003F00 |
00003E00 |
00007C00 |
0000FC00 |
0000F800 |
0001F800 |
0001F000 |
0003F000 |
0007E000 |
0007C000 |
000FC000 |
000F8000 |
001F8000 |
001F0000 |
003E0000 |
007E0000 |
007C0000 |
00FC0000 |
00F80000 |
01F80000 |
03F00000 |
03E00000 |
07E00000 |
07C00000 |
0FC00000 |
0F800000 |
1F000000 |
3F0000C0 |
3E0000C0 |
7E0000C0 |
7FFFFFC0 |
FFFFFFC0 |
ENDCHAR |
STARTCHAR 005B |
ENCODING 91 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 11 48 2 -12 |
BITMAP |
FFE0 |
FFE0 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
F800 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 005C |
ENCODING 92 |
SWIDTH 340 0 |
DWIDTH 17 0 |
BBX 15 36 1 0 |
BITMAP |
8000 |
C000 |
4000 |
4000 |
6000 |
2000 |
3000 |
1000 |
1000 |
1800 |
0800 |
0C00 |
0400 |
0400 |
0600 |
0200 |
0300 |
0300 |
0100 |
0180 |
0080 |
00C0 |
00C0 |
0040 |
0060 |
0020 |
0030 |
0030 |
0010 |
0018 |
0008 |
000C |
000C |
0004 |
0006 |
0002 |
ENDCHAR |
STARTCHAR 005D |
ENCODING 93 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 12 48 0 -12 |
BITMAP |
FFF0 |
FFF0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
01F0 |
FFF0 |
FFF0 |
ENDCHAR |
STARTCHAR 005E |
ENCODING 94 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 20 17 3 19 |
BITMAP |
006000 |
00F000 |
01F000 |
019800 |
031800 |
030C00 |
060C00 |
060600 |
0C0300 |
0C0300 |
180180 |
180180 |
3000C0 |
6000C0 |
600060 |
C00060 |
C00030 |
ENDCHAR |
STARTCHAR 005F |
ENCODING 95 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 22 2 2 -10 |
BITMAP |
FFFFFC |
FFFFFC |
ENDCHAR |
STARTCHAR 0060 |
ENCODING 96 |
SWIDTH 220 0 |
DWIDTH 11 0 |
BBX 8 8 1 27 |
BITMAP |
F8 |
7C |
7C |
3E |
1E |
0F |
07 |
06 |
ENDCHAR |
STARTCHAR 0061 |
ENCODING 97 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 23 25 2 -1 |
BITMAP |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 0062 |
ENCODING 98 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 37 1 -1 |
BITMAP |
FF0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F3F80 |
1FFFF0 |
1FE1F8 |
1F80FC |
1F007C |
1F007E |
1F003E |
1F003E |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001E |
1F003E |
1F003E |
1F003C |
1F007C |
1F80F8 |
FF61F0 |
001F80 |
ENDCHAR |
STARTCHAR 0063 |
ENCODING 99 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 19 25 2 -1 |
BITMAP |
01F820 |
07FE60 |
1FC3E0 |
3F00E0 |
3E0060 |
7C0060 |
7C0020 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0020 |
7E0020 |
3E0060 |
3F00C0 |
1F8380 |
0FFF00 |
01FC00 |
ENDCHAR |
STARTCHAR 0064 |
ENCODING 100 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 37 1 -1 |
BITMAP |
0007F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
01FCF8 |
0FFFF8 |
1F87F8 |
3F01F8 |
3E00F8 |
7E00F8 |
7C00F8 |
7C00F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
7800F8 |
7C00F8 |
7C00F8 |
3C00F8 |
3E00F8 |
1F01F8 |
0F86FF |
01F800 |
ENDCHAR |
STARTCHAR 0065 |
ENCODING 101 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 21 25 2 -1 |
BITMAP |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 0066 |
ENCODING 102 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 13 36 1 0 |
BITMAP |
03E0 |
0FF8 |
0F98 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 0067 |
ENCODING 103 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 36 0 -12 |
BITMAP |
003FFF |
01FFFF |
03E1F0 |
07C0F8 |
0F807C |
0F807C |
1F003C |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003C |
0F807C |
0F807C |
07C0F8 |
03E1F0 |
01FFC0 |
003F80 |
000700 |
00FC00 |
03E000 |
07C000 |
03F000 |
00EF80 |
0780F0 |
1E003C |
3C003E |
78001F |
F8001F |
F8001F |
F8001F |
FC003E |
7E00FE |
3FFFF8 |
07FFC0 |
ENDCHAR |
STARTCHAR 0068 |
ENCODING 104 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 0 |
BITMAP |
FF000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F1FC000 |
1F7FF000 |
1FE0F800 |
1FC07C00 |
1F003E00 |
1F003E00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
FFE0FFE0 |
FFE0FFE0 |
ENDCHAR |
STARTCHAR 0069 |
ENCODING 105 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 10 35 2 0 |
BITMAP |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
0000 |
0000 |
0000 |
0000 |
0000 |
0000 |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFC0 |
FFC0 |
ENDCHAR |
STARTCHAR 006A |
ENCODING 106 |
SWIDTH 220 0 |
DWIDTH 11 0 |
BBX 8 47 1 -12 |
BITMAP |
1F |
1F |
1F |
1F |
1F |
00 |
00 |
00 |
00 |
00 |
00 |
FF |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
1F |
3E |
FC |
F0 |
ENDCHAR |
STARTCHAR 006B |
ENCODING 107 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 36 1 0 |
BITMAP |
FF0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F01F0 |
1F01F0 |
1F0180 |
1F0300 |
1F0600 |
1F0C00 |
1F1800 |
1F1000 |
1F2000 |
1F4000 |
1FC000 |
1FE000 |
1FE000 |
1FF000 |
1FF800 |
1F7C00 |
1F3E00 |
1F1F00 |
1F0F80 |
1F07C0 |
1F03E0 |
1F03F0 |
FFE3FC |
FFE3FC |
ENDCHAR |
STARTCHAR 006C |
ENCODING 108 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 11 36 1 0 |
BITMAP |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 006D |
ENCODING 109 |
SWIDTH 820 0 |
DWIDTH 41 0 |
BBX 38 25 2 0 |
BITMAP |
000C003000 |
FF77C1FE00 |
1FC3E60F00 |
1F81FC0780 |
1F00F807C0 |
1F00F803C0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
1F00F803E0 |
FFE7FF1FFC |
FFE7FF1FFC |
ENDCHAR |
STARTCHAR 006E |
ENCODING 110 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 26 24 2 0 |
BITMAP |
FF1F8000 |
1F7FE000 |
1FE1F800 |
1F80F800 |
1F007C00 |
1F007C00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
FFE1FFC0 |
FFE1FFC0 |
ENDCHAR |
STARTCHAR 006F |
ENCODING 111 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 25 2 -1 |
BITMAP |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 0070 |
ENCODING 112 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 36 1 -12 |
BITMAP |
FF1F80 |
1FE1F0 |
1F80F8 |
1F007C |
1F003C |
1F003E |
1F003E |
1F001E |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F003E |
1F003E |
1F007E |
1F007C |
1F80FC |
1FE1F8 |
1F7FF0 |
1F1FC0 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFE000 |
FFE000 |
ENDCHAR |
STARTCHAR 0071 |
ENCODING 113 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 36 1 -12 |
BITMAP |
01F8F8 |
0F86F8 |
1F01F8 |
3E00F8 |
3C00F8 |
7C00F8 |
7C00F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
7C00F8 |
7C00F8 |
7C00F8 |
3E00F8 |
3F01F8 |
1F87F8 |
0FFEF8 |
01F8F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0007FF |
0007FF |
ENDCHAR |
STARTCHAR 0072 |
ENCODING 114 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 20 24 1 0 |
BITMAP |
FF1F80 |
1F7FE0 |
1FE1F0 |
1F8060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFE000 |
FFE000 |
ENDCHAR |
STARTCHAR 0073 |
ENCODING 115 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 17 25 3 -1 |
BITMAP |
07FF00 |
1FFF00 |
3E1F00 |
7C0F00 |
F80700 |
F80300 |
F80300 |
F80000 |
FC0000 |
7E0000 |
7FC000 |
3FF000 |
0FFC00 |
03FE00 |
007F00 |
001F00 |
001F80 |
000F80 |
800F80 |
C00F80 |
C01F80 |
E01F00 |
F87E00 |
CFFC00 |
03F000 |
ENDCHAR |
STARTCHAR 0074 |
ENCODING 116 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 13 35 1 0 |
BITMAP |
0080 |
0180 |
0380 |
0780 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
FFF8 |
FFF8 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0FC0 |
07F8 |
00F8 |
ENDCHAR |
STARTCHAR 0075 |
ENCODING 117 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 25 1 -1 |
BITMAP |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 0076 |
ENCODING 118 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 24 1 0 |
BITMAP |
FF803F |
FF803F |
1F0008 |
1F0018 |
0F0018 |
0F8010 |
0F8030 |
07C020 |
07C060 |
03C060 |
03E040 |
03E0C0 |
01F080 |
01F180 |
01F180 |
00F900 |
00FB00 |
007E00 |
007E00 |
007E00 |
003C00 |
003C00 |
001800 |
001800 |
ENDCHAR |
STARTCHAR 0077 |
ENCODING 119 |
SWIDTH 740 0 |
DWIDTH 37 0 |
BBX 35 24 1 0 |
BITMAP |
FFDFFF07E0 |
FFDFFF07E0 |
1F03EC0100 |
0F03E80300 |
0F83F80200 |
0F81F00600 |
07C1F00600 |
07C0F80400 |
07C0F80C00 |
03E0F80800 |
03E07C1800 |
01F0FC1800 |
01F0FE1000 |
01F0BE3000 |
00F9BE3000 |
00F91F6000 |
007D1F6000 |
007F0FC000 |
007E0FC000 |
003E0FC000 |
003E078000 |
001C078000 |
001C030000 |
0018030000 |
ENDCHAR |
STARTCHAR 0078 |
ENCODING 120 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 23 24 2 0 |
BITMAP |
FFC07C |
FFC07C |
1F0020 |
1F8060 |
0FC0C0 |
0FC180 |
07E300 |
03F300 |
03F600 |
01FC00 |
00F800 |
00FC00 |
007E00 |
007E00 |
00FF00 |
00DF80 |
019F80 |
030FC0 |
0607E0 |
0407E0 |
0C03F0 |
1801F0 |
FC07FE |
FC07FE |
ENDCHAR |
STARTCHAR 0079 |
ENCODING 121 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 36 1 -12 |
BITMAP |
FFC07E |
FFC07E |
1F0018 |
1F0010 |
0F8030 |
0F8030 |
078020 |
07C060 |
07C060 |
03E040 |
03E0C0 |
01E080 |
01F180 |
01F180 |
00F900 |
00FB00 |
00FB00 |
007E00 |
007E00 |
003C00 |
003C00 |
003C00 |
001800 |
001800 |
001000 |
003000 |
003000 |
002000 |
006000 |
006000 |
004000 |
00C000 |
008000 |
018000 |
070000 |
0E0000 |
ENDCHAR |
STARTCHAR 007A |
ENCODING 122 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 21 24 2 0 |
BITMAP |
FFFFF8 |
FFFFF0 |
C001E0 |
C003E0 |
C007C0 |
000780 |
000F80 |
001F00 |
003E00 |
003C00 |
007C00 |
00F800 |
00F000 |
01F000 |
03E000 |
03C000 |
07C000 |
0F8000 |
1F0000 |
1E0008 |
3E0008 |
7C0008 |
7FFFF8 |
FFFFF8 |
ENDCHAR |
STARTCHAR 007B |
ENCODING 123 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 12 48 1 -12 |
BITMAP |
0030 |
01F0 |
03C0 |
0780 |
0F00 |
0F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1E00 |
1E00 |
3C00 |
F000 |
E000 |
7800 |
3C00 |
1E00 |
1E00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
0F00 |
0F80 |
0780 |
03E0 |
0070 |
ENDCHAR |
STARTCHAR 007C |
ENCODING 124 |
SWIDTH 140 0 |
DWIDTH 7 0 |
BBX 2 48 2 -12 |
BITMAP |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
ENDCHAR |
STARTCHAR 007D |
ENCODING 125 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 12 48 1 -12 |
BITMAP |
C000 |
F800 |
3C00 |
1E00 |
0F00 |
0F00 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0780 |
0780 |
03C0 |
00F0 |
0070 |
01E0 |
03C0 |
0780 |
0780 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F00 |
1F00 |
1E00 |
7C00 |
E000 |
ENDCHAR |
STARTCHAR 007E |
ENCODING 126 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 25 8 2 23 |
BITMAP |
07C00000 |
1FF00100 |
3FF80180 |
787C0300 |
603F0F00 |
C00FFE00 |
4007FC00 |
0001F000 |
ENDCHAR |
STARTCHAR 00A0 |
ENCODING 160 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 1 1 0 0 |
BITMAP |
00 |
ENDCHAR |
STARTCHAR 00A1 |
ENCODING 161 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 37 2 -12 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
00 |
00 |
00 |
00 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 00A2 |
ENCODING 162 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 36 1 -6 |
BITMAP |
0000C0 |
000080 |
000180 |
000180 |
000300 |
000300 |
01FE20 |
0787E0 |
1F04E0 |
3E0460 |
3C0C60 |
7C0820 |
7C1800 |
781800 |
F81000 |
F83000 |
F82000 |
F86000 |
F86000 |
F84000 |
F8C000 |
F88000 |
FD8000 |
7D8000 |
7D0020 |
7F0020 |
3E0060 |
3F00C0 |
1F8380 |
07FF00 |
0DF800 |
0C0000 |
180000 |
180000 |
100000 |
300000 |
ENDCHAR |
STARTCHAR 00A3 |
ENCODING 163 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 23 37 3 -1 |
BITMAP |
01FC00 |
0FFF80 |
1F87C0 |
3E03E0 |
7C01E0 |
FC01F0 |
F801F0 |
F801F0 |
F80080 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7E0000 |
3E0000 |
3E0000 |
1F0000 |
1F0000 |
1F8000 |
FFF800 |
FFF800 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
0F8000 |
0F8000 |
1F0000 |
3E0000 |
7E0000 |
FFC000 |
FEF87E |
301FF8 |
0007E0 |
ENDCHAR |
STARTCHAR 00A4 |
ENCODING 164 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 22 23 3 6 |
BITMAP |
800004 |
C0FC0C |
63FF38 |
3787F0 |
1E01E0 |
0C00C0 |
180060 |
180060 |
300030 |
300030 |
300030 |
300030 |
300030 |
380070 |
180060 |
1C00E0 |
0E01C0 |
070780 |
0FFFC0 |
18FC60 |
300030 |
600018 |
400008 |
ENDCHAR |
STARTCHAR 00A5 |
ENCODING 165 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
FF8001F8 |
FF8001F8 |
1F000040 |
1F0000C0 |
0F800180 |
07C00180 |
07C00300 |
03E00200 |
03E00600 |
01F00C00 |
01F00C00 |
00F81800 |
007C1800 |
007C3000 |
003E6000 |
003E6000 |
001FC000 |
000FC000 |
000F8000 |
000F8000 |
07FFFF00 |
07FFFF00 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
07FFFF00 |
07FFFF00 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FF000 |
007FF000 |
ENDCHAR |
STARTCHAR 00A6 |
ENCODING 166 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 2 48 3 -12 |
BITMAP |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
C0 |
ENDCHAR |
STARTCHAR 00A7 |
ENCODING 167 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 18 38 2 -1 |
BITMAP |
03F000 |
1FFFC0 |
3F07C0 |
7C03C0 |
FC01C0 |
F800C0 |
F800C0 |
F80000 |
FC0000 |
7E0000 |
7F8000 |
3FF000 |
1FFC00 |
0FFE00 |
3FFF00 |
7C3F80 |
781F80 |
F80FC0 |
F807C0 |
F807C0 |
F807C0 |
FE07C0 |
7F8F80 |
3FFF00 |
1FFE00 |
07FE00 |
00FF00 |
003F80 |
000F80 |
000FC0 |
0007C0 |
8007C0 |
C007C0 |
C00FC0 |
E00F80 |
F83F00 |
CFFE00 |
03F000 |
ENDCHAR |
STARTCHAR 00A8 |
ENCODING 168 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 5 2 31 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
ENDCHAR |
STARTCHAR 00A9 |
ENCODING 169 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 31 31 2 1 |
BITMAP |
00038000 |
003FF800 |
00E01E00 |
03800780 |
060001C0 |
0C0FC0E0 |
187FF070 |
10FC1F38 |
21F80718 |
23F0031C |
43E0030C |
43E0000C |
47C00006 |
87C00006 |
87C00006 |
87C00006 |
87C00006 |
87C00006 |
87C00006 |
47C0000E |
43E0000C |
43E0030C |
23F00318 |
31F80618 |
10FC1C30 |
087FF070 |
040FC0E0 |
030003C0 |
01800700 |
00787E00 |
001FF000 |
ENDCHAR |
STARTCHAR 00AA |
ENCODING 170 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 14 16 1 20 |
BITMAP |
1FC0 |
30E0 |
2070 |
2030 |
0030 |
0030 |
0070 |
07B0 |
3830 |
7030 |
E030 |
E030 |
E070 |
E0F0 |
71B0 |
3E3C |
ENDCHAR |
STARTCHAR 00AB |
ENCODING 171 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 21 1 7 |
BITMAP |
004000 |
00C020 |
01C060 |
03C0E0 |
03C1E0 |
0783E0 |
0F07C0 |
1F0F80 |
3E1F00 |
7C1E00 |
F83E00 |
7C1E00 |
3E1F00 |
1F0F80 |
0F07C0 |
0783E0 |
03C1E0 |
03C0E0 |
01C060 |
00C020 |
004000 |
ENDCHAR |
STARTCHAR 00AC |
ENCODING 172 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 12 0 12 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
00000180 |
00000180 |
00000180 |
00000180 |
00000180 |
00000180 |
00000180 |
00000180 |
00000180 |
00000180 |
ENDCHAR |
STARTCHAR 00AE |
ENCODING 174 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 31 31 2 0 |
BITMAP |
000FE000 |
007FFC00 |
01C00F00 |
03000380 |
060001C0 |
08FFE060 |
18FFF030 |
30703838 |
20701C18 |
60700C0C |
40700C0C |
40700C0C |
80701806 |
80703006 |
807FC006 |
8071C006 |
8071E006 |
8070E006 |
8070F006 |
4070700C |
4070780C |
60703C0C |
20F83F18 |
30F81F38 |
10000030 |
08000060 |
060001C0 |
03000380 |
01C00F00 |
007FFC00 |
000FE000 |
ENDCHAR |
STARTCHAR 00AF |
ENCODING 175 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 16 2 2 34 |
BITMAP |
FFFF |
FFFF |
ENDCHAR |
STARTCHAR 00B0 |
ENCODING 176 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 10 12 2 24 |
BITMAP |
1E00 |
7F80 |
7380 |
E1C0 |
E1C0 |
E1C0 |
E1C0 |
E1C0 |
E1C0 |
7380 |
7F80 |
1E00 |
ENDCHAR |
STARTCHAR 00B1 |
ENCODING 177 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 21 22 1 4 |
BITMAP |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
FFFFF8 |
FFFFF8 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
FFFFF8 |
FFFFF8 |
ENDCHAR |
STARTCHAR 00B2 |
ENCODING 178 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 14 19 2 17 |
BITMAP |
07C0 |
1FF0 |
30F8 |
607C |
403C |
C03C |
003C |
0078 |
0070 |
00E0 |
01C0 |
0700 |
0E00 |
1C00 |
3800 |
7000 |
F004 |
FFFC |
FFFC |
ENDCHAR |
STARTCHAR 00B3 |
ENCODING 179 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 12 19 1 17 |
BITMAP |
1F00 |
3FC0 |
61C0 |
01E0 |
00E0 |
00E0 |
00E0 |
01C0 |
0180 |
0F80 |
03E0 |
00E0 |
00F0 |
0070 |
0070 |
0070 |
C0E0 |
E1C0 |
FF80 |
ENDCHAR |
STARTCHAR 00B4 |
ENCODING 180 |
SWIDTH 220 0 |
DWIDTH 11 0 |
BBX 9 8 1 27 |
BITMAP |
0F80 |
1F00 |
1E00 |
3E00 |
3C00 |
7800 |
F000 |
3000 |
ENDCHAR |
STARTCHAR 00B5 |
ENCODING 181 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 26 34 0 -10 |
BITMAP |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F807C00 |
1F807E00 |
1F807E00 |
1F80FE00 |
1FE1FE00 |
1F7FDFC0 |
1F7F9FC0 |
1F0E0000 |
1F000000 |
3F000000 |
3E000000 |
3E000000 |
3E000000 |
7C000000 |
7C000000 |
F8000000 |
70000000 |
ENDCHAR |
STARTCHAR 00B6 |
ENCODING 182 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 36 1 0 |
BITMAP |
01FFF0 |
07FFF0 |
1FE180 |
3FE180 |
7FE180 |
7FE180 |
7FE180 |
FFE180 |
FFE180 |
FFE180 |
FFE180 |
FFE180 |
7FE180 |
7FE180 |
3FE180 |
1FE180 |
0FE180 |
07E180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
006180 |
ENDCHAR |
STARTCHAR 00B7 |
ENCODING 183 |
SWIDTH 200 0 |
DWIDTH 10 0 |
BBX 5 5 2 19 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 00B8 |
ENCODING 184 |
SWIDTH 220 0 |
DWIDTH 11 0 |
BBX 8 13 1 -12 |
BITMAP |
0C |
18 |
10 |
30 |
38 |
7E |
1F |
0F |
0F |
0F |
1F |
FE |
FC |
ENDCHAR |
STARTCHAR 00B9 |
ENCODING 185 |
SWIDTH 240 0 |
DWIDTH 12 0 |
BBX 5 19 2 17 |
BITMAP |
F0 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
70 |
F8 |
ENDCHAR |
STARTCHAR 00BA |
ENCODING 186 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 19 2 17 |
BITMAP |
0FC0 |
1FF0 |
3C78 |
783C |
701C |
F01E |
E00E |
E00E |
E00E |
E00E |
E00E |
E00E |
E00E |
E00E |
701C |
701C |
3C78 |
1FF0 |
0FE0 |
ENDCHAR |
STARTCHAR 00BB |
ENCODING 187 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 21 2 7 |
BITMAP |
800000 |
C02000 |
E03000 |
F03800 |
F83C00 |
783E00 |
3C1F00 |
1E0F80 |
1F07C0 |
0F83E0 |
07C1F0 |
0F83E0 |
1F07C0 |
3E0F80 |
3C1F00 |
783E00 |
F83C00 |
F03800 |
E03000 |
C02000 |
800000 |
ENDCHAR |
STARTCHAR 00BC |
ENCODING 188 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
F0000020 |
70000060 |
700000C0 |
70000180 |
70000100 |
70000300 |
70000600 |
70000C00 |
70000800 |
70001800 |
70003000 |
70006000 |
70004000 |
7000C000 |
70018000 |
70030000 |
70020000 |
F80601C0 |
000C03C0 |
001807C0 |
00180FC0 |
00301BC0 |
006013C0 |
004023C0 |
00C043C0 |
0180C3C0 |
030183C0 |
020303C0 |
060203C0 |
0C07FFF8 |
1807FFF8 |
100003C0 |
300003C0 |
600003C0 |
C00003C0 |
800003C0 |
ENDCHAR |
STARTCHAR 00BD |
ENCODING 189 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 36 1 0 |
BITMAP |
1E000060 |
0E000040 |
0E0000C0 |
0E000180 |
0E000300 |
0E000200 |
0E000600 |
0E000C00 |
0E000800 |
0E001000 |
0E003000 |
0E006000 |
0E004000 |
0E00C000 |
0E018000 |
0E030000 |
0E020000 |
0E060F80 |
1F0C3FE0 |
001861F0 |
0010C0F8 |
00308078 |
00618078 |
00400078 |
00C000F0 |
018000E0 |
030001C0 |
02000380 |
06000E00 |
0C001C00 |
18003800 |
10007000 |
3000E000 |
6001E008 |
C001FFF8 |
C001FFF8 |
ENDCHAR |
STARTCHAR 00BE |
ENCODING 190 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 27 36 1 0 |
BITMAP |
1F000060 |
3FC00060 |
61C000C0 |
00E00180 |
00E00300 |
00E00300 |
00E00600 |
01C00C00 |
03800800 |
0F801800 |
01E03000 |
00E06000 |
00706000 |
0070C000 |
00718000 |
C0730000 |
C0E30000 |
F1C60700 |
DF8C0F00 |
00181F00 |
00183F00 |
00306F00 |
00604F00 |
00408F00 |
00C10F00 |
01830F00 |
03060F00 |
020C0F00 |
06080F00 |
0C1FFFE0 |
181FFFE0 |
18000F00 |
30000F00 |
60000F00 |
C0000F00 |
C0000F00 |
ENDCHAR |
STARTCHAR 00BF |
ENCODING 191 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 37 2 -13 |
BITMAP |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
000000 |
000000 |
000000 |
001800 |
001800 |
001800 |
001800 |
001800 |
001800 |
001800 |
001800 |
001800 |
003000 |
007000 |
00F000 |
01E000 |
03C000 |
078000 |
1F0000 |
3E0000 |
3C01F0 |
7800F8 |
F800F8 |
F800F8 |
F80078 |
F8007C |
F800F8 |
7C00F8 |
3E01F0 |
1F87E0 |
07FF80 |
01FE00 |
ENDCHAR |
STARTCHAR 00C0 |
ENCODING 192 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 46 1 0 |
BITMAP |
00F80000 |
007C0000 |
003C0000 |
003E0000 |
001E0000 |
000F0000 |
00070000 |
00060000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 00C1 |
ENCODING 193 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 46 1 0 |
BITMAP |
0000F800 |
0001F000 |
0001E000 |
0003E000 |
0003C000 |
00078000 |
000F0000 |
00030000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 00C2 |
ENCODING 194 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 45 1 0 |
BITMAP |
00070000 |
000F8000 |
000FC000 |
001DC000 |
0038E000 |
00307000 |
00603000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 00C3 |
ENCODING 195 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 46 1 0 |
BITMAP |
00300000 |
00780400 |
00FE0400 |
00FF0C00 |
00CF9800 |
0183F800 |
0101F000 |
0100E000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 00C4 |
ENCODING 196 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 44 1 0 |
BITMAP |
01F07C00 |
01F07C00 |
01F07C00 |
01F07C00 |
01F07C00 |
00000000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 00C5 |
ENCODING 197 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 29 45 1 0 |
BITMAP |
000F0000 |
001FC000 |
0018C000 |
00306000 |
00306000 |
00306000 |
00306000 |
0018C000 |
001FC000 |
00070000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 00C6 |
ENCODING 198 |
SWIDTH 920 0 |
DWIDTH 46 0 |
BBX 45 36 0 0 |
BITMAP |
000007FFFFF8 |
000007FFFFF8 |
000003F80018 |
000002F80018 |
000006F80018 |
00000CF80000 |
000008F80000 |
000018F80000 |
000030F80000 |
000030F80000 |
000060F80000 |
000040F80000 |
0000C0F80000 |
000180F80000 |
000180F80300 |
000300F80300 |
000200F80300 |
000600FFFF00 |
000C00FFFF00 |
000C00F80300 |
001800F80300 |
003FFFF80300 |
003FFFF80000 |
007000F80000 |
006000F80000 |
00C000F80000 |
01C000F80000 |
018000F80000 |
030000F80000 |
030000F80000 |
060000F80000 |
0C0000F80018 |
0C0000F80018 |
180000F80018 |
FC0007FFFFF8 |
FC0007FFFFF8 |
ENDCHAR |
STARTCHAR 00C7 |
ENCODING 199 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 48 2 -12 |
BITMAP |
001FF0 |
00FFFE |
03F03F |
07C00F |
0F8007 |
1F0003 |
3E0003 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
3E0000 |
3E0003 |
1F0003 |
0F8007 |
07C00F |
03F03F |
00FFFE |
001FF0 |
001000 |
003000 |
003800 |
007E00 |
001F00 |
000F00 |
000F00 |
000F00 |
001F00 |
00FE00 |
00FC00 |
ENDCHAR |
STARTCHAR 00C8 |
ENCODING 200 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 46 1 0 |
BITMAP |
01F000 |
00F800 |
007800 |
007C00 |
003C00 |
001E00 |
000E00 |
000C00 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 00C9 |
ENCODING 201 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 45 1 0 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 00CA |
ENCODING 202 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 45 1 0 |
BITMAP |
000E00 |
001F00 |
001F80 |
003B80 |
0071C0 |
0060E0 |
00C060 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 00CB |
ENCODING 203 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 44 1 0 |
BITMAP |
03E0F8 |
03E0F8 |
03E0F8 |
03E0F8 |
03E0F8 |
000000 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 00CC |
ENCODING 204 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 11 46 1 0 |
BITMAP |
3E00 |
1F00 |
0F00 |
0F80 |
0780 |
03C0 |
01C0 |
0180 |
0000 |
0000 |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 00CD |
ENCODING 205 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 12 46 1 0 |
BITMAP |
01F0 |
03E0 |
03C0 |
07C0 |
0780 |
0F00 |
1E00 |
0600 |
0000 |
0000 |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 00CE |
ENCODING 206 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 12 45 1 0 |
BITMAP |
0700 |
0F80 |
0FC0 |
1DC0 |
38E0 |
3070 |
6030 |
0000 |
0000 |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 00CF |
ENCODING 207 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 15 44 0 0 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
0000 |
0000 |
0000 |
7FF0 |
7FF0 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
7FF0 |
7FF0 |
ENDCHAR |
STARTCHAR 00D0 |
ENCODING 208 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 28 36 1 0 |
BITMAP |
FFFFE000 |
FFFFFC00 |
1F00FE00 |
1F003F00 |
1F001F80 |
1F000FC0 |
1F0007C0 |
1F0007E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
FFFF01F0 |
FFFF01F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0003F0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007E0 |
1F0007C0 |
1F000FC0 |
1F001F80 |
1F003F00 |
1F007E00 |
FFFFFC00 |
FFFFE000 |
ENDCHAR |
STARTCHAR 00D1 |
ENCODING 209 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 46 1 0 |
BITMAP |
00180000 |
003C0200 |
007F0200 |
007F8600 |
0067CC00 |
00C1FC00 |
0080F800 |
00807000 |
00000000 |
00000000 |
FF8007F8 |
FF8007F8 |
1FC000C0 |
1FC000C0 |
1FE000C0 |
1BF000C0 |
1BF000C0 |
19F800C0 |
19F800C0 |
18FC00C0 |
187E00C0 |
187E00C0 |
183F00C0 |
183F00C0 |
181F80C0 |
180FC0C0 |
180FC0C0 |
1807E0C0 |
1807E0C0 |
1803F0C0 |
1801F8C0 |
1801F8C0 |
1800FCC0 |
1800FEC0 |
18007EC0 |
18003FC0 |
18003FC0 |
18001FC0 |
18001FC0 |
18000FC0 |
180007C0 |
180007C0 |
180003C0 |
180003C0 |
FE0001C0 |
FE0000C0 |
ENDCHAR |
STARTCHAR 00D2 |
ENCODING 210 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 47 2 -1 |
BITMAP |
00F80000 |
007C0000 |
003C0000 |
003E0000 |
001E0000 |
000F0000 |
00070000 |
00060000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 00D3 |
ENCODING 211 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 27 47 2 -1 |
BITMAP |
0003E000 |
0007C000 |
00078000 |
000F8000 |
000F0000 |
001E0000 |
003C0000 |
000C0000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 00D4 |
ENCODING 212 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 47 2 -1 |
BITMAP |
000E0000 |
001F0000 |
001F8000 |
003B8000 |
0071C000 |
0060E000 |
00C06000 |
00000000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 00D5 |
ENCODING 213 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 47 2 -1 |
BITMAP |
00600000 |
00F00800 |
01FC0800 |
01FE1800 |
019F3000 |
0307F000 |
0203E000 |
0201C000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 00D6 |
ENCODING 214 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 45 2 -1 |
BITMAP |
03E0F800 |
03E0F800 |
03E0F800 |
03E0F800 |
03E0F800 |
00000000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 00D7 |
ENCODING 215 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 26 24 2 0 |
BITMAP |
E00001C0 |
70000380 |
38000700 |
1C000E00 |
0E001C00 |
07003800 |
03007000 |
0180E000 |
00C1C000 |
00638000 |
00370000 |
001E0000 |
000C0000 |
001E0000 |
00330000 |
00618000 |
00C0C000 |
01806000 |
03003000 |
06001800 |
0C000C00 |
18000600 |
30000300 |
60000180 |
ENDCHAR |
STARTCHAR 00D8 |
ENCODING 216 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 29 37 2 -1 |
BITMAP |
003FF818 |
00FFFC38 |
03F07F30 |
07C01FE0 |
0F800FE0 |
1F800FC0 |
1F0007C0 |
1F0007C0 |
3E0007E0 |
3E0007E0 |
3E000FE0 |
7E0019E0 |
7C0031F0 |
7C0061F0 |
7C0041F0 |
7C00C1F0 |
7C0181F0 |
7C0301F0 |
7C0601F0 |
7C0401F0 |
7C0801F0 |
7C1801F0 |
7C3001F0 |
7C6001F0 |
7C4001F0 |
7C8001F0 |
3F8003E0 |
3F0003E0 |
3E0003E0 |
3F0003C0 |
1F0007C0 |
1F8007C0 |
3F800F80 |
67C01F00 |
C3F07E00 |
C1FFFC00 |
003FE000 |
ENDCHAR |
STARTCHAR 00D9 |
ENCODING 217 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 47 1 -1 |
BITMAP |
000F800000 |
0007C00000 |
0003C00000 |
0003E00000 |
0001E00000 |
0000F00000 |
0000700000 |
0000600000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 00DA |
ENCODING 218 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 46 1 -1 |
BITMAP |
0000F80000 |
0001F00000 |
0001E00000 |
0003E00000 |
0003C00000 |
0007800000 |
000F000000 |
0003000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 00DB |
ENCODING 219 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 46 1 -1 |
BITMAP |
0001C00000 |
0003E00000 |
0003F00000 |
0007700000 |
000E380000 |
000C1C0000 |
00180C0000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 00DC |
ENCODING 220 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 44 1 -1 |
BITMAP |
007C1F0000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 00DD |
ENCODING 221 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 45 1 0 |
BITMAP |
0000F800 |
0001F000 |
0001E000 |
0003E000 |
0003C000 |
00078000 |
000F0000 |
00030000 |
00000000 |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 00DE |
ENCODING 222 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 0 |
BITMAP |
FFC00000 |
FFC00000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1FFFF800 |
1FFFFC00 |
1F001F00 |
1F000F80 |
1F000780 |
1F0007C0 |
1F0003C0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007C0 |
1F0007C0 |
1F000780 |
1F000F80 |
1F001F00 |
1FFFFE00 |
1FFFF000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
FFC00000 |
FFC00000 |
ENDCHAR |
STARTCHAR 00DF |
ENCODING 223 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 26 36 -1 0 |
BITMAP |
00FF0000 |
03FFC000 |
07C3E000 |
0781F000 |
0F01F000 |
0F00F800 |
1F00F800 |
1F00F800 |
1F00F800 |
1F00F000 |
1F01F000 |
1F03E000 |
1F07C000 |
1F0F8000 |
1F1F0000 |
1F1F0000 |
1F1F0000 |
1F0F8000 |
1F07E000 |
1F01F000 |
1F007C00 |
1F003E00 |
1F001F00 |
1F000F80 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F200780 |
1FF00F80 |
1FFC1F00 |
1F3FFE00 |
FF07F800 |
ENDCHAR |
STARTCHAR 00E0 |
ENCODING 224 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 35 2 -1 |
BITMAP |
0F8000 |
07C000 |
03C000 |
03E000 |
01E000 |
00F000 |
007000 |
006000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 00E1 |
ENCODING 225 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 35 2 -1 |
BITMAP |
003E00 |
007C00 |
007800 |
00F800 |
00F000 |
01E000 |
03C000 |
00C000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 00E2 |
ENCODING 226 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 35 2 -1 |
BITMAP |
007000 |
00F800 |
00FC00 |
01DC00 |
038E00 |
030700 |
060300 |
000000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 00E3 |
ENCODING 227 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 35 2 -1 |
BITMAP |
030000 |
078040 |
0FE040 |
0FF0C0 |
0CF980 |
183F80 |
101F00 |
100E00 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 00E4 |
ENCODING 228 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 33 2 -1 |
BITMAP |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
000000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 00E5 |
ENCODING 229 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 35 2 -1 |
BITMAP |
01E000 |
03F800 |
031800 |
060C00 |
060C00 |
060C00 |
060C00 |
031800 |
03F800 |
00E000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 00E6 |
ENCODING 230 |
SWIDTH 800 0 |
DWIDTH 40 0 |
BBX 37 25 1 -1 |
BITMAP |
01FE01FC00 |
1FFFC7FF00 |
1E07FF07C0 |
1C03FE03C0 |
1801FC01E0 |
1800FC01F0 |
1000F800F0 |
0000F800F0 |
0000F800F8 |
0000FFFFF8 |
0003FFFFF8 |
001CF80000 |
03E0F80000 |
1E00F80000 |
3C00F80000 |
7800F80000 |
F800F80000 |
F800FC0000 |
F801FC0008 |
F803FC0018 |
F8073E0030 |
FC0E1F0070 |
7E3C0FE3C0 |
3FF807FF80 |
0FC000FE00 |
ENDCHAR |
STARTCHAR 00E7 |
ENCODING 231 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 36 2 -12 |
BITMAP |
01F820 |
07FE60 |
1FC3E0 |
3F00E0 |
3E0060 |
7C0060 |
7C0020 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0020 |
7E0020 |
3E0060 |
3F00C0 |
1F8380 |
0FFF00 |
01FC00 |
010000 |
030000 |
038000 |
07E000 |
01F000 |
00F000 |
00F000 |
00F000 |
01F000 |
0FE000 |
0FC000 |
ENDCHAR |
STARTCHAR 00E8 |
ENCODING 232 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 35 2 -1 |
BITMAP |
0F8000 |
07C000 |
03C000 |
03E000 |
01E000 |
00F000 |
007000 |
006000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 00E9 |
ENCODING 233 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 35 2 -1 |
BITMAP |
001F00 |
003E00 |
003C00 |
007C00 |
007800 |
00F000 |
01E000 |
006000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 00EA |
ENCODING 234 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 35 2 -1 |
BITMAP |
007000 |
00F800 |
00FC00 |
01DC00 |
038E00 |
030700 |
060300 |
000000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 00EB |
ENCODING 235 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 33 2 -1 |
BITMAP |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
000000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 00EC |
ENCODING 236 |
SWIDTH 240 0 |
DWIDTH 12 0 |
BBX 10 34 1 0 |
BITMAP |
F800 |
7C00 |
3C00 |
3E00 |
1E00 |
0F00 |
0700 |
0600 |
0000 |
0000 |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFC0 |
FFC0 |
ENDCHAR |
STARTCHAR 00ED |
ENCODING 237 |
SWIDTH 240 0 |
DWIDTH 12 0 |
BBX 12 34 0 0 |
BITMAP |
01F0 |
03E0 |
03C0 |
07C0 |
0780 |
0F00 |
1E00 |
0600 |
0000 |
0000 |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFC0 |
FFC0 |
ENDCHAR |
STARTCHAR 00EE |
ENCODING 238 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 11 34 0 0 |
BITMAP |
0E00 |
1F00 |
1F80 |
3B80 |
71C0 |
60E0 |
C060 |
0000 |
0000 |
0000 |
7F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
7FE0 |
7FE0 |
ENDCHAR |
STARTCHAR 00EF |
ENCODING 239 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 15 32 -1 0 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
0000 |
0000 |
0000 |
3FC0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
3FF0 |
3FF0 |
ENDCHAR |
STARTCHAR 00F0 |
ENCODING 240 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 37 1 -1 |
BITMAP |
0F0000 |
1FE000 |
01F9F8 |
007FE0 |
003F80 |
003F00 |
00FF80 |
03F7C0 |
0047C0 |
0003E0 |
0003E0 |
0001F0 |
0001F0 |
0000F8 |
00FEF8 |
03EFF8 |
0F83FC |
1F007C |
3E007C |
3C003C |
7C003E |
7C003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8007E |
7C007C |
7C007C |
7E00F8 |
3E01F8 |
1F01F0 |
0FC7E0 |
07FFC0 |
00FE00 |
ENDCHAR |
STARTCHAR 00F1 |
ENCODING 241 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 35 1 0 |
BITMAP |
00300000 |
00780400 |
00FE0400 |
00FF0C00 |
00CF9800 |
0183F800 |
0101F000 |
0100E000 |
00000000 |
00000000 |
00000000 |
FF1F8000 |
1F7FE000 |
1FE1F800 |
1F80F800 |
1F007C00 |
1F007C00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
FFE1FFC0 |
FFE1FFC0 |
ENDCHAR |
STARTCHAR 00F2 |
ENCODING 242 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 35 2 -1 |
BITMAP |
03E000 |
01F000 |
00F000 |
00F800 |
007800 |
003C00 |
001C00 |
001800 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 00F3 |
ENCODING 243 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 35 1 -1 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 00F4 |
ENCODING 244 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 35 1 -1 |
BITMAP |
003800 |
007C00 |
007E00 |
00EE00 |
01C700 |
018380 |
030180 |
000000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 00F5 |
ENCODING 245 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 36 1 -1 |
BITMAP |
018000 |
03C020 |
07F020 |
07F860 |
067CC0 |
0C1FC0 |
080F80 |
080700 |
000000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 00F6 |
ENCODING 246 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 33 2 -1 |
BITMAP |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
000000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 00F7 |
ENCODING 247 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 27 24 0 1 |
BITMAP |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFFFFFE0 |
FFFFFFE0 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
ENDCHAR |
STARTCHAR 00F8 |
ENCODING 248 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 25 2 -1 |
BITMAP |
01FF8C |
07FFDC |
1F87F8 |
3E01F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7801F8 |
F8037C |
F8067C |
F8047C |
F8087C |
F8107C |
F8207C |
F8407C |
F8807C |
F9807C |
7B0078 |
7E00F8 |
7C00F8 |
3C01F0 |
3E01F0 |
3F87E0 |
47FFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 00F9 |
ENCODING 249 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 35 1 -1 |
BITMAP |
01F00000 |
00F80000 |
00780000 |
007C0000 |
003C0000 |
001E0000 |
000E0000 |
000C0000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 00FA |
ENCODING 250 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 35 1 -1 |
BITMAP |
000F8000 |
001F0000 |
001E0000 |
003E0000 |
003C0000 |
00780000 |
00F00000 |
00300000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 00FB |
ENCODING 251 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 35 1 -1 |
BITMAP |
001C0000 |
003E0000 |
003F0000 |
00770000 |
00E38000 |
00C1C000 |
0180C000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 00FC |
ENCODING 252 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 33 1 -1 |
BITMAP |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 00FD |
ENCODING 253 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 46 1 -12 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
000000 |
FFC07E |
FFC07E |
1F0018 |
1F0010 |
0F8030 |
0F8030 |
078020 |
07C060 |
07C060 |
03E040 |
03E0C0 |
01E080 |
01F180 |
01F180 |
00F900 |
00FB00 |
00FB00 |
007E00 |
007E00 |
003C00 |
003C00 |
003C00 |
001800 |
001800 |
001000 |
003000 |
003000 |
002000 |
006000 |
006000 |
004000 |
00C000 |
008000 |
018000 |
070000 |
0E0000 |
ENDCHAR |
STARTCHAR 00FE |
ENCODING 254 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 48 1 -12 |
BITMAP |
FF0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F3F80 |
1FFFF0 |
1FE1F8 |
1F80FC |
1F007C |
1F007E |
1F003E |
1F003E |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001F |
1F001E |
1F003E |
1F003E |
1F003C |
1F007C |
1F80F8 |
1F61F0 |
1F1F80 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFE000 |
FFE000 |
ENDCHAR |
STARTCHAR 00FF |
ENCODING 255 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 44 1 -12 |
BITMAP |
03E0F8 |
03E0F8 |
03E0F8 |
03E0F8 |
03E0F8 |
000000 |
000000 |
000000 |
FFC07E |
FFC07E |
1F0018 |
1F0010 |
0F8030 |
0F8030 |
078020 |
07C060 |
07C060 |
03E040 |
03E0C0 |
01E080 |
01F180 |
01F180 |
00F900 |
00FB00 |
00FB00 |
007E00 |
007E00 |
003C00 |
003C00 |
003C00 |
001800 |
001800 |
001000 |
003000 |
003000 |
002000 |
006000 |
006000 |
004000 |
00C000 |
008000 |
018000 |
070000 |
0E0000 |
ENDCHAR |
STARTCHAR 0100 |
ENCODING 256 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 40 1 0 |
BITMAP |
03FFFC00 |
03FFFC00 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 0101 |
ENCODING 257 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 30 2 -1 |
BITMAP |
3FFFC0 |
3FFFC0 |
000000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 0102 |
ENCODING 258 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 43 1 0 |
BITMAP |
03E03E00 |
03E03C00 |
01F0F800 |
007FF000 |
001FC000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 0103 |
ENCODING 259 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 32 2 -1 |
BITMAP |
7C07C0 |
7C0780 |
3E1F00 |
0FFE00 |
03F800 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 0104 |
ENCODING 260 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 31 45 1 -9 |
BITMAP |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
000001F0 |
000001F0 |
000001F0 |
000001F0 |
000001F0 |
000000F8 |
000000F8 |
0000007E |
0000001E |
ENDCHAR |
STARTCHAR 0105 |
ENCODING 261 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 32 2 -8 |
BITMAP |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FE000 |
03E000 |
03E000 |
03E000 |
01F000 |
01F000 |
00FC00 |
003C00 |
ENDCHAR |
STARTCHAR 0106 |
ENCODING 262 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 24 46 2 -1 |
BITMAP |
0003E0 |
0007C0 |
000780 |
000F80 |
000F00 |
001E00 |
003C00 |
000C00 |
000000 |
001FF0 |
00FFFE |
03F03F |
07C00F |
0F8007 |
1F0003 |
3E0003 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
3E0000 |
3E0003 |
1F0003 |
0F8007 |
07C00F |
03F03F |
00FFFE |
001FF0 |
ENDCHAR |
STARTCHAR 0107 |
ENCODING 263 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 35 2 -1 |
BITMAP |
003E00 |
007C00 |
007800 |
00F800 |
00F000 |
01E000 |
03C000 |
00C000 |
000000 |
000000 |
01F820 |
07FE60 |
1FC3E0 |
3F00E0 |
3E0060 |
7C0060 |
7C0020 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0020 |
7E0020 |
3E0060 |
3F00C0 |
1F8380 |
0FFF00 |
01FC00 |
ENDCHAR |
STARTCHAR 0108 |
ENCODING 264 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 24 46 2 -1 |
BITMAP |
000E00 |
001F00 |
001F80 |
003B80 |
0071C0 |
0060E0 |
00C060 |
000000 |
000000 |
001FF0 |
00FFFE |
03F03F |
07C00F |
0F8007 |
1F0003 |
3E0003 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
3E0000 |
3E0003 |
1F0003 |
0F8007 |
07C00F |
03F03F |
00FFFE |
001FF0 |
ENDCHAR |
STARTCHAR 0109 |
ENCODING 265 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 35 2 -1 |
BITMAP |
007000 |
00F800 |
00FC00 |
01DC00 |
038E00 |
030700 |
060300 |
000000 |
000000 |
000000 |
01F820 |
07FE60 |
1FC3E0 |
3F00E0 |
3E0060 |
7C0060 |
7C0020 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0020 |
7E0020 |
3E0060 |
3F00C0 |
1F8380 |
0FFF00 |
01FC00 |
ENDCHAR |
STARTCHAR 010A |
ENCODING 266 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 24 44 2 -1 |
BITMAP |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
000000 |
000000 |
001FF0 |
00FFFE |
03F03F |
07C00F |
0F8007 |
1F0003 |
3E0003 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
3E0000 |
3E0003 |
1F0003 |
0F8007 |
07C00F |
03F03F |
00FFFE |
001FF0 |
ENDCHAR |
STARTCHAR 010B |
ENCODING 267 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 33 1 -1 |
BITMAP |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
000000 |
000000 |
000000 |
01F820 |
07FE60 |
1FC3E0 |
3F00E0 |
3E0060 |
7C0060 |
7C0020 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0020 |
7E0020 |
3E0060 |
3F00C0 |
1F8380 |
0FFF00 |
01FC00 |
ENDCHAR |
STARTCHAR 010C |
ENCODING 268 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 45 2 -1 |
BITMAP |
00E030 |
007060 |
0038C0 |
001DC0 |
000F80 |
000F00 |
000000 |
000000 |
001FF0 |
00FFFE |
03F03F |
07C00F |
0F8007 |
1F0003 |
3E0003 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
7C0000 |
7C0000 |
3E0000 |
3E0003 |
1F0003 |
0F8007 |
07C00F |
03F03F |
00FFFE |
001FF0 |
ENDCHAR |
STARTCHAR 010D |
ENCODING 269 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 19 34 2 -1 |
BITMAP |
0E0300 |
070600 |
038C00 |
01DC00 |
00F800 |
00F000 |
000000 |
000000 |
000000 |
01F820 |
07FE60 |
1FC3E0 |
3F00E0 |
3E0060 |
7C0060 |
7C0020 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0020 |
7E0020 |
3E0060 |
3F00C0 |
1F8380 |
0FFF00 |
01FC00 |
ENDCHAR |
STARTCHAR 010E |
ENCODING 270 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 28 45 1 0 |
BITMAP |
07018000 |
03830000 |
01C60000 |
00EE0000 |
007C0000 |
00780000 |
00000000 |
00000000 |
00000000 |
FFFFE000 |
FFFFFC00 |
1F00FE00 |
1F003F00 |
1F001F80 |
1F000FC0 |
1F0007C0 |
1F0007E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0003F0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007E0 |
1F0007C0 |
1F000FC0 |
1F001F80 |
1F003F00 |
1F007E00 |
FFFFFC00 |
FFFFE000 |
ENDCHAR |
STARTCHAR 010F |
ENCODING 271 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 37 1 -1 |
BITMAP |
0007FBE0 |
0000FBE0 |
0000FBE0 |
0000FBE0 |
0000FBE0 |
0000F8E0 |
0000F860 |
0000F8C0 |
0000F980 |
0000FB00 |
0000F800 |
0000F800 |
01FCF800 |
0FFFF800 |
1F87F800 |
3F01F800 |
3E00F800 |
7E00F800 |
7C00F800 |
7C00F800 |
F800F800 |
F800F800 |
F800F800 |
F800F800 |
F800F800 |
F800F800 |
F800F800 |
F800F800 |
F800F800 |
7800F800 |
7C00F800 |
7C00F800 |
3C00F800 |
3E00F800 |
1F01F800 |
0F86FF00 |
01F80000 |
ENDCHAR |
STARTCHAR 0112 |
ENCODING 274 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 40 1 0 |
BITMAP |
0FFFF0 |
0FFFF0 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 0113 |
ENCODING 275 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 30 2 -1 |
BITMAP |
3FFFC0 |
3FFFC0 |
000000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 0114 |
ENCODING 276 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 43 1 0 |
BITMAP |
07C07C |
07C078 |
03E1F0 |
00FFE0 |
003F80 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 0115 |
ENCODING 277 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 32 2 -1 |
BITMAP |
3E03E0 |
3E03C0 |
1F0F80 |
07FF00 |
01FC00 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 0116 |
ENCODING 278 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 43 1 0 |
BITMAP |
001F00 |
001F00 |
001F00 |
001F00 |
001F00 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 0117 |
ENCODING 279 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 33 2 -1 |
BITMAP |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
000000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 0118 |
ENCODING 280 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 44 1 -8 |
BITMAP |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
007C00 |
007C00 |
007C00 |
007C00 |
003E00 |
003E00 |
001F80 |
000780 |
ENDCHAR |
STARTCHAR 0119 |
ENCODING 281 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 32 1 -8 |
BITMAP |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
00F800 |
00F800 |
00F800 |
007C00 |
007C00 |
003F00 |
000F00 |
ENDCHAR |
STARTCHAR 011A |
ENCODING 282 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 44 1 0 |
BITMAP |
01C060 |
00E0C0 |
007180 |
003B80 |
001F00 |
001E00 |
000000 |
000000 |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 011B |
ENCODING 283 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 34 2 -1 |
BITMAP |
0E0300 |
070600 |
038C00 |
01DC00 |
00F800 |
00F000 |
000000 |
000000 |
000000 |
01FC00 |
07FF00 |
1F07C0 |
3E03C0 |
3C01E0 |
7C01F0 |
7800F0 |
7800F0 |
F800F8 |
FFFFF8 |
FFFFF8 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0010 |
3C0018 |
3E0030 |
1F0060 |
0F81C0 |
07FF80 |
01FC00 |
ENDCHAR |
STARTCHAR 011C |
ENCODING 284 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 46 2 -1 |
BITMAP |
001C0000 |
003E0000 |
003F0000 |
00770000 |
00E38000 |
00C1C000 |
0180C000 |
00000000 |
00000000 |
007F8000 |
03FFF000 |
07E07C00 |
0F801E00 |
1F000F00 |
3F000700 |
3E000700 |
7E000300 |
7C000300 |
7C000300 |
7C000300 |
FC000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F800FFF8 |
F800FFF8 |
F80007C0 |
F80007C0 |
F80007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
3E000FC0 |
3E000F80 |
1F000F80 |
1F801F00 |
0FC03E00 |
07E07C00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 011D |
ENCODING 285 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 24 46 -1 -12 |
BITMAP |
001C00 |
003E00 |
003F00 |
007700 |
00E380 |
00C1C0 |
0180C0 |
000000 |
000000 |
000000 |
003FFF |
01FFFF |
03E1F0 |
07C0F8 |
0F807C |
0F807C |
1F003C |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003C |
0F807C |
0F807C |
07C0F8 |
03E1F0 |
01FFC0 |
003F80 |
000700 |
00FC00 |
03E000 |
07C000 |
03F000 |
00EF80 |
0780F0 |
1E003C |
3C003E |
78001F |
F8001F |
F8001F |
F8001F |
FC003E |
7E00FE |
3FFFF8 |
07FFC0 |
ENDCHAR |
STARTCHAR 011E |
ENCODING 286 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 29 44 2 -1 |
BITMAP |
07C07C00 |
07C07800 |
03E1F000 |
00FFE000 |
003F8000 |
00000000 |
00000000 |
007F8000 |
03FFF000 |
07E07C00 |
0F801E00 |
1F000F00 |
3F000700 |
3E000700 |
7E000300 |
7C000300 |
7C000300 |
7C000300 |
FC000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F800FFF8 |
F800FFF8 |
F80007C0 |
F80007C0 |
F80007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
3E000FC0 |
3E000F80 |
1F000F80 |
1F801F00 |
0FC03E00 |
07E07C00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 011F |
ENCODING 287 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 24 44 -1 -12 |
BITMAP |
0F80F8 |
0F80F0 |
07C3E0 |
01FFC0 |
007F00 |
000000 |
000000 |
000000 |
003FFF |
01FFFF |
03E1F0 |
07C0F8 |
0F807C |
0F807C |
1F003C |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003C |
0F807C |
0F807C |
07C0F8 |
03E1F0 |
01FFC0 |
003F80 |
000700 |
00FC00 |
03E000 |
07C000 |
03F000 |
00EF80 |
0780F0 |
1E003C |
3C003E |
78001F |
F8001F |
F8001F |
F8001F |
FC003E |
7E00FE |
3FFFF8 |
07FFC0 |
ENDCHAR |
STARTCHAR 0120 |
ENCODING 288 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 44 2 -1 |
BITMAP |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
00000000 |
00000000 |
007F8000 |
03FFF000 |
07E07C00 |
0F801E00 |
1F000F00 |
3F000700 |
3E000700 |
7E000300 |
7C000300 |
7C000300 |
7C000300 |
FC000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F800FFF8 |
F800FFF8 |
F80007C0 |
F80007C0 |
F80007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
3E000FC0 |
3E000F80 |
1F000F80 |
1F801F00 |
0FC03E00 |
07E07C00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 0121 |
ENCODING 289 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 24 44 0 -12 |
BITMAP |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
000000 |
000000 |
000000 |
003FFF |
01FFFF |
03E1F0 |
07C0F8 |
0F807C |
0F807C |
1F003C |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003C |
0F807C |
0F807C |
07C0F8 |
03E1F0 |
01FFC0 |
003F80 |
000700 |
00FC00 |
03E000 |
07C000 |
03F000 |
00EF80 |
0780F0 |
1E003C |
3C003E |
78001F |
F8001F |
F8001F |
F8001F |
FC003E |
7E00FE |
3FFFF8 |
07FFC0 |
ENDCHAR |
STARTCHAR 0124 |
ENCODING 292 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 31 45 0 0 |
BITMAP |
00038000 |
0007C000 |
0007E000 |
000EE000 |
001C7000 |
00183800 |
00301800 |
00000000 |
00000000 |
FFE007FE |
FFE007FE |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1FFFFFF0 |
1FFFFFF0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
FFE007FE |
FFE007FE |
ENDCHAR |
STARTCHAR 0125 |
ENCODING 293 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 45 1 0 |
BITMAP |
0E000000 |
1F000000 |
1F800000 |
3B800000 |
71C00000 |
60E00000 |
C0600000 |
00000000 |
00000000 |
FF000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F1FC000 |
1F7FF000 |
1FE0F800 |
1FC07C00 |
1F003E00 |
1F003E00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
FFE0FFE0 |
FFE0FFE0 |
ENDCHAR |
STARTCHAR 0126 |
ENCODING 294 |
SWIDTH 680 0 |
DWIDTH 34 0 |
BBX 33 36 0 0 |
BITMAP |
7FF007FF00 |
7FF007FF00 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
FFFFFFFF80 |
FFFFFFFF80 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0FFFFFF800 |
0FFFFFF800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
0F8000F800 |
7FF007FF00 |
7FF007FF00 |
ENDCHAR |
STARTCHAR 0127 |
ENCODING 295 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 0 |
BITMAP |
FF000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
FFFFC000 |
FFFFC000 |
1F000000 |
1F000000 |
1F000000 |
1F3FC000 |
1FFFF000 |
1FE0F800 |
1F807C00 |
1F003E00 |
1F003E00 |
1F001E00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
FFE0FFE0 |
FFE0FFE0 |
ENDCHAR |
STARTCHAR 0128 |
ENCODING 296 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 15 46 1 0 |
BITMAP |
1800 |
3C02 |
7F02 |
7F86 |
67CC |
C1FC |
80F8 |
8070 |
0000 |
0000 |
3FF8 |
3FF8 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
3FF8 |
3FF8 |
ENDCHAR |
STARTCHAR 0129 |
ENCODING 297 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 15 35 -1 0 |
BITMAP |
1800 |
3C02 |
7F02 |
7F86 |
67CC |
C1FC |
80F8 |
8070 |
0000 |
0000 |
0000 |
3FC0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
3FF0 |
3FF0 |
ENDCHAR |
STARTCHAR 012A |
ENCODING 298 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 16 40 -1 0 |
BITMAP |
FFFF |
FFFF |
0000 |
0000 |
3FF8 |
3FF8 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
3FF8 |
3FF8 |
ENDCHAR |
STARTCHAR 012B |
ENCODING 299 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 16 29 -2 0 |
BITMAP |
FFFF |
FFFF |
0000 |
0000 |
0000 |
1FE0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
03E0 |
1FF8 |
1FF8 |
ENDCHAR |
STARTCHAR 012C |
ENCODING 300 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 17 43 -1 0 |
BITMAP |
F80F80 |
F80F00 |
7C3E00 |
1FFC00 |
07F000 |
000000 |
000000 |
3FF800 |
3FF800 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
3FF800 |
3FF800 |
ENDCHAR |
STARTCHAR 012D |
ENCODING 301 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 17 31 -2 0 |
BITMAP |
F80F80 |
F80F00 |
7C3E00 |
1FFC00 |
07F000 |
000000 |
000000 |
1FE000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
1FF800 |
1FF800 |
ENDCHAR |
STARTCHAR 012E |
ENCODING 302 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 14 44 1 -8 |
BITMAP |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
03E0 |
03E0 |
03E0 |
03E0 |
01F0 |
01F0 |
00FC |
003C |
ENDCHAR |
STARTCHAR 012F |
ENCODING 303 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 10 43 1 -8 |
BITMAP |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
0000 |
0000 |
0000 |
0000 |
0000 |
0000 |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFC0 |
FFC0 |
7C00 |
7C00 |
7C00 |
7C00 |
3E00 |
3E00 |
1F80 |
0780 |
ENDCHAR |
STARTCHAR 0130 |
ENCODING 304 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 11 43 1 0 |
BITMAP |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0000 |
0000 |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 0131 |
ENCODING 305 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 10 24 1 0 |
BITMAP |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFC0 |
FFC0 |
ENDCHAR |
STARTCHAR 0134 |
ENCODING 308 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 22 46 1 -1 |
BITMAP |
0001C0 |
0003E0 |
0003F0 |
000770 |
000E38 |
000C1C |
00180C |
000000 |
000000 |
000FFC |
000FFC |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
0003E0 |
3003E0 |
F003E0 |
F003E0 |
7007E0 |
7807C0 |
3C0FC0 |
1E1F80 |
0FFF00 |
01F800 |
ENDCHAR |
STARTCHAR 0135 |
ENCODING 309 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 11 45 2 -12 |
BITMAP |
0E00 |
1F00 |
3B80 |
31C0 |
60C0 |
C060 |
0000 |
0000 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
3E00 |
7C00 |
F000 |
ENDCHAR |
STARTCHAR 0136 |
ENCODING 310 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 1 1 0 0 |
BITMAP |
00 |
ENDCHAR |
STARTCHAR 0139 |
ENCODING 313 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 46 1 0 |
BITMAP |
03E000 |
07C000 |
078000 |
0F8000 |
0F0000 |
1E0000 |
3C0000 |
0C0000 |
000000 |
000000 |
FFC000 |
FFC000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0006 |
1F0006 |
1F0006 |
FFFFFE |
FFFFFE |
ENDCHAR |
STARTCHAR 013A |
ENCODING 314 |
SWIDTH 240 0 |
DWIDTH 12 0 |
BBX 11 46 1 0 |
BITMAP |
03E0 |
07C0 |
0780 |
0F80 |
0F00 |
1E00 |
3C00 |
0C00 |
0000 |
0000 |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 013D |
ENCODING 317 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 36 1 0 |
BITMAP |
FFC3E0 |
FFC3E0 |
1F03E0 |
1F03E0 |
1F03E0 |
1F00E0 |
1F0060 |
1F00C0 |
1F0180 |
1F0300 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0006 |
1F0006 |
1F0006 |
FFFFFE |
FFFFFE |
ENDCHAR |
STARTCHAR 013E |
ENCODING 318 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 14 36 1 0 |
BITMAP |
FF7C |
1F7C |
1F7C |
1F7C |
1F7C |
1F1C |
1F0C |
1F18 |
1F30 |
1F60 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 013F |
ENCODING 319 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 36 1 0 |
BITMAP |
FFC000 |
FFC000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0006 |
1F0006 |
1F0006 |
FFFFFE |
FFFFFE |
ENDCHAR |
STARTCHAR 0140 |
ENCODING 320 |
SWIDTH 360 0 |
DWIDTH 18 0 |
BBX 15 36 1 0 |
BITMAP |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F3E |
1F3E |
1F3E |
1F3E |
1F3E |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 0141 |
ENCODING 321 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 38 1 0 |
BITMAP |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F3C000 |
01F7C000 |
01FF0000 |
01FE0000 |
01F80000 |
03F00000 |
07F00000 |
1FF00000 |
3FF00000 |
F9F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01F00000 |
01FFFFE0 |
00FFFFE0 |
ENDCHAR |
STARTCHAR 0142 |
ENCODING 322 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 17 40 1 -2 |
BITMAP |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03EF80 |
03FF00 |
03FC00 |
03F000 |
07E000 |
1FE000 |
3FE000 |
FBE000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
ENDCHAR |
STARTCHAR 0143 |
ENCODING 323 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 46 1 0 |
BITMAP |
0007C000 |
000F8000 |
000F0000 |
001F0000 |
001E0000 |
003C0000 |
00780000 |
00180000 |
00000000 |
00000000 |
FF8007F8 |
FF8007F8 |
1FC000C0 |
1FC000C0 |
1FE000C0 |
1BF000C0 |
1BF000C0 |
19F800C0 |
19F800C0 |
18FC00C0 |
187E00C0 |
187E00C0 |
183F00C0 |
183F00C0 |
181F80C0 |
180FC0C0 |
180FC0C0 |
1807E0C0 |
1807E0C0 |
1803F0C0 |
1801F8C0 |
1801F8C0 |
1800FCC0 |
1800FEC0 |
18007EC0 |
18003FC0 |
18003FC0 |
18001FC0 |
18001FC0 |
18000FC0 |
180007C0 |
180007C0 |
180003C0 |
180003C0 |
FE0001C0 |
FE0000C0 |
ENDCHAR |
STARTCHAR 0144 |
ENCODING 324 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 34 1 0 |
BITMAP |
0003E000 |
0007C000 |
00078000 |
000F8000 |
000F0000 |
001E0000 |
003C0000 |
000C0000 |
00000000 |
00000000 |
FF1F8000 |
1F7FE000 |
1FE1F800 |
1F80F800 |
1F007C00 |
1F007C00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
FFE1FFC0 |
FFE1FFC0 |
ENDCHAR |
STARTCHAR 0147 |
ENCODING 327 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 45 1 0 |
BITMAP |
00E03000 |
00706000 |
0038C000 |
001DC000 |
000F8000 |
000F0000 |
00000000 |
00000000 |
00000000 |
FF8007F8 |
FF8007F8 |
1FC000C0 |
1FC000C0 |
1FE000C0 |
1BF000C0 |
1BF000C0 |
19F800C0 |
19F800C0 |
18FC00C0 |
187E00C0 |
187E00C0 |
183F00C0 |
183F00C0 |
181F80C0 |
180FC0C0 |
180FC0C0 |
1807E0C0 |
1807E0C0 |
1803F0C0 |
1801F8C0 |
1801F8C0 |
1800FCC0 |
1800FEC0 |
18007EC0 |
18003FC0 |
18003FC0 |
18001FC0 |
18001FC0 |
18000FC0 |
180007C0 |
180007C0 |
180003C0 |
180003C0 |
FE0001C0 |
FE0000C0 |
ENDCHAR |
STARTCHAR 0148 |
ENCODING 328 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 26 33 1 0 |
BITMAP |
01C06000 |
00E0C000 |
00718000 |
003B8000 |
001F0000 |
001E0000 |
00000000 |
00000000 |
00000000 |
FF1F8000 |
1F7FE000 |
1FE1F800 |
1F80F800 |
1F007C00 |
1F007C00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
FFE1FFC0 |
FFE1FFC0 |
ENDCHAR |
STARTCHAR 0149 |
ENCODING 329 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 31 31 3 0 |
BITMAP |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
38000000 |
18000000 |
37F8FC00 |
60FBFF00 |
C0FF0FC0 |
00FC07C0 |
00F803E0 |
00F803E0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
00F801F0 |
07FF0FFE |
07FF0FFE |
ENDCHAR |
STARTCHAR 014A |
ENCODING 330 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 25 44 2 -8 |
BITMAP |
F8000F80 |
FC000F80 |
FC000F80 |
FE000F80 |
FF000F80 |
FF000F80 |
FF800F80 |
FF800F80 |
FFC00F80 |
FFC00F80 |
FBE00F80 |
FBE00F80 |
F9F00F80 |
F9F80F80 |
F8F80F80 |
F87C0F80 |
F87C0F80 |
F83E0F80 |
F83E0F80 |
F81F0F80 |
F80F0F80 |
F80F8F80 |
F807CF80 |
F807CF80 |
F803EF80 |
F801EF80 |
F801FF80 |
F800FF80 |
F800FF80 |
F8007F80 |
F8007F80 |
F8003F80 |
F8001F80 |
F8001F80 |
F8000F80 |
F8000F80 |
00000F80 |
00000F80 |
00000F80 |
00001F00 |
00001F00 |
00003E00 |
0000FC00 |
0000F000 |
ENDCHAR |
STARTCHAR 014B |
ENCODING 331 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 33 1 -9 |
BITMAP |
FF1F80 |
1F61E0 |
1F80F0 |
1F0078 |
1F0078 |
1F007C |
1F003C |
1F003C |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
FFE03E |
FFE03E |
00003E |
00003E |
00003E |
00003E |
00007C |
00007C |
0000F8 |
0003F0 |
0003C0 |
ENDCHAR |
STARTCHAR 014C |
ENCODING 332 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 27 41 2 -1 |
BITMAP |
07FFF800 |
07FFF800 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 014D |
ENCODING 333 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 30 2 -1 |
BITMAP |
1FFFE0 |
1FFFE0 |
000000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 014E |
ENCODING 334 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 44 2 -1 |
BITMAP |
07C07C00 |
07C07800 |
03E1F000 |
00FFE000 |
003F8000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 014F |
ENCODING 335 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 32 1 -1 |
BITMAP |
1F01F0 |
1F01E0 |
0F87C0 |
03FF80 |
00FE00 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 0150 |
ENCODING 336 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 46 2 -1 |
BITMAP |
001F8FC0 |
003F1F80 |
007C3E00 |
00F07800 |
01E0F000 |
0783C000 |
0E070000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 0151 |
ENCODING 337 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 24 34 2 -1 |
BITMAP |
007E3F |
00FC7E |
01F0F8 |
03C1E0 |
0783C0 |
1E0F00 |
381C00 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 0152 |
ENCODING 338 |
SWIDTH 860 0 |
DWIDTH 43 0 |
BBX 39 37 2 -1 |
BITMAP |
007FFFFFFE |
03FFFFFFFE |
07F0FF0006 |
0FC03F0006 |
1F801F0000 |
3F001F0000 |
3F001F0000 |
7E001F0000 |
7E001F0000 |
7C001F0000 |
7C001F0000 |
FC001F0000 |
FC001F0000 |
F8001F0000 |
F8001F00C0 |
F8001F00C0 |
F8001F00C0 |
F8001FFFC0 |
F8001FFFC0 |
F8001F00C0 |
F8001F00C0 |
F8001F00C0 |
F8001F0000 |
F8001F0000 |
FC001F0000 |
7C001F0000 |
7C001F0000 |
7C001F0000 |
7E001F0000 |
3E001F0000 |
3F001F0000 |
1F001F0000 |
1F801F0006 |
0FC03F0006 |
07F0FF0006 |
03FFFFFFFE |
007F800000 |
ENDCHAR |
STARTCHAR 0153 |
ENCODING 339 |
SWIDTH 860 0 |
DWIDTH 43 0 |
BBX 39 25 2 -1 |
BITMAP |
00FF007F00 |
07FFC1FFC0 |
0F83F3C1F0 |
1F01F780F0 |
3E00FF0078 |
7C007F007C |
7C007E003C |
7C007E003C |
F8003E003E |
F8003FFFFE |
F8003FFFFE |
F8003E0000 |
F8003E0000 |
F8003E0000 |
F8003E0000 |
F8003E0000 |
F8003E0000 |
7C007F0000 |
7C007F0002 |
7C007F0006 |
3E00FF800E |
3F01F7C01C |
1F83F3F078 |
07FFC1FFE0 |
01FF003F80 |
ENDCHAR |
STARTCHAR 0154 |
ENCODING 340 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 31 45 1 0 |
BITMAP |
0007C000 |
000F8000 |
000F0000 |
001F0000 |
001E0000 |
003C0000 |
00780000 |
00180000 |
00000000 |
FFFFE000 |
FFFFFC00 |
1F007E00 |
1F001F00 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F001F80 |
1F007F00 |
1FFFFC00 |
1FFFF000 |
1F07E000 |
1F03E000 |
1F03F000 |
1F03F000 |
1F01F800 |
1F00F800 |
1F00FC00 |
1F007C00 |
1F007E00 |
1F003F00 |
1F003F80 |
1F001F80 |
1F000FC0 |
1F000FE0 |
1F0007F0 |
FFE003FE |
FFE001FE |
ENDCHAR |
STARTCHAR 0155 |
ENCODING 341 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 20 34 1 0 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
000000 |
FF1F80 |
1F7FE0 |
1FE1F0 |
1F8060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFE000 |
FFE000 |
ENDCHAR |
STARTCHAR 0158 |
ENCODING 344 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 31 45 1 0 |
BITMAP |
01C06000 |
00E0C000 |
00718000 |
003B8000 |
001F0000 |
001E0000 |
00000000 |
00000000 |
00000000 |
FFFFE000 |
FFFFFC00 |
1F007E00 |
1F001F00 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F001F80 |
1F007F00 |
1FFFFC00 |
1FFFF000 |
1F07E000 |
1F03E000 |
1F03F000 |
1F03F000 |
1F01F800 |
1F00F800 |
1F00FC00 |
1F007C00 |
1F007E00 |
1F003F00 |
1F003F80 |
1F001F80 |
1F000FC0 |
1F000FE0 |
1F0007F0 |
FFE003FE |
FFE001FE |
ENDCHAR |
STARTCHAR 0159 |
ENCODING 345 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 20 33 1 0 |
BITMAP |
0380C0 |
01C180 |
00E300 |
007700 |
003E00 |
003C00 |
000000 |
000000 |
000000 |
FF1F80 |
1F7FE0 |
1FE1F0 |
1F8060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFE000 |
FFE000 |
ENDCHAR |
STARTCHAR 015A |
ENCODING 346 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 47 2 -1 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
000000 |
01FE00 |
0FFFE0 |
1F83F0 |
3F00F0 |
7E0070 |
7C0070 |
F80030 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
FC0000 |
7E0000 |
7F0000 |
3FC000 |
1FF800 |
0FFF00 |
03FFC0 |
00FFE0 |
001FF0 |
0003F8 |
0000FC |
00007C |
00007E |
00003E |
00003E |
C0003E |
C0003E |
E0003E |
E0007C |
E0007C |
F000F8 |
7801F0 |
3E07E0 |
0FFFC0 |
03FE00 |
ENDCHAR |
STARTCHAR 015B |
ENCODING 347 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 17 35 3 -1 |
BITMAP |
00F800 |
01F000 |
01E000 |
03E000 |
03C000 |
078000 |
0F0000 |
030000 |
000000 |
000000 |
07FF00 |
1FFF00 |
3E1F00 |
7C0F00 |
F80700 |
F80300 |
F80300 |
F80000 |
FC0000 |
7E0000 |
7FC000 |
3FF000 |
0FFC00 |
03FE00 |
007F00 |
001F00 |
001F80 |
000F80 |
800F80 |
C00F80 |
C01F80 |
E01F00 |
F87E00 |
CFFC00 |
03F000 |
ENDCHAR |
STARTCHAR 015C |
ENCODING 348 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 46 2 -1 |
BITMAP |
003800 |
007C00 |
007E00 |
00EE00 |
01C700 |
018380 |
030180 |
000000 |
000000 |
01FE00 |
0FFFE0 |
1F83F0 |
3F00F0 |
7E0070 |
7C0070 |
F80030 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
FC0000 |
7E0000 |
7F0000 |
3FC000 |
1FF800 |
0FFF00 |
03FFC0 |
00FFE0 |
001FF0 |
0003F8 |
0000FC |
00007C |
00007E |
00003E |
00003E |
C0003E |
C0003E |
E0003E |
E0007C |
E0007C |
F000F8 |
7801F0 |
3E07E0 |
0FFFC0 |
03FE00 |
ENDCHAR |
STARTCHAR 015D |
ENCODING 349 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 17 35 2 -1 |
BITMAP |
01C000 |
03E000 |
03F000 |
077000 |
0E3800 |
0C1C00 |
180C00 |
000000 |
000000 |
000000 |
07FF00 |
1FFF00 |
3E1F00 |
7C0F00 |
F80700 |
F80300 |
F80300 |
F80000 |
FC0000 |
7E0000 |
7FC000 |
3FF000 |
0FFC00 |
03FE00 |
007F00 |
001F00 |
001F80 |
000F80 |
800F80 |
C00F80 |
C01F80 |
E01F00 |
F87E00 |
CFFC00 |
03F000 |
ENDCHAR |
STARTCHAR 015E |
ENCODING 350 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 48 2 -12 |
BITMAP |
01FE00 |
0FFFE0 |
1F83F0 |
3F00F0 |
7E0070 |
7C0070 |
F80030 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
FC0000 |
7E0000 |
7F0000 |
3FC000 |
1FF800 |
0FFF00 |
03FFC0 |
00FFE0 |
001FF0 |
0003F8 |
0000FC |
00007C |
00007E |
00003E |
00003E |
C0003E |
C0003E |
E0003E |
E0007C |
E0007C |
F000F8 |
7801F0 |
3E07E0 |
0FFFC0 |
03FE00 |
008000 |
018000 |
01C000 |
03F000 |
00F800 |
007800 |
007800 |
007800 |
00F800 |
07F000 |
07E000 |
ENDCHAR |
STARTCHAR 015F |
ENCODING 351 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 17 36 2 -12 |
BITMAP |
07FF00 |
1FFF00 |
3E1F00 |
7C0F00 |
F80700 |
F80300 |
F80300 |
F80000 |
FC0000 |
7E0000 |
7FC000 |
3FF000 |
0FFC00 |
03FE00 |
007F00 |
001F00 |
001F80 |
000F80 |
800F80 |
C00F80 |
C01F80 |
E01F00 |
F87E00 |
CFFC00 |
03F000 |
020000 |
060000 |
070000 |
0FC000 |
03E000 |
01E000 |
01E000 |
01E000 |
03E000 |
1FC000 |
1F8000 |
ENDCHAR |
STARTCHAR 0160 |
ENCODING 352 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 46 2 0 |
BITMAP |
070180 |
038300 |
01C600 |
00EE00 |
007C00 |
007800 |
000000 |
000000 |
000000 |
01FE00 |
0FFFE0 |
1F83F0 |
3F00F0 |
7E0070 |
7C0070 |
F80030 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
FC0000 |
7E0000 |
7F0000 |
3FC000 |
1FF800 |
0FFF00 |
03FFC0 |
00FFE0 |
001FF0 |
0003F8 |
0000FC |
00007C |
00007E |
00003E |
00003E |
C0003E |
C0003E |
E0003E |
E0007C |
E0007C |
F000F8 |
7801F0 |
3E07E0 |
0FFFC0 |
03FE00 |
ENDCHAR |
STARTCHAR 0161 |
ENCODING 353 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 17 34 3 0 |
BITMAP |
1C0600 |
0E0C00 |
071800 |
03B800 |
01F000 |
01E000 |
000000 |
000000 |
000000 |
07FF00 |
1FFF00 |
3E1F00 |
7C0F00 |
F80700 |
F80300 |
F80300 |
F80000 |
FC0000 |
7E0000 |
7FC000 |
3FF000 |
0FFC00 |
03FE00 |
007F00 |
001F00 |
001F80 |
000F80 |
800F80 |
C00F80 |
C01F80 |
E01F00 |
F87E00 |
CFFC00 |
03F000 |
ENDCHAR |
STARTCHAR 0162 |
ENCODING 354 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 48 1 -12 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
C03E0380 |
C03E0380 |
C03E0380 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
01FF8000 |
01FF8000 |
00180000 |
00100000 |
00300000 |
00380000 |
007E0000 |
001F0000 |
000F0000 |
000F0000 |
000F0000 |
001F0000 |
00FE0000 |
00FC0000 |
ENDCHAR |
STARTCHAR 0163 |
ENCODING 355 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 14 47 1 -12 |
BITMAP |
0080 |
0180 |
0380 |
0780 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
FFF8 |
FFF8 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0FC0 |
07F8 |
00F8 |
0060 |
0040 |
00C0 |
00E0 |
01F8 |
007C |
003C |
003C |
003C |
007C |
03F8 |
03F0 |
ENDCHAR |
STARTCHAR 0164 |
ENCODING 356 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 25 45 1 0 |
BITMAP |
01C06000 |
00E0C000 |
00718000 |
003B8000 |
001F0000 |
001E0000 |
00000000 |
00000000 |
00000000 |
FFFFFF80 |
FFFFFF80 |
C03E0380 |
C03E0380 |
C03E0380 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
01FF8000 |
01FF8000 |
ENDCHAR |
STARTCHAR 0165 |
ENCODING 357 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 19 37 1 0 |
BITMAP |
0003E0 |
0003E0 |
0083E0 |
0183E0 |
0383E0 |
0780E0 |
0F8060 |
0F80C0 |
0F8180 |
0F8300 |
0F8000 |
0F8000 |
0F8000 |
FFF800 |
FFF800 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
0FC000 |
07F800 |
00F800 |
ENDCHAR |
STARTCHAR 0166 |
ENCODING 358 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 36 1 0 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
C03E0380 |
C03E0380 |
C03E0380 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
0FFFF000 |
0FFFF000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
01FF8000 |
01FF8000 |
ENDCHAR |
STARTCHAR 0167 |
ENCODING 359 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 13 35 1 0 |
BITMAP |
0080 |
0180 |
0380 |
0780 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
FFF8 |
3FF8 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
FFF8 |
FFF8 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0FC0 |
07F8 |
00F8 |
ENDCHAR |
STARTCHAR 0168 |
ENCODING 360 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 47 1 -1 |
BITMAP |
000C000000 |
001E010000 |
003F810000 |
003FC30000 |
0033E60000 |
0060FE0000 |
00407C0000 |
0040380000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 0169 |
ENCODING 361 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 -1 |
BITMAP |
00600000 |
00F00800 |
01FC0800 |
01FE1800 |
019F3000 |
0307F000 |
0203E000 |
0201C000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 016A |
ENCODING 362 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 34 41 1 -1 |
BITMAP |
007FFF8000 |
007FFF8000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 016B |
ENCODING 363 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 30 1 -1 |
BITMAP |
07FFF800 |
07FFF800 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 016C |
ENCODING 364 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 44 1 -1 |
BITMAP |
00F80F8000 |
00F80F0000 |
007C3E0000 |
001FFC0000 |
0007F00000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 016D |
ENCODING 365 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 32 1 -1 |
BITMAP |
0F80F800 |
0F80F000 |
07C3E000 |
01FFC000 |
007F0000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 016E |
ENCODING 366 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 46 1 -1 |
BITMAP |
0003C00000 |
0007F00000 |
0006300000 |
000C180000 |
000C180000 |
000C180000 |
000C180000 |
0006300000 |
0007F00000 |
FFC1C1FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 016F |
ENCODING 367 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 37 1 -1 |
BITMAP |
003C0000 |
007F0000 |
00630000 |
00C18000 |
00C18000 |
00C18000 |
00C18000 |
00630000 |
007F0000 |
001C0000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 0170 |
ENCODING 368 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 46 1 -1 |
BITMAP |
0007E3F000 |
000FC7E000 |
001F0F8000 |
003C1E0000 |
00783C0000 |
01E0F00000 |
0381C00000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 0171 |
ENCODING 369 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 35 0 -1 |
BITMAP |
001F8FC0 |
003F1F80 |
007C3E00 |
00F07800 |
01E0F000 |
0783C000 |
0E070000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 0174 |
ENCODING 372 |
SWIDTH 860 0 |
DWIDTH 43 0 |
BBX 41 45 1 0 |
BITMAP |
00001C000000 |
00003E000000 |
00003F000000 |
000077000000 |
0000E3800000 |
0000C1C00000 |
000180C00000 |
000000000000 |
000000000000 |
FFCFFFF83F80 |
FFCFFFF83F80 |
1F03F0C00C00 |
1F81F0C01C00 |
1F81F9C01800 |
0F81F9801800 |
0FC0F9803800 |
0FC0FF803000 |
07C0FF003000 |
07E07F007000 |
07E07F006000 |
03E07F006000 |
03F03E00E000 |
03F03E00C000 |
01F03F00C000 |
01F83F01C000 |
01F81F018000 |
00F81F818000 |
00FC1F818000 |
00FC1F838000 |
007C3FC30000 |
007C3FC30000 |
007E37C70000 |
003E77E60000 |
003E67E60000 |
003F63EE0000 |
003FE3FC0000 |
001FC3FC0000 |
001FC1FC0000 |
001FC1F80000 |
000FC1F80000 |
000F80F80000 |
000F80F00000 |
000780F00000 |
000700700000 |
000700700000 |
ENDCHAR |
STARTCHAR 0175 |
ENCODING 373 |
SWIDTH 740 0 |
DWIDTH 37 0 |
BBX 35 34 1 0 |
BITMAP |
0000E00000 |
0001F00000 |
0001F80000 |
0003B80000 |
00071C0000 |
00060E0000 |
000C060000 |
0000000000 |
0000000000 |
0000000000 |
FFDFFF07E0 |
FFDFFF07E0 |
1F03EC0100 |
0F03E80300 |
0F83F80200 |
0F81F00600 |
07C1F00600 |
07C0F80400 |
07C0F80C00 |
03E0F80800 |
03E07C1800 |
01F0FC1800 |
01F0FE1000 |
01F0BE3000 |
00F9BE3000 |
00F91F6000 |
007D1F6000 |
007F0FC000 |
007E0FC000 |
003E0FC000 |
003E078000 |
001C078000 |
001C030000 |
0018030000 |
ENDCHAR |
STARTCHAR 0176 |
ENCODING 374 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 45 1 0 |
BITMAP |
00038000 |
0007C000 |
0007E000 |
000EE000 |
001C7000 |
00183800 |
00301800 |
00000000 |
00000000 |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 0177 |
ENCODING 375 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 46 1 -12 |
BITMAP |
001C00 |
003E00 |
003F00 |
007700 |
00E380 |
00C1C0 |
0180C0 |
000000 |
000000 |
000000 |
FFC07E |
FFC07E |
1F0018 |
1F0010 |
0F8030 |
0F8030 |
078020 |
07C060 |
07C060 |
03E040 |
03E0C0 |
01E080 |
01F180 |
01F180 |
00F900 |
00FB00 |
00FB00 |
007E00 |
007E00 |
003C00 |
003C00 |
003C00 |
001800 |
001800 |
001000 |
003000 |
003000 |
002000 |
006000 |
006000 |
004000 |
00C000 |
008000 |
018000 |
070000 |
0E0000 |
ENDCHAR |
STARTCHAR 0178 |
ENCODING 376 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 29 45 1 1 |
BITMAP |
00F83E00 |
00F83E00 |
00F83E00 |
00F83E00 |
00F83E00 |
00000000 |
00000000 |
00000000 |
00000000 |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 0179 |
ENCODING 377 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 46 1 0 |
BITMAP |
0001F000 |
0003E000 |
0003C000 |
0007C000 |
00078000 |
000F0000 |
001E0000 |
00060000 |
00000000 |
00000000 |
7FFFFFC0 |
7FFFFF80 |
60001F80 |
60001F00 |
60003F00 |
00003E00 |
00007C00 |
0000FC00 |
0000F800 |
0001F800 |
0001F000 |
0003F000 |
0007E000 |
0007C000 |
000FC000 |
000F8000 |
001F8000 |
001F0000 |
003E0000 |
007E0000 |
007C0000 |
00FC0000 |
00F80000 |
01F80000 |
03F00000 |
03E00000 |
07E00000 |
07C00000 |
0FC00000 |
0F800000 |
1F000000 |
3F0000C0 |
3E0000C0 |
7E0000C0 |
7FFFFFC0 |
FFFFFFC0 |
ENDCHAR |
STARTCHAR 017A |
ENCODING 378 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 34 2 0 |
BITMAP |
003E00 |
007C00 |
007800 |
00F800 |
00F000 |
01E000 |
03C000 |
00C000 |
000000 |
000000 |
FFFFF8 |
FFFFF0 |
C001E0 |
C003E0 |
C007C0 |
000780 |
000F80 |
001F00 |
003E00 |
003C00 |
007C00 |
00F800 |
00F000 |
01F000 |
03E000 |
03C000 |
07C000 |
0F8000 |
1F0000 |
1E0008 |
3E0008 |
7C0008 |
7FFFF8 |
FFFFF8 |
ENDCHAR |
STARTCHAR 017B |
ENCODING 379 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 43 1 0 |
BITMAP |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
00000000 |
00000000 |
7FFFFFC0 |
7FFFFF80 |
60001F80 |
60001F00 |
60003F00 |
00003E00 |
00007C00 |
0000FC00 |
0000F800 |
0001F800 |
0001F000 |
0003F000 |
0007E000 |
0007C000 |
000FC000 |
000F8000 |
001F8000 |
001F0000 |
003E0000 |
007E0000 |
007C0000 |
00FC0000 |
00F80000 |
01F80000 |
03F00000 |
03E00000 |
07E00000 |
07C00000 |
0FC00000 |
0F800000 |
1F000000 |
3F0000C0 |
3E0000C0 |
7E0000C0 |
7FFFFFC0 |
FFFFFFC0 |
ENDCHAR |
STARTCHAR 017C |
ENCODING 380 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 32 1 0 |
BITMAP |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
000000 |
000000 |
000000 |
FFFFF8 |
FFFFF0 |
C001E0 |
C003E0 |
C007C0 |
000780 |
000F80 |
001F00 |
003E00 |
003C00 |
007C00 |
00F800 |
00F000 |
01F000 |
03E000 |
03C000 |
07C000 |
0F8000 |
1F0000 |
1E0008 |
3E0008 |
7C0008 |
7FFFF8 |
FFFFF8 |
ENDCHAR |
STARTCHAR 017D |
ENCODING 381 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 26 45 1 1 |
BITMAP |
00E03000 |
00706000 |
0038C000 |
001DC000 |
000F8000 |
000F0000 |
00000000 |
00000000 |
00000000 |
7FFFFFC0 |
7FFFFF80 |
60001F80 |
60001F00 |
60003F00 |
00003E00 |
00007C00 |
0000FC00 |
0000F800 |
0001F800 |
0001F000 |
0003F000 |
0007E000 |
0007C000 |
000FC000 |
000F8000 |
001F8000 |
001F0000 |
003E0000 |
007E0000 |
007C0000 |
00FC0000 |
00F80000 |
01F80000 |
03F00000 |
03E00000 |
07E00000 |
07C00000 |
0FC00000 |
0F800000 |
1F000000 |
3F0000C0 |
3E0000C0 |
7E0000C0 |
7FFFFFC0 |
FFFFFFC0 |
ENDCHAR |
STARTCHAR 017E |
ENCODING 382 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 21 33 2 1 |
BITMAP |
1C0600 |
0E0C00 |
071800 |
03B800 |
01F000 |
01E000 |
000000 |
000000 |
000000 |
FFFFF8 |
FFFFF0 |
C001E0 |
C003E0 |
C007C0 |
000780 |
000F80 |
001F00 |
003E00 |
003C00 |
007C00 |
00F800 |
00F000 |
01F000 |
03E000 |
03C000 |
07C000 |
0F8000 |
1F0000 |
1E0008 |
3E0008 |
7C0008 |
7FFFF8 |
FFFFF8 |
ENDCHAR |
STARTCHAR 0192 |
ENCODING 402 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 43 2 -7 |
BITMAP |
000FF0 |
001FF8 |
003E00 |
003E00 |
007C00 |
007C00 |
007C00 |
007C00 |
00FC00 |
00F800 |
00F800 |
00F800 |
07FF00 |
07FF00 |
01F800 |
01F800 |
01F000 |
01F000 |
01F000 |
01F000 |
03F000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
07C000 |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
1F0000 |
1F0000 |
3E0000 |
3E0000 |
FC0000 |
F00000 |
ENDCHAR |
STARTCHAR 01CD |
ENCODING 461 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 45 1 0 |
BITMAP |
00E03000 |
00706000 |
0038C000 |
001DC000 |
000F8000 |
000F0000 |
00000000 |
00000000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 01CE |
ENCODING 462 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 34 1 -1 |
BITMAP |
070180 |
038300 |
01C600 |
00EE00 |
007C00 |
007800 |
000000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3C0FC0 |
3807E0 |
3003E0 |
3001F0 |
2001F0 |
0001F0 |
0001F0 |
0001F0 |
0003F0 |
001DF0 |
03E1F0 |
1F01F0 |
3C01F0 |
7C01F0 |
F801F0 |
F801F0 |
F803F0 |
F803F0 |
F807F0 |
FC0DF0 |
7E39F8 |
3FF0FE |
0FC000 |
ENDCHAR |
STARTCHAR 01CF |
ENCODING 463 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 12 45 1 0 |
BITMAP |
E030 |
7060 |
38C0 |
1DC0 |
0F80 |
0F00 |
0000 |
0000 |
0000 |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 01D0 |
ENCODING 464 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 12 33 1 0 |
BITMAP |
E030 |
7060 |
38C0 |
1DC0 |
0F80 |
0F00 |
0000 |
0000 |
0000 |
FF00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFC0 |
FFC0 |
ENDCHAR |
STARTCHAR 01D1 |
ENCODING 465 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 46 2 -1 |
BITMAP |
0380C000 |
01C18000 |
00E30000 |
00770000 |
003E0000 |
003C0000 |
00000000 |
00000000 |
00000000 |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 01D2 |
ENCODING 466 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 34 2 -1 |
BITMAP |
070180 |
038300 |
01C600 |
00EE00 |
007C00 |
007800 |
000000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 01D3 |
ENCODING 467 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 46 1 -1 |
BITMAP |
00380C0000 |
001C180000 |
000E300000 |
0007700000 |
0003E00000 |
0003C00000 |
0000000000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 01D4 |
ENCODING 468 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 34 1 -1 |
BITMAP |
01C06000 |
00E0C000 |
00718000 |
003B8000 |
001F0000 |
001E0000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 01D5 |
ENCODING 469 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 48 1 -1 |
BITMAP |
007FFF8000 |
007FFF8000 |
0000000000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
0000000000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 01D6 |
ENCODING 470 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 37 1 -1 |
BITMAP |
07FFF800 |
07FFF800 |
00000000 |
00000000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 01D7 |
ENCODING 471 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 53 1 -1 |
BITMAP |
00003E0000 |
00007C0000 |
0000780000 |
0000F80000 |
0000F00000 |
0001E00000 |
0003C00000 |
0000C00000 |
003E0F8000 |
003E0F8000 |
003E0F8000 |
003E0F8000 |
003E0F8000 |
0000000000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 01D8 |
ENCODING 472 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 42 1 -1 |
BITMAP |
0007C000 |
000F8000 |
000F0000 |
001F0000 |
001E0000 |
003C0000 |
00780000 |
00180000 |
00000000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 01D9 |
ENCODING 473 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 51 1 -1 |
BITMAP |
00380C0000 |
001C180000 |
000E300000 |
0007700000 |
0003E00000 |
0003C00000 |
0000000000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
007C1F0000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 01DA |
ENCODING 474 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 41 0 -1 |
BITMAP |
01C06000 |
00E0C000 |
00718000 |
003B8000 |
001F0000 |
001E0000 |
00000000 |
00000000 |
03E0F800 |
03E0F800 |
03E0F800 |
03E0F800 |
03E0F800 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 01DB |
ENCODING 475 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 34 54 1 -1 |
BITMAP |
007C000000 |
003E000000 |
001E000000 |
001F000000 |
000F000000 |
0007800000 |
0003800000 |
0003000000 |
0000000000 |
00F83E0000 |
00F83E0000 |
00F83E0000 |
00F83E0000 |
00F83E0000 |
0000000000 |
0000000000 |
0000000000 |
FFC001FFC0 |
FFC001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F80003E00 |
0F80007C00 |
0F80007C00 |
0F80007C00 |
07C0007800 |
07C000F800 |
03E000F800 |
03E001F000 |
01F003E000 |
00FC0FC000 |
003FFF8000 |
0007FC0000 |
ENDCHAR |
STARTCHAR 01DC |
ENCODING 476 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 43 1 -1 |
BITMAP |
01F00000 |
00F80000 |
00780000 |
007C0000 |
003C0000 |
001E0000 |
000E0000 |
000C0000 |
00000000 |
00000000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
07C1F000 |
00000000 |
00000000 |
00000000 |
FF00FF00 |
FF00FF00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
0F801F00 |
0F803F00 |
07C07F00 |
03E0FF00 |
01FFDFE0 |
007F0000 |
ENDCHAR |
STARTCHAR 01E2 |
ENCODING 482 |
SWIDTH 920 0 |
DWIDTH 46 0 |
BBX 45 40 0 0 |
BITMAP |
0000001FFFE0 |
0000001FFFE0 |
000000000000 |
000000000000 |
000007FFFFF8 |
000007FFFFF8 |
000003F80018 |
000002F80018 |
000006F80018 |
00000CF80000 |
000008F80000 |
000018F80000 |
000030F80000 |
000030F80000 |
000060F80000 |
000040F80000 |
0000C0F80000 |
000180F80000 |
000180F80300 |
000300F80300 |
000200F80300 |
000600FFFF00 |
000C00FFFF00 |
000C00F80300 |
001800F80300 |
003FFFF80300 |
003FFFF80000 |
007000F80000 |
006000F80000 |
00C000F80000 |
01C000F80000 |
018000F80000 |
030000F80000 |
030000F80000 |
060000F80000 |
0C0000F80018 |
0C0000F80018 |
180000F80018 |
FC0007FFFFF8 |
FC0007FFFFF8 |
ENDCHAR |
STARTCHAR 01E3 |
ENCODING 483 |
SWIDTH 780 0 |
DWIDTH 39 0 |
BBX 37 30 1 -1 |
BITMAP |
003FFFC000 |
003FFFC000 |
0000000000 |
0000000000 |
0000000000 |
01FE01FC00 |
1FFFC7FF00 |
1E07FF07C0 |
1C03FE03C0 |
1801FC01E0 |
1800FC01F0 |
1000F800F0 |
0000F800F0 |
0000F800F8 |
0000FFFFF8 |
0003FFFFF8 |
001CF80000 |
03E0F80000 |
1E00F80000 |
3C00F80000 |
7800F80000 |
F800F80000 |
F800FC0000 |
F801FC0008 |
F803FC0018 |
F8073E0030 |
FC0E1F0070 |
7E3C0FE3C0 |
3FF807FF80 |
0FC000FE00 |
ENDCHAR |
STARTCHAR 01E6 |
ENCODING 486 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 46 2 -1 |
BITMAP |
01C06000 |
00E0C000 |
00718000 |
003B8000 |
001F0000 |
001E0000 |
00000000 |
00000000 |
00000000 |
007F8000 |
03FFF000 |
07E07C00 |
0F801E00 |
1F000F00 |
3F000700 |
3E000700 |
7E000300 |
7C000300 |
7C000300 |
7C000300 |
FC000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F800FFF8 |
F800FFF8 |
F80007C0 |
F80007C0 |
F80007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
3E000FC0 |
3E000F80 |
1F000F80 |
1F801F00 |
0FC03E00 |
07E07C00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 01E7 |
ENCODING 487 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 24 45 0 -12 |
BITMAP |
0380C0 |
01C180 |
00E300 |
007700 |
003E00 |
003C00 |
000000 |
000000 |
000000 |
003FFF |
01FFFF |
03E1F0 |
07C0F8 |
0F807C |
0F807C |
1F003C |
1F003E |
1F003E |
1F003E |
1F003E |
1F003E |
1F003C |
0F807C |
0F807C |
07C0F8 |
03E1F0 |
01FFC0 |
003F80 |
000700 |
00FC00 |
03E000 |
07C000 |
03F000 |
00EF80 |
0780F0 |
1E003C |
3C003E |
78001F |
F8001F |
F8001F |
F8001F |
FC003E |
7E00FE |
3FFFF8 |
07FFC0 |
ENDCHAR |
STARTCHAR 01FC |
ENCODING 508 |
SWIDTH 920 0 |
DWIDTH 46 0 |
BBX 45 46 0 0 |
BITMAP |
000000007C00 |
00000000F800 |
00000000F000 |
00000001F000 |
00000001E000 |
00000003C000 |
000000078000 |
000000018000 |
000000000000 |
000000000000 |
000007FFFFF8 |
000007FFFFF8 |
000003F80018 |
000002F80018 |
000006F80018 |
00000CF80000 |
000008F80000 |
000018F80000 |
000030F80000 |
000030F80000 |
000060F80000 |
000040F80000 |
0000C0F80000 |
000180F80000 |
000180F80300 |
000300F80300 |
000200F80300 |
000600FFFF00 |
000C00FFFF00 |
000C00F80300 |
001800F80300 |
003FFFF80300 |
003FFFF80000 |
007000F80000 |
006000F80000 |
00C000F80000 |
01C000F80000 |
018000F80000 |
030000F80000 |
030000F80000 |
060000F80000 |
0C0000F80018 |
0C0000F80018 |
180000F80018 |
FC0007FFFFF8 |
FC0007FFFFF8 |
ENDCHAR |
STARTCHAR 01FD |
ENCODING 509 |
SWIDTH 780 0 |
DWIDTH 39 0 |
BBX 37 35 1 -1 |
BITMAP |
00003E0000 |
00007C0000 |
0000780000 |
0000F80000 |
0000F00000 |
0001E00000 |
0003C00000 |
0000C00000 |
0000000000 |
0000000000 |
01FE01FC00 |
1FFFC7FF00 |
1E07FF07C0 |
1C03FE03C0 |
1801FC01E0 |
1800FC01F0 |
1000F800F0 |
0000F800F0 |
0000F800F8 |
0000FFFFF8 |
0003FFFFF8 |
001CF80000 |
03E0F80000 |
1E00F80000 |
3C00F80000 |
7800F80000 |
F800F80000 |
F800FC0000 |
F801FC0008 |
F803FC0018 |
F8073E0030 |
FC0E1F0070 |
7E3C0FE3C0 |
3FF807FF80 |
0FC000FE00 |
ENDCHAR |
STARTCHAR 01FE |
ENCODING 510 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 47 1 -1 |
BITMAP |
0001F000 |
0003E000 |
0003C000 |
0007C000 |
00078000 |
000F0000 |
001E0000 |
00060000 |
00000000 |
00000000 |
003FF818 |
00FFFC38 |
03F07F30 |
07C01FE0 |
0F800FE0 |
1F800FC0 |
1F0007C0 |
1F0007C0 |
3E0007E0 |
3E0007E0 |
3E000FE0 |
7E0019E0 |
7C0031F0 |
7C0061F0 |
7C0041F0 |
7C00C1F0 |
7C0181F0 |
7C0301F0 |
7C0601F0 |
7C0401F0 |
7C0801F0 |
7C1801F0 |
7C3001F0 |
7C6001F0 |
7C4001F0 |
7C8001F0 |
3F8003E0 |
3F0003E0 |
3E0003E0 |
3F0003C0 |
1F0007C0 |
1F8007C0 |
3F800F80 |
67C01F00 |
C3F07E00 |
C1FFFC00 |
003FE000 |
ENDCHAR |
STARTCHAR 01FF |
ENCODING 511 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 35 2 -1 |
BITMAP |
001F00 |
003E00 |
003C00 |
007C00 |
007800 |
00F000 |
01E000 |
006000 |
000000 |
000000 |
01FF8C |
07FFDC |
1F87F8 |
3E01F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7801F8 |
F8037C |
F8067C |
F8047C |
F8087C |
F8107C |
F8207C |
F8407C |
F8807C |
F9807C |
7B0078 |
7E00F8 |
7C00F8 |
3C01F0 |
3E01F0 |
3F87E0 |
47FFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 0200 |
ENCODING 512 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 46 1 0 |
BITMAP |
0007C000 |
07C3E000 |
03E1E000 |
01E1F000 |
01F0F000 |
00F07800 |
00783800 |
00383000 |
00300000 |
00000000 |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 0232 |
ENCODING 562 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 29 40 1 0 |
BITMAP |
01FFFE00 |
01FFFE00 |
00000000 |
00000000 |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 02C6 |
ENCODING 710 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 11 7 4 29 |
BITMAP |
0E00 |
1F00 |
1F80 |
3B80 |
71C0 |
60E0 |
C060 |
ENDCHAR |
STARTCHAR 02C7 |
ENCODING 711 |
SWIDTH 360 0 |
DWIDTH 18 0 |
BBX 12 6 3 29 |
BITMAP |
E030 |
7060 |
38C0 |
1DC0 |
0F80 |
0F00 |
ENDCHAR |
STARTCHAR 02C9 |
ENCODING 713 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 16 2 2 34 |
BITMAP |
FFFF |
FFFF |
ENDCHAR |
STARTCHAR 02D8 |
ENCODING 728 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 17 5 2 29 |
BITMAP |
F80F80 |
F80F00 |
7C3E00 |
1FFC00 |
07F000 |
ENDCHAR |
STARTCHAR 02DA |
ENCODING 730 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 9 10 2 25 |
BITMAP |
3C00 |
7F00 |
6300 |
C180 |
C180 |
C180 |
C180 |
6300 |
7F00 |
1C00 |
ENDCHAR |
STARTCHAR 02DB |
ENCODING 731 |
SWIDTH 240 0 |
DWIDTH 12 0 |
BBX 8 9 2 -8 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
7C |
7C |
3F |
0F |
ENDCHAR |
STARTCHAR 02DC |
ENCODING 732 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 8 2 28 |
BITMAP |
1800 |
3C02 |
7F02 |
7F86 |
67CC |
C1FC |
80F8 |
8070 |
ENDCHAR |
STARTCHAR 02DD |
ENCODING 733 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 7 2 28 |
BITMAP |
01F8FC |
03F1F8 |
07C3E0 |
0F0780 |
1E0F00 |
783C00 |
E07000 |
ENDCHAR |
STARTCHAR 037E |
ENCODING 894 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 29 2 -5 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
00 |
F8 |
F8 |
F8 |
F8 |
F8 |
38 |
18 |
30 |
60 |
C0 |
ENDCHAR |
STARTCHAR 0386 |
ENCODING 902 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 39 1 0 |
BITMAP |
01F00000 |
03E00000 |
03C00000 |
07C60000 |
078F0000 |
0F0F0000 |
1E0F0000 |
060F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 0388 |
ENCODING 904 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 30 41 1 0 |
BITMAP |
0F800000 |
1F000000 |
1E000000 |
3E000000 |
3C000000 |
7BFFFFFC |
F3FFFFFC |
307C000C |
007C000C |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0180 |
007C0180 |
007C0180 |
007FFF80 |
007FFF80 |
007C0180 |
007C0180 |
007C0180 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C0000 |
007C000C |
007C000C |
007C000C |
03FFFFFC |
03FFFFFC |
ENDCHAR |
STARTCHAR 0389 |
ENCODING 905 |
SWIDTH 740 0 |
DWIDTH 37 0 |
BBX 39 41 -2 0 |
BITMAP |
0F80000000 |
1F00000000 |
1E00000000 |
3E00000000 |
3C00000000 |
78FFE007FE |
F0FFE007FE |
301F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001FFFFFF0 |
001FFFFFF0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
001F0001F0 |
00FFE007FE |
00FFE007FE |
ENDCHAR |
STARTCHAR 038A |
ENCODING 906 |
SWIDTH 340 0 |
DWIDTH 17 0 |
BBX 17 42 -2 0 |
BITMAP |
0F8000 |
1F0000 |
1E0000 |
3E0000 |
3C0000 |
780000 |
F3FF80 |
33FF80 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
03FF80 |
03FF80 |
ENDCHAR |
STARTCHAR 038C |
ENCODING 908 |
SWIDTH 680 0 |
DWIDTH 34 0 |
BBX 32 40 0 -1 |
BITMAP |
0F800000 |
1F000000 |
1E000000 |
3E03FC00 |
3C0FFF80 |
783F07E0 |
F07C03F0 |
30F801F8 |
00F800F8 |
01F0007C |
03F0007C |
03E0007E |
03E0003E |
07E0003E |
07E0003F |
07E0003F |
07E0003F |
07C0003F |
07C0001F |
07C0001F |
07C0001F |
07C0001F |
07C0001F |
07C0001F |
07C0001F |
07C0003F |
07C0003F |
07E0003F |
07E0003F |
07E0003E |
03E0003E |
03E0007E |
03F0007C |
01F0007C |
00F800F8 |
00F801F8 |
007C03F0 |
003F07E0 |
000FFF80 |
0003FE00 |
ENDCHAR |
STARTCHAR 038E |
ENCODING 910 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 37 42 -6 0 |
BITMAP |
0F80000000 |
1F00000000 |
1E00000000 |
3E00000000 |
3C00000000 |
7800000000 |
F0FFC001F8 |
30FFC001F8 |
001F0000C0 |
000F8001C0 |
000FC00180 |
0007C00300 |
0007E00700 |
0003E00600 |
0003F00E00 |
0001F00C00 |
0000F81800 |
0000F81800 |
00007C3000 |
00007C7000 |
00003E6000 |
00001FE000 |
00001FC000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00000F8000 |
00007FE000 |
00007FE000 |
ENDCHAR |
STARTCHAR 038F |
ENCODING 911 |
SWIDTH 800 0 |
DWIDTH 40 0 |
BBX 36 40 1 0 |
BITMAP |
0F80000000 |
1F00000000 |
1E00000000 |
3E003C0000 |
3C07FFE000 |
781FC3F800 |
F07E007E00 |
30FC003F00 |
01F8001F80 |
01F0000F80 |
03E00007C0 |
03E00007C0 |
07C00003E0 |
07C00003E0 |
07C00003E0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
0F800001F0 |
07C00001E0 |
07C00003E0 |
03C00003C0 |
03E00007C0 |
01F0000780 |
00F0000F00 |
0078001E00 |
003C003C00 |
000E007800 |
0203006020 |
0203006020 |
0203006020 |
03FF007FE0 |
03FF007FE0 |
03FF007FE0 |
03FF007FE0 |
ENDCHAR |
STARTCHAR 0391 |
ENCODING 913 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 36 1 0 |
BITMAP |
00060000 |
000F0000 |
000F0000 |
000F0000 |
000F8000 |
001F8000 |
001F8000 |
001FC000 |
003FC000 |
0037C000 |
0037E000 |
0077E000 |
0063E000 |
0063F000 |
00E3F000 |
00C1F000 |
00C1F800 |
01C1F800 |
0180F800 |
0180FC00 |
0180FC00 |
03807C00 |
03FFFC00 |
03FFFE00 |
07007E00 |
06003E00 |
06003F00 |
0E003F00 |
0C001F00 |
0C001F80 |
1C001F80 |
18000F80 |
18000FC0 |
38000FC0 |
FE001FF8 |
FE001FF8 |
ENDCHAR |
STARTCHAR 0392 |
ENCODING 914 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 26 36 1 0 |
BITMAP |
FFFFC000 |
FFFFF000 |
1F01F800 |
1F007C00 |
1F003E00 |
1F003E00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F001F00 |
1F003E00 |
1F003E00 |
1F007C00 |
1F01F800 |
1FFFF000 |
1FFFFC00 |
1F007E00 |
1F003F00 |
1F001F80 |
1F000F80 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F000F80 |
1F001F00 |
1F003F00 |
1F007E00 |
FFFFF800 |
FFFFE000 |
ENDCHAR |
STARTCHAR 0393 |
ENCODING 915 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 36 1 0 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
1F000080 |
1F000080 |
1F000080 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
FFE00000 |
FFE00000 |
ENDCHAR |
STARTCHAR 0394 |
ENCODING 916 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 36 1 0 |
BITMAP |
000C0000 |
000C0000 |
001C0000 |
001E0000 |
001E0000 |
003E0000 |
003F0000 |
003F0000 |
006F0000 |
004F8000 |
004F8000 |
00CF8000 |
00878000 |
0087C000 |
0187C000 |
0103C000 |
0103E000 |
0303E000 |
0201E000 |
0201F000 |
0601F000 |
0401F000 |
0400F800 |
0C00F800 |
0800F800 |
08007800 |
18007C00 |
10007C00 |
10003C00 |
30003E00 |
20003E00 |
20001E00 |
60001F00 |
40001F00 |
7FFFFF00 |
FFFFFF80 |
ENDCHAR |
STARTCHAR 0395 |
ENCODING 917 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 24 36 1 0 |
BITMAP |
FFFFFF |
FFFFFF |
1F0003 |
1F0003 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0060 |
1F0060 |
1F0060 |
1FFFE0 |
1FFFE0 |
1F0060 |
1F0060 |
1F0060 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0003 |
1F0003 |
1F0003 |
FFFFFF |
FFFFFF |
ENDCHAR |
STARTCHAR 0396 |
ENCODING 918 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 26 36 1 0 |
BITMAP |
7FFFFFC0 |
7FFFFF80 |
60001F80 |
60001F00 |
60003F00 |
00003E00 |
00007C00 |
0000FC00 |
0000F800 |
0001F800 |
0001F000 |
0003F000 |
0007E000 |
0007C000 |
000FC000 |
000F8000 |
001F8000 |
001F0000 |
003E0000 |
007E0000 |
007C0000 |
00FC0000 |
00F80000 |
01F80000 |
03F00000 |
03E00000 |
07E00000 |
07C00000 |
0FC00000 |
0F800000 |
1F000000 |
3F0000C0 |
3E0000C0 |
7E0000C0 |
7FFFFFC0 |
FFFFFFC0 |
ENDCHAR |
STARTCHAR 0397 |
ENCODING 919 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 31 36 1 0 |
BITMAP |
FFE007FE |
FFE007FE |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1FFFFFF0 |
1FFFFFF0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
1F0001F0 |
FFE007FE |
FFE007FE |
ENDCHAR |
STARTCHAR 0398 |
ENCODING 920 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 27 37 2 -1 |
BITMAP |
007FC000 |
01FFF800 |
07E0FC00 |
0F803E00 |
1F001F00 |
3F001F80 |
3E000F80 |
3E000F80 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
F80007C0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
FFFFFFE0 |
FFFFFFE0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
FC0007E0 |
7C0007C0 |
7C0007C0 |
7C0007C0 |
3E000F80 |
3E000F80 |
3F001F80 |
1F001F00 |
0F803E00 |
07E0FC00 |
03FFF800 |
007FC000 |
ENDCHAR |
STARTCHAR 0399 |
ENCODING 921 |
SWIDTH 280 0 |
DWIDTH 14 0 |
BBX 11 36 1 0 |
BITMAP |
FFE0 |
FFE0 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
1F00 |
FFE0 |
FFE0 |
ENDCHAR |
STARTCHAR 039A |
ENCODING 922 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 30 36 1 0 |
BITMAP |
FFE003F0 |
FFE003F0 |
1F000180 |
1F000700 |
1F000E00 |
1F001C00 |
1F003000 |
1F006000 |
1F00C000 |
1F038000 |
1F070000 |
1F0E0000 |
1F1C0000 |
1F300000 |
1F600000 |
1FE00000 |
1FF00000 |
1FF80000 |
1FFC0000 |
1FFE0000 |
1F7F0000 |
1F3F8000 |
1F1F8000 |
1F1FC000 |
1F0FE000 |
1F07F000 |
1F03F800 |
1F01FC00 |
1F00FE00 |
1F007F00 |
1F003F80 |
1F001FC0 |
1F000FC0 |
1F000FE0 |
FFE00FFC |
FFE00FFC |
ENDCHAR |
STARTCHAR 039B |
ENCODING 923 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
00030000 |
00070000 |
00070000 |
00078000 |
000F8000 |
000F8000 |
000FC000 |
001FC000 |
001FC000 |
0013C000 |
0033E000 |
0033E000 |
0021E000 |
0061F000 |
0061F000 |
0040F000 |
00C0F800 |
00C0F800 |
0080F800 |
01807C00 |
01807C00 |
01007C00 |
03003E00 |
03003E00 |
02003E00 |
06001E00 |
06001F00 |
04001F00 |
0C000F00 |
0C000F80 |
08000F80 |
18000F80 |
180007C0 |
100007C0 |
FC001FF8 |
FC001FF8 |
ENDCHAR |
STARTCHAR 039C |
ENCODING 924 |
SWIDTH 760 0 |
DWIDTH 38 0 |
BBX 35 36 1 0 |
BITMAP |
FF80003FE0 |
FF80003FE0 |
1F80003F00 |
1FC0007F00 |
1FC0007F00 |
1FC0007F00 |
1FE000FF00 |
1FE000FF00 |
1BE000FF00 |
1BF001DF00 |
1BF001DF00 |
19F001DF00 |
19F8039F00 |
19F8039F00 |
18F8039F00 |
18FC071F00 |
18FC071F00 |
187C071F00 |
187E0E1F00 |
187E0E1F00 |
183E0E1F00 |
183F1C1F00 |
183F1C1F00 |
181F1C1F00 |
181FB81F00 |
181FB81F00 |
180FB01F00 |
180FF01F00 |
180FF01F00 |
1807E01F00 |
1807E01F00 |
1807E01F00 |
1803C01F00 |
1803C01F00 |
FF03C07FE0 |
FF01807FE0 |
ENDCHAR |
STARTCHAR 039D |
ENCODING 925 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
FF8007F8 |
FF8007F8 |
1FC000C0 |
1FC000C0 |
1FE000C0 |
1BF000C0 |
1BF000C0 |
19F800C0 |
19F800C0 |
18FC00C0 |
187E00C0 |
187E00C0 |
183F00C0 |
183F00C0 |
181F80C0 |
180FC0C0 |
180FC0C0 |
1807E0C0 |
1807E0C0 |
1803F0C0 |
1801F8C0 |
1801F8C0 |
1800FCC0 |
1800FEC0 |
18007EC0 |
18003FC0 |
18003FC0 |
18001FC0 |
18001FC0 |
18000FC0 |
180007C0 |
180007C0 |
180003C0 |
180003C0 |
FE0001C0 |
FE0000C0 |
ENDCHAR |
STARTCHAR 039E |
ENCODING 926 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 20 36 0 0 |
BITMAP |
FFFFF0 |
FFFFF0 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
1FFFC0 |
1FFFC0 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
FFFFF0 |
FFFFF0 |
ENDCHAR |
STARTCHAR 039F |
ENCODING 927 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 37 2 -1 |
BITMAP |
007F8000 |
01FFF000 |
07E0FC00 |
0F807E00 |
1F003F00 |
1F001F00 |
3E000F80 |
7E000F80 |
7C000FC0 |
7C0007C0 |
FC0007C0 |
FC0007E0 |
FC0007E0 |
FC0007E0 |
F80007E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80003E0 |
F80007E0 |
F80007E0 |
FC0007E0 |
FC0007E0 |
FC0007C0 |
7C0007C0 |
7C000FC0 |
7E000F80 |
3E000F80 |
1F001F00 |
1F003F00 |
0F807E00 |
07E0FC00 |
01FFF000 |
007FC000 |
ENDCHAR |
STARTCHAR 03A0 |
ENCODING 928 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 26 36 2 0 |
BITMAP |
FFFFFFC0 |
FFFFFFC0 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
1F003E00 |
FFE1FFC0 |
FFE1FFC0 |
ENDCHAR |
STARTCHAR 03A1 |
ENCODING 929 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 0 |
BITMAP |
FFFFE000 |
FFFFFC00 |
1F007E00 |
1F001F80 |
1F000F80 |
1F0007C0 |
1F0007C0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0003E0 |
1F0007C0 |
1F0007C0 |
1F000F80 |
1F001F80 |
1F007E00 |
1FFFFC00 |
1FFFE000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
1F000000 |
FFE00000 |
FFE00000 |
ENDCHAR |
STARTCHAR 03A3 |
ENCODING 931 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 22 36 3 0 |
BITMAP |
FFFFFC |
7FFFFC |
78000C |
3C000C |
1E000C |
1E0000 |
0F0000 |
0F8000 |
078000 |
03C000 |
03E000 |
01E000 |
00F000 |
00F800 |
007800 |
003C00 |
003E00 |
001E00 |
001C00 |
000C00 |
001800 |
003000 |
002000 |
004000 |
00C000 |
018000 |
010000 |
020000 |
06000C |
0C000C |
08000C |
1FFFFC |
3FFFFC |
7FFFFC |
7FFFFC |
FFFFFC |
ENDCHAR |
STARTCHAR 03A4 |
ENCODING 932 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 25 36 1 0 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
C03E0380 |
C03E0380 |
C03E0380 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
003E0000 |
01FF8000 |
01FF8000 |
ENDCHAR |
STARTCHAR 03A5 |
ENCODING 933 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 03A6 |
ENCODING 934 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 31 36 1 0 |
BITMAP |
001FF800 |
001FF800 |
0007C000 |
0007C000 |
0007C000 |
0007C000 |
007FFC00 |
01E7CF80 |
07C7C7C0 |
0F87C3E0 |
1F07C1F0 |
3E07C0F8 |
7C07C07C |
7C07C07C |
7C07C07C |
F807C03E |
F807C03E |
F807C03E |
F807C03E |
F807C03E |
F807C03E |
7C07C07C |
7C07C07C |
7C07C0FC |
3E07C0F8 |
1F07C1F0 |
0F87C3E0 |
07C7C7C0 |
03E7DF80 |
007FFE00 |
0007C000 |
0007C000 |
0007C000 |
0007C000 |
001FF800 |
001FF800 |
ENDCHAR |
STARTCHAR 03A7 |
ENCODING 935 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 36 2 0 |
BITMAP |
FFC01FC0 |
FFC01FC0 |
1F000600 |
1F800E00 |
0F800C00 |
0FC01800 |
07C03800 |
07E03000 |
03F07000 |
01F06000 |
01F8E000 |
00F9C000 |
00FD8000 |
007F8000 |
003F0000 |
003F0000 |
001F0000 |
001F8000 |
001F8000 |
001FC000 |
003FE000 |
0033E000 |
0063F000 |
00E1F000 |
00C1F800 |
01C0FC00 |
01807C00 |
03007E00 |
03003E00 |
06003F00 |
0E001F00 |
0C000F80 |
1C000FC0 |
180007C0 |
FC001FF8 |
FC001FF8 |
ENDCHAR |
STARTCHAR 03A8 |
ENCODING 936 |
SWIDTH 780 0 |
DWIDTH 39 0 |
BBX 36 36 1 0 |
BITMAP |
FF07FF07F0 |
FF07FF07F0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
1F00F807C0 |
0F80F80F80 |
0F80F80F80 |
0FC0F81F80 |
07C0F81F00 |
03E0F83E00 |
01F0F87C00 |
00F8F8F800 |
003EFBE000 |
000FFF8000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0000F80000 |
0007FF0000 |
0007FF0000 |
ENDCHAR |
STARTCHAR 03A9 |
ENCODING 937 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 32 37 1 0 |
BITMAP |
0003C000 |
007FFE00 |
01FC3F80 |
07E007E0 |
0FC003F0 |
1F8001F8 |
1F0000F8 |
3E00007C |
3E00007C |
7C00003E |
7C00003E |
7C00003E |
F800001F |
F800001F |
F800001F |
F800001F |
F800001F |
F800001F |
F800001F |
F800001F |
F800001F |
7C00001E |
7C00003E |
3C00003C |
3E00007C |
1F000078 |
0F0000F0 |
078001E0 |
03C003C0 |
00E00780 |
20300602 |
20300602 |
20300602 |
3FF007FE |
3FF007FE |
3FF007FE |
3FF007FE |
ENDCHAR |
STARTCHAR 03AA |
ENCODING 938 |
SWIDTH 300 0 |
DWIDTH 15 0 |
BBX 15 44 0 0 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
0000 |
0000 |
0000 |
7FF0 |
7FF0 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
0F80 |
7FF0 |
7FF0 |
ENDCHAR |
STARTCHAR 03AB |
ENCODING 939 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 29 44 1 0 |
BITMAP |
007C1F00 |
007C1F00 |
007C1F00 |
007C1F00 |
007C1F00 |
00000000 |
00000000 |
00000000 |
FFC001F8 |
FFC001F8 |
1F0000C0 |
0F8001C0 |
0FC00180 |
07C00300 |
07E00700 |
03E00600 |
03F00E00 |
01F00C00 |
00F81800 |
00F81800 |
007C3000 |
007C7000 |
003E6000 |
001FE000 |
001FC000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
007FE000 |
007FE000 |
ENDCHAR |
STARTCHAR 03AC |
ENCODING 940 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 24 36 2 -1 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
000000 |
000000 |
01FE1E |
07FF9E |
1F87FE |
3F03FE |
3E01FE |
7C00FE |
7C00FE |
7C00FE |
F8007E |
F8007E |
F8007E |
F8003E |
F8003E |
F8003E |
F8007E |
F8007E |
F8007E |
7C007E |
7C00FE |
7C00FE |
3E01FE |
3F03FE |
1F87FF |
07FF9F |
01FE00 |
ENDCHAR |
STARTCHAR 03AD |
ENCODING 941 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 36 2 -1 |
BITMAP |
003E00 |
007C00 |
007800 |
00F800 |
00F000 |
01E000 |
03C000 |
00C000 |
000000 |
000000 |
000000 |
03FE00 |
1FFF80 |
3F0FC0 |
7E03E0 |
FC01F0 |
F801F0 |
F80000 |
F80000 |
F80000 |
7C0000 |
3E0000 |
1F8000 |
07E000 |
1F8000 |
3E0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F800C0 |
FC01F0 |
7C03E0 |
3F07E0 |
1FFF80 |
03FE00 |
ENDCHAR |
STARTCHAR 03AE |
ENCODING 942 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 21 48 1 -12 |
BITMAP |
000F80 |
001F00 |
001E00 |
003E00 |
003C00 |
007800 |
00F000 |
003000 |
000000 |
000000 |
000000 |
000000 |
F9FC00 |
FFCF80 |
FF87C0 |
FF03E0 |
FE01E0 |
FC01F0 |
FC01F0 |
FC00F0 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
ENDCHAR |
STARTCHAR 03B1 |
ENCODING 945 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 25 2 -1 |
BITMAP |
01FE1E |
07FF9E |
1F87FE |
3F03FE |
3E01FE |
7C00FE |
7C00FE |
7C00FE |
F8007E |
F8007E |
F8007E |
F8003E |
F8003E |
F8003E |
F8007E |
F8007E |
F8007E |
7C007E |
7C00FE |
7C00FE |
3E01FE |
3F03FE |
1F87FF |
07FF9F |
01FE00 |
ENDCHAR |
STARTCHAR 03B2 |
ENCODING 946 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 43 2 -7 |
BITMAP |
01FC00 |
0F9F80 |
1F07C0 |
3E03E0 |
7C01F0 |
7C01F0 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F801F8 |
F801F0 |
F803E0 |
F807E0 |
F81F80 |
FBFE00 |
FBFC00 |
F80F80 |
F803E0 |
F800F0 |
F80078 |
F8007C |
F8007C |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8007E |
F8007C |
FC00FC |
FC00F8 |
FE03F0 |
FF87E0 |
FFFFC0 |
F87E00 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
180000 |
ENDCHAR |
STARTCHAR 03B3 |
ENCODING 947 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 36 2 -12 |
BITMAP |
F8003E |
F8003E |
78007C |
7C007C |
7C007C |
3E00F8 |
3E00F8 |
1E01F0 |
1F01F0 |
1F01F0 |
0F83E0 |
0F83E0 |
07C7C0 |
07C7C0 |
07C7C0 |
03EF80 |
03EF80 |
01FF00 |
01FF00 |
01FF00 |
00FE00 |
00FE00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
ENDCHAR |
STARTCHAR 03B4 |
ENCODING 948 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 35 2 -1 |
BITMAP |
0FFF80 |
1FFF80 |
0F0000 |
0F8000 |
07C000 |
03C000 |
03E000 |
01F000 |
00F000 |
00F800 |
03FE00 |
0FC3C0 |
1F01E0 |
3E00F0 |
3E0078 |
7C007C |
7C007C |
7C003C |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
7C007C |
7C007C |
7C00FC |
3E00F8 |
3F01F8 |
1F83F0 |
07FFC0 |
00FF00 |
ENDCHAR |
STARTCHAR 03B5 |
ENCODING 949 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 20 25 2 -1 |
BITMAP |
03FE00 |
1FFF80 |
3F0FC0 |
7E03E0 |
FC01F0 |
F801F0 |
F80000 |
F80000 |
F80000 |
7C0000 |
3E0000 |
1F8000 |
07E000 |
1F8000 |
3E0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F800C0 |
FC01F0 |
7C03E0 |
3F07E0 |
1FFF80 |
03FE00 |
ENDCHAR |
STARTCHAR 03B6 |
ENCODING 950 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 18 46 1 -10 |
BITMAP |
0FFF80 |
0FFFC0 |
0007C0 |
000F80 |
001F00 |
001E00 |
003E00 |
007C00 |
007800 |
00F800 |
01F000 |
01F000 |
03E000 |
03C000 |
07C000 |
078000 |
0F8000 |
1F0000 |
1F0000 |
1E0000 |
3E0000 |
3E0000 |
7C0000 |
7C0000 |
7C0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
7C0000 |
3E0000 |
1F0000 |
07FE00 |
001F80 |
000F80 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
000FC0 |
000F80 |
003F00 |
003C00 |
ENDCHAR |
STARTCHAR 03B7 |
ENCODING 951 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 36 1 -12 |
BITMAP |
F9FC00 |
FFCF80 |
FF87C0 |
FF03E0 |
FE01E0 |
FC01F0 |
FC01F0 |
FC00F0 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
F800F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
ENDCHAR |
STARTCHAR 03B8 |
ENCODING 952 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 23 37 2 -1 |
BITMAP |
00FE00 |
03CF80 |
0703C0 |
0F01E0 |
1E01F0 |
1C00F0 |
3C00F8 |
3C00F8 |
780078 |
78007C |
78007C |
78007C |
F8003C |
F8003E |
F8003E |
F8003E |
F8003E |
FFFFFE |
FFFFFE |
F8003E |
F8003E |
F8003E |
F8003E |
78003E |
78003C |
78007C |
78007C |
78007C |
3C00F8 |
3C00F8 |
3E00F8 |
1E01F0 |
1F03F0 |
0F87E0 |
07EFC0 |
03FF80 |
00FE00 |
ENDCHAR |
STARTCHAR 03B9 |
ENCODING 953 |
SWIDTH 200 0 |
DWIDTH 10 0 |
BBX 5 24 2 0 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 03BA |
ENCODING 954 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 18 24 2 0 |
BITMAP |
F80700 |
F80E00 |
F81C00 |
F83800 |
F87000 |
F8E000 |
F9C000 |
FB8000 |
FF0000 |
FE0000 |
FF0000 |
FF8000 |
FF8000 |
FFC000 |
FBE000 |
F9F000 |
F9F000 |
F8F800 |
F87C00 |
F83E00 |
F83E00 |
F81F00 |
F80F80 |
F807C0 |
ENDCHAR |
STARTCHAR 03BB |
ENCODING 955 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 36 2 0 |
BITMAP |
0F8000 |
0F8000 |
0F8000 |
07C000 |
07C000 |
03C000 |
03E000 |
03E000 |
01F000 |
01F000 |
00F000 |
00F800 |
00F800 |
00FC00 |
00FC00 |
01FC00 |
01FE00 |
01FE00 |
03FF00 |
03FF00 |
07CF00 |
07CF80 |
07CF80 |
0F87C0 |
0F87C0 |
0F83C0 |
1F03E0 |
1F03E0 |
3E01F0 |
3E01F0 |
3E00F0 |
7C00F8 |
7C00F8 |
78007C |
F8007C |
F8007C |
ENDCHAR |
STARTCHAR 03BC |
ENCODING 956 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 26 34 0 -10 |
BITMAP |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F007C00 |
1F807C00 |
1F807E00 |
1F807E00 |
1F80FE00 |
1FE1FE00 |
1F7FDFC0 |
1F7F9FC0 |
1F0E0000 |
1F000000 |
3F000000 |
3E000000 |
3E000000 |
3E000000 |
7C000000 |
7C000000 |
F8000000 |
70000000 |
ENDCHAR |
STARTCHAR 03BD |
ENCODING 957 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 21 24 2 0 |
BITMAP |
F000F8 |
F800F8 |
F800F8 |
7801F0 |
7C01F0 |
7C01F0 |
3C03E0 |
3E03E0 |
3E03E0 |
1E07C0 |
1F07C0 |
1F07C0 |
0F8F80 |
0F8F80 |
0F8F00 |
07DF00 |
07DF00 |
07DE00 |
03FE00 |
03FE00 |
03FC00 |
01FC00 |
01FC00 |
01F800 |
ENDCHAR |
STARTCHAR 03BE |
ENCODING 958 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 46 1 -9 |
BITMAP |
003F80 |
01FFC0 |
03F000 |
07C000 |
0F8000 |
0F8000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F8000 |
0F8000 |
0FC000 |
07E000 |
01F800 |
00F800 |
03F000 |
07C000 |
0F8000 |
1F0000 |
3E0000 |
7C0000 |
7C0000 |
780000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FC0000 |
7C0000 |
7E0000 |
3F0000 |
1FE000 |
07FFE0 |
007FF8 |
00007C |
00007E |
00003E |
00003E |
00003E |
00007C |
000078 |
0001F8 |
0003C0 |
ENDCHAR |
STARTCHAR 03BF |
ENCODING 959 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 25 2 -1 |
BITMAP |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7E00F8 |
7C00F8 |
7C0078 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
780078 |
7C00F8 |
7C00F8 |
3C00F0 |
3E01F0 |
1F03E0 |
0787C0 |
01FE00 |
ENDCHAR |
STARTCHAR 03C0 |
ENCODING 960 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 21 24 2 0 |
BITMAP |
FFFFF8 |
FFFFF8 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
ENDCHAR |
STARTCHAR 03C1 |
ENCODING 961 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 36 2 -12 |
BITMAP |
00FF00 |
03FFC0 |
0F83F0 |
1F01F8 |
1E00F8 |
3C007C |
7C007C |
78003C |
78003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
FC007C |
FC007C |
FC007C |
FE00F8 |
FF01F8 |
FF83F0 |
F9FFC0 |
F87F00 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
ENDCHAR |
STARTCHAR 03C2 |
ENCODING 962 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 34 1 -10 |
BITMAP |
007F80 |
03FF80 |
07E000 |
1F8000 |
1F0000 |
3E0000 |
7E0000 |
7C0000 |
FC0000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
7C0000 |
7C0000 |
3E0000 |
3E0000 |
1F0000 |
0F8000 |
03E000 |
00FF80 |
0003F0 |
0000F8 |
00007C |
00003C |
00003E |
00003E |
00003E |
00007C |
0000F8 |
0000E0 |
ENDCHAR |
STARTCHAR 03C3 |
ENCODING 963 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 25 25 2 -1 |
BITMAP |
01FFFF80 |
07FFFF80 |
1F87E000 |
3F03E000 |
3E01F000 |
7C00F800 |
7C00F800 |
7C00F800 |
F8007C00 |
F8007C00 |
F8007C00 |
F8007C00 |
F8007C00 |
F8007C00 |
F8007C00 |
F8007C00 |
F8007C00 |
7C00F800 |
7C00F800 |
7C00F800 |
3E01F000 |
3F03F000 |
1F87E000 |
0FFFC000 |
01FE0000 |
ENDCHAR |
STARTCHAR 03C4 |
ENCODING 964 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 18 23 0 1 |
BITMAP |
FFFFC0 |
FFFFC0 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
01F000 |
ENDCHAR |
STARTCHAR 03C5 |
ENCODING 965 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 23 25 2 -1 |
BITMAP |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
7C007C |
7C007C |
3E00F8 |
3F01F8 |
0FC7F0 |
07FFC0 |
00FE00 |
ENDCHAR |
STARTCHAR 03C6 |
ENCODING 966 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 26 36 1 -12 |
BITMAP |
00E1E000 |
03823800 |
0F061C00 |
1E040E00 |
3E040700 |
3C040780 |
7C040780 |
780403C0 |
F80403C0 |
F80403C0 |
F80403C0 |
F80403C0 |
F80403C0 |
F80403C0 |
F80403C0 |
780403C0 |
7C0407C0 |
7C040780 |
3C040780 |
3E040F00 |
1F041E00 |
0F043C00 |
03C47800 |
01FFE000 |
003F8000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
00040000 |
ENDCHAR |
STARTCHAR 03C7 |
ENCODING 967 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 36 2 -12 |
BITMAP |
F8001F |
7C003E |
7C003E |
3E007C |
3E007C |
1F00F8 |
1F00F8 |
0F81F0 |
0F81F0 |
07C3E0 |
07C3E0 |
03E7C0 |
03E7C0 |
01FF80 |
01FF80 |
00FF00 |
00FF00 |
007E00 |
007E00 |
007E00 |
007E00 |
00FF00 |
00FF00 |
01FF80 |
01FF80 |
03E7C0 |
03C7C0 |
07C3E0 |
0783E0 |
0F81F0 |
0F01F0 |
1F00F8 |
3E00F8 |
3E007C |
7C003C |
7C003E |
ENDCHAR |
STARTCHAR 03C8 |
ENCODING 968 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 36 2 -12 |
BITMAP |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
F87C7C |
FC7C7C |
7C7CF8 |
7E7CF8 |
3F7DF0 |
1FFFE0 |
01FF00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
007C00 |
ENDCHAR |
STARTCHAR 03C9 |
ENCODING 969 |
SWIDTH 680 0 |
DWIDTH 34 0 |
BBX 30 25 2 -1 |
BITMAP |
00303000 |
00F03C00 |
03C00F00 |
07000380 |
0F0003C0 |
0E0001E0 |
1C0000E0 |
3C0000F0 |
3C0000F0 |
7C0000F8 |
78000078 |
78000078 |
F803007C |
F803007C |
F803007C |
F803007C |
F803007C |
F803007C |
F803007C |
780780F8 |
7C0480F8 |
3C0CC0F0 |
3E1861F0 |
0FF03FC0 |
03800700 |
ENDCHAR |
STARTCHAR 03CA |
ENCODING 970 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 15 32 -1 0 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
0000 |
0000 |
0000 |
3FC0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
07C0 |
3FF0 |
3FF0 |
ENDCHAR |
STARTCHAR 03CB |
ENCODING 971 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 33 2 -1 |
BITMAP |
0F83E0 |
0F83E0 |
0F83E0 |
0F83E0 |
0F83E0 |
000000 |
000000 |
000000 |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
7C007C |
7C007C |
3E00F8 |
3F01F8 |
0FC7F0 |
07FFC0 |
00FE00 |
ENDCHAR |
STARTCHAR 03CC |
ENCODING 972 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 22 35 2 -1 |
BITMAP |
003E00 |
007C00 |
007800 |
00F800 |
00F000 |
01E000 |
03C000 |
00C000 |
000000 |
000000 |
01FE00 |
07FF80 |
1F87E0 |
3F03F0 |
3E01F0 |
7C00F8 |
7C00F8 |
7C00F8 |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
F8007C |
7C00F8 |
7C00F8 |
7C00F8 |
3E01F0 |
3F03F0 |
1F87E0 |
0FFFC0 |
01FE00 |
ENDCHAR |
STARTCHAR 03CD |
ENCODING 973 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 35 2 -1 |
BITMAP |
003E00 |
007C00 |
007800 |
00F800 |
00F000 |
01E000 |
03C000 |
00C000 |
000000 |
000000 |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
F8003E |
7C007C |
7C007C |
3E00F8 |
3F01F8 |
0FC7F0 |
07FFC0 |
00FE00 |
ENDCHAR |
STARTCHAR 03CE |
ENCODING 974 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 30 35 2 -1 |
BITMAP |
0001F000 |
0003E000 |
0003C000 |
0007C000 |
00078000 |
000F0000 |
001E0000 |
00060000 |
00000000 |
00000000 |
00303000 |
00F03C00 |
03C00F00 |
07000380 |
0F0003C0 |
0E0001E0 |
1C0000E0 |
3C0000F0 |
3C0000F0 |
7C0000F8 |
78000078 |
78000078 |
F803007C |
F803007C |
F803007C |
F803007C |
F803007C |
F803007C |
F803007C |
780780F8 |
7C0480F8 |
3C0CC0F0 |
3E1861F0 |
0FF03FC0 |
03800700 |
ENDCHAR |
STARTCHAR 2013 |
ENCODING 8211 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 20 2 2 17 |
BITMAP |
FFFFF0 |
FFFFF0 |
ENDCHAR |
STARTCHAR 2014 |
ENCODING 8212 |
SWIDTH 760 0 |
DWIDTH 38 0 |
BBX 33 2 2 17 |
BITMAP |
FFFFFFFF80 |
FFFFFFFF80 |
ENDCHAR |
STARTCHAR 2018 |
ENCODING 8216 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 10 2 26 |
BITMAP |
18 |
30 |
60 |
C0 |
C0 |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 2019 |
ENCODING 8217 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 10 2 26 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
18 |
18 |
30 |
60 |
C0 |
ENDCHAR |
STARTCHAR 201A |
ENCODING 8218 |
SWIDTH 180 0 |
DWIDTH 9 0 |
BBX 5 10 2 -5 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
38 |
18 |
30 |
60 |
C0 |
ENDCHAR |
STARTCHAR 201C |
ENCODING 8220 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 11 2 25 |
BITMAP |
1806 |
300C |
6018 |
C030 |
C030 |
E038 |
F83E |
F83E |
F83E |
F83E |
F83E |
ENDCHAR |
STARTCHAR 201D |
ENCODING 8221 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 10 2 26 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
380E |
1806 |
300C |
6018 |
C030 |
ENDCHAR |
STARTCHAR 201E |
ENCODING 8222 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 15 10 2 -5 |
BITMAP |
F83E |
F83E |
F83E |
F83E |
F83E |
380E |
1806 |
300C |
6018 |
C030 |
ENDCHAR |
STARTCHAR 2020 |
ENCODING 8224 |
SWIDTH 440 0 |
DWIDTH 22 0 |
BBX 22 45 0 -10 |
BITMAP |
007800 |
007800 |
00FC00 |
00FC00 |
00FC00 |
007800 |
007800 |
007800 |
7C30F8 |
FFB7FC |
FFFFFC |
FFB7FC |
7C30F8 |
003000 |
003000 |
003000 |
007800 |
007800 |
00FC00 |
01FE00 |
00FC00 |
00FC00 |
00FC00 |
007800 |
007800 |
007800 |
007800 |
007800 |
007800 |
007800 |
007000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
003000 |
ENDCHAR |
STARTCHAR 2021 |
ENCODING 8225 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 22 48 -1 -12 |
BITMAP |
007000 |
00F800 |
00F800 |
00F800 |
00F800 |
00F800 |
007000 |
007000 |
7C70F8 |
FFA7FC |
FFFFFC |
FFB7FC |
7C30F8 |
003000 |
003000 |
003000 |
007800 |
007800 |
00FC00 |
01FE00 |
00FC00 |
007800 |
007800 |
003000 |
003000 |
007800 |
007800 |
00FC00 |
01FE00 |
00FC00 |
007800 |
007800 |
003000 |
003000 |
003000 |
7C30F8 |
FFA7FC |
FFFFFC |
FFB7FC |
7C60F8 |
006000 |
00F000 |
00F000 |
00F800 |
00F800 |
00F800 |
00F800 |
007000 |
ENDCHAR |
STARTCHAR 2022 |
ENCODING 8226 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 12 12 2 12 |
BITMAP |
1F00 |
3FC0 |
7FE0 |
FFE0 |
FFF0 |
FFF0 |
FFF0 |
FFF0 |
FFE0 |
7FE0 |
3FC0 |
1F00 |
ENDCHAR |
STARTCHAR 2026 |
ENCODING 8230 |
SWIDTH 860 0 |
DWIDTH 43 0 |
BBX 39 5 2 0 |
BITMAP |
F8007C003E |
F8007C003E |
F8007C003E |
F8007C003E |
F8007C003E |
ENDCHAR |
STARTCHAR 2030 |
ENCODING 8240 |
SWIDTH 780 0 |
DWIDTH 39 0 |
BBX 36 37 2 -1 |
BITMAP |
1E00C00000 |
7F80C00000 |
7380C00000 |
E1C1800000 |
E1C1800000 |
E1C1000000 |
E1C3000000 |
E1C3000000 |
E1C6000000 |
7386000000 |
7F84000000 |
1E0C000000 |
000C000000 |
0008000000 |
0018000000 |
0010000000 |
0030000000 |
0030000000 |
0020000000 |
0060000000 |
0040000000 |
00C0000000 |
00C0000000 |
0080000000 |
0180000000 |
0183C00F80 |
010FF03FE0 |
030E7038E0 |
021C387070 |
061C387070 |
061C387070 |
041C387070 |
0C1C387070 |
081C387070 |
080E7038E0 |
180FF03FE0 |
0003C00F80 |
ENDCHAR |
STARTCHAR 2039 |
ENCODING 8249 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 10 15 1 10 |
BITMAP |
07C0 |
0FC0 |
0F80 |
1F00 |
3E00 |
7C00 |
7C00 |
F800 |
7C00 |
7C00 |
3E00 |
1F00 |
0F80 |
07C0 |
07C0 |
ENDCHAR |
STARTCHAR 203A |
ENCODING 8250 |
SWIDTH 260 0 |
DWIDTH 13 0 |
BBX 10 21 2 7 |
BITMAP |
8000 |
C000 |
E000 |
F000 |
F800 |
7800 |
3C00 |
1E00 |
1F00 |
0F80 |
07C0 |
0F80 |
1F00 |
3E00 |
3C00 |
7800 |
F800 |
F000 |
E000 |
C000 |
8000 |
ENDCHAR |
STARTCHAR 2044 |
ENCODING 8260 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 0 |
BITMAP |
00000060 |
00000040 |
000000C0 |
00000180 |
00000300 |
00000200 |
00000600 |
00000C00 |
00000800 |
00001000 |
00003000 |
00006000 |
00004000 |
0000C000 |
00018000 |
00030000 |
00020000 |
00060000 |
000C0000 |
00180000 |
00100000 |
00300000 |
00600000 |
00400000 |
00C00000 |
01800000 |
03000000 |
02000000 |
06000000 |
0C000000 |
18000000 |
10000000 |
30000000 |
60000000 |
C0000000 |
C0000000 |
ENDCHAR |
STARTCHAR 20AC |
ENCODING 8364 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 37 2 -1 |
BITMAP |
003F80 |
00FBE0 |
01F0F8 |
03E0F8 |
07C07C |
0F807C |
0F8000 |
1F0000 |
1F0000 |
1F0000 |
3E0000 |
3E0000 |
FFFF00 |
FFFF00 |
3E0000 |
3E0000 |
3E0000 |
3E0000 |
3E0000 |
3E0000 |
3E0000 |
3E0000 |
FFFF00 |
FFFF00 |
3E0000 |
3E0000 |
1F0000 |
1F0000 |
1F0000 |
0F0000 |
0F8000 |
0F807C |
07C07C |
03E078 |
01E0F8 |
00FBF0 |
003F80 |
ENDCHAR |
STARTCHAR 2122 |
ENCODING 8482 |
SWIDTH 980 0 |
DWIDTH 49 0 |
BBX 46 21 1 15 |
BITMAP |
FFFFC7FC03FC |
FFFFC7FC03FC |
C1F040FC07E0 |
C1F040FE07E0 |
C1F040FE0FE0 |
01F000FE0FE0 |
01F000DF0FE0 |
01F000DF1BE0 |
01F000DF1BE0 |
01F000CF9BE0 |
01F000CFB3E0 |
01F000CFB3E0 |
01F000C7F3E0 |
01F000C7E3E0 |
01F000C7E3E0 |
01F000C3E3E0 |
01F000C3C3E0 |
01F000C3C3E0 |
01F000C1C3E0 |
0FFE07F98FFC |
0FFE07F98FFC |
ENDCHAR |
STARTCHAR 2202 |
ENCODING 8706 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 22 37 2 -1 |
BITMAP |
01F800 |
079E00 |
0F0F00 |
1F0780 |
3E03C0 |
0003C0 |
0001E0 |
0001E0 |
0001F0 |
0000F0 |
0000F0 |
0000F8 |
0000F8 |
000078 |
000078 |
0003FC |
001FFC |
00FE7C |
03F87C |
07E07C |
1F807C |
3F007C |
3E007C |
7C007C |
7C007C |
F8007C |
F8007C |
F800FC |
F800F8 |
F800F8 |
F801F8 |
7C01F0 |
7C03E0 |
3E07E0 |
1F0FC0 |
0FFF00 |
03F800 |
ENDCHAR |
STARTCHAR 2206 |
ENCODING 8710 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 24 36 3 0 |
BITMAP |
001800 |
001800 |
003C00 |
003C00 |
003C00 |
007E00 |
007E00 |
005E00 |
00DF00 |
00DF00 |
009F00 |
018F00 |
018F80 |
010F80 |
010780 |
0307C0 |
0207C0 |
0203C0 |
0603E0 |
0403E0 |
0403E0 |
0C01E0 |
0801F0 |
0801F0 |
1800F0 |
1000F8 |
1000F8 |
300078 |
20007C |
20007C |
60003C |
40003E |
40003E |
C0003E |
FFFFFE |
FFFFFF |
ENDCHAR |
STARTCHAR 220F |
ENCODING 8719 |
SWIDTH 760 0 |
DWIDTH 38 0 |
BBX 34 48 2 -12 |
BITMAP |
FFFFFFFFC0 |
FFFFFFFFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
FFE001FFC0 |
FFE001FFC0 |
ENDCHAR |
STARTCHAR 2210 |
ENCODING 8720 |
SWIDTH 760 0 |
DWIDTH 38 0 |
BBX 34 48 2 -12 |
BITMAP |
FFE001FFC0 |
FFE001FFC0 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
1F00003E00 |
FFFFFFFFC0 |
FFFFFFFFC0 |
ENDCHAR |
STARTCHAR 2211 |
ENCODING 8721 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 27 46 2 -10 |
BITMAP |
FFFFFFE0 |
7FFFFFE0 |
3C000020 |
3E000020 |
1F000020 |
0F000000 |
0F800000 |
07C00000 |
07C00000 |
03E00000 |
01E00000 |
01F00000 |
00F80000 |
00780000 |
007C0000 |
003E0000 |
003E0000 |
001F0000 |
000F8000 |
000F8000 |
0007C000 |
0003E000 |
0003E000 |
0001C000 |
0001C000 |
00018000 |
00030000 |
00060000 |
000C0000 |
000C0000 |
00180000 |
00300000 |
00600000 |
00600000 |
00C00000 |
01800000 |
03000000 |
02000000 |
06000060 |
0C000060 |
18000060 |
1FFFFFE0 |
3FFFFFE0 |
7FFFFFE0 |
FFFFFFE0 |
FFFFFFE0 |
ENDCHAR |
STARTCHAR 2212 |
ENCODING 8722 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 16 2 2 17 |
BITMAP |
FFFF |
FFFF |
ENDCHAR |
STARTCHAR 2215 |
ENCODING 8725 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 36 1 0 |
BITMAP |
00000060 |
00000040 |
000000C0 |
00000180 |
00000300 |
00000200 |
00000600 |
00000C00 |
00000800 |
00001000 |
00003000 |
00006000 |
00004000 |
0000C000 |
00018000 |
00030000 |
00020000 |
00060000 |
000C0000 |
00180000 |
00100000 |
00300000 |
00600000 |
00400000 |
00C00000 |
01800000 |
03000000 |
02000000 |
06000000 |
0C000000 |
18000000 |
10000000 |
30000000 |
60000000 |
C0000000 |
C0000000 |
ENDCHAR |
STARTCHAR 2219 |
ENCODING 8729 |
SWIDTH 200 0 |
DWIDTH 10 0 |
BBX 5 5 2 19 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 221A |
ENCODING 8730 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 19 38 1 0 |
BITMAP |
000060 |
000040 |
0000C0 |
0000C0 |
0000C0 |
0000C0 |
000080 |
000180 |
000180 |
000180 |
000100 |
000300 |
000300 |
000300 |
000200 |
000600 |
000600 |
000600 |
000400 |
000C00 |
FE0C00 |
3E0C00 |
1E0C00 |
1F0800 |
1F1800 |
0F9800 |
0F9800 |
0F9000 |
07F000 |
07F000 |
03F000 |
03E000 |
03E000 |
01E000 |
01E000 |
00C000 |
00C000 |
00C000 |
ENDCHAR |
STARTCHAR 221E |
ENCODING 8734 |
SWIDTH 740 0 |
DWIDTH 37 0 |
BBX 33 15 2 6 |
BITMAP |
000007E000 |
07E03FFC00 |
1FF8783E00 |
383CE00F00 |
701FC00700 |
E00FC00780 |
E007800380 |
E007800380 |
E007800380 |
E00FC00380 |
700FC00700 |
383CE00F00 |
1FF8783E00 |
07E03FF800 |
00000FE000 |
ENDCHAR |
STARTCHAR 221F |
ENCODING 8735 |
SWIDTH 580 0 |
DWIDTH 29 0 |
BBX 27 35 2 0 |
BITMAP |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
F8000000 |
FFFFFFE0 |
7FFFFFE0 |
ENDCHAR |
STARTCHAR 222B |
ENCODING 8747 |
SWIDTH 360 0 |
DWIDTH 18 0 |
BBX 17 48 1 -12 |
BITMAP |
00FC00 |
01FE00 |
03FF00 |
03FF00 |
03EF80 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
03E000 |
FBE000 |
7FE000 |
7FE000 |
3FC000 |
1F8000 |
ENDCHAR |
STARTCHAR 2248 |
ENCODING 8776 |
SWIDTH 520 0 |
DWIDTH 26 0 |
BBX 23 15 2 12 |
BITMAP |
0FC000 |
3FF07E |
7CF8FC |
F83FF0 |
000FC0 |
000000 |
000000 |
000000 |
000000 |
000000 |
0FC000 |
3FF07E |
7CF8FC |
F83FF0 |
000FC0 |
ENDCHAR |
STARTCHAR 2249 |
ENCODING 8777 |
SWIDTH 500 0 |
DWIDTH 25 0 |
BBX 23 26 1 6 |
BITMAP |
0007C0 |
000780 |
000F80 |
000F80 |
000F00 |
001F00 |
1FFF00 |
7EFE7C |
F87EF8 |
003FF0 |
007C00 |
007C00 |
007C00 |
00F800 |
00F800 |
0FF800 |
3FF03E |
7DFC7C |
F9FFF0 |
03E7C0 |
03E000 |
03E000 |
07C000 |
07C000 |
07C000 |
0F8000 |
ENDCHAR |
STARTCHAR 2260 |
ENCODING 8800 |
SWIDTH 400 0 |
DWIDTH 20 0 |
BBX 18 27 1 5 |
BITMAP |
0007C0 |
0007C0 |
000F80 |
000F80 |
001F00 |
003F00 |
FFFF80 |
FFFF80 |
007C00 |
007C00 |
00F800 |
01F000 |
01F000 |
03E000 |
03E000 |
07C000 |
07C000 |
FFFF80 |
FFFF80 |
1F0000 |
1F0000 |
3E0000 |
3E0000 |
7E0000 |
7C0000 |
FC0000 |
180000 |
ENDCHAR |
STARTCHAR 2261 |
ENCODING 8801 |
SWIDTH 380 0 |
DWIDTH 19 0 |
BBX 17 22 1 7 |
BITMAP |
FFFF80 |
FFFF80 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
FFFF80 |
FFFF80 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
000000 |
FFFF80 |
FFFF80 |
ENDCHAR |
STARTCHAR 2262 |
ENCODING 8802 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 19 33 1 2 |
BITMAP |
0003E0 |
0003E0 |
0007C0 |
0007C0 |
000F80 |
000F80 |
FFFF80 |
FFFF80 |
001F00 |
003E00 |
003E00 |
007C00 |
007C00 |
00F800 |
00F800 |
00F000 |
FFFF80 |
FFFF80 |
03E000 |
03E000 |
03C000 |
07C000 |
07C000 |
0F8000 |
0F8000 |
1F0000 |
FFFF80 |
FFFF80 |
3E0000 |
3E0000 |
7C0000 |
7C0000 |
F80000 |
ENDCHAR |
STARTCHAR 2264 |
ENCODING 8804 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 24 31 2 2 |
BITMAP |
00001E |
00007C |
0001F8 |
0003E0 |
000F80 |
003F00 |
007C00 |
01F800 |
07E000 |
0F8000 |
3F0000 |
7C0000 |
F00000 |
FC0000 |
3E0000 |
0F8000 |
07E000 |
01F000 |
007C00 |
003F00 |
000F80 |
0007E0 |
0001F0 |
00007C |
00003F |
000000 |
000000 |
000000 |
000000 |
7FFFF8 |
7FFFF8 |
ENDCHAR |
STARTCHAR 2265 |
ENCODING 8805 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 24 30 2 3 |
BITMAP |
F80000 |
7C0000 |
1F0000 |
0FC000 |
03E000 |
01F800 |
007C00 |
001F00 |
000FC0 |
0003E0 |
0000F8 |
00007E |
00001F |
00007C |
0001F8 |
0003E0 |
000FC0 |
001F00 |
007C00 |
01F800 |
03E000 |
0F8000 |
3F0000 |
7C0000 |
780000 |
000000 |
000000 |
000000 |
7FFFF8 |
7FFFF8 |
ENDCHAR |
STARTCHAR 226E |
ENCODING 8814 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 34 2 1 |
BITMAP |
0001F0 |
0001F0 |
0001F0 |
0003E0 |
0003E0 |
0003FF |
0003FC |
0007F8 |
0007E0 |
000FC0 |
001FC0 |
007F80 |
01FF80 |
03EF80 |
0F8F80 |
3F1F00 |
7C1F00 |
F81F00 |
7E1E00 |
1F3E00 |
0FFE00 |
03FE00 |
00FC00 |
007E00 |
007F80 |
007FC0 |
007BF0 |
00F8F8 |
00F83E |
00F800 |
01F000 |
01F000 |
01F000 |
01F000 |
ENDCHAR |
STARTCHAR 226F |
ENCODING 8815 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 24 34 2 1 |
BITMAP |
0F8000 |
0F8000 |
0F8000 |
0F8000 |
07C000 |
FFC000 |
7FC000 |
1FC000 |
07E000 |
03F000 |
03F800 |
03FE00 |
01FF80 |
01F7C0 |
01F1F0 |
00F0F8 |
00F83E |
00F81F |
00F87E |
0079F8 |
007FE0 |
007FC0 |
007F00 |
007C00 |
01FE00 |
07FE00 |
0FBE00 |
3E1E00 |
FC1F00 |
001F00 |
001F00 |
000F80 |
000F80 |
000F80 |
ENDCHAR |
STARTCHAR 2310 |
ENCODING 8976 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 25 12 2 12 |
BITMAP |
FFFFFF80 |
FFFFFF80 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
C0000000 |
ENDCHAR |
STARTCHAR 2500 |
ENCODING 9472 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 27 2 2 17 |
BITMAP |
FFFFFFE0 |
FFFFFFE0 |
ENDCHAR |
STARTCHAR 2502 |
ENCODING 9474 |
SWIDTH 200 0 |
DWIDTH 10 0 |
BBX 5 36 2 0 |
BITMAP |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
F8 |
ENDCHAR |
STARTCHAR 250C |
ENCODING 9484 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 24 2 0 |
BITMAP |
7FFFF0 |
FFFFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
ENDCHAR |
STARTCHAR 2510 |
ENCODING 9488 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 24 1 0 |
BITMAP |
FFFFE0 |
FFFFF0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
ENDCHAR |
STARTCHAR 2514 |
ENCODING 9492 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 19 2 17 |
BITMAP |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFF0 |
7FFFF0 |
ENDCHAR |
STARTCHAR 2518 |
ENCODING 9496 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 19 1 17 |
BITMAP |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
FFFFF0 |
FFFFE0 |
ENDCHAR |
STARTCHAR 251C |
ENCODING 9500 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 18 36 2 0 |
BITMAP |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFC0 |
FFFFC0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
ENDCHAR |
STARTCHAR 2524 |
ENCODING 9508 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 18 36 1 0 |
BITMAP |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
FFFFC0 |
FFFFC0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
ENDCHAR |
STARTCHAR 252C |
ENCODING 9516 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 19 1 0 |
BITMAP |
FFFFFFF8 |
FFFFFFF8 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
ENDCHAR |
STARTCHAR 2534 |
ENCODING 9524 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 22 1 14 |
BITMAP |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
FFFFFFF8 |
FFFFFFF8 |
ENDCHAR |
STARTCHAR 253C |
ENCODING 9532 |
SWIDTH 560 0 |
DWIDTH 28 0 |
BBX 27 36 1 0 |
BITMAP |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
FFFFFFE0 |
FFFFFFE0 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
ENDCHAR |
STARTCHAR 2550 |
ENCODING 9552 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 27 9 2 10 |
BITMAP |
FFFFFFE0 |
FFFFFFE0 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFFFFFE0 |
FFFFFFE0 |
ENDCHAR |
STARTCHAR 2551 |
ENCODING 9553 |
SWIDTH 320 0 |
DWIDTH 16 0 |
BBX 12 36 2 0 |
BITMAP |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
F9F0 |
ENDCHAR |
STARTCHAR 2552 |
ENCODING 9554 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 19 2 0 |
BITMAP |
7FFFF0 |
FFFFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFF0 |
FFFFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
ENDCHAR |
STARTCHAR 2553 |
ENCODING 9555 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 19 2 0 |
BITMAP |
7FFFF0 |
FFFFF0 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
ENDCHAR |
STARTCHAR 2554 |
ENCODING 9556 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 19 2 0 |
BITMAP |
7FFFF0 |
FFFFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F8FFF0 |
F9FFF0 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
ENDCHAR |
STARTCHAR 2555 |
ENCODING 9557 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 19 1 0 |
BITMAP |
FFFFE0 |
FFFFF0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
FFFFF0 |
FFFFF0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
ENDCHAR |
STARTCHAR 2556 |
ENCODING 9558 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 19 1 0 |
BITMAP |
FFFFF0 |
FFFFF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
ENDCHAR |
STARTCHAR 2557 |
ENCODING 9559 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 20 19 2 0 |
BITMAP |
FFFFE0 |
FFFFF0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
FFF9F0 |
FFFDF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
ENDCHAR |
STARTCHAR 2558 |
ENCODING 9560 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 24 2 12 |
BITMAP |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFF0 |
FFFFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFF0 |
7FFFF0 |
ENDCHAR |
STARTCHAR 2559 |
ENCODING 9561 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 21 2 15 |
BITMAP |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
FFFFF0 |
7FFFF0 |
ENDCHAR |
STARTCHAR 255A |
ENCODING 9562 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 24 2 12 |
BITMAP |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9FFF0 |
F8FFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFF0 |
7FFFF0 |
ENDCHAR |
STARTCHAR 255B |
ENCODING 9563 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 24 1 12 |
BITMAP |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
FFFFF0 |
FFFFF0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
FFFFF0 |
FFFFE0 |
ENDCHAR |
STARTCHAR 255C |
ENCODING 9564 |
SWIDTH 480 0 |
DWIDTH 24 0 |
BBX 21 21 1 15 |
BITMAP |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
FFFFF8 |
FFFFF0 |
ENDCHAR |
STARTCHAR 255D |
ENCODING 9565 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 24 1 12 |
BITMAP |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
007DF0 |
FFFDF0 |
FFF9F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
0001F0 |
FFFFF0 |
FFFFE0 |
ENDCHAR |
STARTCHAR 255E |
ENCODING 9566 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 18 36 2 0 |
BITMAP |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFC0 |
FFFFC0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
FFFFC0 |
FFFFC0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
ENDCHAR |
STARTCHAR 255F |
ENCODING 9567 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 36 2 0 |
BITMAP |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9FFF0 |
F9FFF0 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
ENDCHAR |
STARTCHAR 2560 |
ENCODING 9568 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 36 2 0 |
BITMAP |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9FFF0 |
F8FFF0 |
F80000 |
F80000 |
F80000 |
F80000 |
F80000 |
F8FFF0 |
F9FFF0 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
F9F000 |
ENDCHAR |
STARTCHAR 2561 |
ENCODING 9569 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 18 38 1 -2 |
BITMAP |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
FFFFC0 |
FFFFC0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
FFFFC0 |
FFFFC0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
0007C0 |
ENDCHAR |
STARTCHAR 2562 |
ENCODING 9570 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 21 36 0 0 |
BITMAP |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
FFFCF8 |
FFFCF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
ENDCHAR |
STARTCHAR 2563 |
ENCODING 9571 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 21 36 0 0 |
BITMAP |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
FFFCF8 |
FFF8F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
0000F8 |
FFF8F8 |
FFFCF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
007CF8 |
ENDCHAR |
STARTCHAR 2564 |
ENCODING 9572 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 19 1 0 |
BITMAP |
FFFFFFF0 |
FFFFFFF0 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFFFFFF8 |
FFFFFFF8 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
ENDCHAR |
STARTCHAR 2565 |
ENCODING 9573 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 28 19 1 0 |
BITMAP |
FFFFFFF0 |
FFFFFFF0 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
ENDCHAR |
STARTCHAR 2566 |
ENCODING 9574 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 28 19 1 0 |
BITMAP |
FFFFFFF0 |
FFFFFFF0 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFF8FFE0 |
FFFDFC00 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
ENDCHAR |
STARTCHAR 2567 |
ENCODING 9575 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 24 1 12 |
BITMAP |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
000F8000 |
FFFFFFF8 |
FFFFFFF8 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFFFFFF0 |
FFFFFFF0 |
ENDCHAR |
STARTCHAR 2568 |
ENCODING 9576 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 28 22 1 14 |
BITMAP |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
FFFFFFF0 |
FFFFFFF0 |
ENDCHAR |
STARTCHAR 2569 |
ENCODING 9577 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 28 24 1 12 |
BITMAP |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
FFFDFFF0 |
FFF8FFF0 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFFFFFF0 |
FFFFFFF0 |
ENDCHAR |
STARTCHAR 256A |
ENCODING 9578 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 29 36 1 0 |
BITMAP |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
FFFFFFF8 |
FFFFFFF8 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
FFFFFFF8 |
FFFFFFF8 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
001F0000 |
ENDCHAR |
STARTCHAR 256B |
ENCODING 9579 |
SWIDTH 600 0 |
DWIDTH 30 0 |
BBX 28 36 1 0 |
BITMAP |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
FFFFFFF0 |
FFFFFFF0 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
007DF000 |
ENDCHAR |
STARTCHAR 256C |
ENCODING 9580 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 36 1 0 |
BITMAP |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
FFFCFFF8 |
FFF87FF8 |
00000000 |
00000000 |
00000000 |
00000000 |
00000000 |
FFF87FF8 |
FFFCFFF8 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
007CF800 |
ENDCHAR |
STARTCHAR 263A |
ENCODING 9786 |
SWIDTH 860 0 |
DWIDTH 43 0 |
BBX 39 40 2 0 |
BITMAP |
0001FE0000 |
000FFFE000 |
003E01F800 |
00F0003C00 |
01C0000F00 |
0300000380 |
06000001C0 |
0C000000E0 |
1800000060 |
1000000030 |
2000000038 |
6000000018 |
4007C3E01C |
4007C3E00C |
4007C3E00C |
8007C3E00C |
8000000006 |
8000000006 |
8000000006 |
8000000006 |
8000000006 |
8000000006 |
8000000006 |
8000000006 |
804000080E |
404000080C |
406000180C |
403000301C |
6018006018 |
200F01C038 |
1003FF0030 |
1800FC0060 |
0C000000E0 |
06000001C0 |
0300000380 |
01C0000F00 |
00E0003C00 |
003E01F800 |
000FFFE000 |
0001FE0000 |
ENDCHAR |
STARTCHAR 2640 |
ENCODING 9792 |
SWIDTH 620 0 |
DWIDTH 31 0 |
BBX 29 42 1 -4 |
BITMAP |
001FC000 |
00FFF800 |
01E03E00 |
03000F00 |
0E000380 |
0C0001C0 |
180000E0 |
30000060 |
20000070 |
60000030 |
40000030 |
40000018 |
40000018 |
40000018 |
C0000018 |
40000018 |
40000018 |
40000018 |
40000030 |
60000030 |
20000070 |
30000060 |
180000E0 |
0C0001C0 |
0E000380 |
07000F00 |
01E03E00 |
00FFF800 |
001FE000 |
00030000 |
00030000 |
00030000 |
00030000 |
00030000 |
00030000 |
00030000 |
00FFF800 |
00FFF800 |
00030000 |
00030000 |
00030000 |
00030000 |
ENDCHAR |
STARTCHAR 2641 |
ENCODING 9793 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 1 1 0 0 |
BITMAP |
00 |
ENDCHAR |
STARTCHAR 2642 |
ENCODING 9794 |
SWIDTH 740 0 |
DWIDTH 37 0 |
BBX 33 33 2 0 |
BITMAP |
0000007F80 |
0000007F80 |
0000000380 |
0000000580 |
0000001980 |
003F803180 |
00FFF06180 |
03C07CC180 |
06001F8000 |
1C00070000 |
1000038000 |
200001C000 |
600000C000 |
4000006000 |
C000006000 |
8000006000 |
8000003000 |
8000003000 |
8000003000 |
8000003000 |
8000003000 |
8000003000 |
8000007000 |
8000006000 |
4000006000 |
600000C000 |
200001C000 |
1000038000 |
1C00070000 |
06001E0000 |
03C07C0000 |
00FFF00000 |
003FC00000 |
ENDCHAR |
STARTCHAR 2663 |
ENCODING 9827 |
SWIDTH 660 0 |
DWIDTH 33 0 |
BBX 32 34 1 0 |
BITMAP |
0007E000 |
001FF800 |
003FFC00 |
007FFE00 |
007FFE00 |
00FFFF00 |
00FFFF00 |
00FFFF00 |
00FFFF00 |
00FFFF00 |
00FFFF00 |
00FFFF00 |
01FFFF80 |
0FFFFFF0 |
1FFFFFF8 |
3FFFFFFC |
7FFFFFFE |
7FFFFFFE |
7FFFFFFE |
FFFFFFFF |
FFFFFFFF |
7FFFFFFF |
7FFFFFFE |
7FFFFFFE |
3FFFFFFC |
3FFFFFFC |
1FFDBFF8 |
07F18FE0 |
00018000 |
00018000 |
00018000 |
00018000 |
0007F000 |
0007F000 |
ENDCHAR |
STARTCHAR 2665 |
ENCODING 9829 |
SWIDTH 700 0 |
DWIDTH 35 0 |
BBX 32 34 2 1 |
BITMAP |
07E007C0 |
1FF81FF0 |
3FFC7FF8 |
7FFE7FFC |
7FFEFFFE |
FFFFFFFE |
FFFFFFFE |
FFFFFFFF |
FFFFFFFF |
FFFFFFFF |
FFFFFFFF |
FFFFFFFF |
FFFFFFFE |
FFFFFFFE |
7FFFFFFE |
7FFFFFFC |
7FFFFFFC |
3FFFFFFC |
3FFFFFF8 |
1FFFFFF8 |
1FFFFFF0 |
0FFFFFE0 |
07FFFFE0 |
07FFFFC0 |
03FFFF80 |
01FFFF80 |
00FFFF00 |
00FFFE00 |
007FFC00 |
003FF800 |
001FF000 |
000FE000 |
0003C000 |
00010000 |
ENDCHAR |
STARTCHAR 2666 |
ENCODING 9830 |
SWIDTH 540 0 |
DWIDTH 27 0 |
BBX 24 38 1 -1 |
BITMAP |
000800 |
001800 |
001C00 |
003E00 |
007E00 |
007F00 |
00FF00 |
00FF80 |
01FFC0 |
03FFC0 |
03FFE0 |
07FFF0 |
0FFFF0 |
0FFFF8 |
1FFFFC |
3FFFFC |
3FFFFE |
7FFFFE |
7FFFFF |
FFFFFF |
7FFFFF |
3FFFFE |
3FFFFC |
1FFFFC |
1FFFF8 |
0FFFF8 |
07FFF0 |
07FFE0 |
03FFE0 |
01FFC0 |
01FF80 |
00FF80 |
007F00 |
007E00 |
003E00 |
001C00 |
001800 |
000800 |
ENDCHAR |
STARTCHAR 2669 |
ENCODING 9833 |
SWIDTH 420 0 |
DWIDTH 21 0 |
BBX 19 37 0 0 |
BITMAP |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
000060 |
01FC60 |
07FF60 |
1FFFE0 |
3FFFE0 |
7FFFE0 |
7FFFE0 |
FFFFE0 |
7FFFC0 |
7FFF80 |
3FFF00 |
1FFE00 |
07F000 |
ENDCHAR |
STARTCHAR 266A |
ENCODING 9834 |
SWIDTH 640 0 |
DWIDTH 32 0 |
BBX 31 39 0 -1 |
BITMAP |
00006000 |
00006000 |
00006000 |
00007F80 |
00007FE0 |
000061F0 |
000060F8 |
000060F8 |
00006078 |
0000607C |
0000607C |
0000603E |
00006010 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
00006000 |
01FC6000 |
0FFF6000 |
1FFFE000 |
3FFFE000 |
7FFFE000 |
7FFFE000 |
FFFFE000 |
7FFFC000 |
7FFF8000 |
3FFF0000 |
1FFE0000 |
07F00000 |
ENDCHAR |
STARTCHAR 266B |
ENCODING 9835 |
SWIDTH 840 0 |
DWIDTH 42 0 |
BBX 39 44 1 -4 |
BITMAP |
0000000006 |
00000000FE |
0000001FFE |
000001FFFE |
00003FFFFE |
00007FFF86 |
00007FF806 |
00007F0006 |
0000700006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000603FE6 |
000060FFFE |
000061FFFE |
000063FFFE |
01FC67FFFE |
0FFF67FFFE |
1FFFEFFFFE |
3FFFE7FFFC |
7FFFE7FFF8 |
7FFFE3FFF0 |
FFFFE1FFC0 |
7FFFC00800 |
7FFFC00000 |
3FFF000000 |
1FFE000000 |
07F0000000 |
ENDCHAR |
STARTCHAR 266C |
ENCODING 9836 |
SWIDTH 840 0 |
DWIDTH 42 0 |
BBX 39 43 1 -2 |
BITMAP |
0000000006 |
00000000FE |
0000001FFE |
000003FFFE |
00003FFFE6 |
00007FFC06 |
00007FC006 |
0000780006 |
0000600006 |
0000600006 |
0000600006 |
000060001E |
00006003FE |
0000603FFE |
000067FFF6 |
00007FFF06 |
00007FE006 |
00007E0006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000600006 |
0000601FC6 |
000060FFF6 |
000061FFFE |
000063FFFE |
007867FFFE |
07FF67FFFE |
1FFFEFFFFE |
3FFFE7FFFC |
7FFFE7FFF8 |
7FFFE3FFF0 |
FFFFE1FFE0 |
7FFFC07F00 |
7FFFC00000 |
3FFF000000 |
1FFE000000 |
07F0000000 |
ENDCHAR |
STARTCHAR FB01 |
ENCODING 64257 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 20 36 1 0 |
BITMAP |
03E000 |
0FF800 |
0F9800 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
1F0000 |
FFFFC0 |
FFE7C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
FFFFF0 |
FFFFF0 |
ENDCHAR |
STARTCHAR FB02 |
ENCODING 64258 |
SWIDTH 460 0 |
DWIDTH 23 0 |
BBX 21 36 1 0 |
BITMAP |
03FFC0 |
0FFFC0 |
0F9FC0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
FFE7C0 |
FFE7C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
1F07C0 |
FFFFF8 |
FFFFF8 |
ENDCHAR |
ENDFONT |
/contrib/sdk/sources/SDL-1.2.2/SDL_bdf-1.2/showbdf.c |
---|
0,0 → 1,185 |
/* |
showbdf - shows a BDF font on the screen |
Placed in the public domain by Andre de Leiradella on 21-jan-2003. |
You'll need SDL, SDLmain and SDL_gfxPrimitives to compile this program. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <mem.h> |
#include <SDL.h> |
#include <SDL_main.h> |
#include "SDL_bdf.h" |
#include "SDL_gfxPrimitives.h" |
/* Reads a byte from a rwops. */ |
static int ReadByteRwops(void *info) { |
unsigned char b; |
if (SDL_RWread((SDL_RWops *)info, &b, 1, 1) != 1) |
return -1; |
return b; |
} |
/* Put a pixel on a SDL surface. */ |
static void PutPixel(void *surface, int x, int y, unsigned int color) { |
pixelColor((SDL_Surface *)surface, (Sint16)x, (Sint16)y, (Uint32)color); |
} |
/* Put a pixel on a b&w surface with 1 bit per pixel. The first 4 bytes hold the width of the surface. */ |
static void PutBWPixel(void *surface, int x, int y, unsigned int color) { |
(void)color; |
y *= *(int *)surface; |
((unsigned char *)surface)[y + x / 8 + sizeof(int)] |= 1 << (x & 7); |
} |
/* |
Example showing how to simulate anti-aliased text reducing the size of an |
image. This function will render a text to a new SDL_Surface. |
*/ |
static SDL_Surface *DrawAAH(BDF_Font *font, char *text, int entities, Uint8 r0, Uint8 g0, Uint8 b0, Uint8 r, Uint8 g, Uint8 b) { |
SDL_Surface *surface; |
int x0, y0, w, h, a; |
unsigned char *pixels, *aux, *endimage, *endline; |
static Uint8 alpha[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; |
if (entities) |
BDF_SizeEntitiesH(font, text, &x0, &y0, &w, &h); |
else |
BDF_SizeH(font, text, &x0, &y0, &w, &h); |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
surface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA, (w + 3) / 4, (h + 3) / 4, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); |
#else |
surface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA, (w + 3) / 4, (h + 3) / 4, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); |
#endif |
if (surface == NULL) |
return NULL; |
boxRGBA(surface, 0, 0, surface->w - 1, surface->h - 1, r0, g0, b0, 255); |
w = (w + 7) / 8; |
h = ((h + 3) / 4) * 4; |
a = w * h * + sizeof(int); |
pixels = (unsigned char *)malloc(a); |
if (pixels == NULL) { |
SDL_OutOfMemory(); |
SDL_FreeSurface(surface); |
return NULL; |
} |
memset(pixels, 0, a); |
*(int *)pixels = w; |
if (entities) |
BDF_DrawEntitiesH(pixels, PutBWPixel, font, text, x0, y0, 0); |
else |
BDF_DrawH(pixels, PutBWPixel, font, text, x0, y0, 0); |
aux = pixels + sizeof(int); |
endimage = aux + w * h; |
for (y0 = 0; aux < endimage; y0++, aux += w * 3) |
for (endline = aux + w, x0 = 0; aux < endline; x0 += 2, aux++) { |
a = alpha[aux[0] & 15]; |
a += alpha[aux[w] & 15]; |
a += alpha[aux[w * 2] & 15]; |
a += alpha[aux[w * 3] & 15]; |
pixelRGBA(surface, x0, y0, r, g, b, a * 255 / 16); |
a = alpha[(aux[0] >> 4) & 15]; |
a += alpha[(aux[w] >> 4) & 15]; |
a += alpha[(aux[w * 2] >> 4) & 15]; |
a += alpha[(aux[w * 3] >> 4) & 15]; |
pixelRGBA(surface, x0 + 1, y0, r, g, b, a * 255 / 16); |
} |
free(pixels); |
return surface; |
} |
/* Calls DrawAAH to render the text without support to entities. */ |
static SDL_Surface *RenderAAH(BDF_Font *font, char *text, Uint8 r0, Uint8 g0, Uint8 b0, Uint8 r, Uint8 g, Uint8 b) { |
return DrawAAH(font, text, 0, r0, g0, b0, r, g, b); |
} |
/* Calls DrawAAH to render the text with support to entities. */ |
static SDL_Surface *RenderEntitiesAAH(BDF_Font *font, char *text, Uint8 r0, Uint8 g0, Uint8 b0, Uint8 r, Uint8 g, Uint8 b) { |
return DrawAAH(font, text, 1, r0, g0, b0, r, g, b); |
} |
int main(int argc, char *argv[]) { |
SDL_RWops *rwops; |
BDF_Font *font; |
SDL_Surface *screen, *aatext; |
int x0, y0, w, h; |
SDL_Rect pos; |
SDL_Event event; |
char *text = "The quick fox jumped over the lazy dog"; |
if (argc != 2) { |
fprintf(stderr, "Usage: showbdf <file.bdf>\n"); |
return -1; |
} |
/* Reads the font. */ |
rwops = SDL_RWFromFile(argv[1], "rb"); |
font = BDF_OpenFont(ReadByteRwops, (void *)rwops, &w); |
SDL_RWclose(rwops); |
/* Check for error code. */ |
switch (w) { |
case BDF_MEMORYERROR: |
fprintf(stderr, "Not enough memory reading BDF font\n"); |
return -1; |
case BDF_READERROR: |
fprintf(stderr, "Error while reading BDF font\n"); |
return -1; |
case BDF_WRONGVERSION: |
fprintf(stderr, "Wrong BDF font version, can only handle versions up to 2.2\n"); |
return -1; |
case BDF_CANNOTHANDLEVERTICAL: |
fprintf(stderr, "Wrong BDF font direction, can only handle horizontal direction\n"); |
return -1; |
case BDF_TOOMANYCHARACTERS: |
case BDF_TOOFEWCHARACTERS: |
case BDF_PARSEERROR: |
fprintf(stderr, "Invalid BDF font\n"); |
return -1; |
} |
/* Init SDL. */ |
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { |
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); |
return -1; |
} |
atexit(SDL_Quit); |
/* Check the size of the image required to acomodate the rendered text. */ |
BDF_SizeH(font, text, &x0, &y0, &w, &h); |
/* Set the video a little bit bigger than the minimum. */ |
screen = SDL_SetVideoMode(w + 10, h + 15 + (h + 3) / 4, 0, SDL_SWSURFACE); |
if (screen == NULL) { |
fprintf(stderr, "Couldn't set %dx%d video mode: %s\n", w + 10, h + 15 + (h + 3) / 4, SDL_GetError()); |
return -1; |
} |
/* Clear the screen to white. */ |
boxColor(screen, 0, 0, screen->w - 1, screen->h - 1, 0xFFFFFFFF); |
/* Render the text to the screen with black. */ |
BDF_DrawH((void *)screen, PutPixel, font, text, x0 + 5, y0 + 5, 0x000000FF); |
/* Render the same text with white blackgorund and black foreground to a new surface. */ |
aatext = RenderAAH(font, text, 255, 255, 255, 0, 0, 0); |
if (aatext == NULL) { |
fprintf(stderr, "Couldn't render anti-aliased text: %s\n", SDL_GetError()); |
return -1; |
} |
/* Blit it to the screen. */ |
pos.x = (screen->w - aatext->w) / 2; |
pos.y = h + 5 + aatext->h / 2; |
SDL_BlitSurface(aatext, NULL, screen, &pos); |
SDL_FreeSurface(aatext); |
/* Update the screen. */ |
SDL_UpdateRect(screen, 0, 0, 0, 0); |
/* Wait for something to happen... */ |
for(;;) { |
if (SDL_WaitEvent(&event) < 0) { |
fprintf(stderr, "SDL_PullEvent() error: %s\n", SDL_GetError()); |
return -1; |
} |
switch (event.type) { |
case SDL_MOUSEBUTTONDOWN: |
case SDL_KEYDOWN: |
case SDL_QUIT: |
BDF_CloseFont(font); |
return 0; |
} |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/AUTHORS |
---|
0,0 → 1,3 |
Mario Palomo Torrero <mpalomo@ihman.com> |
Jose M. de la Huerga Fernández |
Pepe González Mora |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/COPYING |
---|
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 |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/INSTALL |
---|
0,0 → 1,182 |
Basic Installation |
================== |
These are generic installation instructions. |
The `configure' shell script attempts to guess correct values for |
various system-dependent variables used during compilation. It uses |
those values to create a `Makefile' in each directory of the package. |
It may also create one or more `.h' files containing system-dependent |
definitions. Finally, it creates a shell script `config.status' that |
you can run in the future to recreate the current configuration, a file |
`config.cache' that saves the results of its tests to speed up |
reconfiguring, and a file `config.log' containing compiler output |
(useful mainly for debugging `configure'). |
If you need to do unusual things to compile the package, please try |
to figure out how `configure' could check whether to do them, and mail |
diffs or instructions to the address given in the `README' so they can |
be considered for the next release. If at some point `config.cache' |
contains results you don't want to keep, you may remove or edit it. |
The file `configure.in' is used to create `configure' by a program |
called `autoconf'. You only need `configure.in' if you want to change |
it or regenerate `configure' using a newer version of `autoconf'. |
The simplest way to compile this package is: |
1. `cd' to the directory containing the package's source code and type |
`./configure' to configure the package for your system. If you're |
using `csh' on an old version of System V, you might need to type |
`sh ./configure' instead to prevent `csh' from trying to execute |
`configure' itself. |
Running `configure' takes awhile. While running, it prints some |
messages telling which features it is checking for. |
2. Type `make' to compile the package. |
3. Optionally, type `make check' to run any self-tests that come with |
the package. |
4. Type `make install' to install the programs and any data files and |
documentation. |
5. You can remove the program binaries and object files from the |
source code directory by typing `make clean'. To also remove the |
files that `configure' created (so you can compile the package for |
a different kind of computer), type `make distclean'. There is |
also a `make maintainer-clean' target, but that is intended mainly |
for the package's developers. If you use it, you may have to get |
all sorts of other programs in order to regenerate files that came |
with the distribution. |
Compilers and Options |
===================== |
Some systems require unusual options for compilation or linking that |
the `configure' script does not know about. You can give `configure' |
initial values for variables by setting them in the environment. Using |
a Bourne-compatible shell, you can do that on the command line like |
this: |
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure |
Or on systems that have the `env' program, you can do it like this: |
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure |
Compiling For Multiple Architectures |
==================================== |
You can compile the package for more than one kind of computer at the |
same time, by placing the object files for each architecture in their |
own directory. To do this, you must use a version of `make' that |
supports the `VPATH' variable, such as GNU `make'. `cd' to the |
directory where you want the object files and executables to go and run |
the `configure' script. `configure' automatically checks for the |
source code in the directory that `configure' is in and in `..'. |
If you have to use a `make' that does not supports the `VPATH' |
variable, you have to compile the package for one architecture at a time |
in the source code directory. After you have installed the package for |
one architecture, use `make distclean' before reconfiguring for another |
architecture. |
Installation Names |
================== |
By default, `make install' will install the package's files in |
`/usr/local/bin', `/usr/local/man', etc. You can specify an |
installation prefix other than `/usr/local' by giving `configure' the |
option `--prefix=PATH'. |
You can specify separate installation prefixes for |
architecture-specific files and architecture-independent files. If you |
give `configure' the option `--exec-prefix=PATH', the package will use |
PATH as the prefix for installing programs and libraries. |
Documentation and other data files will still use the regular prefix. |
In addition, if you use an unusual directory layout you can give |
options like `--bindir=PATH' to specify different values for particular |
kinds of files. Run `configure --help' for a list of the directories |
you can set and what kinds of files go in them. |
If the package supports it, you can cause programs to be installed |
with an extra prefix or suffix on their names by giving `configure' the |
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. |
Optional Features |
================= |
Some packages pay attention to `--enable-FEATURE' options to |
`configure', where FEATURE indicates an optional part of the package. |
They may also pay attention to `--with-PACKAGE' options, where PACKAGE |
is something like `gnu-as' or `x' (for the X Window System). The |
`README' should mention any `--enable-' and `--with-' options that the |
package recognizes. |
For packages that use the X Window System, `configure' can usually |
find the X include and library files automatically, but if it doesn't, |
you can use the `configure' options `--x-includes=DIR' and |
`--x-libraries=DIR' to specify their locations. |
Specifying the System Type |
========================== |
There may be some features `configure' can not figure out |
automatically, but needs to determine by the type of host the package |
will run on. Usually `configure' can figure that out, but if it prints |
a message saying it can not guess the host type, give it the |
`--host=TYPE' option. TYPE can either be a short name for the system |
type, such as `sun4', or a canonical name with three fields: |
CPU-COMPANY-SYSTEM |
See the file `config.sub' for the possible values of each field. If |
`config.sub' isn't included in this package, then this package doesn't |
need to know the host type. |
If you are building compiler tools for cross-compiling, you can also |
use the `--target=TYPE' option to select the type of system they will |
produce code for and the `--build=TYPE' option to select the type of |
system on which you are compiling the package. |
Sharing Defaults |
================ |
If you want to set default values for `configure' scripts to share, |
you can create a site shell script called `config.site' that gives |
default values for variables like `CC', `cache_file', and `prefix'. |
`configure' looks for `PREFIX/share/config.site' if it exists, then |
`PREFIX/etc/config.site' if it exists. Or, you can set the |
`CONFIG_SITE' environment variable to the location of the site script. |
A warning: not all `configure' scripts look for a site script. |
Operation Controls |
================== |
`configure' recognizes the following options to control how it |
operates. |
`--cache-file=FILE' |
Use and save the results of the tests in FILE instead of |
`./config.cache'. Set FILE to `/dev/null' to disable caching, for |
debugging `configure'. |
`--help' |
Print a summary of the options to `configure', and exit. |
`--quiet' |
`--silent' |
`-q' |
Do not print messages saying which checks are being made. To |
suppress all normal output, redirect it to `/dev/null' (any error |
messages will still be shown). |
`--srcdir=DIR' |
Look for the package's source code in directory DIR. Usually |
`configure' can determine that directory automatically. |
`--version' |
Print the version of Autoconf used to generate the `configure' |
script, and exit. |
`configure' also accepts some other, not widely useful, options. |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/Makefile |
---|
0,0 → 1,5 |
OUTFILE = ../lib/libSDLdraw.a |
OBJS = src/SDL_draw.o |
CFLAGS = -Iinclude -I. -I../include |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/NEWS |
---|
--- sources/SDL-1.2.2/SDL_draw/README (nonexistent) |
+++ sources/SDL-1.2.2/SDL_draw/README (revision 5131) |
@@ -0,0 +1,117 @@ |
+ |
+SDL_draw 1.2.1 |
+~~~~~~~~~~~~~~ |
+The latest version of this library is available from: |
+http://sdl-draw.sourceforge.net/ |
+ |
+This is a simple library to draw basic elements, like points, lines and |
+circles, on SDL surfaces. |
+ |
+Library API |
+~~~~~~~~~~~ |
+#include "SDL_draw.h" |
+ |
+//IMPORTANT: Call this function AFTER the call to 'SDL_SetVideoMode': |
+Draw_Init(); //Register the functions for current bpp |
+ |
+ |
+void Draw_Pixel(SDL_Surface *super, |
+ Sint16 x, Sint16 y, Uint32 color); |
+ |
+ Draw a colored pixel on coordinates x,y. |
+ |
+ |
+void Draw_Line(SDL_Surface *super, |
+ Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, |
+ Uint32 color); |
+ |
+ Draw a line from x1,y1 to x2,y2. |
+ |
+ |
+void Draw_Circle(SDL_Surface *super, |
+ Sint16 x0, Sint16 y0, Uint16 r, |
+ Uint32 color); |
+ |
+ Draw a circle with center x0,y0 and radius r. |
+ |
+ |
+void Draw_FillCircle(SDL_Surface *super, |
+ Sint16 x0, Sint16 y0, Uint16 r, |
+ Uint32 color); |
+ |
+ Draw a filled circle with center x0,y0 and radius r. |
+ |
+ |
+void Draw_HLine(SDL_Surface *super, |
+ Sint16 x0,Sint16 y0, Sint16 x1, |
+ Uint32 color); |
+ |
+ Draw a horizontal line from x0,y0 to x1,y0. |
+ |
+ |
+void Draw_VLine(SDL_Surface *super, |
+ Sint16 x0,Sint16 y0, Sint16 y1, |
+ Uint32 color); |
+ |
+ Draw a vertical line from x0,y0 to x0,y1. |
+ |
+ |
+void Draw_Rect(SDL_Surface *super, |
+ Sint16 x,Sint16 y, Uint16 w,Uint16 h, |
+ Uint32 color); |
+ |
+ Draw a rectangle with upper left corner in x,y being w the width and h the |
+ height. |
+ |
+ |
+void Draw_FillRect(SDL_Surface *super, |
+ Sint16 x,Sint16 y, Uint16 w,Uint16 h, |
+ Uint32 color); |
+ |
+ The same as above but the rectangle is filled. This function is equivalent |
+ to SDL_FillRect (is a MACRO). |
+ |
+ |
+void Draw_Ellipse(SDL_Surface *super, |
+ Sint16 x0, Sint16 y0, |
+ Uint16 Xradius, Uint16 Yradius, |
+ Uint32 color); |
+ |
+ Draw a ellipse with center in x0,y0. Xradius is the major axis and Yradius is |
+ the minor axis. |
+ |
+ |
+void Draw_FillEllipse(SDL_Surface *super, |
+ Sint16 x0, Sint16 y0, |
+ Uint16 Xradius, Uint16 Yradius, |
+ Uint32 color); |
+ |
+ Draw a filled ellipse (same parameters as the above function). |
+ |
+ |
+void Draw_Round(SDL_Surface *super, |
+ Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
+ Uint16 corner, Uint32 color); |
+ |
+ Draw a rectangle with rounded corners. x0,y0 is the upper left corner of the |
+ rectangle, w is the width and h is the height. corner is the radius of the |
+ corner. |
+ |
+ |
+void Draw_Round(SDL_Surface *super, |
+ Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
+ Uint16 corner, Uint32 color); |
+ |
+ The same as above but the rounded rectangle is filled. |
+ |
+ |
+The file sdldrawtest.c is a example application for the library. You can |
+compile it using (for GNU Compiler): |
+ |
+$ export CFLAGS="`sdl-config --cflags` -I./include" |
+$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a" |
+$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS |
+ |
+This library is under the GNU Library General Public License, see the file |
+"COPYING" for details. |
+ |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/TODO |
---|
0,0 → 1,9 |
TODO 07-2002 |
~~~~~~~~~~~~ |
- Draw_Arc |
- Draw_Pie (or Draw_FillArc) |
- Draw_Thick* (Thicks versions of the functions) |
- Implement __antialiasing__ version of the functions (ex: Draw_ALine) |
- Optimizations (Processor Pipeline and others) |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/confdefs.h |
---|
0,0 → 1,3 |
#define PACKAGE "SDL_draw" |
#define VERSION "1.2.1" |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/include/SDL_draw.h |
---|
0,0 → 1,114 |
/*! |
\file SDL_draw.h |
\author Mario Palomo Torrero <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
Drawing primitives for SDL. Main header file. |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#ifndef SDL_DRAW_H |
#define SDL_DRAW_H |
#include "SDL.h" |
#include "begin_code.h" |
#ifdef __cplusplus |
extern "C" { |
#endif |
extern DECLSPEC void Draw_Init(void); |
extern DECLSPEC |
void (*Draw_Pixel)(SDL_Surface *super, |
Sint16 x, Sint16 y, Uint32 color); |
extern DECLSPEC |
void (*Draw_Line)(SDL_Surface *super, |
Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_Circle)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_FillCircle)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_HLine)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 x1, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_VLine)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 y1, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_Rect)(SDL_Surface *super, |
Sint16 x,Sint16 y, Uint16 w,Uint16 h, |
Uint32 color); |
/* We wrap SDL_FillRect with the SDL_draw name convention */ |
#define Draw_FillRect(SUPER, X, Y, W, H, COLOR) \ |
do { \ |
SDL_Rect r = {(X), (Y), (W), (H)}; \ |
SDL_FillRect((SUPER), &r, (COLOR)); \ |
}while(0) |
extern DECLSPEC |
void (*Draw_Ellipse)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_FillEllipse)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color); |
extern DECLSPEC |
void (*Draw_Round)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color); |
extern DECLSPEC |
void (*Draw_FillRound)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color); |
/* We'll use SDL for reporting errors */ |
#define Draw_SetError SDL_SetError |
#define Draw_GetError SDL_GetError |
#ifdef __cplusplus |
} /* extern "C" */ |
#endif |
#include "close_code.h" |
#endif /* SDL_DRAW_H */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_Circle.c |
---|
0,0 → 1,101 |
/*! |
\file Draw_Circle.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#define SDL_DRAW_PUTPIXEL_BPP(A, B, C) \ |
*(##A##(##B##(Uint8*)super->pixels + (y0+y)*super->pitch + \ |
(x0+x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0-y)*super->pitch + \ |
(x0+x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0+y)*super->pitch + \ |
(x0-x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0-y)*super->pitch + \ |
(x0-x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0+x)*super->pitch + \ |
(x0+y)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0-x)*super->pitch + \ |
(x0+y)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0+x)*super->pitch + \ |
(x0-y)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0-x)*super->pitch + \ |
(x0-y)*SDL_DRAW_BPP)) = ##C##; |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP(0+,0+,color) |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint16*),0+,color) |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_PUTPIXEL_BPP(0+,1+,colorbyte1) \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,colorbyte2) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,colorbyte0) \ |
}else{ \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,colorbyte0) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,colorbyte2) \ |
} |
#elif SDL_DRAW_BPP == 4 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint32*),0+,color) |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
Sint16 x = 0; |
Sint16 y = r-1; /*radius zero == draw nothing*/ |
Sint16 d = 3 - 2*r; |
Sint16 diagonalInc = 10 - 4*r; |
Sint16 rightInc = 6; |
while (x <= y) { |
SDL_DRAW_PUTPIXEL |
if (d >= 0) { |
d += diagonalInc; |
diagonalInc += 8; |
y -= 1; |
} else { |
d += rightInc; |
diagonalInc += 4; |
} |
rightInc += 4; |
x += 1; |
} |
}/*Draw_Circle*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_Ellipse.c |
---|
0,0 → 1,137 |
/*! |
\file Draw_Ellipse.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#define SDL_DRAW_PUTPIXEL_BPP(A, B, C) \ |
*(##A##(##B##(Uint8*)super->pixels + (y0+y)*super->pitch + \ |
(x0+x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0-y)*super->pitch + \ |
(x0+x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0+y)*super->pitch + \ |
(x0-x)*SDL_DRAW_BPP)) = ##C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (y0-y)*super->pitch + \ |
(x0-x)*SDL_DRAW_BPP)) = ##C##; |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP(0+,0+,color) |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint16*),0+,color) |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_PUTPIXEL_BPP(0+,1+,colorbyte1) \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,colorbyte2) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,colorbyte0) \ |
}else{ \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,colorbyte0) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,colorbyte2) \ |
} |
#elif SDL_DRAW_BPP == 4 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint32*),0+,color) |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color) |
{ |
Sint32 x, y; |
Sint32 Xchange, Ychange; |
Sint32 EllipseError; |
Sint32 TwoASquare, TwoBSquare; |
Sint32 StoppingX, StoppingY; |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
TwoASquare = 2*Xradius*Xradius; |
TwoBSquare = 2*Yradius*Yradius; |
/*1st set of points*/ |
x = Xradius-1; /*radius zero == draw nothing*/ |
y = 0; |
Xchange = Yradius*Yradius*(1-2*Xradius); |
Ychange = Xradius*Xradius; |
EllipseError = 0; |
StoppingX = TwoBSquare*Xradius; |
StoppingY = 0; |
/*Plot four ellipse points by iteration*/ |
while (StoppingX > StoppingY) { |
SDL_DRAW_PUTPIXEL |
++y; |
StoppingY += TwoASquare; |
EllipseError += Ychange; |
Ychange += TwoASquare; |
if (( 2*EllipseError + Xchange) > 0) { |
--x; |
StoppingX -= TwoBSquare; |
EllipseError += Xchange; |
Xchange += TwoBSquare; |
} |
}/*while*/ |
/*2nd set of points*/ |
x = 0; |
y = Yradius-1; /*radius zero == draw nothing*/ |
Xchange = Yradius*Yradius; |
Ychange = Xradius*Xradius*(1-2*Yradius); |
EllipseError = 0; |
StoppingX = 0; |
StoppingY = TwoASquare*Yradius; |
/*Plot four ellipse points by iteration*/ |
while (StoppingX < StoppingY) { |
SDL_DRAW_PUTPIXEL |
++x; |
StoppingX += TwoBSquare; |
EllipseError += Xchange; |
Xchange += TwoBSquare; |
if ((2*EllipseError + Ychange) > 0) { |
--y; |
StoppingY -= TwoASquare; |
EllipseError += Ychange; |
Ychange += TwoASquare; |
} |
} |
}/*Draw_Ellipse*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_FillCircle.c |
---|
0,0 → 1,216 |
/*! |
\file Draw_FillCircle.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
memset(p0, color, 2*x+1); \ |
memset(p1, color, 2*x+1); \ |
p0 = ((Uint8*)super->pixels+ (y0+x)*super->pitch+ (x0-y)); \ |
p1 = ((Uint8*)super->pixels+ (y0-x)*super->pitch+ (x0-y)); \ |
memset(p0, color, 2*y+1); \ |
memset(p1, color, 2*y+1); |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
i = 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 3: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 2: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 1: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} \ |
p0 = ((Uint8*)super->pixels+ (y0+x)*super->pitch+ (x0-y)*2); \ |
p1 = ((Uint8*)super->pixels+ (y0-x)*super->pitch+ (x0-y)*2); \ |
i = 2*y+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 3: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 2: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 1: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p0[0] = colorbyte2; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte0; \ |
p1[0] = colorbyte2; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte0; \ |
} else { \ |
p0[0] = colorbyte0; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte2; \ |
p1[0] = colorbyte0; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
i = 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} \ |
p0 = ((Uint8*)super->pixels+ (y0+x)*super->pitch+ (x0-y)*3); \ |
p1 = ((Uint8*)super->pixels+ (y0-x)*super->pitch+ (x0-y)*3); \ |
i = 2*y+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 4 |
#ifdef __linux__ |
#define SDL_DRAW_WMEMSET_START \ |
if (sizeof(wchar_t) == sizeof(Uint32)) { \ |
wmemset((wchar_t*)p0, color, 2*x+1); \ |
wmemset((wchar_t*)p1, color, 2*x+1); \ |
p0 = ((Uint8*)super->pixels+ (y0+x)*super->pitch+ (x0-y)*4); \ |
p1 = ((Uint8*)super->pixels+ (y0-x)*super->pitch+ (x0-y)*4); \ |
wmemset((wchar_t*)p0, color, 2*y+1); \ |
wmemset((wchar_t*)p1, color, 2*y+1); \ |
} else { |
#define SDL_DRAW_WMEMSET_END } |
#else |
#define SDL_DRAW_WMEMSET_START |
#define SDL_DRAW_WMEMSET_END |
#endif |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_WMEMSET_START \ |
i = 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 3: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 2: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 1: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
p0 = ((Uint8*)super->pixels+ (y0+x)*super->pitch+ (x0-y)*4); \ |
p1 = ((Uint8*)super->pixels+ (y0-x)*super->pitch+ (x0-y)*4); \ |
i = 2*y+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 3: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 2: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 1: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
SDL_DRAW_WMEMSET_END |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
register Uint8 *p0; |
register Uint8 *p1; |
#if SDL_DRAW_BPP != 1 |
register Sint16 i; |
#endif |
Sint16 x = 0; |
Sint16 y = r-1; /*radius zero == draw nothing*/ |
Sint16 d = 3 - 2*r; |
Sint16 diagonalInc = 10 - 4*r; |
Sint16 rightInc = 6; |
while (x <= y) { |
p0 = ((Uint8*)super->pixels+ (y0+y)*super->pitch+ (x0-x)*SDL_DRAW_BPP); |
p1 = ((Uint8*)super->pixels+ (y0-y)*super->pitch+ (x0-x)*SDL_DRAW_BPP); |
SDL_DRAW_PUTPIXEL |
if (d >= 0) { |
d += diagonalInc; |
diagonalInc += 8; |
y -= 1; |
} else { |
d += rightInc; |
diagonalInc += 4; |
} |
rightInc += 4; |
x += 1; |
} |
}/*Draw_FillCircle*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP_3_AUX |
#undef SDL_DRAW_WMEMSET_START |
#undef SDL_DRAW_WMEMSET_END |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_FillEllipse.c |
---|
0,0 → 1,217 |
/*! |
\file Draw_FillEllipse.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
memset(((Uint8*)super->pixels+ (y0+y)*super->pitch+ (x0-x)), \ |
color, 2*x+1); \ |
memset(((Uint8*)super->pixels+ (y0-y)*super->pitch+ (x0-x)), \ |
color, 2*x+1); |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
{ \ |
p0 = ((Uint8*)super->pixels+ (y0+y)*super->pitch+ (x0-x)*2); \ |
p1 = ((Uint8*)super->pixels+ (y0-y)*super->pitch+ (x0-x)*2); \ |
i = 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 3: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 2: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 1: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p0[0] = colorbyte2; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte0; \ |
p1[0] = colorbyte2; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte0; \ |
} else { \ |
p0[0] = colorbyte0; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte2; \ |
p1[0] = colorbyte0; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
{ \ |
p0 = ((Uint8*)super->pixels+ (y0+y)*super->pitch+ (x0-x)*3); \ |
p1 = ((Uint8*)super->pixels+ (y0-y)*super->pitch+ (x0-x)*3); \ |
i = 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} \ |
} |
#elif SDL_DRAW_BPP == 4 |
#ifdef __linux__ |
#define SDL_DRAW_WMEMSET_START \ |
if (sizeof(wchar_t) == sizeof(Uint32)) { \ |
wmemset( (wchar_t*)((Uint8*)super->pixels+ (y0+y)*super->pitch+ (x0-x)*4), \ |
color, 2*x+1); \ |
wmemset( (wchar_t*)((Uint8*)super->pixels+ (y0-y)*super->pitch+ (x0-x)*4), \ |
color, 2*x+1); \ |
} else { |
#define SDL_DRAW_WMEMSET_END } |
#else |
#define SDL_DRAW_WMEMSET_START |
#define SDL_DRAW_WMEMSET_END |
#endif |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_WMEMSET_START \ |
p0 = ((Uint8*)super->pixels+ (y0+y)*super->pitch+ (x0-x)*4); \ |
p1 = ((Uint8*)super->pixels+ (y0-y)*super->pitch+ (x0-x)*4); \ |
i = 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 3: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 2: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 1: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
SDL_DRAW_WMEMSET_END |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
#if SDL_DRAW_BPP != 1 |
register Uint8 *p0; |
register Uint8 *p1; |
register Sint16 i; |
#endif |
Sint32 x, y; |
Sint32 Xchange, Ychange; |
Sint32 EllipseError; |
Sint32 TwoASquare, TwoBSquare; |
Sint32 StoppingX, StoppingY; |
TwoASquare = 2*Xradius*Xradius; |
TwoBSquare = 2*Yradius*Yradius; |
/*1st set of points*/ |
x = Xradius-1; /*radius zero == draw nothing*/ |
y = 0; |
Xchange = Yradius*Yradius*(1-2*Xradius); |
Ychange = Xradius*Xradius; |
EllipseError = 0; |
StoppingX = TwoBSquare*Xradius; |
StoppingY = 0; |
/*Plot 2 ellipse scan lines for iteration*/ |
while (StoppingX > StoppingY) { |
SDL_DRAW_PUTPIXEL |
++y; |
StoppingY += TwoASquare; |
EllipseError += Ychange; |
Ychange += TwoASquare; |
if (( 2*EllipseError + Xchange) > 0) { |
--x; |
StoppingX -= TwoBSquare; |
EllipseError += Xchange; |
Xchange += TwoBSquare; |
} |
}/*while*/ |
/*2nd set of points*/ |
x = 0; |
y = Yradius-1; /*radius zero == draw nothing*/ |
Xchange = Yradius*Yradius; |
Ychange = Xradius*Xradius*(1-2*Yradius); |
EllipseError = 0; |
StoppingX = 0; |
StoppingY = TwoASquare*Yradius; |
/*Plot 2 ellipse scan lines for iteration*/ |
while (StoppingX < StoppingY) { |
SDL_DRAW_PUTPIXEL |
++x; |
StoppingX += TwoBSquare; |
EllipseError += Xchange; |
Xchange += TwoBSquare; |
if ((2*EllipseError + Ychange) > 0) { |
--y; |
StoppingY -= TwoASquare; |
EllipseError += Ychange; |
Ychange += TwoASquare; |
} |
} |
}/*Draw_FillEllipse*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP_3_AUX |
#undef SDL_DRAW_WMEMSET_START |
#undef SDL_DRAW_WMEMSET_END |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_FillRound.c |
---|
0,0 → 1,248 |
/*! |
\file Draw_FillRound.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
memset(p0, color, X2center - Xcenter + 2*corner+1); \ |
memset(p1, color, X2center - Xcenter + 2*corner+1); \ |
p0 = ((Uint8*)super->pixels+(Y2center+corner)*super->pitch+(Xcenter-x)); \ |
p1 = ((Uint8*)super->pixels+(Ycenter-corner)*super->pitch +(Xcenter-x)); \ |
memset(p0, color, X2center - Xcenter + 2*x+1); \ |
memset(p1, color, X2center - Xcenter + 2*x+1); |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
i = X2center - Xcenter + 2*corner+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 3: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 2: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 1: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} \ |
p0 = ((Uint8*)super->pixels+(Y2center+corner)*super->pitch+(Xcenter-x)*2); \ |
p1 = ((Uint8*)super->pixels+(Ycenter-corner)*super->pitch +(Xcenter-x)*2); \ |
i = X2center - Xcenter + 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 3: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 2: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
case 1: *(Uint16*)p0 = color; *(Uint16*)p1 = color; \ |
p0+=2; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p0[0] = colorbyte2; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte0; \ |
p1[0] = colorbyte2; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte0; \ |
} else { \ |
p0[0] = colorbyte0; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte2; \ |
p1[0] = colorbyte0; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
i = X2center - Xcenter + 2*corner+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} \ |
p0 = ((Uint8*)super->pixels+(Y2center+corner)*super->pitch+(Xcenter-x)*3); \ |
p1 = ((Uint8*)super->pixels+(Ycenter-corner)*super->pitch +(Xcenter-x)*3); \ |
i = X2center - Xcenter + 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 4 |
#ifdef __linux__ |
#define SDL_DRAW_WMEMSET_START \ |
if (sizeof(wchar_t) == sizeof(Uint32)) { \ |
wmemset((wchar_t*)p0, color, X2center - Xcenter + 2*corner+1); \ |
wmemset((wchar_t*)p1, color, X2center - Xcenter + 2*corner+1); \ |
p0 = ((Uint8*)super->pixels+(Y2center+corner)*super->pitch+(Xcenter-x)*4); \ |
p1 = ((Uint8*)super->pixels+(Ycenter-corner)*super->pitch +(Xcenter-x)*4); \ |
wmemset((wchar_t*)p0, color, X2center - Xcenter + 2*x+1); \ |
wmemset((wchar_t*)p1, color, X2center - Xcenter + 2*x+1); \ |
} else { |
#define SDL_DRAW_WMEMSET_END } |
#else |
#define SDL_DRAW_WMEMSET_START |
#define SDL_DRAW_WMEMSET_END |
#endif |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_WMEMSET_START \ |
i = X2center - Xcenter + 2*corner+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 3: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 2: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 1: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
p0 = ((Uint8*)super->pixels+(Y2center+corner)*super->pitch+(Xcenter-x)*4); \ |
p1 = ((Uint8*)super->pixels+(Ycenter-corner)*super->pitch +(Xcenter-x)*4); \ |
i = X2center - Xcenter + 2*x+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 3: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 2: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
case 1: *(Uint32*)p0 = color; *(Uint32*)p1 = color; \ |
p0+=4; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
SDL_DRAW_WMEMSET_END |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
register Uint8 *p0; |
register Uint8 *p1; |
#if SDL_DRAW_BPP != 1 |
register Sint16 i; |
#endif |
Sint16 dx, dy; |
Sint16 Xcenter, Ycenter, X2center, Y2center; |
Sint16 x = 0; |
Sint16 rightInc = 6; |
Sint16 d, diagonalInc; |
SDL_Rect r; |
if (w==0 || h==0) return; |
/*TODO: We can do better :-)*/ |
if (corner!=0) { |
d = w<h ? w : h; |
--corner; |
if (corner!=0 && corner+2 >= d ) { |
if (corner+2 == d) --corner; |
else corner = 0; |
} |
} |
d = 3 - (corner<<1); |
diagonalInc = 10 - (corner<<2); |
/*Rectangles*/ |
dx = w - (corner<<1); |
Xcenter = x0+corner; |
dy = h - (corner<<1); |
Ycenter = y0+corner; |
/*Centers*/ |
X2center=Xcenter+dx-1; |
Y2center=Ycenter+dy-1; |
r.x = x0; r.y = Ycenter; |
r.w = w; r.h = dy; |
SDL_FillRect(super, &r, color); |
while (x < corner) { |
p0 = ((Uint8*)super->pixels+(Ycenter-x)*super->pitch + |
(Xcenter-corner)*SDL_DRAW_BPP); |
p1 = ((Uint8*)super->pixels+(Y2center+x)*super->pitch + |
(Xcenter-corner)*SDL_DRAW_BPP); |
SDL_DRAW_PUTPIXEL |
if (d >= 0) { |
d += diagonalInc; |
diagonalInc += 8; |
--corner; |
} else { |
d += rightInc; |
diagonalInc += 4; |
} |
rightInc += 4; |
++x; |
}/*while*/ |
}/*Draw_FillRound*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_WMEMSET_START |
#undef SDL_DRAW_WMEMSET_END |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_HLine.c |
---|
0,0 → 1,117 |
/*! |
\file Draw_HLine.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
memset(p, color, x1-x0+1); |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
i = x1-x0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p = color; p+=2; \ |
case 3: *(Uint16*)p = color; p+=2; \ |
case 2: *(Uint16*)p = color; p+=2; \ |
case 1: *(Uint16*)p = color; p+=2; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p[0] = colorbyte2; \ |
p[1] = colorbyte1; \ |
p[2] = colorbyte0; \ |
} else { \ |
p[0] = colorbyte0; \ |
p[1] = colorbyte1; \ |
p[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
i = x1-x0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=3; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=3; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=3; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=3; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 4 |
#ifdef __linux__ |
#define SDL_DRAW_WMEMSET_START \ |
if (sizeof(wchar_t) == sizeof(Uint32)) { \ |
wmemset((wchar_t*)p, color, x1-x0+1); \ |
} else { |
#define SDL_DRAW_WMEMSET_END } |
#else |
#define SDL_DRAW_WMEMSET_START |
#define SDL_DRAW_WMEMSET_END |
#endif |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_WMEMSET_START \ |
i = x1-x0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p = color; p+=4; \ |
case 3: *(Uint32*)p = color; p+=4; \ |
case 2: *(Uint32*)p = color; p+=4; \ |
case 1: *(Uint32*)p = color; p+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
SDL_DRAW_WMEMSET_END |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 x1, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
register Uint8 *p; |
register Sint16 i; |
if (x0 > x1) { i=x1; x1=x0; x0=i; } |
p = (Uint8*)super->pixels + y0 * super->pitch + x0 * SDL_DRAW_BPP; |
SDL_DRAW_PUTPIXEL |
}/*Draw_HLine*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP_3_AUX |
#undef SDL_DRAW_WMEMSET_START |
#undef SDL_DRAW_WMEMSET_END |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_Line.c |
---|
0,0 → 1,135 |
/*! |
\file Draw_Line.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#define SDL_DRAW_PUTPIXEL_BPP(A, B, C) \ |
*(##A##(##B##(Uint8*)super->pixels + y*super->pitch + x*SDL_DRAW_BPP))=##C##; |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP(0+,0+,color) |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint16*),0+,color) |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_PUTPIXEL_BPP(0+,1+,(Uint8)colorbyte1) \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,(Uint8)colorbyte2) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,(Uint8)colorbyte0) \ |
}else{ \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,(Uint8)colorbyte0) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,(Uint8)colorbyte2) \ |
} |
#elif SDL_DRAW_BPP == 4 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint32*),0+,color) |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
Sint16 x = x1; |
Sint16 y = y1; |
Sint16 dy = y2 - y1; |
Sint16 dx = x2 - x1; |
Sint16 G, DeltaG1, DeltaG2, minG, maxG; |
Sint16 swap; |
Sint16 inc = 1; |
SDL_DRAW_PUTPIXEL |
if (abs(dy) < abs(dx)) { /* -1 < ramp < 1 */ |
if (dx < 0) { |
dx = -dx; |
dy = -dy; |
swap = y2; |
y2 = y1; |
y1 = swap; |
swap = x2; |
x2 = x1; |
x1 = swap; |
} |
if (dy < 0) { |
dy = -dy; |
inc = -1; |
} |
G = 2 * dy - dx; |
DeltaG1 = 2 * (dy - dx); |
DeltaG2 = 2 * dy; |
while (x++ < x2) { |
if (G > 0) { G += DeltaG1; y += inc; } |
else G += DeltaG2; |
SDL_DRAW_PUTPIXEL |
}/*while*/ |
} else { /* ramp < -1 or ramp > 1 */ |
if (dy < 0) { |
dx = -dx; |
dy = -dy; |
swap = y2; |
y2 = y1; |
y1 = swap; |
swap = x2; |
x2 = x1; |
x1 = swap; |
} |
if (dx < 0) { |
dx = -dx; |
inc = -1; |
} |
G = 2 * dx - dy; |
minG = maxG = G; |
DeltaG1 = 2 * (dx - dy); |
DeltaG2 = 2 * dx; |
while (y++ < y2) { |
if (G > 0) { G += DeltaG1; x += inc; } |
else G += DeltaG2; |
SDL_DRAW_PUTPIXEL |
}/*while*/ |
}/*if*/ |
}/*Draw_Line*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_Pixel.c |
---|
0,0 → 1,64 |
/*! |
\file Draw_Pixel.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#define SDL_DRAW_PUTPIXEL_BPP(A, B, C) \ |
*(##A##(##B##(Uint8*)super->pixels + y*super->pitch + x*SDL_DRAW_BPP))=##C##; |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP(0+,0+,(Uint8)color) |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint16*),0+,(Uint16)color) |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_PUTPIXEL_BPP(0+,1+,colorbyte1) \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,colorbyte2) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,colorbyte0) \ |
}else{ \ |
SDL_DRAW_PUTPIXEL_BPP(0+,0+,colorbyte0) \ |
SDL_DRAW_PUTPIXEL_BPP(0+,2+,colorbyte2) \ |
} |
#elif SDL_DRAW_BPP == 4 |
#define SDL_DRAW_PUTPIXEL SDL_DRAW_PUTPIXEL_BPP((Uint32*),0+,color) |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x, Sint16 y, Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
SDL_DRAW_PUTPIXEL |
}/*Draw_Pixel*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_Rect.c |
---|
0,0 → 1,236 |
/*! |
\file Draw_Rect.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
memset(p0, color, w); \ |
memset(p1, color, w); \ |
\ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + (y+1)*super->pitch + x; \ |
p1 = (Uint8*)super->pixels + (y+1)*super->pitch + (x+w-1); \ |
i = h-2; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
case 3: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
case 2: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
case 1: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
i = w; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
case 3: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
case 2: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
case 1: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} \ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + (y+1)*super->pitch + x*2; \ |
p1 = (Uint8*)super->pixels + (y+1)*super->pitch + (x+w-1)*2; \ |
i = h-2; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
case 3: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
case 2: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
case 1: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p0[0] = colorbyte2; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte0; \ |
p1[0] = colorbyte2; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte0; \ |
} else { \ |
p0[0] = colorbyte0; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte2; \ |
p1[0] = colorbyte0; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
i = w; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} \ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + (y+1)*super->pitch + x*3; \ |
p1 = (Uint8*)super->pixels + (y+1)*super->pitch + (x+w-1)*3; \ |
i = h-2; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
case 3: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
case 2: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
case 1: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 4 |
#ifdef __linux__ |
#define SDL_DRAW_WMEMSET_START \ |
if (sizeof(wchar_t) == sizeof(Uint32)) { \ |
wmemset((wchar_t*)p0, color, w); \ |
wmemset((wchar_t*)p1, color, w); \ |
} else { |
#define SDL_DRAW_WMEMSET_END } |
#else |
#define SDL_DRAW_WMEMSET_START |
#define SDL_DRAW_WMEMSET_END |
#endif |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_WMEMSET_START \ |
i = w; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
case 3: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
case 2: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
case 1: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
SDL_DRAW_WMEMSET_END \ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + (y+1)*super->pitch + x*4; \ |
p1 = (Uint8*)super->pixels + (y+1)*super->pitch + (x+w-1)*4; \ |
i = h-2; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
case 3: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
case 2: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
case 1: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x, Sint16 y, Uint16 w, Uint16 h, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
register Uint8 *p0; |
register Uint8 *p1; |
register Sint16 i; |
if (w==0 || h==0) return; |
p0 = (Uint8*)super->pixels + y * super->pitch + x * SDL_DRAW_BPP; |
p1 = (Uint8*)super->pixels + (y+h-1) * super->pitch + x * SDL_DRAW_BPP; |
SDL_DRAW_PUTPIXEL |
}/*Draw_Rect*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP_3_AUX |
#undef SDL_DRAW_WMEMSET_START |
#undef SDL_DRAW_WMEMSET_END |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_Round.c |
---|
0,0 → 1,326 |
/*! |
\file Draw_Round.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
/*Circle arcs*/ |
#define SDL_DRAW_PUTPIXEL_CIRCLE_BPP(A, B, C) \ |
*(##A##(##B##(Uint8*)super->pixels + (Ycenter-x)*super->pitch + \ |
(Xcenter - corner)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Ycenter-corner)*super->pitch + \ |
(Xcenter - x)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Ycenter-corner)*super->pitch + \ |
(X2center + x)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Ycenter-x)*super->pitch + \ |
(X2center + corner)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Y2center+corner)*super->pitch + \ |
(X2center + x)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Y2center+x)*super->pitch + \ |
(X2center + corner)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Y2center+corner)*super->pitch + \ |
(Xcenter - x)*SDL_DRAW_BPP)) = C##; \ |
*(##A##(##B##(Uint8*)super->pixels + (Y2center+x)*super->pitch + \ |
(Xcenter - corner)*SDL_DRAW_BPP)) = C##; |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL_CIRCLE SDL_DRAW_PUTPIXEL_CIRCLE_BPP(0+,0+,color) |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL_CIRCLE SDL_DRAW_PUTPIXEL_CIRCLE_BPP((Uint16*),0+,color) |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_CIRCLE \ |
SDL_DRAW_PUTPIXEL_CIRCLE_BPP(0+,1+,colorbyte1) \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
SDL_DRAW_PUTPIXEL_CIRCLE_BPP(0+,0+,colorbyte2) \ |
SDL_DRAW_PUTPIXEL_CIRCLE_BPP(0+,2+,colorbyte0) \ |
}else{ \ |
SDL_DRAW_PUTPIXEL_CIRCLE_BPP(0+,0+,colorbyte0) \ |
SDL_DRAW_PUTPIXEL_CIRCLE_BPP(0+,2+,colorbyte2) \ |
} |
#elif SDL_DRAW_BPP == 4 |
#define SDL_DRAW_PUTPIXEL_CIRCLE SDL_DRAW_PUTPIXEL_CIRCLE_BPP((Uint32*),0+,color) |
#endif /*SDL_DRAW_BPP*/ |
/*Rectangles*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
memset(p0, color, dx); \ |
memset(p1, color, dx); \ |
\ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + Ycenter*super->pitch + x0; \ |
p1 = (Uint8*)super->pixels + Ycenter*super->pitch + x0+w-1; \ |
i=dy; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
case 3: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
case 2: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
case 1: \ |
*p0 = color; p0+=super->pitch; \ |
*p1 = color; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
i=dx; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
case 3: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
case 2: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
case 1: \ |
*(Uint16*)p0 = color; p0+=2; \ |
*(Uint16*)p1 = color; p1+=2; \ |
}while( (i-=4) > 0 ); \ |
} \ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + Ycenter*super->pitch + x0*2; \ |
p1 = (Uint8*)super->pixels + Ycenter*super->pitch + (x0+w-1)*2; \ |
i=dy; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
case 3: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
case 2: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
case 1: \ |
*(Uint16*)p0 = color; p0+=super->pitch; \ |
*(Uint16*)p1 = color; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p0[0] = colorbyte2; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte0; \ |
p1[0] = colorbyte2; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte0; \ |
} else { \ |
p0[0] = colorbyte0; \ |
p0[1] = colorbyte1; \ |
p0[2] = colorbyte2; \ |
p1[0] = colorbyte0; \ |
p1[1] = colorbyte1; \ |
p1[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
i=dx; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 3: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 2: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
case 1: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=3; p1+=3; \ |
}while( (i-=4) > 0 ); \ |
} \ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + Ycenter*super->pitch + x0*3; \ |
p1 = (Uint8*)super->pixels + Ycenter*super->pitch + (x0+w-1)*3; \ |
i=dy; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
case 3: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
case 2: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
case 1: \ |
SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
p0+=super->pitch; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 4 |
#ifdef __linux__ |
#define SDL_DRAW_WMEMSET_START \ |
if (sizeof(wchar_t) == sizeof(Uint32)) { \ |
wmemset((wchar_t*)p0, color, dx); \ |
wmemset((wchar_t*)p1, color, dx); \ |
} else { |
#define SDL_DRAW_WMEMSET_END } |
#else |
#define SDL_DRAW_WMEMSET_START |
#define SDL_DRAW_WMEMSET_END |
#endif |
#define SDL_DRAW_PUTPIXEL \ |
SDL_DRAW_WMEMSET_START \ |
i=dx; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
case 3: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
case 2: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
case 1: \ |
*(Uint32*)p0 = color; p0+=4; \ |
*(Uint32*)p1 = color; p1+=4; \ |
}while( (i-=4) > 0 ); \ |
} \ |
SDL_DRAW_WMEMSET_END \ |
if (h<3) return; \ |
p0 = (Uint8*)super->pixels + Ycenter*super->pitch + x0*4; \ |
p1 = (Uint8*)super->pixels + Ycenter*super->pitch + (x0+w-1)*4; \ |
i=dy; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
case 3: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
case 2: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
case 1: \ |
*(Uint32*)p0 = color; p0+=super->pitch; \ |
*(Uint32*)p1 = color; p1+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
register Uint8 *p0; |
register Uint8 *p1; |
register Sint16 i; |
Sint16 dx, dy; |
Sint16 Xcenter, Ycenter, X2center, Y2center; |
Sint16 x = 0; |
Sint16 rightInc = 6; |
Sint16 d, diagonalInc; |
if (w==0 || h==0) return; |
/*TODO: We can do better :-)*/ |
if (corner!=0) { |
d = w<h ? w : h; |
--corner; |
if (corner!=0 && corner+2 >= d ) { |
if (corner+2 == d) --corner; |
else corner = 0; |
} |
} |
d = 3 - (corner<<1); |
diagonalInc = 10 - (corner<<2); |
/*Rectangles*/ |
dx = w - (corner<<1); |
Xcenter = x0+corner; |
dy = h - (corner<<1); |
Ycenter = y0+corner; |
/*Centers*/ |
X2center=Xcenter+dx-1; |
Y2center=Ycenter+dy-1; |
p0 = (Uint8*)super->pixels + y0 * super->pitch + Xcenter*SDL_DRAW_BPP; |
p1 = (Uint8*)super->pixels + (y0+h-1) * super->pitch + Xcenter*SDL_DRAW_BPP; |
SDL_DRAW_PUTPIXEL |
while (x < corner) { |
SDL_DRAW_PUTPIXEL_CIRCLE |
if (d >= 0) { |
d += diagonalInc; |
diagonalInc += 8; |
--corner; |
} else { |
d += rightInc; |
diagonalInc += 4; |
} |
rightInc += 4; |
++x; |
}/*while*/ |
}/*Draw_Round*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_CIRCLE |
#undef SDL_DRAW_PUTPIXEL_CIRCLE_BPP |
#undef SDL_DRAW_WMEMSET_START |
#undef SDL_DRAW_WMEMSET_END |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/Draw_VLine.c |
---|
0,0 → 1,109 |
/*! |
\file Draw_VLine.c |
\author Mario Palomo <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#if SDL_DRAW_BPP == 1 |
#define SDL_DRAW_PUTPIXEL \ |
i = y1-y0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *p = color; p+=super->pitch; \ |
case 3: *p = color; p+=super->pitch; \ |
case 2: *p = color; p+=super->pitch; \ |
case 1: *p = color; p+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 2 |
#define SDL_DRAW_PUTPIXEL \ |
i = y1-y0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint16*)p = color; p+=super->pitch; \ |
case 3: *(Uint16*)p = color; p+=super->pitch; \ |
case 2: *(Uint16*)p = color; p+=super->pitch; \ |
case 1: *(Uint16*)p = color; p+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 3 |
#define SDL_DRAW_PUTPIXEL_BPP_3_AUX \ |
if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
p[0] = colorbyte2; \ |
p[1] = colorbyte1; \ |
p[2] = colorbyte0; \ |
} else { \ |
p[0] = colorbyte0; \ |
p[1] = colorbyte1; \ |
p[2] = colorbyte2; \ |
} |
#define SDL_DRAW_PUTPIXEL \ |
i = y1-y0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=super->pitch; \ |
case 3: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=super->pitch; \ |
case 2: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=super->pitch; \ |
case 1: SDL_DRAW_PUTPIXEL_BPP_3_AUX p+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#elif SDL_DRAW_BPP == 4 |
#define SDL_DRAW_PUTPIXEL \ |
i = y1-y0+1; \ |
switch( i % 4 ) { \ |
do{ \ |
case 0: *(Uint32*)p = color; p+=super->pitch; \ |
case 3: *(Uint32*)p = color; p+=super->pitch; \ |
case 2: *(Uint32*)p = color; p+=super->pitch; \ |
case 1: *(Uint32*)p = color; p+=super->pitch; \ |
}while( (i-=4) > 0 ); \ |
} |
#endif /*SDL_DRAW_BPP*/ |
void SDL_DRAWFUNCTION(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 y1, |
Uint32 color) |
{ |
#if SDL_DRAW_BPP == 3 |
Uint8 colorbyte0 = (Uint8) (color & 0xff); |
Uint8 colorbyte1 = (Uint8) ((color >> 8) & 0xff); |
Uint8 colorbyte2 = (Uint8) ((color >> 16) & 0xff); |
#endif |
register Uint8 *p; |
register Sint16 i; |
if (y0 > y1) { i=y1; y1=y0; y0=i; } |
p = (Uint8*)super->pixels + y0 * super->pitch + x0 * SDL_DRAW_BPP; |
SDL_DRAW_PUTPIXEL |
}/*Draw_VLine*/ |
#undef SDL_DRAW_PUTPIXEL |
#undef SDL_DRAW_PUTPIXEL_BPP_3_AUX |
/contrib/sdk/sources/SDL-1.2.2/SDL_draw/src/SDL_draw.c |
---|
0,0 → 1,546 |
/*! |
\file SDL_draw.c |
\author Mario Palomo Torrero <mpalomo@ihman.com> |
\author Jose M. de la Huerga Fernández |
\author Pepe González Mora |
\date 05-2002 |
Drawing primitives for SDL. Main implementation file. |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free Foundation, |
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#include "SDL_draw.h" |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <wchar.h> /*wmemset*/ |
/*==================== BEGIN of Draw_Pixel ======================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_Pixel_1 |
#include "Draw_Pixel.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_Pixel_2 |
#include "Draw_Pixel.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_Pixel_3 |
#include "Draw_Pixel.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_Pixel_4 |
#include "Draw_Pixel.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_Pixel_error(SDL_Surface *super, |
Sint16 x, Sint16 y, Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_Pixel ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_Pixel)(SDL_Surface *super, |
Sint16 x, Sint16 y, Uint32 color) = Draw_Pixel_error; |
/*===================== END of Draw_Pixel =======================*/ |
/*==================== BEGIN of Draw_Line ======================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_Line_1 |
#include "Draw_Line.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_Line_2 |
#include "Draw_Line.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_Line_3 |
#include "Draw_Line.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_Line_4 |
#include "Draw_Line.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_Line_error(SDL_Surface *super, |
Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_Line ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_Line)(SDL_Surface *super, |
Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, |
Uint32 color) = Draw_Line_error; |
/*===================== END of Draw_Line =======================*/ |
/*=================== BEGIN of Draw_Circle =====================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_Circle_1 |
#include "Draw_Circle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_Circle_2 |
#include "Draw_Circle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_Circle_3 |
#include "Draw_Circle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_Circle_4 |
#include "Draw_Circle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_Circle_error(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_Circle ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_Circle)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color) = Draw_Circle_error; |
/*==================== END of Draw_Circle ======================*/ |
/*================= BEGIN of Draw_FillCircle ===================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_FillCircle_1 |
#include "Draw_FillCircle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_FillCircle_2 |
#include "Draw_FillCircle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_FillCircle_3 |
#include "Draw_FillCircle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_FillCircle_4 |
#include "Draw_FillCircle.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_FillCircle_error(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_FillCircle ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_FillCircle)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, Uint16 r, |
Uint32 color) = Draw_FillCircle_error; |
/*================== END of Draw_FillCircle ====================*/ |
/*=================== BEGIN of Draw_HLine =====================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_HLine_1 |
#include "Draw_HLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_HLine_2 |
#include "Draw_HLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_HLine_3 |
#include "Draw_HLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_HLine_4 |
#include "Draw_HLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_HLine_error(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 x1, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_HLine ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_HLine)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 x1, |
Uint32 color) = Draw_HLine_error; |
/*==================== END of Draw_HLine ======================*/ |
/*=================== BEGIN of Draw_VLine =====================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_VLine_1 |
#include "Draw_VLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_VLine_2 |
#include "Draw_VLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_VLine_3 |
#include "Draw_VLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_VLine_4 |
#include "Draw_VLine.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_VLine_error(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 y1, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_VLine ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_VLine)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Sint16 y1, |
Uint32 color) = Draw_VLine_error; |
/*==================== END of Draw_VLine ======================*/ |
/*==================== BEGIN of Draw_Rect ======================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_Rect_1 |
#include "Draw_Rect.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_Rect_2 |
#include "Draw_Rect.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_Rect_3 |
#include "Draw_Rect.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_Rect_4 |
#include "Draw_Rect.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_Rect_error(SDL_Surface *super, |
Sint16 x,Sint16 y, Uint16 w,Uint16 h, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_Rect ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_Rect)(SDL_Surface *super, |
Sint16 x,Sint16 y, Uint16 w,Uint16 h, |
Uint32 color) = Draw_Rect_error; |
/*===================== END of Draw_Rect =======================*/ |
/*=================== BEGIN of Draw_Ellipse ====================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_Ellipse_1 |
#include "Draw_Ellipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_Ellipse_2 |
#include "Draw_Ellipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_Ellipse_3 |
#include "Draw_Ellipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_Ellipse_4 |
#include "Draw_Ellipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_Ellipse_error(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_Ellipse ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_Ellipse)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color) = Draw_Ellipse_error; |
/*==================== END of Draw_Ellipse =====================*/ |
/*================= BEGIN of Draw_FillEllipse ==================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_FillEllipse_1 |
#include "Draw_FillEllipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_FillEllipse_2 |
#include "Draw_FillEllipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_FillEllipse_3 |
#include "Draw_FillEllipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_FillEllipse_4 |
#include "Draw_FillEllipse.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_FillEllipse_error(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_FillEllipse ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_FillEllipse)(SDL_Surface *super, |
Sint16 x0, Sint16 y0, |
Uint16 Xradius, Uint16 Yradius, |
Uint32 color) = Draw_FillEllipse_error; |
/*================== END of Draw_FillEllipse ===================*/ |
/*==================== BEGIN of Draw_Round =====================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_Round_1 |
#include "Draw_Round.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_Round_2 |
#include "Draw_Round.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_Round_3 |
#include "Draw_Round.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_Round_4 |
#include "Draw_Round.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_Round_error(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_Round ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_Round)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color) = Draw_Round_error; |
/*===================== END of Draw_Round ======================*/ |
/*================== BEGIN of Draw_FillRound ===================*/ |
#define SDL_DRAW_BPP 1 |
#define SDL_DRAWFUNCTION Draw_FillRound_1 |
#include "Draw_FillRound.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 2 |
#define SDL_DRAWFUNCTION Draw_FillRound_2 |
#include "Draw_FillRound.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 3 |
#define SDL_DRAWFUNCTION Draw_FillRound_3 |
#include "Draw_FillRound.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
#define SDL_DRAW_BPP 4 |
#define SDL_DRAWFUNCTION Draw_FillRound_4 |
#include "Draw_FillRound.c" |
#undef SDL_DRAWFUNCTION |
#undef SDL_DRAW_BPP |
static |
void Draw_FillRound_error(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color) |
{ |
SDL_printf("SDL_draw: Draw_FillRound ERROR!!." |
" Have you call to SDL_Draw_Init()?\n"); |
exit(-1); |
} |
void (*Draw_FillRound)(SDL_Surface *super, |
Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
Uint16 corner, Uint32 color) = Draw_FillRound_error; |
/*=================== END of Draw_FillRound ====================*/ |
/*Assignment of function pointers:*/ |
#define SDL_DRAW_FUNCTIONS_BPP(x) \ |
Draw_Pixel = Draw_Pixel_##x; \ |
Draw_Line = Draw_Line_##x; \ |
Draw_Circle = Draw_Circle_##x; \ |
Draw_FillCircle = Draw_FillCircle_##x; \ |
Draw_HLine = Draw_HLine_##x; \ |
Draw_VLine = Draw_VLine_##x; \ |
Draw_Rect = Draw_Rect_##x; \ |
Draw_Ellipse = Draw_Ellipse_##x; \ |
Draw_FillEllipse = Draw_FillEllipse_##x; \ |
Draw_Round = Draw_Round_##x; \ |
Draw_FillRound = Draw_FillRound_##x |
/*IMPORTANT: Call this function AFTER the call to 'SDL_SetVideoMode'*/ |
void Draw_Init(void) |
{ |
SDL_Surface *screen = SDL_GetVideoSurface(); |
if (!screen) { |
SDL_printf("SDL_draw: SDL_Draw_Init ERROR!!." |
" Video Surface not found\n"); |
exit(-2); |
} |
switch(screen->format->BytesPerPixel) { |
case 1: |
SDL_DRAW_FUNCTIONS_BPP(1); |
break; |
case 2: |
SDL_DRAW_FUNCTIONS_BPP(2); |
break; |
case 3: |
SDL_DRAW_FUNCTIONS_BPP(3); |
break; |
case 4: |
SDL_DRAW_FUNCTIONS_BPP(4); |
break; |
}/*switch*/ |
}/*Draw_Init*/ |
#undef SDL_DRAW_FUNCTIONS_BPP |
/contrib/sdk/sources/SDL-1.2.2/SDL_flic-1.2/Makefile |
---|
0,0 → 1,5 |
CFLAGS = -DINLINE=__inline -I. -I$(MENUETDEV)/include/SDL |
OUTFILE = libSDL_flic.a |
OBJS = SDL_flic.o |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
/contrib/sdk/sources/SDL-1.2.2/SDL_flic-1.2/README.txt |
---|
0,0 → 1,31 |
SDL_flic version 1.2 |
http://www.geocities.com/andre_leiradella/ |
For copyright information see the source files. |
SDL_flic is a small library that renders frames of FLI and FLC animation files. |
The library has been tested with under Windows but should work on any platform. |
The functions provided are: |
. int FLI_Version(void): Returns the library version in the format |
MAJOR << 16 | MINOR. |
. FLI_Animation *FLI_Open(SDL_RWops *rwops, int *error): Opens a FLIC animation |
and returns a pointer to it. rwops is left at the same point it was before |
the the call. error receives the result of the call. |
. void FLI_Close(FLI_Animation *flic): Closes the animation, closes the stream |
and frees all used memory. |
. int FLI_NextFrame(FLI_Animation *flic): Renders the next frame of the |
animation returning an int to indicate if it was successfull or not. |
. int FLI_Rewind(FLI_Animation *flic): Rewinds the animation to the first |
frame. |
. int FLI_Skip(FLI_Animation *flic): Skips the current frame without rendering |
it. |
TODO: |
. Handle other formats of FLIC animation. |
. Play animation inside a thread? |
. What else? Tell me: leiradella@bigfoot.com |
/contrib/sdk/sources/SDL-1.2.2/SDL_flic-1.2/SDL_flic.c |
---|
0,0 → 1,469 |
/* |
SDL_flic - renders FLIC animations |
Copyright (C) 2003 Andre de Leiradella |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with this library; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For information about SDL_flic contact leiradella@bigfoot.com |
Version 1.0: first public release. |
Version 1.1: fixed bug to set *error to FLI_OK when returning successfully from FLI_Open |
added function FLI_Reset to reset the animation to the first frame |
Version 1.2: added function FLI_Skip to skip the current frame without rendering |
FLI_Animation->surface is now correctly locked and unlocked |
the rwops stream is now part of the FLI_Animation structure and is closed inside FLI_Close |
renamed FLI_Reset to FLI_Rewind |
added function FLI_Version that returns the library version |
*/ |
#include <SDL_flic.h> |
#include <setjmp.h> |
#include <stdlib.h> |
#include <mem.h> |
/* Library version. */ |
#define FLI_MAJOR 1 |
#define FLI_MINOR 2 |
/* Chunk types. */ |
#define FLI_COLOR256 4 |
#define FLI_SS2 7 |
#define FLI_COLOR 11 |
#define FLI_LC 12 |
#define FLI_BLACK 13 |
#define FLI_BRUN 15 |
#define FLI_COPY 16 |
#define FLI_PSTAMP 18 |
typedef struct { |
Uint32 size, type, numchunks; |
} FLI_Frame; |
typedef struct { |
Uint32 size, type, index; |
} FLI_Chunk; |
static INLINE void readbuffer(FLI_Animation *flic, void *buffer, int size) { |
if (SDL_RWread(flic->rwops, buffer, 1, size) != size) |
longjmp(flic->error, FLI_READERROR); |
} |
static INLINE Uint8 readu8(FLI_Animation *flic) { |
Uint8 b; |
readbuffer(flic, &b, 1); |
return b; |
} |
static INLINE Uint16 readu16(FLI_Animation *flic) { |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
Uint16 hi, lo; |
readbuffer(flic, &lo, 1); |
readbuffer(flic, &hi, 1); |
return hi << 8 | lo; |
#else |
Uint16 w; |
readbuffer(flic, &w, 2); |
return w; |
#endif |
} |
static INLINE Uint32 readu32(FLI_Animation *flic) { |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
Uint32 hi; |
hi = readu16(flic); |
return hi << 16 | readu16(flic); |
#else |
Uint32 u; |
readbuffer(flic, &u, 4); |
return u; |
#endif |
} |
static void readheader(FLI_Animation *flic) { |
/* Skip size, we don't need it. */ |
SDL_RWseek(flic->rwops, 4, SEEK_CUR); |
/* Read and check magic. */ |
flic->format = readu16(flic); |
if (flic->format != FLI_FLI && flic->format != FLI_FLC) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Read number of frames, maximum is 4000 for FLI and FLC files. */ |
flic->numframes = readu16(flic); |
if (flic->numframes > 4000) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Read width and height, must be 320x200 for FLI files. */ |
flic->width = readu16(flic); |
flic->height = readu16(flic); |
if (flic->format == FLI_FLI && (flic->width != 320 || flic->height != 200)) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Read color depth, must be 8 for FLI and FLC files. */ |
flic->depth = readu16(flic); |
if (flic->depth != 8) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Skip the flags, it doesn't look like it follows the specs. */ |
readu16(flic); |
/* Read the delay between frames. */ |
flic->delay = (flic->format == FLI_FLI) ? readu16(flic) : readu32(flic); |
/* Skip rest of the header. */ |
SDL_RWseek(flic->rwops, (flic->format == FLI_FLI) ? 110 : 108, SEEK_CUR); |
} |
static INLINE void readframe(FLI_Animation *flic, FLI_Frame *frame) { |
/* Read the size of the frame, must be less than or equal to 64k in FLI files. */ |
frame->size = readu32(flic); |
if (flic->format == FLI_FLI && frame->size > 65536) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Read the type of the frame, must be 0xF1FA in FLI files or 0xF1FA or 0xF100 in FLC files. */ |
frame->type = readu16(flic); |
if (frame->type != 0xF1FA && (flic->format == FLI_FLC && frame->type != 0xF100)) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Read the number of chunks in this frame. */ |
frame->numchunks = readu16(flic); |
/* Skip rest of the data. */ |
SDL_RWseek(flic->rwops, 8, SEEK_CUR); |
} |
static INLINE void readchunk(FLI_Animation *flic, FLI_Chunk *chunk) { |
/* Read the chunk size. */ |
chunk->size = readu32(flic); |
/* Read the chunk type. */ |
chunk->type = readu16(flic); |
} |
static void handlecolor(FLI_Animation *flic, FLI_Chunk *chunk) { |
int numpackets, index, count; |
SDL_Color color; |
(void)chunk; |
/* Number of packets. */ |
numpackets = readu16(flic); |
/* Color index that will be changed. */ |
index = 0; |
while (numpackets-- > 0) { |
/* Skip some colors. */ |
index += readu8(flic); |
/* And change some others. */ |
count = readu8(flic); |
if (count == 0) |
count = 256; |
while (count-- > 0) { |
/* r, g and b are in the range [0..63]. */ |
color.r = ((Uint32)readu8(flic)) * 255 / 63; |
color.g = ((Uint32)readu8(flic)) * 255 / 63; |
color.b = ((Uint32)readu8(flic)) * 255 / 63; |
SDL_SetColors(flic->surface, &color, index++, 1); |
} |
} |
} |
static void handlelc(FLI_Animation *flic, FLI_Chunk *chunk) { |
int numlines, numpackets, size; |
Uint8 *line, *p; |
(void)chunk; |
/* Skip lines at the top of the image. */ |
line = (Uint8 *)flic->surface->pixels + readu16(flic) * flic->surface->pitch; |
/* numlines lines will change. */ |
numlines = readu16(flic); |
while (numlines-- > 0) { |
p = line; |
line += flic->surface->pitch; |
/* Each line has numpackets changes. */ |
numpackets = readu8(flic); |
while (numpackets-- > 0) { |
/* Skip pixels at the beginning of the line. */ |
p += readu8(flic); |
/* size pixels will change. */ |
size = (Sint8)readu8(flic); |
if (size >= 0) { |
/* Pixels follow. */ |
readbuffer(flic, (void *)p, size); |
} else { |
size = -size; |
/* One pixel to be repeated follow. */ |
memset((void *)p, readu8(flic), size); |
} |
p += size; |
} |
} |
} |
static void handleblack(FLI_Animation *flic, FLI_Chunk *chunk) { |
(void)chunk; |
/* Fill the surface with color 0. */ |
if (SDL_FillRect(flic->surface, NULL, 0) != 0) |
longjmp(flic->error, FLI_SDLERROR); |
} |
static void handlebrun(FLI_Animation *flic, FLI_Chunk *chunk) { |
int numlines, size; |
Uint8 *p, *next; |
(void)chunk; |
/* Begin at the top of the image. */ |
p = (Uint8 *)flic->surface->pixels; |
/* All lines will change. */ |
numlines = flic->height; |
while (numlines-- > 0) { |
/* The number of packages is ignored, packets run until the next line is reached. */ |
readu8(flic); |
next = p + flic->surface->pitch; |
while (p < next) { |
/* size pixels will change. */ |
size = (Sint8)readu8(flic); |
if (size < 0) { |
size = -size; |
/* Pixels follow. */ |
readbuffer(flic, (void *)p, size); |
} else { |
/* One pixel to be repeated follow. */ |
memset((void *)p, readu8(flic), size); |
} |
p += size; |
} |
} |
} |
static void handlecopy(FLI_Animation *flic, FLI_Chunk *chunk) { |
(void)chunk; |
/* Read the entire image from the stream. */ |
readbuffer(flic, (void *)flic->surface->pixels, flic->width * flic->height); |
} |
static void handlecolor256(FLI_Animation *flic, FLI_Chunk *chunk) { |
int numpackets, index, count; |
SDL_Color color; |
(void)chunk; |
if (flic->format == FLI_FLI) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* Number of packets. */ |
numpackets = readu16(flic); |
/* Color index that will be changed. */ |
index = 0; |
while (numpackets-- > 0) { |
/* Skip some colors. */ |
index += readu8(flic); |
/* And change some others. */ |
count = readu8(flic); |
if (count == 0) |
count = 256; |
while (count-- > 0) { |
/* r, g and b are in the range [0..255]. */ |
color.r = readu8(flic); |
color.g = readu8(flic); |
color.b = readu8(flic); |
SDL_SetColors(flic->surface, &color, index++, 1); |
} |
} |
} |
static void handless2(FLI_Animation *flic, FLI_Chunk *chunk) { |
int numlines, y, code, size; |
Uint8 *p, c; |
(void)chunk; |
if (flic->format == FLI_FLI) |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
/* numlines lines will change. */ |
numlines = readu16(flic); |
y = 0; |
while (numlines > 0) { |
/* Read the code. */ |
code = readu16(flic); |
switch ((code >> 14) & 0x03) { |
case 0x00: |
p = (Uint8 *)flic->surface->pixels + flic->surface->pitch * y; |
while (code-- > 0) { |
/* Skip some pixels. */ |
p += readu8(flic); |
size = ((Sint8)readu8(flic)) * 2; |
if (size >= 0) { |
/* Pixels follow. */ |
readbuffer(flic, (void *)p, size); |
} else { |
size = -size; |
readu8(flic); |
/* One pixel to be repeated follow. */ |
memset((void *)p, readu8(flic), size); |
} |
p += size; |
} |
y++; |
numlines--; |
break; |
case 0x01: |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
case 0x02: |
/* Last pixel of the line. */ |
p = (Uint8 *)flic->surface->pixels + flic->surface->pitch * (y + 1); |
p[-1] = code & 0xFF; |
break; |
case 0x03: |
/* Skip some lines. */ |
y += (code ^ 0xFFFF) + 1; |
break; |
} |
} |
} |
int FLI_Version(void) { |
return FLI_MAJOR << 16 | FLI_MINOR; |
} |
FLI_Animation *FLI_Open(SDL_RWops *rwops, int *error) { |
FLI_Animation *flic; |
FLI_Frame frame; |
int err; |
/* Alloc animation. */ |
flic = (FLI_Animation *)malloc(sizeof(FLI_Animation)); |
if (flic == NULL) { |
if (error != NULL) *error = FLI_OUTOFMEMORY; |
return NULL; |
} |
flic->rwops = rwops; |
flic->surface = NULL; |
/* Error handling. */ |
err = setjmp(flic->error); |
if (err != 0) { |
if (error != NULL) *error = err; |
FLI_Close(flic); |
return NULL; |
} |
/* Read the header. */ |
readheader(flic); |
/* Create a buffer to hold the rendered frame. */ |
flic->surface = SDL_CreateRGBSurface(SDL_SWSURFACE, flic->width, flic->height, 8, 0, 0, 0, 0); |
if (flic->surface == NULL) |
longjmp(flic->error, FLI_SDLERROR); |
/* Read the first frame. */ |
flic->offframe1 = SDL_RWtell(rwops); |
readframe(flic, &frame); |
/* If it's a prefix frame, skip it. */ |
if (frame.type == 0xF100) { |
SDL_RWseek(rwops, frame.size - 16, SEEK_CUR); |
flic->offframe1 = SDL_RWtell(rwops); |
flic->numframes--; |
} |
flic->offnextframe = flic->offframe1; |
flic->nextframe = 1; |
if (error != NULL) *error = FLI_OK; |
return flic; |
} |
void FLI_Close(FLI_Animation *flic) { |
if (flic != NULL) { |
if (flic->rwops != NULL) |
SDL_RWclose(flic->rwops); |
if (flic->surface != NULL) |
SDL_FreeSurface(flic->surface); |
free(flic); |
} |
} |
int FLI_NextFrame(FLI_Animation *flic) { |
FLI_Frame frame; |
FLI_Chunk chunk; |
int error, locked; |
Uint32 i; |
/* Flag to tell if the surface is locked. */ |
locked = 0; |
/* Error handling. */ |
error = setjmp(flic->error); |
if (error != 0) { |
if (locked) |
SDL_UnlockSurface(flic->surface); |
return error; |
} |
/* Seek to the current frame. */ |
SDL_RWseek(flic->rwops, flic->offnextframe, SEEK_SET); |
/* Read the current frame. */ |
readframe(flic, &frame); |
/* Read and process each of the chunks of this frame. */ |
SDL_LockSurface(flic->surface); |
locked = 1; |
(void)locked; |
for (i = frame.numchunks; i != 0; i--) { |
readchunk(flic, &chunk); |
switch (chunk.type) { |
case FLI_COLOR: |
handlecolor(flic, &chunk); |
break; |
case FLI_LC: |
handlelc(flic, &chunk); |
break; |
case FLI_BLACK: |
handleblack(flic, &chunk); |
break; |
case FLI_BRUN: |
handlebrun(flic, &chunk); |
break; |
case FLI_COPY: |
handlecopy(flic, &chunk); |
break; |
case FLI_COLOR256: |
handlecolor256(flic, &chunk); |
break; |
case FLI_SS2: |
handless2(flic, &chunk); |
break; |
case FLI_PSTAMP: |
/* Ignore this chunk. */ |
break; |
default: |
longjmp(flic->error, FLI_CORRUPTEDFILE); |
} |
} |
SDL_UnlockSurface(flic->surface); |
/* Setup the number and position of next frame. If it wraps, go to the first one. */ |
if (++flic->nextframe > flic->numframes) { |
flic->offnextframe = flic->offframe1; |
flic->nextframe = 1; |
} else |
flic->offnextframe += frame.size; |
return FLI_OK; |
} |
int FLI_Rewind(FLI_Animation *flic) { |
flic->offnextframe = flic->offframe1; |
flic->nextframe = 1; |
return FLI_OK; |
} |
int FLI_Skip(FLI_Animation *flic) { |
FLI_Frame frame; |
int error; |
/* Error handling. */ |
error = setjmp(flic->error); |
if (error != 0) |
return error; |
/* Seek to the current frame. */ |
SDL_RWseek(flic->rwops, flic->offnextframe, SEEK_SET); |
/* Read the current frame. */ |
readframe(flic, &frame); |
/* Skip to the next frame without rendering. */ |
if (++flic->nextframe > flic->numframes) { |
flic->offnextframe = flic->offframe1; |
flic->nextframe = 1; |
} else |
flic->offnextframe += frame.size; |
return FLI_OK; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_flic-1.2/SDL_flic.h |
---|
0,0 → 1,102 |
/* |
SDL_flic - renders FLIC animations |
Copyright (C) 2003 Andre de Leiradella |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Lesser General Public |
License as published by the Free Software Foundation; either |
version 2.1 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Lesser General Public License for more details. |
You should have received a copy of the GNU Lesser General Public |
License along with this library; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
For information about SDL_flic contact leiradella@bigfoot.com |
Version 1.0: first public release. |
Version 1.1: fixed bug to set *error to FLI_OK when returning successfully from FLI_Open |
added function FLI_Reset to reset the animation to the first frame |
Version 1.2: added function FLI_Skip to skip the current frame without rendering |
FLI_Animation->surface is now correctly locked and unlocked |
the rwops stream is now part of the FLI_Animation structure and is closed inside FLI_Close |
renamed FLI_Reset to FLI_Rewind |
added function FLI_Version that returns the library version |
*/ |
#ifndef __SDL_flic_h__ |
#define __SDL_flic_h__ |
#include <SDL.h> |
#include <setjmp.h> |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Supported formats. */ |
#define FLI_FLI 0xAF11 |
#define FLI_FLC 0xAF12 |
/* Error codes. */ |
/* No error. */ |
#define FLI_OK 0 |
/* Error reading the file. */ |
#define FLI_READERROR 1 |
/* Invalid frame size (corrupted file). */ |
#define FLI_CORRUPTEDFILE 2 |
/* Error in SDL operation. */ |
#define FLI_SDLERROR 3 |
/* Out of memory. */ |
#define FLI_OUTOFMEMORY 4 |
/* |
The animation structure, all members are read-only, don't try to longjmp to |
error. |
*/ |
typedef struct { |
Uint32 format, numframes, width, height, depth, delay, offframe1, nextframe, offnextframe; |
/* rwops is where the animation is read from. */ |
SDL_RWops *rwops; |
/* surface is where the frames is rendered to. */ |
SDL_Surface *surface; |
/* error is used to longjmp in case of error so to avoid a chain of if's. */ |
jmp_buf error; |
} FLI_Animation; |
/* |
Returns the library version in the format MAJOR << 16 | MINOR. |
*/ |
extern int FLI_Version(void); |
/* |
Opens a FLIC animation and return a pointer to it. rwops is left at the same |
point it was before the the call. error receives the result of the call. |
*/ |
extern FLI_Animation *FLI_Open(SDL_RWops *rwops, int *error); |
/* |
Closes the animation, closes the stream and frees all used memory. |
*/ |
extern void FLI_Close(FLI_Animation *flic); |
/* |
Renders the next frame of the animation returning an int to indicate if it was |
successfull or not. |
*/ |
extern int FLI_NextFrame(FLI_Animation *flic); |
/* |
Rewinds the animation to the first frame. |
*/ |
extern int FLI_Rewind(FLI_Animation *flic); |
/* |
Skips the current frame of the animation without rendering it. |
*/ |
extern int FLI_Skip(FLI_Animation *flic); |
#ifdef __cplusplus |
}; |
#endif |
#endif |
/contrib/sdk/sources/SDL-1.2.2/SDL_flic-1.2/playflic.c |
---|
0,0 → 1,92 |
/* |
playflic - play a FLIC file on the screen |
Placed in the public domain by Andre de Leiradella on 24-fev-2003. |
You'll need SDL and SDLmain to compile this program. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <SDL.h> |
#include <SDL_main.h> |
#include "SDL_flic.h" |
int main(int argc, char *argv[]) { |
SDL_RWops *rwops; |
FLI_Animation *flic; |
int error; |
SDL_Surface *screen; |
SDL_Rect pos; |
SDL_Event event; |
Uint32 ticks, ticks2; |
if (argc != 2) { |
fprintf(stderr, "Usage: playflic <flicfile>\n"); |
return 0; |
} |
/* Open the flic. */ |
rwops = SDL_RWFromFile(argv[1], "rb"); |
if (rwops == NULL) { |
fprintf(stderr, "FLIC file not found\n"); |
return 0; |
} |
flic = FLI_Open(rwops, &error); |
if (error != FLI_OK) |
goto out; |
/* Init SDL. */ |
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { |
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); |
goto out; |
} |
atexit(SDL_Quit); |
/* Set the video with the size of the flic. */ |
screen = SDL_SetVideoMode(flic->width, flic->height, 0, SDL_SWSURFACE); |
if (screen == NULL) { |
fprintf(stderr, "Couldn't set %dx%d video mode: %s\n", flic->width, flic->height, SDL_GetError()); |
goto out; |
} |
/* Play the flic. */ |
pos.x = pos.y = 0; |
ticks = SDL_GetTicks(); |
for (;;) { |
/* Render the next frame. */ |
error = FLI_NextFrame(flic); |
if (error != FLI_OK) |
goto out; |
/* Blit it. */ |
SDL_BlitSurface(flic->surface, NULL, screen, &pos); |
SDL_UpdateRect(screen, 0, 0, 0, 0); |
/* Exit program in case of any event. */ |
while (SDL_PollEvent(&event) == 1) { |
switch (event.type) { |
case SDL_MOUSEBUTTONDOWN: |
case SDL_KEYDOWN: |
case SDL_QUIT: |
goto out; |
} |
} |
/* Delay between frames. */ |
ticks = SDL_GetTicks() - ticks; |
if (ticks < flic->delay) |
SDL_Delay(flic->delay - ticks); |
ticks = SDL_GetTicks(); |
} |
out: |
/* Describe the error. */ |
switch (error) { |
case FLI_READERROR: |
fprintf(stderr, "Error while reading FLIC\n"); |
break; |
case FLI_CORRUPTEDFILE: |
fprintf(stderr, "FLIC file corrupted\n"); |
break; |
case FLI_SDLERROR: |
fprintf(stderr, "SDL error: %s\n", SDL_GetError()); |
break; |
case FLI_OUTOFMEMORY: |
fprintf(stderr, "Out of memory\n"); |
break; |
} |
FLI_Close(flic); |
return 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_flic-1.2/sample.flc |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG.c |
---|
0,0 → 1,134 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* A simple library to load images of various formats as SDL surfaces */ |
#include <stdio.h> |
#include <string.h> |
#include <ctype.h> |
#include "SDL_image.h" |
#define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0])) |
/* Table of image detection and loading functions */ |
static struct { |
char *type; |
int (*is)(SDL_RWops *src); |
SDL_Surface *(*load)(SDL_RWops *src); |
} supported[] = { |
/* keep magicless formats first */ |
{ "TGA", 0, IMG_LoadTGA_RW }, |
{ "BMP", IMG_isBMP, IMG_LoadBMP_RW }, |
{ "PNM", IMG_isPNM, IMG_LoadPNM_RW }, /* P[BGP]M share code */ |
{ "XPM", IMG_isXPM, IMG_LoadXPM_RW }, |
{ "XCF", IMG_isXCF, IMG_LoadXCF_RW }, |
{ "PCX", IMG_isPCX, IMG_LoadPCX_RW }, |
{ "GIF", IMG_isGIF, IMG_LoadGIF_RW }, |
{ "JPG", IMG_isJPG, IMG_LoadJPG_RW }, |
{ "TIF", IMG_isTIF, IMG_LoadTIF_RW }, |
{ "PNG", IMG_isPNG, IMG_LoadPNG_RW } |
}; |
/* Load an image from a file */ |
SDL_Surface *IMG_Load(const char *file) |
{ |
SDL_RWops *src = SDL_RWFromFile(file, "rb"); |
char *ext = strrchr(file, '.'); |
if(ext) |
ext++; |
return IMG_LoadTyped_RW(src, 1, ext); |
} |
/* Load an image from an SDL datasource (for compatibility) */ |
SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc) |
{ |
return IMG_LoadTyped_RW(src, freesrc, NULL); |
} |
/* Portable case-insensitive string compare function */ |
int IMG_string_equals(const char *str1, const char *str2) |
{ |
while ( *str1 && *str2 ) { |
if ( toupper((unsigned char)*str1) != |
toupper((unsigned char)*str2) ) |
break; |
++str1; |
++str2; |
} |
return (!*str1 && !*str2); |
} |
/* Load an image from an SDL datasource, optionally specifying the type */ |
SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type) |
{ |
int i, start; |
SDL_Surface *image; |
/* Make sure there is something to do.. */ |
if ( src == NULL ) { |
return(NULL); |
} |
/* See whether or not this data source can handle seeking */ |
if ( SDL_RWseek(src, 0, SEEK_CUR) < 0 ) { |
IMG_SetError("Can't seek in this data source"); |
return(NULL); |
} |
/* Detect the type of image being loaded */ |
start = SDL_RWtell(src); |
image = NULL; |
for ( i=0; i < ARRAYSIZE(supported); ++i ) { |
if( (supported[i].is |
&& (SDL_RWseek(src, start, SEEK_SET), |
supported[i].is(src))) |
|| (type && IMG_string_equals(type, supported[i].type))) { |
#ifdef DEBUG_IMGLIB |
SDL_printf("IMGLIB: Loading image as %s\n", |
supported[i].type); |
#endif |
SDL_RWseek(src, start, SEEK_SET); |
image = supported[i].load(src); |
break; |
} |
} |
/* Clean up, check for errors, and return */ |
if ( freesrc ) { |
SDL_RWclose(src); |
} |
if ( i == ARRAYSIZE(supported) ) { |
IMG_SetError("Unsupported image format"); |
} |
return(image); |
} |
/* Invert the alpha of a surface for use with OpenGL |
This function is a no-op and only kept for backwards compatibility. |
*/ |
int IMG_InvertAlpha(int on) |
{ |
return 1; |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_bmp.c |
---|
0,0 → 1,69 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* This is a BMP image file loading framework */ |
#include <stdio.h> |
#include <string.h> |
#include "SDL_image.h" |
#ifdef LOAD_BMP |
/* See if an image is contained in a data source */ |
int IMG_isBMP(SDL_RWops *src) |
{ |
int is_BMP; |
char magic[2]; |
is_BMP = 0; |
if ( SDL_RWread(src, magic, 2, 1) ) { |
if ( strncmp(magic, "BM", 2) == 0 ) { |
is_BMP = 1; |
} |
} |
return(is_BMP); |
} |
/* Load a BMP type image from an SDL datasource */ |
SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src) |
{ |
return(SDL_LoadBMP_RW(src, 0)); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isBMP(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a BMP type image from an SDL datasource */ |
SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_BMP */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_gif.c |
---|
0,0 → 1,604 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* This is a GIF image file loading framework */ |
#include <stdio.h> |
#include <string.h> |
#include "SDL_image.h" |
#ifdef LOAD_GIF |
/* See if an image is contained in a data source */ |
int IMG_isGIF(SDL_RWops *src) |
{ |
int is_GIF; |
char magic[6]; |
is_GIF = 0; |
if ( SDL_RWread(src, magic, 6, 1) ) { |
if ( (strncmp(magic, "GIF", 3) == 0) && |
((memcmp(magic + 3, "87a", 3) == 0) || |
(memcmp(magic + 3, "89a", 3) == 0)) ) { |
is_GIF = 1; |
} |
} |
return(is_GIF); |
} |
/* Code from here to end of file has been adapted from XPaint: */ |
/* +-------------------------------------------------------------------+ */ |
/* | Copyright 1990, 1991, 1993 David Koblas. | */ |
/* | Copyright 1996 Torsten Martinsen. | */ |
/* | Permission to use, copy, modify, and distribute this software | */ |
/* | and its documentation for any purpose and without fee is hereby | */ |
/* | granted, provided that the above copyright notice appear in all | */ |
/* | copies and that both that copyright notice and this permission | */ |
/* | notice appear in supporting documentation. This software is | */ |
/* | provided "as is" without express or implied warranty. | */ |
/* +-------------------------------------------------------------------+ */ |
/* Adapted for use in SDL by Sam Lantinga -- 7/20/98 */ |
#define USED_BY_SDL |
#include <stdio.h> |
#include <string.h> |
#ifdef USED_BY_SDL |
/* Changes to work with SDL: |
Include SDL header file |
Use SDL_Surface rather than xpaint Image structure |
Define SDL versions of RWSetMsg(), ImageNewCmap() and ImageSetCmap() |
*/ |
#include "SDL.h" |
#define Image SDL_Surface |
#define RWSetMsg IMG_SetError |
#define ImageNewCmap(w, h, s) SDL_AllocSurface(SDL_SWSURFACE,w,h,8,0,0,0,0) |
#define ImageSetCmap(s, i, R, G, B) do { \ |
s->format->palette->colors[i].r = R; \ |
s->format->palette->colors[i].g = G; \ |
s->format->palette->colors[i].b = B; \ |
} while (0) |
/* * * * * */ |
#else |
/* Original XPaint sources */ |
#include "image.h" |
#include "rwTable.h" |
#define SDL_RWops FILE |
#define SDL_RWclose fclose |
#endif /* USED_BY_SDL */ |
#define MAXCOLORMAPSIZE 256 |
#define TRUE 1 |
#define FALSE 0 |
#define CM_RED 0 |
#define CM_GREEN 1 |
#define CM_BLUE 2 |
#define MAX_LWZ_BITS 12 |
#define INTERLACE 0x40 |
#define LOCALCOLORMAP 0x80 |
#define BitSet(byte, bit) (((byte) & (bit)) == (bit)) |
#define ReadOK(file,buffer,len) SDL_RWread(file, buffer, len, 1) |
#define LM_to_uint(a,b) (((b)<<8)|(a)) |
static struct { |
unsigned int Width; |
unsigned int Height; |
unsigned char ColorMap[3][MAXCOLORMAPSIZE]; |
unsigned int BitPixel; |
unsigned int ColorResolution; |
unsigned int Background; |
unsigned int AspectRatio; |
int GrayScale; |
} GifScreen; |
static struct { |
int transparent; |
int delayTime; |
int inputFlag; |
int disposal; |
} Gif89; |
static int ReadColorMap(SDL_RWops * src, int number, |
unsigned char buffer[3][MAXCOLORMAPSIZE], int *flag); |
static int DoExtension(SDL_RWops * src, int label); |
static int GetDataBlock(SDL_RWops * src, unsigned char *buf); |
static int GetCode(SDL_RWops * src, int code_size, int flag); |
static int LWZReadByte(SDL_RWops * src, int flag, int input_code_size); |
static Image *ReadImage(SDL_RWops * src, int len, int height, int, |
unsigned char cmap[3][MAXCOLORMAPSIZE], |
int gray, int interlace, int ignore); |
Image * |
IMG_LoadGIF_RW(SDL_RWops *src) |
{ |
unsigned char buf[16]; |
unsigned char c; |
unsigned char localColorMap[3][MAXCOLORMAPSIZE]; |
int grayScale; |
int useGlobalColormap; |
int bitPixel; |
int imageCount = 0; |
char version[4]; |
int imageNumber = 1; |
Image *image = NULL; |
if ( src == NULL ) { |
goto done; |
} |
if (!ReadOK(src, buf, 6)) { |
RWSetMsg("error reading magic number"); |
goto done; |
} |
if (strncmp((char *) buf, "GIF", 3) != 0) { |
RWSetMsg("not a GIF file"); |
goto done; |
} |
strncpy(version, (char *) buf + 3, 3); |
version[3] = '\0'; |
if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { |
RWSetMsg("bad version number, not '87a' or '89a'"); |
goto done; |
} |
Gif89.transparent = -1; |
Gif89.delayTime = -1; |
Gif89.inputFlag = -1; |
Gif89.disposal = 0; |
if (!ReadOK(src, buf, 7)) { |
RWSetMsg("failed to read screen descriptor"); |
goto done; |
} |
GifScreen.Width = LM_to_uint(buf[0], buf[1]); |
GifScreen.Height = LM_to_uint(buf[2], buf[3]); |
GifScreen.BitPixel = 2 << (buf[4] & 0x07); |
GifScreen.ColorResolution = (((buf[4] & 0x70) >> 3) + 1); |
GifScreen.Background = buf[5]; |
GifScreen.AspectRatio = buf[6]; |
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ |
if (ReadColorMap(src, GifScreen.BitPixel, GifScreen.ColorMap, |
&GifScreen.GrayScale)) { |
RWSetMsg("error reading global colormap"); |
goto done; |
} |
} |
do { |
if (!ReadOK(src, &c, 1)) { |
RWSetMsg("EOF / read error on image data"); |
goto done; |
} |
if (c == ';') { /* GIF terminator */ |
if (imageCount < imageNumber) { |
RWSetMsg("only %d image%s found in file", |
imageCount, imageCount > 1 ? "s" : ""); |
goto done; |
} |
} |
if (c == '!') { /* Extension */ |
if (!ReadOK(src, &c, 1)) { |
RWSetMsg("EOF / read error on extention function code"); |
goto done; |
} |
DoExtension(src, c); |
continue; |
} |
if (c != ',') { /* Not a valid start character */ |
continue; |
} |
++imageCount; |
if (!ReadOK(src, buf, 9)) { |
RWSetMsg("couldn't read left/top/width/height"); |
goto done; |
} |
useGlobalColormap = !BitSet(buf[8], LOCALCOLORMAP); |
bitPixel = 1 << ((buf[8] & 0x07) + 1); |
if (!useGlobalColormap) { |
if (ReadColorMap(src, bitPixel, localColorMap, &grayScale)) { |
RWSetMsg("error reading local colormap"); |
goto done; |
} |
image = ReadImage(src, LM_to_uint(buf[4], buf[5]), |
LM_to_uint(buf[6], buf[7]), |
bitPixel, localColorMap, grayScale, |
BitSet(buf[8], INTERLACE), |
imageCount != imageNumber); |
} else { |
image = ReadImage(src, LM_to_uint(buf[4], buf[5]), |
LM_to_uint(buf[6], buf[7]), |
GifScreen.BitPixel, GifScreen.ColorMap, |
GifScreen.GrayScale, BitSet(buf[8], INTERLACE), |
imageCount != imageNumber); |
} |
} while (image == NULL); |
#ifdef USED_BY_SDL |
if ( Gif89.transparent > 0 ) { |
SDL_SetColorKey(image, SDL_SRCCOLORKEY, Gif89.transparent); |
} |
#endif |
done: |
return image; |
} |
static int |
ReadColorMap(SDL_RWops *src, int number, |
unsigned char buffer[3][MAXCOLORMAPSIZE], int *gray) |
{ |
int i; |
unsigned char rgb[3]; |
int flag; |
flag = TRUE; |
for (i = 0; i < number; ++i) { |
if (!ReadOK(src, rgb, sizeof(rgb))) { |
RWSetMsg("bad colormap"); |
return 1; |
} |
buffer[CM_RED][i] = rgb[0]; |
buffer[CM_GREEN][i] = rgb[1]; |
buffer[CM_BLUE][i] = rgb[2]; |
flag &= (rgb[0] == rgb[1] && rgb[1] == rgb[2]); |
} |
#if 0 |
if (flag) |
*gray = (number == 2) ? PBM_TYPE : PGM_TYPE; |
else |
*gray = PPM_TYPE; |
#else |
*gray = 0; |
#endif |
return FALSE; |
} |
static int |
DoExtension(SDL_RWops *src, int label) |
{ |
static unsigned char buf[256]; |
char *str; |
switch (label) { |
case 0x01: /* Plain Text Extension */ |
str = "Plain Text Extension"; |
break; |
case 0xff: /* Application Extension */ |
str = "Application Extension"; |
break; |
case 0xfe: /* Comment Extension */ |
str = "Comment Extension"; |
while (GetDataBlock(src, (unsigned char *) buf) != 0); |
return FALSE; |
case 0xf9: /* Graphic Control Extension */ |
str = "Graphic Control Extension"; |
(void) GetDataBlock(src, (unsigned char *) buf); |
Gif89.disposal = (buf[0] >> 2) & 0x7; |
Gif89.inputFlag = (buf[0] >> 1) & 0x1; |
Gif89.delayTime = LM_to_uint(buf[1], buf[2]); |
if ((buf[0] & 0x1) != 0) |
Gif89.transparent = buf[3]; |
while (GetDataBlock(src, (unsigned char *) buf) != 0); |
return FALSE; |
default: |
str = (char *)buf; |
sprintf(str, "UNKNOWN (0x%02x)", label); |
break; |
} |
while (GetDataBlock(src, (unsigned char *) buf) != 0); |
return FALSE; |
} |
static int ZeroDataBlock = FALSE; |
static int |
GetDataBlock(SDL_RWops *src, unsigned char *buf) |
{ |
unsigned char count; |
if (!ReadOK(src, &count, 1)) { |
/* pm_message("error in getting DataBlock size" ); */ |
return -1; |
} |
ZeroDataBlock = count == 0; |
if ((count != 0) && (!ReadOK(src, buf, count))) { |
/* pm_message("error in reading DataBlock" ); */ |
return -1; |
} |
return count; |
} |
static int |
GetCode(SDL_RWops *src, int code_size, int flag) |
{ |
static unsigned char buf[280]; |
static int curbit, lastbit, done, last_byte; |
int i, j, ret; |
unsigned char count; |
if (flag) { |
curbit = 0; |
lastbit = 0; |
done = FALSE; |
return 0; |
} |
if ((curbit + code_size) >= lastbit) { |
if (done) { |
if (curbit >= lastbit) |
RWSetMsg("ran off the end of my bits"); |
return -1; |
} |
buf[0] = buf[last_byte - 2]; |
buf[1] = buf[last_byte - 1]; |
if ((count = GetDataBlock(src, &buf[2])) == 0) |
done = TRUE; |
last_byte = 2 + count; |
curbit = (curbit - lastbit) + 16; |
lastbit = (2 + count) * 8; |
} |
ret = 0; |
for (i = curbit, j = 0; j < code_size; ++i, ++j) |
ret |= ((buf[i / 8] & (1 << (i % 8))) != 0) << j; |
curbit += code_size; |
return ret; |
} |
static int |
LWZReadByte(SDL_RWops *src, int flag, int input_code_size) |
{ |
static int fresh = FALSE; |
int code, incode; |
static int code_size, set_code_size; |
static int max_code, max_code_size; |
static int firstcode, oldcode; |
static int clear_code, end_code; |
static int table[2][(1 << MAX_LWZ_BITS)]; |
static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp; |
register int i; |
if (flag) { |
set_code_size = input_code_size; |
code_size = set_code_size + 1; |
clear_code = 1 << set_code_size; |
end_code = clear_code + 1; |
max_code_size = 2 * clear_code; |
max_code = clear_code + 2; |
GetCode(src, 0, TRUE); |
fresh = TRUE; |
for (i = 0; i < clear_code; ++i) { |
table[0][i] = 0; |
table[1][i] = i; |
} |
for (; i < (1 << MAX_LWZ_BITS); ++i) |
table[0][i] = table[1][0] = 0; |
sp = stack; |
return 0; |
} else if (fresh) { |
fresh = FALSE; |
do { |
firstcode = oldcode = GetCode(src, code_size, FALSE); |
} while (firstcode == clear_code); |
return firstcode; |
} |
if (sp > stack) |
return *--sp; |
while ((code = GetCode(src, code_size, FALSE)) >= 0) { |
if (code == clear_code) { |
for (i = 0; i < clear_code; ++i) { |
table[0][i] = 0; |
table[1][i] = i; |
} |
for (; i < (1 << MAX_LWZ_BITS); ++i) |
table[0][i] = table[1][i] = 0; |
code_size = set_code_size + 1; |
max_code_size = 2 * clear_code; |
max_code = clear_code + 2; |
sp = stack; |
firstcode = oldcode = GetCode(src, code_size, FALSE); |
return firstcode; |
} else if (code == end_code) { |
int count; |
unsigned char buf[260]; |
if (ZeroDataBlock) |
return -2; |
while ((count = GetDataBlock(src, buf)) > 0); |
if (count != 0) { |
/* |
* pm_message("missing EOD in data stream (common occurence)"); |
*/ |
} |
return -2; |
} |
incode = code; |
if (code >= max_code) { |
*sp++ = firstcode; |
code = oldcode; |
} |
while (code >= clear_code) { |
*sp++ = table[1][code]; |
if (code == table[0][code]) |
RWSetMsg("circular table entry BIG ERROR"); |
code = table[0][code]; |
} |
*sp++ = firstcode = table[1][code]; |
if ((code = max_code) < (1 << MAX_LWZ_BITS)) { |
table[0][code] = oldcode; |
table[1][code] = firstcode; |
++max_code; |
if ((max_code >= max_code_size) && |
(max_code_size < (1 << MAX_LWZ_BITS))) { |
max_code_size *= 2; |
++code_size; |
} |
} |
oldcode = incode; |
if (sp > stack) |
return *--sp; |
} |
return code; |
} |
static Image * |
ReadImage(SDL_RWops * src, int len, int height, int cmapSize, |
unsigned char cmap[3][MAXCOLORMAPSIZE], |
int gray, int interlace, int ignore) |
{ |
Image *image; |
unsigned char c; |
int i, v; |
int xpos = 0, ypos = 0, pass = 0; |
/* |
** Initialize the compression routines |
*/ |
if (!ReadOK(src, &c, 1)) { |
RWSetMsg("EOF / read error on image data"); |
return NULL; |
} |
if (LWZReadByte(src, TRUE, c) < 0) { |
RWSetMsg("error reading image"); |
return NULL; |
} |
/* |
** If this is an "uninteresting picture" ignore it. |
*/ |
if (ignore) { |
while (LWZReadByte(src, FALSE, c) >= 0); |
return NULL; |
} |
image = ImageNewCmap(len, height, cmapSize); |
for (i = 0; i < cmapSize; i++) |
ImageSetCmap(image, i, cmap[CM_RED][i], |
cmap[CM_GREEN][i], cmap[CM_BLUE][i]); |
while ((v = LWZReadByte(src, FALSE, c)) >= 0) { |
#ifdef USED_BY_SDL |
((Uint8 *)image->pixels)[xpos + ypos * image->pitch] = v; |
#else |
image->data[xpos + ypos * len] = v; |
#endif |
++xpos; |
if (xpos == len) { |
xpos = 0; |
if (interlace) { |
switch (pass) { |
case 0: |
case 1: |
ypos += 8; |
break; |
case 2: |
ypos += 4; |
break; |
case 3: |
ypos += 2; |
break; |
} |
if (ypos >= height) { |
++pass; |
switch (pass) { |
case 1: |
ypos = 4; |
break; |
case 2: |
ypos = 2; |
break; |
case 3: |
ypos = 1; |
break; |
default: |
goto fini; |
} |
} |
} else { |
++ypos; |
} |
} |
if (ypos >= height) |
break; |
} |
fini: |
return image; |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isGIF(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a GIF type image from an SDL datasource */ |
SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_GIF */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_jpg.c |
---|
0,0 → 1,242 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* This is a JPEG image file loading framework */ |
#include <stdio.h> |
#include <string.h> |
#include "SDL_image.h" |
#ifdef LOAD_JPG |
#include <jpeglib.h> |
/* Define this for fast loading and not as good image quality */ |
/*#define FAST_JPEG*/ |
/* See if an image is contained in a data source */ |
int IMG_isJPG(SDL_RWops *src) |
{ |
int is_JPG; |
Uint8 magic[4]; |
is_JPG = 0; |
if ( SDL_RWread(src, magic, 2, 1) ) { |
if ( (magic[0] == 0xFF) && (magic[1] == 0xD8) ) { |
SDL_RWread(src, magic, 4, 1); |
SDL_RWread(src, magic, 4, 1); |
if ( memcmp((char *)magic, "JFIF", 4) == 0 ) { |
is_JPG = 1; |
} |
} |
} |
return(is_JPG); |
} |
#define INPUT_BUFFER_SIZE 4096 |
typedef struct { |
struct jpeg_source_mgr pub; |
SDL_RWops *ctx; |
Uint8 buffer[INPUT_BUFFER_SIZE]; |
} my_source_mgr; |
/* |
* Initialize source --- called by jpeg_read_header |
* before any data is actually read. |
*/ |
static void init_source (j_decompress_ptr cinfo) |
{ |
/* We don't actually need to do anything */ |
return; |
} |
/* |
* Fill the input buffer --- called whenever buffer is emptied. |
*/ |
static int fill_input_buffer (j_decompress_ptr cinfo) |
{ |
my_source_mgr * src = (my_source_mgr *) cinfo->src; |
int nbytes; |
nbytes = SDL_RWread(src->ctx, src->buffer, 1, INPUT_BUFFER_SIZE); |
if (nbytes <= 0) { |
/* Insert a fake EOI marker */ |
src->buffer[0] = (Uint8) 0xFF; |
src->buffer[1] = (Uint8) JPEG_EOI; |
nbytes = 2; |
} |
src->pub.next_input_byte = src->buffer; |
src->pub.bytes_in_buffer = nbytes; |
return TRUE; |
} |
/* |
* Skip data --- used to skip over a potentially large amount of |
* uninteresting data (such as an APPn marker). |
* |
* Writers of suspendable-input applications must note that skip_input_data |
* is not granted the right to give a suspension return. If the skip extends |
* beyond the data currently in the buffer, the buffer can be marked empty so |
* that the next read will cause a fill_input_buffer call that can suspend. |
* Arranging for additional bytes to be discarded before reloading the input |
* buffer is the application writer's problem. |
*/ |
static void skip_input_data (j_decompress_ptr cinfo, long num_bytes) |
{ |
my_source_mgr * src = (my_source_mgr *) cinfo->src; |
/* Just a dumb implementation for now. Could use fseek() except |
* it doesn't work on pipes. Not clear that being smart is worth |
* any trouble anyway --- large skips are infrequent. |
*/ |
if (num_bytes > 0) { |
while (num_bytes > (long) src->pub.bytes_in_buffer) { |
num_bytes -= (long) src->pub.bytes_in_buffer; |
(void) src->pub.fill_input_buffer(cinfo); |
/* note we assume that fill_input_buffer will never |
* return FALSE, so suspension need not be handled. |
*/ |
} |
src->pub.next_input_byte += (size_t) num_bytes; |
src->pub.bytes_in_buffer -= (size_t) num_bytes; |
} |
} |
/* |
* Terminate source --- called by jpeg_finish_decompress |
* after all data has been read. |
*/ |
static void term_source (j_decompress_ptr cinfo) |
{ |
/* We don't actually need to do anything */ |
return; |
} |
/* |
* Prepare for input from a stdio stream. |
* The caller must have already opened the stream, and is responsible |
* for closing it after finishing decompression. |
*/ |
static void jpeg_SDL_RW_src (j_decompress_ptr cinfo, SDL_RWops *ctx) |
{ |
my_source_mgr *src; |
/* The source object and input buffer are made permanent so that a series |
* of JPEG images can be read from the same file by calling jpeg_stdio_src |
* only before the first one. (If we discarded the buffer at the end of |
* one image, we'd likely lose the start of the next one.) |
* This makes it unsafe to use this manager and a different source |
* manager serially with the same JPEG object. Caveat programmer. |
*/ |
if (cinfo->src == NULL) { /* first time for this JPEG object? */ |
cinfo->src = (struct jpeg_source_mgr *) |
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, |
sizeof(my_source_mgr)); |
src = (my_source_mgr *) cinfo->src; |
} |
src = (my_source_mgr *) cinfo->src; |
src->pub.init_source = init_source; |
src->pub.fill_input_buffer = fill_input_buffer; |
src->pub.skip_input_data = skip_input_data; |
src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ |
src->pub.term_source = term_source; |
src->ctx = ctx; |
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ |
src->pub.next_input_byte = NULL; /* until buffer loaded */ |
} |
/* Load a JPEG type image from an SDL datasource */ |
SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src) |
{ |
struct jpeg_error_mgr errmgr; |
struct jpeg_decompress_struct cinfo; |
JSAMPROW rowptr[1]; |
SDL_Surface *surface; |
/* Create a decompression structure and load the JPEG header */ |
cinfo.err = jpeg_std_error(&errmgr); |
jpeg_create_decompress(&cinfo); |
jpeg_SDL_RW_src(&cinfo, src); |
jpeg_read_header(&cinfo, TRUE); |
/* Set 24-bit RGB output */ |
cinfo.out_color_space = JCS_RGB; |
cinfo.quantize_colors = FALSE; |
#ifdef FAST_JPEG |
cinfo.scale_num = 1; |
cinfo.scale_denom = 1; |
cinfo.dct_method = JDCT_FASTEST; |
cinfo.do_fancy_upsampling = FALSE; |
#endif |
jpeg_calc_output_dimensions(&cinfo); |
/* Allocate an output surface to hold the image */ |
surface = SDL_AllocSurface(SDL_SWSURFACE, |
cinfo.output_width, cinfo.output_height, 24, |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
0x0000FF, 0x00FF00, 0xFF0000, |
#else |
0xFF0000, 0x00FF00, 0x0000FF, |
#endif |
0); |
if ( surface == NULL ) { |
IMG_SetError("Out of memory"); |
goto done; |
} |
/* Decompress the image */ |
jpeg_start_decompress(&cinfo); |
while ( cinfo.output_scanline < cinfo.output_height ) { |
rowptr[0] = (JSAMPROW)(Uint8 *)surface->pixels + |
cinfo.output_scanline * surface->pitch; |
jpeg_read_scanlines(&cinfo, rowptr, (JDIMENSION) 1); |
} |
jpeg_finish_decompress(&cinfo); |
/* Clean up and return */ |
done: |
jpeg_destroy_decompress(&cinfo); |
return(surface); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isJPG(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a JPEG type image from an SDL datasource */ |
SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_JPG */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_pcx.c |
---|
0,0 → 1,253 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* |
* PCX file reader: |
* Supports: |
* 1..4 bits/pixel in multiplanar format (1 bit/plane/pixel) |
* 8 bits/pixel in single-planar format (8 bits/plane/pixel) |
* 24 bits/pixel in 3-plane format (8 bits/plane/pixel) |
* |
* (The <8bpp formats are expanded to 8bpp surfaces) |
* |
* Doesn't support: |
* single-planar packed-pixel formats other than 8bpp |
* 4-plane 32bpp format with a fourth "intensity" plane |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include "SDL_endian.h" |
#include "SDL_image.h" |
#ifdef LOAD_PCX |
struct PCXheader { |
Uint8 Manufacturer; |
Uint8 Version; |
Uint8 Encoding; |
Uint8 BitsPerPixel; |
Sint16 Xmin, Ymin, Xmax, Ymax; |
Sint16 HDpi, VDpi; |
Uint8 Colormap[48]; |
Uint8 Reserved; |
Uint8 NPlanes; |
Sint16 BytesPerLine; |
Sint16 PaletteInfo; |
Sint16 HscreenSize; |
Sint16 VscreenSize; |
Uint8 Filler[54]; |
}; |
/* See if an image is contained in a data source */ |
int IMG_isPCX(SDL_RWops *src) |
{ |
int is_PCX; |
const int ZSoft_Manufacturer = 10; |
const int PC_Paintbrush_Version = 5; |
const int PCX_RunLength_Encoding = 1; |
struct PCXheader pcxh; |
is_PCX = 0; |
if ( SDL_RWread(src, &pcxh, sizeof(pcxh), 1) == 1 ) { |
if ( (pcxh.Manufacturer == ZSoft_Manufacturer) && |
(pcxh.Version == PC_Paintbrush_Version) && |
(pcxh.Encoding == PCX_RunLength_Encoding) ) { |
is_PCX = 1; |
} |
} |
return(is_PCX); |
} |
/* Load a PCX type image from an SDL datasource */ |
SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src) |
{ |
struct PCXheader pcxh; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
Uint32 Amask; |
SDL_Surface *surface = NULL; |
int width, height; |
int y, bpl; |
Uint8 *row, *buf = NULL; |
char *error = NULL; |
int bits, src_bits; |
if ( ! src ) { |
goto done; |
} |
if ( ! SDL_RWread(src, &pcxh, sizeof(pcxh), 1) ) { |
error = "file truncated"; |
goto done; |
} |
pcxh.Xmin = SDL_SwapLE16(pcxh.Xmin); |
pcxh.Ymin = SDL_SwapLE16(pcxh.Ymin); |
pcxh.Xmax = SDL_SwapLE16(pcxh.Xmax); |
pcxh.Ymax = SDL_SwapLE16(pcxh.Ymax); |
pcxh.BytesPerLine = SDL_SwapLE16(pcxh.BytesPerLine); |
/* Create the surface of the appropriate type */ |
width = (pcxh.Xmax - pcxh.Xmin) + 1; |
height = (pcxh.Ymax - pcxh.Ymin) + 1; |
Rmask = Gmask = Bmask = Amask = 0; |
src_bits = pcxh.BitsPerPixel * pcxh.NPlanes; |
if((pcxh.BitsPerPixel == 1 && pcxh.NPlanes >= 1 && pcxh.NPlanes <= 4) |
|| (pcxh.BitsPerPixel == 8 && pcxh.NPlanes == 1)) { |
bits = 8; |
} else if(pcxh.BitsPerPixel == 8 && pcxh.NPlanes == 3) { |
bits = 24; |
if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { |
Rmask = 0x000000FF; |
Gmask = 0x0000FF00; |
Bmask = 0x00FF0000; |
} else { |
Rmask = 0xFF0000; |
Gmask = 0x00FF00; |
Bmask = 0x0000FF; |
} |
} else { |
error = "unsupported PCX format"; |
goto done; |
} |
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, |
bits, Rmask, Gmask, Bmask, Amask); |
if ( surface == NULL ) |
goto done; |
bpl = pcxh.NPlanes * pcxh.BytesPerLine; |
buf = malloc(bpl); |
row = surface->pixels; |
for ( y=0; y<surface->h; ++y ) { |
/* decode a scan line to a temporary buffer first */ |
int i, count = 0; |
Uint8 ch; |
Uint8 *dst = (src_bits == 8) ? row : buf; |
for(i = 0; i < bpl; i++) { |
if(!count) { |
if(!SDL_RWread(src, &ch, 1, 1)) { |
error = "file truncated"; |
goto done; |
} |
if( (ch & 0xc0) == 0xc0) { |
count = ch & 0x3f; |
if(!SDL_RWread(src, &ch, 1, 1)) { |
error = "file truncated"; |
goto done; |
} |
} else |
count = 1; |
} |
dst[i] = ch; |
count--; |
} |
if(src_bits <= 4) { |
/* expand planes to 1 byte/pixel */ |
Uint8 *src = buf; |
int plane; |
for(plane = 0; plane < pcxh.NPlanes; plane++) { |
int i, j, x = 0; |
for(i = 0; i < pcxh.BytesPerLine; i++) { |
Uint8 byte = *src++; |
for(j = 7; j >= 0; j--) { |
unsigned bit = (byte >> j) & 1; |
row[x++] |= bit << plane; |
} |
} |
} |
} else if(src_bits == 24) { |
/* de-interlace planes */ |
Uint8 *src = buf; |
int plane; |
for(plane = 0; plane < pcxh.NPlanes; plane++) { |
int x; |
dst = row + plane; |
for(x = 0; x < width; x++) { |
*dst = *src++; |
dst += pcxh.NPlanes; |
} |
} |
} |
row += surface->pitch; |
} |
if(bits == 8) { |
SDL_Color *colors = surface->format->palette->colors; |
int nc = 1 << src_bits; |
int i; |
surface->format->palette->ncolors = nc; |
if(src_bits == 8) { |
Uint8 ch; |
/* look for a 256-colour palette */ |
do { |
if ( !SDL_RWread(src, &ch, 1, 1)) { |
error = "file truncated"; |
goto done; |
} |
} while ( ch != 12 ); |
for(i = 0; i < 256; i++) { |
SDL_RWread(src, &colors[i].r, 1, 1); |
SDL_RWread(src, &colors[i].g, 1, 1); |
SDL_RWread(src, &colors[i].b, 1, 1); |
} |
} else { |
for(i = 0; i < nc; i++) { |
colors[i].r = pcxh.Colormap[i * 3]; |
colors[i].g = pcxh.Colormap[i * 3 + 1]; |
colors[i].b = pcxh.Colormap[i * 3 + 2]; |
} |
} |
} |
done: |
free(buf); |
if ( error ) { |
SDL_FreeSurface(surface); |
IMG_SetError(error); |
surface = NULL; |
} |
return(surface); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isPCX(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a PCX type image from an SDL datasource */ |
SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_PCX */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_png.c |
---|
0,0 → 1,286 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* This is a PNG image file loading framework */ |
#include <stdlib.h> |
#include <stdio.h> |
#include "SDL_image.h" |
#ifdef LOAD_PNG |
/*============================================================================= |
File: SDL_png.c |
Purpose: A PNG loader and saver for the SDL library |
Revision: |
Created by: Philippe Lavoie (2 November 1998) |
lavoie@zeus.genie.uottawa.ca |
Modified by: |
Copyright notice: |
Copyright (C) 1998 Philippe Lavoie |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Comments: The load and save routine are basically the ones you can find |
in the example.c file from the libpng distribution. |
Changes: |
5/17/99 - Modified to use the new SDL data sources - Sam Lantinga |
=============================================================================*/ |
#include "SDL_endian.h" |
#ifdef macintosh |
#define MACOS |
#endif |
#include <png.h> |
#define PNG_BYTES_TO_CHECK 4 |
/* See if an image is contained in a data source */ |
int IMG_isPNG(SDL_RWops *src) |
{ |
unsigned char buf[PNG_BYTES_TO_CHECK]; |
/* Read in the signature bytes */ |
if (SDL_RWread(src, buf, 1, PNG_BYTES_TO_CHECK) != PNG_BYTES_TO_CHECK) |
return 0; |
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. */ |
return( !png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK)); |
} |
/* Load a PNG type image from an SDL datasource */ |
static void png_read_data(png_structp ctx, png_bytep area, png_size_t size) |
{ |
SDL_RWops *src; |
src = (SDL_RWops *)png_get_io_ptr(ctx); |
SDL_RWread(src, area, size, 1); |
} |
SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) |
{ |
SDL_Surface *volatile surface; |
png_structp png_ptr; |
png_infop info_ptr; |
png_uint_32 width, height; |
int bit_depth, color_type, interlace_type; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
Uint32 Amask; |
SDL_Palette *palette; |
png_bytep *volatile row_pointers; |
int row, i; |
volatile int ckey = -1; |
png_color_16 *transv; |
/* Initialize the data we will clean up when we're done */ |
png_ptr = NULL; info_ptr = NULL; row_pointers = NULL; surface = NULL; |
/* Check to make sure we have something to do */ |
if ( ! src ) { |
goto done; |
} |
/* Create the PNG loading context structure */ |
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, |
NULL,NULL,NULL); |
if (png_ptr == NULL){ |
IMG_SetError("Couldn't allocate memory for PNG file"); |
goto done; |
} |
/* Allocate/initialize the memory for image information. REQUIRED. */ |
info_ptr = png_create_info_struct(png_ptr); |
if (info_ptr == NULL) { |
IMG_SetError("Couldn't create image information for PNG file"); |
goto done; |
} |
/* Set error handling if you are using setjmp/longjmp method (this is |
* the normal method of doing things with libpng). REQUIRED unless you |
* set up your own error handlers in png_create_read_struct() earlier. |
*/ |
if ( setjmp(png_ptr->jmpbuf) ) { |
IMG_SetError("Error reading the PNG file."); |
goto done; |
} |
/* Set up the input control */ |
png_set_read_fn(png_ptr, src, png_read_data); |
/* Read PNG header info */ |
png_read_info(png_ptr, info_ptr); |
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, |
&color_type, &interlace_type, NULL, NULL); |
/* tell libpng to strip 16 bit/color files down to 8 bits/color */ |
png_set_strip_16(png_ptr) ; |
/* Extract multiple pixels with bit depths of 1, 2, and 4 from a single |
* byte into separate bytes (useful for paletted and grayscale images). |
*/ |
png_set_packing(png_ptr); |
/* scale greyscale values to the range 0..255 */ |
if(color_type == PNG_COLOR_TYPE_GRAY) |
png_set_expand(png_ptr); |
/* For images with a single "transparent colour", set colour key; |
if more than one index has transparency, use full alpha channel */ |
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { |
int num_trans; |
Uint8 *trans; |
png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, |
&transv); |
if(color_type == PNG_COLOR_TYPE_PALETTE) { |
if(num_trans == 1) { |
/* exactly one transparent value: set colour key */ |
ckey = trans[0]; |
} else |
png_set_expand(png_ptr); |
} else |
ckey = 0; /* actual value will be set later */ |
} |
if ( color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) |
png_set_gray_to_rgb(png_ptr); |
png_read_update_info(png_ptr, info_ptr); |
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, |
&color_type, &interlace_type, NULL, NULL); |
/* Allocate the SDL surface to hold the image */ |
Rmask = Gmask = Bmask = Amask = 0 ; |
if ( color_type != PNG_COLOR_TYPE_PALETTE ) { |
if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { |
Rmask = 0x000000FF; |
Gmask = 0x0000FF00; |
Bmask = 0x00FF0000; |
Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; |
} else { |
int s = (info_ptr->channels == 4) ? 0 : 8; |
Rmask = 0xFF000000 >> s; |
Gmask = 0x00FF0000 >> s; |
Bmask = 0x0000FF00 >> s; |
Amask = 0x000000FF >> s; |
} |
} |
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, |
bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask); |
if ( surface == NULL ) { |
IMG_SetError("Out of memory"); |
goto done; |
} |
if(ckey != -1) { |
if(color_type != PNG_COLOR_TYPE_PALETTE) |
/* FIXME: Should these be truncated or shifted down? */ |
ckey = SDL_MapRGB(surface->format, |
(Uint8)transv->red, |
(Uint8)transv->green, |
(Uint8)transv->blue); |
SDL_SetColorKey(surface, SDL_SRCCOLORKEY, ckey); |
} |
/* Create the array of pointers to image data */ |
row_pointers = (png_bytep*) malloc(sizeof(png_bytep)*height); |
if ( (row_pointers == NULL) ) { |
IMG_SetError("Out of memory"); |
SDL_FreeSurface(surface); |
surface = NULL; |
goto done; |
} |
for (row = 0; row < (int)height; row++) { |
row_pointers[row] = (png_bytep) |
(Uint8 *)surface->pixels + row*surface->pitch; |
} |
/* Read the entire image in one go */ |
png_read_image(png_ptr, row_pointers); |
/* read rest of file, get additional chunks in info_ptr - REQUIRED */ |
png_read_end(png_ptr, info_ptr); |
/* Load the palette, if any */ |
palette = surface->format->palette; |
if ( palette ) { |
if(color_type == PNG_COLOR_TYPE_GRAY) { |
palette->ncolors = 256; |
for(i = 0; i < 256; i++) { |
palette->colors[i].r = i; |
palette->colors[i].g = i; |
palette->colors[i].b = i; |
} |
} else if (info_ptr->num_palette > 0 ) { |
palette->ncolors = info_ptr->num_palette; |
for( i=0; i<info_ptr->num_palette; ++i ) { |
palette->colors[i].b = info_ptr->palette[i].blue; |
palette->colors[i].g = info_ptr->palette[i].green; |
palette->colors[i].r = info_ptr->palette[i].red; |
} |
} |
} |
done: /* Clean up and return */ |
png_destroy_read_struct(&png_ptr, info_ptr ? &info_ptr : (png_infopp)0, |
(png_infopp)0); |
if ( row_pointers ) { |
free(row_pointers); |
} |
return(surface); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isPNG(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a PNG type image from an SDL datasource */ |
SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_PNG */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_pnm.c |
---|
0,0 → 1,242 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* |
* PNM (portable anymap) image loader: |
* |
* Supports: PBM, PGM and PPM, ASCII and binary formats |
* (PBM and PGM are loaded as 8bpp surfaces) |
* Does not support: maximum component value > 255 |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <ctype.h> |
#include <string.h> |
#include "SDL_image.h" |
#ifdef LOAD_PNM |
/* See if an image is contained in a data source */ |
int IMG_isPNM(SDL_RWops *src) |
{ |
char magic[2]; |
/* |
* PNM magic signatures: |
* P1 PBM, ascii format |
* P2 PGM, ascii format |
* P3 PPM, ascii format |
* P4 PBM, binary format |
* P5 PGM, binary format |
* P6 PPM, binary format |
*/ |
return (SDL_RWread(src, magic, 2, 1) |
&& magic[0] == 'P' && magic[1] >= '1' && magic[1] <= '6'); |
} |
/* read a non-negative integer from the source. return -1 upon error */ |
static int ReadNumber(SDL_RWops *src) |
{ |
int number; |
unsigned char ch; |
/* Initialize return value */ |
number = 0; |
/* Skip leading whitespace */ |
do { |
if ( ! SDL_RWread(src, &ch, 1, 1) ) { |
return(0); |
} |
/* Eat comments as whitespace */ |
if ( ch == '#' ) { /* Comment is '#' to end of line */ |
do { |
if ( ! SDL_RWread(src, &ch, 1, 1) ) { |
return -1; |
} |
} while ( (ch != '\r') && (ch != '\n') ); |
} |
} while ( isspace(ch) ); |
/* Add up the number */ |
do { |
number *= 10; |
number += ch-'0'; |
if ( !SDL_RWread(src, &ch, 1, 1) ) { |
return -1; |
} |
} while ( isdigit(ch) ); |
return(number); |
} |
SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src) |
{ |
SDL_Surface *surface = NULL; |
int width, height; |
int maxval, y, bpl; |
Uint8 *row; |
Uint8 *buf = NULL; |
char *error = NULL; |
Uint8 magic[2]; |
int ascii; |
enum { PBM, PGM, PPM } kind; |
#define ERROR(s) do { error = (s); goto done; } while(0) |
if(!src) |
return NULL; |
SDL_RWread(src, magic, 2, 1); |
kind = magic[1] - '1'; |
ascii = 1; |
if(kind >= 3) { |
ascii = 0; |
kind -= 3; |
} |
width = ReadNumber(src); |
height = ReadNumber(src); |
if(width <= 0 || height <= 0) |
ERROR("Unable to read image width and height"); |
if(kind != PBM) { |
maxval = ReadNumber(src); |
if(maxval <= 0 || maxval > 255) |
ERROR("unsupported PNM format"); |
} else |
maxval = 255; /* never scale PBMs */ |
/* binary PNM allows just a single character of whitespace after |
the last parameter, and we've already consumed it */ |
if(kind == PPM) { |
/* 24-bit surface in R,G,B byte order */ |
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, 24, |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
0x000000ff, 0x0000ff00, 0x00ff0000, |
#else |
0x00ff0000, 0x0000ff00, 0x000000ff, |
#endif |
0); |
} else { |
/* load PBM/PGM as 8-bit indexed images */ |
surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, 8, |
0, 0, 0, 0); |
} |
if ( surface == NULL ) |
ERROR("Out of memory"); |
bpl = width * surface->format->BytesPerPixel; |
if(kind == PGM) { |
SDL_Color *c = surface->format->palette->colors; |
int i; |
for(i = 0; i < 256; i++) |
c[i].r = c[i].g = c[i].b = i; |
surface->format->palette->ncolors = 256; |
} else if(kind == PBM) { |
/* for some reason PBM has 1=black, 0=white */ |
SDL_Color *c = surface->format->palette->colors; |
c[0].r = c[0].g = c[0].b = 255; |
c[1].r = c[1].g = c[1].b = 0; |
surface->format->palette->ncolors = 2; |
bpl = (width + 7) >> 3; |
buf = malloc(bpl); |
if(buf == NULL) |
ERROR("Out of memory"); |
} |
/* Read the image into the surface */ |
row = surface->pixels; |
for(y = 0; y < height; y++) { |
if(ascii) { |
int i; |
if(kind == PBM) { |
for(i = 0; i < width; i++) { |
Uint8 ch; |
do { |
if(!SDL_RWread(src, &ch, |
1, 1)) |
ERROR("file truncated"); |
ch -= '0'; |
} while(ch > 1); |
row[i] = ch; |
} |
} else { |
for(i = 0; i < bpl; i++) { |
int c; |
c = ReadNumber(src); |
if(c < 0) |
ERROR("file truncated"); |
row[i] = c; |
} |
} |
} else { |
Uint8 *dst = (kind == PBM) ? buf : row; |
if(!SDL_RWread(src, dst, bpl, 1)) |
ERROR("file truncated"); |
if(kind == PBM) { |
/* expand bitmap to 8bpp */ |
int i; |
for(i = 0; i < width; i++) { |
int bit = 7 - (i & 7); |
row[i] = (buf[i >> 3] >> bit) & 1; |
} |
} |
} |
if(maxval < 255) { |
/* scale up to full dynamic range (slow) */ |
int i; |
for(i = 0; i < bpl; i++) |
row[i] = row[i] * 255 / maxval; |
} |
row += surface->pitch; |
} |
done: |
free(buf); |
if(error) { |
SDL_FreeSurface(surface); |
IMG_SetError(error); |
surface = NULL; |
} |
return(surface); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isPNM(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a PNM type image from an SDL datasource */ |
SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_PNM */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_tga.c |
---|
0,0 → 1,321 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include "SDL_endian.h" |
#include "SDL_image.h" |
#ifdef LOAD_TGA |
/* |
* A TGA loader for the SDL library |
* Supports: Reading 8, 15, 16, 24 and 32bpp images, with alpha or colourkey, |
* uncompressed or RLE encoded. |
* |
* 2000-06-10 Mattias Engdegård <f91-men@nada.kth.se>: initial version |
* 2000-06-26 Mattias Engdegård <f91-men@nada.kth.se>: read greyscale TGAs |
* 2000-08-09 Mattias Engdegård <f91-men@nada.kth.se>: alpha inversion removed |
*/ |
struct TGAheader { |
Uint8 infolen; /* length of info field */ |
Uint8 has_cmap; /* 1 if image has colormap, 0 otherwise */ |
Uint8 type; |
Uint8 cmap_start[2]; /* index of first colormap entry */ |
Uint8 cmap_len[2]; /* number of entries in colormap */ |
Uint8 cmap_bits; /* bits per colormap entry */ |
Uint8 yorigin[2]; /* image origin (ignored here) */ |
Uint8 xorigin[2]; |
Uint8 width[2]; /* image size */ |
Uint8 height[2]; |
Uint8 pixel_bits; /* bits/pixel */ |
Uint8 flags; |
}; |
enum tga_type { |
TGA_TYPE_INDEXED = 1, |
TGA_TYPE_RGB = 2, |
TGA_TYPE_BW = 3, |
TGA_TYPE_RLE_INDEXED = 9, |
TGA_TYPE_RLE_RGB = 10, |
TGA_TYPE_RLE_BW = 11 |
}; |
#define TGA_INTERLEAVE_MASK 0xc0 |
#define TGA_INTERLEAVE_NONE 0x00 |
#define TGA_INTERLEAVE_2WAY 0x40 |
#define TGA_INTERLEAVE_4WAY 0x80 |
#define TGA_ORIGIN_MASK 0x30 |
#define TGA_ORIGIN_LEFT 0x00 |
#define TGA_ORIGIN_RIGHT 0x10 |
#define TGA_ORIGIN_LOWER 0x00 |
#define TGA_ORIGIN_UPPER 0x20 |
/* read/write unaligned little-endian 16-bit ints */ |
#define LE16(p) ((p)[0] + ((p)[1] << 8)) |
#define SETLE16(p, v) ((p)[0] = (v), (p)[1] = (v) >> 8) |
static void unsupported(void) |
{ |
IMG_SetError("unsupported TGA format"); |
} |
/* Load a TGA type image from an SDL datasource */ |
SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src) |
{ |
struct TGAheader hdr; |
int rle = 0; |
int alpha = 0; |
int indexed = 0; |
int grey = 0; |
int ckey = -1; |
int ncols, w, h; |
SDL_Surface *img; |
Uint32 rmask, gmask, bmask, amask; |
Uint8 *dst; |
int i; |
int bpp; |
int lstep; |
Uint32 pixel; |
int count, rep; |
if(!SDL_RWread(src, &hdr, sizeof(hdr), 1)) |
goto error; |
ncols = LE16(hdr.cmap_len); |
switch(hdr.type) { |
case TGA_TYPE_RLE_INDEXED: |
rle = 1; |
/* fallthrough */ |
case TGA_TYPE_INDEXED: |
if(!hdr.has_cmap || hdr.pixel_bits != 8 || ncols > 256) |
goto error; |
indexed = 1; |
break; |
case TGA_TYPE_RLE_RGB: |
rle = 1; |
/* fallthrough */ |
case TGA_TYPE_RGB: |
indexed = 0; |
break; |
case TGA_TYPE_RLE_BW: |
rle = 1; |
/* fallthrough */ |
case TGA_TYPE_BW: |
if(hdr.pixel_bits != 8) |
goto error; |
/* Treat greyscale as 8bpp indexed images */ |
indexed = grey = 1; |
break; |
default: |
unsupported(); |
return NULL; |
} |
bpp = (hdr.pixel_bits + 7) >> 3; |
rmask = gmask = bmask = amask = 0; |
switch(hdr.pixel_bits) { |
case 8: |
if(!indexed) { |
unsupported(); |
return NULL; |
} |
break; |
case 15: |
case 16: |
/* 15 and 16bpp both seem to use 5 bits/plane. The extra alpha bit |
is ignored for now. */ |
rmask = 0x7c00; |
gmask = 0x03e0; |
bmask = 0x001f; |
break; |
case 32: |
alpha = 1; |
/* fallthrough */ |
case 24: |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { |
int s = alpha ? 0 : 8; |
amask = 0x000000ff >> s; |
rmask = 0x0000ff00 >> s; |
gmask = 0x00ff0000 >> s; |
bmask = 0xff000000 >> s; |
} else { |
amask = alpha ? 0xff000000 : 0; |
rmask = 0x00ff0000; |
gmask = 0x0000ff00; |
bmask = 0x000000ff; |
} |
break; |
default: |
unsupported(); |
return NULL; |
} |
if((hdr.flags & TGA_INTERLEAVE_MASK) != TGA_INTERLEAVE_NONE |
|| hdr.flags & TGA_ORIGIN_RIGHT) { |
unsupported(); |
return NULL; |
} |
SDL_RWseek(src, hdr.infolen, SEEK_CUR); /* skip info field */ |
w = LE16(hdr.width); |
h = LE16(hdr.height); |
img = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, |
bpp * 8, |
rmask, gmask, bmask, amask); |
if(hdr.has_cmap) { |
int palsiz = ncols * ((hdr.cmap_bits + 7) >> 3); |
if(indexed && !grey) { |
Uint8 *pal = malloc(palsiz), *p = pal; |
SDL_Color *colors = img->format->palette->colors; |
img->format->palette->ncolors = ncols; |
SDL_RWread(src, pal, palsiz, 1); |
for(i = 0; i < ncols; i++) { |
switch(hdr.cmap_bits) { |
case 15: |
case 16: |
{ |
Uint16 c = p[0] + (p[1] << 8); |
p += 2; |
colors[i].r = (c >> 7) & 0xf8; |
colors[i].g = (c >> 2) & 0xf8; |
colors[i].b = c << 3; |
} |
break; |
case 24: |
case 32: |
colors[i].b = *p++; |
colors[i].g = *p++; |
colors[i].r = *p++; |
if(hdr.cmap_bits == 32 && *p++ < 128) |
ckey = i; |
break; |
} |
} |
free(pal); |
if(ckey >= 0) |
SDL_SetColorKey(img, SDL_SRCCOLORKEY, ckey); |
} else { |
/* skip unneeded colormap */ |
SDL_RWseek(src, palsiz, SEEK_CUR); |
} |
} |
if(grey) { |
SDL_Color *colors = img->format->palette->colors; |
for(i = 0; i < 256; i++) |
colors[i].r = colors[i].g = colors[i].b = i; |
img->format->palette->ncolors = 256; |
} |
if(hdr.flags & TGA_ORIGIN_UPPER) { |
lstep = img->pitch; |
dst = img->pixels; |
} else { |
lstep = -img->pitch; |
dst = (Uint8 *)img->pixels + (h - 1) * img->pitch; |
} |
/* The RLE decoding code is slightly convoluted since we can't rely on |
spans not to wrap across scan lines */ |
count = rep = 0; |
for(i = 0; i < h; i++) { |
if(rle) { |
int x = 0; |
for(;;) { |
Uint8 c; |
if(count) { |
int n = count; |
if(n > w - x) |
n = w - x; |
SDL_RWread(src, dst + x * bpp, n * bpp, 1); |
count -= n; |
x += n; |
if(x == w) |
break; |
} else if(rep) { |
int n = rep; |
if(n > w - x) |
n = w - x; |
rep -= n; |
while(n--) { |
memcpy(dst + x * bpp, &pixel, bpp); |
x++; |
} |
if(x == w) |
break; |
} |
SDL_RWread(src, &c, 1, 1); |
if(c & 0x80) { |
SDL_RWread(src, &pixel, bpp, 1); |
rep = (c & 0x7f) + 1; |
} else { |
count = c + 1; |
} |
} |
} else { |
SDL_RWread(src, dst, w * bpp, 1); |
} |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN && bpp == 2) { |
/* swap byte order */ |
int x; |
Uint16 *p = (Uint16 *)dst; |
for(x = 0; x < w; x++) |
p[x] = SDL_Swap16(p[x]); |
} |
dst += lstep; |
} |
return img; |
error: |
IMG_SetError("Error reading TGA data"); |
return NULL; |
} |
#else |
/* dummy TGA load routine */ |
SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_TGA */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_tif.c |
---|
0,0 → 1,174 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
5/29/2000: TIFF loader written. Mark Baker (mbaker@0x7a69.net) |
2000-07-28: Fixed two off-by one bugs in reversal loop and made it work on |
big-endian machines (Mattias) |
2000-08-09: Removed alpha inversion (Mattias) |
*/ |
/* This is a TIFF image file loading framework */ |
#include <stdio.h> |
#include "SDL_image.h" |
#ifdef LOAD_TIF |
#include <tiffio.h> |
/* |
* These are the thunking routine to use the SDL_RWops* routines from |
* libtiff's internals. |
*/ |
static tsize_t tiff_read(thandle_t fd, tdata_t buf, tsize_t size) |
{ |
return SDL_RWread((SDL_RWops*)fd, buf, 1, size); |
} |
static toff_t tiff_seek(thandle_t fd, toff_t offset, int origin) |
{ |
return SDL_RWseek((SDL_RWops*)fd, offset, origin); |
} |
static tsize_t tiff_write(thandle_t fd, tdata_t buf, tsize_t size) |
{ |
return SDL_RWwrite((SDL_RWops*)fd, buf, 1, size); |
} |
static int tiff_close(thandle_t fd) |
{ |
/* |
* We don't want libtiff closing our SDL_RWops*, but if it's not given |
* a routine to try, and if the image isn't a TIFF, it'll segfault. |
*/ |
return 0; |
} |
static toff_t tiff_size(thandle_t fd) |
{ |
Uint32 save_pos; |
toff_t size; |
save_pos = SDL_RWtell((SDL_RWops*)fd); |
SDL_RWseek((SDL_RWops*)fd, 0, SEEK_END); |
size = SDL_RWtell((SDL_RWops*)fd); |
SDL_RWseek((SDL_RWops*)fd, save_pos, SEEK_SET); |
return size; |
} |
int IMG_isTIF(SDL_RWops* src) |
{ |
TIFF* tiff; |
TIFFErrorHandler prev_handler; |
/* Suppress output from libtiff */ |
prev_handler = TIFFSetErrorHandler(NULL); |
/* Attempt to process the given file data */ |
/* turn off memory mapped access with the m flag */ |
tiff = TIFFClientOpen("SDL_image", "rm", (thandle_t)src, |
tiff_read, tiff_write, tiff_seek, tiff_close, tiff_size, NULL, NULL); |
/* Reset the default error handler, since it can be useful for info */ |
TIFFSetErrorHandler(prev_handler); |
/* If it's not a TIFF, then tiff will be NULL. */ |
if(!tiff) |
return 0; |
/* Free up any dynamically allocated memory libtiff uses */ |
TIFFClose(tiff); |
return 1; |
} |
SDL_Surface* IMG_LoadTIF_RW(SDL_RWops* src) |
{ |
TIFF* tiff; |
SDL_Surface* surface = NULL; |
Uint32 img_width, img_height; |
Uint32 Rmask, Gmask, Bmask, Amask, mask; |
Uint32 x, y; |
Uint32 half; |
/* turn off memory mapped access with the m flag */ |
tiff = TIFFClientOpen("SDL_image", "rm", (thandle_t)src, |
tiff_read, tiff_write, tiff_seek, tiff_close, tiff_size, NULL, NULL); |
if(!tiff) |
return NULL; |
/* Retrieve the dimensions of the image from the TIFF tags */ |
TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &img_width); |
TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &img_height); |
Rmask = 0x000000FF; |
Gmask = 0x0000FF00; |
Bmask = 0x00FF0000; |
Amask = 0xFF000000; |
surface = SDL_AllocSurface(SDL_SWSURFACE, img_width, img_height, 32, |
Rmask, Gmask, Bmask, Amask); |
if(!surface) |
return NULL; |
if(!TIFFReadRGBAImage(tiff, img_width, img_height, surface->pixels, 0)) |
return NULL; |
/* libtiff loads the image upside-down, flip it back */ |
half = img_height / 2; |
for(y = 0; y < half; y++) |
{ |
Uint32 *top = (Uint32 *)surface->pixels + y * surface->pitch/4; |
Uint32 *bot = (Uint32 *)surface->pixels |
+ (img_height - y - 1) * surface->pitch/4; |
for(x = 0; x < img_width; x++) |
{ |
Uint32 tmp = top[x]; |
top[x] = bot[x]; |
bot[x] = tmp; |
} |
} |
TIFFClose(tiff); |
return surface; |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isTIF(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a TIFF type image from an SDL datasource */ |
SDL_Surface *IMG_LoadTIF_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_TIF */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_xcf.c |
---|
0,0 → 1,796 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
XCF support by Bernhard J. Pietsch <bjtp@gmx.net> |
*/ |
/* This is a XCF image file loading framework */ |
#include <stdio.h> |
#include <ctype.h> |
#include <string.h> |
#include "SDL_image.h" |
#ifdef LOAD_XCF |
static char prop_names [][30] = { |
"end", |
"colormap", |
"active_layer", |
"active_channel", |
"selection", |
"floating_selection", |
"opacity", |
"mode", |
"visible", |
"linked", |
"preserve_transparency", |
"apply_mask", |
"edit_mask", |
"show_mask", |
"show_masked", |
"offsets", |
"color", |
"compression", |
"guides", |
"resolution", |
"tattoo", |
"parasites", |
"unit", |
"paths", |
"user_unit" |
}; |
typedef enum |
{ |
PROP_END = 0, |
PROP_COLORMAP = 1, |
PROP_ACTIVE_LAYER = 2, |
PROP_ACTIVE_CHANNEL = 3, |
PROP_SELECTION = 4, |
PROP_FLOATING_SELECTION = 5, |
PROP_OPACITY = 6, |
PROP_MODE = 7, |
PROP_VISIBLE = 8, |
PROP_LINKED = 9, |
PROP_PRESERVE_TRANSPARENCY = 10, |
PROP_APPLY_MASK = 11, |
PROP_EDIT_MASK = 12, |
PROP_SHOW_MASK = 13, |
PROP_SHOW_MASKED = 14, |
PROP_OFFSETS = 15, |
PROP_COLOR = 16, |
PROP_COMPRESSION = 17, |
PROP_GUIDES = 18, |
PROP_RESOLUTION = 19, |
PROP_TATTOO = 20, |
PROP_PARASITES = 21, |
PROP_UNIT = 22, |
PROP_PATHS = 23, |
PROP_USER_UNIT = 24 |
} xcf_prop_type; |
typedef enum { |
COMPR_NONE = 0, |
COMPR_RLE = 1, |
COMPR_ZLIB = 2, |
COMPR_FRACTAL = 3 |
} xcf_compr_type; |
typedef enum { |
IMAGE_RGB = 0, |
IMAGE_GREYSCALE = 1, |
IMAGE_INDEXED = 2 |
} xcf_image_type; |
typedef struct { |
Uint32 id; |
Uint32 length; |
union { |
struct { |
Uint32 num; |
char * cmap; |
} colormap; // 1 |
struct { |
Uint32 drawable_offset; |
} floating_selection; // 5 |
Sint32 opacity; |
Sint32 mode; |
int visible; |
int linked; |
int preserve_transparency; |
int apply_mask; |
int show_mask; |
struct { |
Sint32 x; |
Sint32 y; |
} offset; |
unsigned char color [3]; |
Uint8 compression; |
struct { |
Sint32 x; |
Sint32 y; |
} resolution; |
struct { |
char * name; |
Uint32 flags; |
Uint32 size; |
char * data; |
} parasite; |
} data; |
} xcf_prop; |
typedef struct { |
char sign [14]; |
Uint32 width; |
Uint32 height; |
Sint32 image_type; |
xcf_prop * properties; |
Uint32 * layer_file_offsets; |
Uint32 * channel_file_offsets; |
xcf_compr_type compr; |
Uint32 cm_num; |
unsigned char * cm_map; |
} xcf_header; |
typedef struct { |
Uint32 width; |
Uint32 height; |
Sint32 layer_type; |
char * name; |
xcf_prop * properties; |
Uint32 hierarchy_file_offset; |
Uint32 layer_mask_offset; |
Uint32 offset_x; |
Uint32 offset_y; |
} xcf_layer; |
typedef struct { |
Uint32 width; |
Uint32 height; |
char * name; |
xcf_prop * properties; |
Uint32 hierarchy_file_offset; |
Uint32 color; |
Uint32 opacity; |
int selection : 1; |
} xcf_channel; |
typedef struct { |
Uint32 width; |
Uint32 height; |
Uint32 bpp; |
Uint32 * level_file_offsets; |
} xcf_hierarchy; |
typedef struct { |
Uint32 width; |
Uint32 height; |
Uint32 * tile_file_offsets; |
} xcf_level; |
typedef unsigned char * xcf_tile; |
typedef unsigned char * (* load_tile_type) (SDL_RWops *, Uint32, int, int, int); |
/* See if an image is contained in a data source */ |
int IMG_isXCF(SDL_RWops *src) { |
int is_XCF; |
char magic[14]; |
is_XCF = 0; |
if ( SDL_RWread(src, magic, 14, 1) ) { |
if (strncmp(magic, "gimp xcf ", 9) == 0) { |
is_XCF = 1; |
} |
} |
return(is_XCF); |
} |
static char * read_string (SDL_RWops * src) { |
Uint32 tmp; |
char * data; |
tmp = SDL_ReadBE32 (src); |
if (tmp > 0) { |
data = (char *) malloc (sizeof (char) * tmp); |
SDL_RWread (src, data, tmp, 1); |
} |
else { |
data = NULL; |
} |
return data; |
} |
static Uint32 Swap32 (Uint32 v) { |
return |
((v & 0x000000FF) << 16) |
| ((v & 0x0000FF00)) |
| ((v & 0x00FF0000) >> 16) |
| ((v & 0xFF000000)); |
} |
void xcf_read_property (SDL_RWops * src, xcf_prop * prop) { |
prop->id = SDL_ReadBE32 (src); |
prop->length = SDL_ReadBE32 (src); |
printf ("%.8X: %s: %d\n", SDL_RWtell (src), prop->id < 25 ? prop_names [prop->id] : "unknown", prop->length); |
switch (prop->id) { |
case PROP_COLORMAP: |
prop->data.colormap.num = SDL_ReadBE32 (src); |
prop->data.colormap.cmap = (char *) malloc (sizeof (char) * prop->data.colormap.num * 3); |
SDL_RWread (src, prop->data.colormap.cmap, prop->data.colormap.num*3, 1); |
break; |
case PROP_OFFSETS: |
prop->data.offset.x = SDL_ReadBE32 (src); |
prop->data.offset.y = SDL_ReadBE32 (src); |
break; |
case PROP_OPACITY: |
prop->data.opacity = SDL_ReadBE32 (src); |
break; |
case PROP_COMPRESSION: |
case PROP_COLOR: |
SDL_RWread (src, &prop->data, prop->length, 1); |
break; |
default: |
// SDL_RWread (src, &prop->data, prop->length, 1); |
SDL_RWseek (src, prop->length, SEEK_CUR); |
} |
} |
void free_xcf_header (xcf_header * h) { |
if (h->cm_num) |
free (h->cm_map); |
free (h); |
} |
xcf_header * read_xcf_header (SDL_RWops * src) { |
xcf_header * h; |
xcf_prop prop; |
h = (xcf_header *) malloc (sizeof (xcf_header)); |
SDL_RWread (src, h->sign, 14, 1); |
h->width = SDL_ReadBE32 (src); |
h->height = SDL_ReadBE32 (src); |
h->image_type = SDL_ReadBE32 (src); |
h->properties = NULL; |
h->compr = COMPR_NONE; |
h->cm_num = 0; |
h->cm_map = NULL; |
// Just read, don't save |
do { |
xcf_read_property (src, &prop); |
if (prop.id == PROP_COMPRESSION) |
h->compr = prop.data.compression; |
else if (prop.id == PROP_COLORMAP) { |
int i; |
h->cm_num = prop.data.colormap.num; |
h->cm_map = (char *) malloc (sizeof (char) * 3 * h->cm_num); |
memcpy (h->cm_map, prop.data.colormap.cmap, 3*sizeof (char)*h->cm_num); |
free (prop.data.colormap.cmap); |
} |
} while (prop.id != PROP_END); |
return h; |
} |
void free_xcf_layer (xcf_layer * l) { |
free (l->name); |
free (l); |
} |
xcf_layer * read_xcf_layer (SDL_RWops * src) { |
xcf_layer * l; |
xcf_prop prop; |
l = (xcf_layer *) malloc (sizeof (xcf_layer)); |
l->width = SDL_ReadBE32 (src); |
l->height = SDL_ReadBE32 (src); |
l->layer_type = SDL_ReadBE32 (src); |
l->name = read_string (src); |
do { |
xcf_read_property (src, &prop); |
if (prop.id == PROP_OFFSETS) { |
l->offset_x = prop.data.offset.x; |
l->offset_y = prop.data.offset.y; |
} |
} while (prop.id != PROP_END); |
l->hierarchy_file_offset = SDL_ReadBE32 (src); |
l->layer_mask_offset = SDL_ReadBE32 (src); |
return l; |
} |
void free_xcf_channel (xcf_channel * c) { |
free (c->name); |
free (c); |
} |
xcf_channel * read_xcf_channel (SDL_RWops * src) { |
xcf_channel * l; |
xcf_prop prop; |
l = (xcf_channel *) malloc (sizeof (xcf_channel)); |
l->width = SDL_ReadBE32 (src); |
l->height = SDL_ReadBE32 (src); |
l->name = read_string (src); |
l->selection = 0; |
do { |
xcf_read_property (src, &prop); |
switch (prop.id) { |
case PROP_OPACITY: |
l->opacity = prop.data.opacity << 24; |
break; |
case PROP_COLOR: |
l->color = ((Uint32) prop.data.color[0] << 16) |
| ((Uint32) prop.data.color[1] << 8) |
| ((Uint32) prop.data.color[2]); |
break; |
case PROP_SELECTION: |
l->selection = 1; |
break; |
default: |
} |
} while (prop.id != PROP_END); |
l->hierarchy_file_offset = SDL_ReadBE32 (src); |
return l; |
} |
void free_xcf_hierarchy (xcf_hierarchy * h) { |
free (h->level_file_offsets); |
free (h); |
} |
xcf_hierarchy * read_xcf_hierarchy (SDL_RWops * src) { |
xcf_hierarchy * h; |
int i; |
h = (xcf_hierarchy *) malloc (sizeof (xcf_hierarchy)); |
h->width = SDL_ReadBE32 (src); |
h->height = SDL_ReadBE32 (src); |
h->bpp = SDL_ReadBE32 (src); |
h->level_file_offsets = NULL; |
i = 0; |
do { |
h->level_file_offsets = (Uint32 *) realloc (h->level_file_offsets, sizeof (Uint32) * (i+1)); |
h->level_file_offsets [i] = SDL_ReadBE32 (src); |
} while (h->level_file_offsets [i++]); |
return h; |
} |
void free_xcf_level (xcf_level * l) { |
free (l->tile_file_offsets); |
free (l); |
} |
xcf_level * read_xcf_level (SDL_RWops * src) { |
xcf_level * l; |
int i; |
l = (xcf_level *) malloc (sizeof (xcf_level)); |
l->width = SDL_ReadBE32 (src); |
l->height = SDL_ReadBE32 (src); |
l->tile_file_offsets = NULL; |
i = 0; |
do { |
l->tile_file_offsets = (Uint32 *) realloc (l->tile_file_offsets, sizeof (Uint32) * (i+1)); |
l->tile_file_offsets [i] = SDL_ReadBE32 (src); |
} while (l->tile_file_offsets [i++]); |
return l; |
} |
void free_xcf_tile (unsigned char * t) { |
free (t); |
} |
unsigned char * load_xcf_tile_none (SDL_RWops * src, Uint32 len, int bpp, int x, int y) { |
unsigned char * load; |
load = (char *) malloc (len); // expect this is okay |
SDL_RWread (src, load, len, 1); |
return load; |
} |
unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, int x, int y) { |
unsigned char * load, * t, * data, * d; |
Uint32 reallen; |
int i, size, count, j, length; |
unsigned char val; |
t = load = (char *) malloc (len); |
reallen = SDL_RWread (src, t, 1, len); |
data = (char *) malloc (x*y*bpp); |
for (i = 0; i < bpp; i++) { |
d = data + i; |
size = x*y; |
count = 0; |
while (size > 0) { |
val = *t++; |
length = val; |
if (length >= 128) { |
length = 255 - (length - 1); |
if (length == 128) { |
length = (*t << 8) + t[1]; |
t += 2; |
} |
count += length; |
size -= length; |
while (length-- > 0) { |
*d = *t++; |
d += bpp; |
} |
} |
else { |
length += 1; |
if (length == 128) { |
length = (*t << 8) + t[1]; |
t += 2; |
} |
count += length; |
size -= length; |
val = *t++; |
for (j = 0; j < length; j++) { |
*d = val; |
d += bpp; |
} |
} |
} |
} |
free (load); |
return (data); |
} |
static Uint32 rgb2grey (Uint32 a) { |
Uint8 l; |
l = 0.2990 * ((a && 0x00FF0000) >> 16) |
+ 0.5870 * ((a && 0x0000FF00) >> 8) |
+ 0.1140 * ((a && 0x000000FF)); |
return (l << 16) | (l << 8) | l; |
} |
void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 color, Uint32 opacity) { |
Uint32 c; |
switch (itype) { |
case IMAGE_RGB: |
case IMAGE_INDEXED: |
c = opacity | color; |
break; |
case IMAGE_GREYSCALE: |
c = opacity | rgb2grey (color); |
break; |
} |
SDL_FillRect (surf, NULL, c); |
} |
int do_layer_surface (SDL_Surface * surface, SDL_RWops * src, xcf_header * head, xcf_layer * layer, load_tile_type load_tile) { |
xcf_hierarchy * hierarchy; |
xcf_level * level; |
unsigned char * tile; |
Uint8 * p8; |
Uint16 * p16; |
Uint32 * p; |
int x, y, tx, ty, ox, oy, width, height, i, j; |
Uint32 *row; |
SDL_RWseek (src, layer->hierarchy_file_offset, SEEK_SET); |
hierarchy = read_xcf_hierarchy (src); |
level = NULL; |
for (i = 0; hierarchy->level_file_offsets [i]; i++) { |
SDL_RWseek (src, hierarchy->level_file_offsets [i], SEEK_SET); |
level = read_xcf_level (src); |
ty = tx = 0; |
for (j = 0; level->tile_file_offsets [j]; j++) { |
SDL_RWseek (src, level->tile_file_offsets [j], SEEK_SET); |
ox = tx+64 > level->width ? level->width % 64 : 64; |
oy = ty+64 > level->height ? level->height % 64 : 64; |
if (level->tile_file_offsets [j+1]) { |
tile = load_tile |
(src, |
level->tile_file_offsets [j+1] - level->tile_file_offsets [j], |
hierarchy->bpp, |
ox, oy); |
} |
else { |
tile = load_tile |
(src, |
ox*oy*6, |
hierarchy->bpp, |
ox, oy); |
} |
p8 = tile; |
p16 = (Uint16 *) p8; |
p = (Uint32 *) p8; |
for (y=ty; y < ty+oy; y++) { |
row = (Uint32 *)((Uint8 *)surface->pixels + y*surface->pitch + tx*4); |
switch (hierarchy->bpp) { |
case 4: |
for (x=tx; x < tx+ox; x++) |
*row++ = Swap32 (*p++); |
break; |
case 3: |
for (x=tx; x < tx+ox; x++) { |
*row = 0xFF000000; |
*row |= ((Uint32) *(p8++) << 16); |
*row |= ((Uint32) *(p8++) << 8); |
*row |= ((Uint32) *(p8++) << 0); |
row++; |
} |
break; |
case 2: // Indexed/Greyscale + Alpha |
switch (head->image_type) { |
case IMAGE_INDEXED: |
for (x=tx; x < tx+ox; x++) { |
*row = ((Uint32) (head->cm_map [*p8*3]) << 16); |
*row |= ((Uint32) (head->cm_map [*p8*3+1]) << 8); |
*row |= ((Uint32) (head->cm_map [*p8++*3+2]) << 0); |
*row |= ((Uint32) *p8++ << 24);; |
row++; |
} |
break; |
case IMAGE_GREYSCALE: |
for (x=tx; x < tx+ox; x++) { |
*row = ((Uint32) *p8 << 16); |
*row |= ((Uint32) *p8 << 8); |
*row |= ((Uint32) *p8++ << 0); |
*row |= ((Uint32) *p8++ << 24);; |
row++; |
} |
break; |
default: |
fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type); |
return 1; |
} |
break; |
case 1: // Indexed/Greyscale |
switch (head->image_type) { |
case IMAGE_INDEXED: |
for (x = tx; x < tx+ox; x++) { |
*row++ = 0xFF000000 |
| ((Uint32) (head->cm_map [*p8*3]) << 16) |
| ((Uint32) (head->cm_map [*p8*3+1]) << 8) |
| ((Uint32) (head->cm_map [*p8*3+2]) << 0); |
p8++; |
} |
break; |
case IMAGE_GREYSCALE: |
for (x=tx; x < tx+ox; x++) { |
*row++ = 0xFF000000 |
| (((Uint32) (*p8)) << 16) |
| (((Uint32) (*p8)) << 8) |
| (((Uint32) (*p8++)) << 0); |
} |
break; |
default: |
fprintf (stderr, "Unknown Gimp image type (%d)\n", head->image_type); |
return 1; |
} |
break; |
} |
} |
tx += 64; |
if (tx >= level->width) { |
tx = 0; |
ty += 64; |
} |
if (ty >= level->height) { |
break; |
} |
free_xcf_tile (tile); |
} |
free_xcf_level (level); |
} |
free_xcf_hierarchy (hierarchy); |
} |
SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src) { |
SDL_Surface *surface, *lays; |
xcf_header * head; |
xcf_layer * layer; |
xcf_channel ** channel; |
int read_error, chnls, i, offsets; |
Uint32 offset, fp; |
unsigned char * (* load_tile) (SDL_RWops *, Uint32, int, int, int); |
/* Initialize the data we will clean up when we're done */ |
surface = NULL; |
read_error = 0; |
/* Check to make sure we have something to do */ |
if ( ! src ) { |
goto done; |
} |
head = read_xcf_header (src); |
switch (head->compr) { |
case COMPR_NONE: |
load_tile = load_xcf_tile_none; |
break; |
case COMPR_RLE: |
load_tile = load_xcf_tile_rle; |
break; |
default: |
fprintf (stderr, "Unsupported Compression.\n"); |
free_xcf_header (head); |
return NULL; |
} |
/* Create the surface of the appropriate type */ |
surface = SDL_AllocSurface(SDL_SWSURFACE, head->width, head->height, 32, |
0x00FF0000,0x0000FF00,0x000000FF,0xFF000000); |
if ( surface == NULL ) { |
IMG_SetError("Out of memory"); |
goto done; |
} |
head->layer_file_offsets = NULL; |
offsets = 0; |
while (offset = SDL_ReadBE32 (src)) { |
head->layer_file_offsets = (Uint32 *) realloc (head->layer_file_offsets, sizeof (Uint32) * (offsets+1)); |
head->layer_file_offsets [offsets] = offset; |
offsets++; |
} |
fp = SDL_RWtell (src); |
lays = SDL_AllocSurface(SDL_SWSURFACE, head->width, head->height, 32, |
0x00FF0000,0x0000FF00,0x000000FF,0xFF000000); |
if ( lays == NULL ) { |
IMG_SetError("Out of memory"); |
goto done; |
} |
// Blit layers backwards, because Gimp saves them highest first |
for (i = offsets; i > 0; i--) { |
SDL_Rect rs, rd; |
SDL_RWseek (src, head->layer_file_offsets [i-1], SEEK_SET); |
layer = read_xcf_layer (src); |
do_layer_surface (lays, src, head, layer, load_tile); |
rs.x = 0; |
rs.y = 0; |
rs.w = layer->width; |
rs.h = layer->height; |
rd.x = layer->offset_x; |
rd.y = layer->offset_y; |
rd.w = layer->width; |
rd.h = layer->height; |
free_xcf_layer (layer); |
SDL_BlitSurface (lays, &rs, surface, &rd); |
} |
SDL_FreeSurface (lays); |
SDL_RWseek (src, fp, SEEK_SET); |
// read channels |
channel = NULL; |
chnls = 0; |
while (offset = SDL_ReadBE32 (src)) { |
channel = (xcf_channel **) realloc (channel, sizeof (xcf_channel *) * (chnls+1)); |
fp = SDL_RWtell (src); |
SDL_RWseek (src, offset, SEEK_SET); |
channel [chnls++] = (read_xcf_channel (src)); |
SDL_RWseek (src, fp, SEEK_SET); |
} |
if (chnls) { |
SDL_Surface * chs; |
chs = SDL_AllocSurface(SDL_SWSURFACE, head->width, head->height, 32, |
0x00FF0000,0x0000FF00,0x000000FF,0xFF000000); |
if (chs == NULL) { |
IMG_SetError("Out of memory"); |
goto done; |
} |
for (i = 0; i < chnls; i++) { |
// printf ("CNLBLT %i\n", i); |
if (!channel [i]->selection) { |
create_channel_surface (chs, head->image_type, channel [i]->color, channel [i]->opacity); |
SDL_BlitSurface (chs, NULL, surface, NULL); |
} |
free_xcf_channel (channel [i]); |
} |
SDL_FreeSurface (chs); |
} |
done: |
free_xcf_header (head); |
if ( read_error ) { |
SDL_FreeSurface(surface); |
IMG_SetError("Error reading XCF data"); |
surface = NULL; |
} |
return(surface); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isXCF(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a XCF type image from an SDL datasource */ |
SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_XCF */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/IMG_xpm.c |
---|
0,0 → 1,462 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* This is an XPM image file loading framework */ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include <ctype.h> |
#include "SDL_image.h" |
#ifdef LOAD_XPM |
/* See if an image is contained in a data source */ |
int IMG_isXPM(SDL_RWops *src) |
{ |
int is_XPM; |
char magic[10]; |
is_XPM = 0; |
if ( SDL_RWread(src, magic, sizeof(magic), 1) ) { |
if(memcmp(magic, "/* XPM */", 9) == 0) { |
is_XPM = 1; |
} |
} |
return(is_XPM); |
} |
static char *SDL_RWgets(char *string, int maxlen, SDL_RWops *src) |
{ |
int i; |
for ( i=0; i<(maxlen-1); ++i ) { |
if ( SDL_RWread(src, &string[i], 1, 1) <= 0 ) { |
/* EOF or error */ |
if ( i == 0 ) { |
/* Hmm, EOF on initial read, return NULL */ |
return NULL; |
} |
break; |
} |
/* In this case it's okay to use either '\r' or '\n' |
as line separators because blank lines are just |
ignored by the XPM format. |
*/ |
if ( (string[i] == '\n') || (string[i] == '\r') ) { |
break; |
} |
} |
string[i] = '\0'; |
return(string); |
} |
/* Hash table to look up colors from pixel strings */ |
#define STARTING_HASH_SIZE 256 |
struct hash_entry { |
char *key; |
Uint32 color; |
struct hash_entry *next; |
}; |
struct color_hash { |
struct hash_entry **table; |
struct hash_entry *entries; /* array of all entries */ |
struct hash_entry *next_free; |
int size; |
int maxnum; |
}; |
static int hash_key(const char *key, int cpp, int size) |
{ |
int hash; |
hash = 0; |
while ( cpp-- > 0 ) { |
hash = hash * 33 + *key++; |
} |
return hash & (size - 1); |
} |
static struct color_hash *create_colorhash(int maxnum) |
{ |
int bytes, s; |
struct color_hash *hash; |
/* we know how many entries we need, so we can allocate |
everything here */ |
hash = malloc(sizeof *hash); |
if(!hash) |
return NULL; |
/* use power-of-2 sized hash table for decoding speed */ |
for(s = STARTING_HASH_SIZE; s < maxnum; s <<= 1) |
; |
hash->size = s; |
hash->maxnum = maxnum; |
bytes = hash->size * sizeof(struct hash_entry **); |
hash->entries = NULL; /* in case malloc fails */ |
hash->table = malloc(bytes); |
if(!hash->table) |
return NULL; |
memset(hash->table, 0, bytes); |
hash->entries = malloc(maxnum * sizeof(struct hash_entry)); |
if(!hash->entries) |
return NULL; |
hash->next_free = hash->entries; |
return hash; |
} |
static int add_colorhash(struct color_hash *hash, |
char *key, int cpp, Uint32 color) |
{ |
int index = hash_key(key, cpp, hash->size); |
struct hash_entry *e = hash->next_free++; |
e->color = color; |
e->key = key; |
e->next = hash->table[index]; |
hash->table[index] = e; |
return 1; |
} |
/* fast lookup that works if cpp == 1 */ |
#define QUICK_COLORHASH(hash, key) ((hash)->table[*(Uint8 *)(key)]->color) |
static Uint32 get_colorhash(struct color_hash *hash, const char *key, int cpp) |
{ |
struct hash_entry *entry = hash->table[hash_key(key, cpp, hash->size)]; |
while(entry) { |
if(memcmp(key, entry->key, cpp) == 0) |
return entry->color; |
entry = entry->next; |
} |
return 0; /* garbage in - garbage out */ |
} |
static void free_colorhash(struct color_hash *hash) |
{ |
if(hash && hash->table) { |
free(hash->table); |
free(hash->entries); |
free(hash); |
} |
} |
#define ARRAYSIZE(a) (int)(sizeof(a) / sizeof((a)[0])) |
/* |
* convert colour spec to RGB (in 0xrrggbb format). |
* return 1 if successful. may scribble on the colorspec buffer. |
*/ |
static int color_to_rgb(char *spec, Uint32 *rgb) |
{ |
/* poor man's rgb.txt */ |
static struct { char *name; Uint32 rgb; } known[] = { |
{"none", 0xffffffff}, |
{"black", 0x00000000}, |
{"white", 0x00ffffff}, |
{"red", 0x00ff0000}, |
{"green", 0x0000ff00}, |
{"blue", 0x000000ff} |
}; |
if(spec[0] == '#') { |
char buf[7]; |
++spec; |
switch(strlen(spec)) { |
case 3: |
buf[0] = buf[1] = spec[0]; |
buf[2] = buf[3] = spec[1]; |
buf[4] = buf[5] = spec[2]; |
break; |
case 6: |
memcpy(buf, spec, 6); |
break; |
case 12: |
buf[0] = spec[0]; |
buf[1] = spec[1]; |
buf[2] = spec[4]; |
buf[3] = spec[5]; |
buf[4] = spec[8]; |
buf[5] = spec[9]; |
break; |
} |
buf[6] = '\0'; |
*rgb = strtol(buf, NULL, 16); |
return 1; |
} else { |
int i; |
for(i = 0; i < ARRAYSIZE(known); i++) |
if(IMG_string_equals(known[i].name, spec)) { |
*rgb = known[i].rgb; |
return 1; |
} |
return 0; |
} |
} |
static char *skipspace(char *p) |
{ |
while(isspace((unsigned char)*p)) |
++p; |
return p; |
} |
static char *skipnonspace(char *p) |
{ |
while(!isspace((unsigned char)*p) && *p) |
++p; |
return p; |
} |
#ifndef MAX |
#define MAX(a, b) ((a) > (b) ? (a) : (b)) |
#endif |
/* Load a XPM type image from an SDL datasource */ |
SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src) |
{ |
SDL_Surface *image; |
char line[1024]; |
char *here; |
int index; |
int x, y; |
int w, h, ncolors, cpp; |
int pixels_len; |
char *pixels = NULL; |
int indexed; |
Uint8 *dst; |
struct color_hash *colors; |
SDL_Color *im_colors = NULL; |
char *keystrings, *nextkey; |
char *error = NULL; |
/* Skip to the first string, which describes the image */ |
do { |
here = SDL_RWgets(line, sizeof(line), src); |
if ( !here ) { |
IMG_SetError("Premature end of data"); |
return(NULL); |
} |
here = skipspace(here); |
} while(*here != '"'); |
/* |
* The header string of an XPMv3 image has the format |
* |
* <width> <height> <ncolors> <cpp> [ <hotspot_x> <hotspot_y> ] |
* |
* where the hotspot coords are intended for mouse cursors. |
* Right now we don't use the hotspots but it should be handled |
* one day. |
*/ |
if(sscanf(here + 1, "%d %d %d %d", &w, &h, &ncolors, &cpp) != 4 |
|| w <= 0 || h <= 0 || ncolors <= 0 || cpp <= 0) { |
IMG_SetError("Invalid format description"); |
return(NULL); |
} |
keystrings = malloc(ncolors * cpp); |
if(!keystrings) { |
IMG_SetError("Out of memory"); |
free(pixels); |
return NULL; |
} |
nextkey = keystrings; |
/* Create the new surface */ |
if(ncolors <= 256) { |
indexed = 1; |
image = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 8, |
0, 0, 0, 0); |
im_colors = image->format->palette->colors; |
image->format->palette->ncolors = ncolors; |
} else { |
indexed = 0; |
image = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, |
0xff0000, 0x00ff00, 0x0000ff, 0); |
} |
if(!image) { |
/* Hmm, some SDL error (out of memory?) */ |
free(pixels); |
return(NULL); |
} |
/* Read the colors */ |
colors = create_colorhash(ncolors); |
if ( ! colors ) { |
error = "Out of memory"; |
goto done; |
} |
for(index = 0; index < ncolors; ++index ) { |
char *key; |
int len; |
do { |
here = SDL_RWgets(line, sizeof(line), src); |
if(!here) { |
error = "Premature end of data"; |
goto done; |
} |
here = skipspace(here); |
} while(*here != '"'); |
++here; |
len = strlen(here); |
if(len < cpp + 7) |
continue; /* cannot be a valid line */ |
key = here; |
key[cpp] = '\0'; |
here += cpp + 1; |
/* parse a colour definition */ |
for(;;) { |
char nametype; |
char *colname; |
char delim; |
Uint32 rgb; |
here = skipspace(here); |
nametype = *here; |
here = skipnonspace(here); |
here = skipspace(here); |
colname = here; |
while(*here && !isspace((unsigned char)*here) |
&& *here != '"') |
here++; |
if(!*here) { |
error = "color parse error"; |
goto done; |
} |
if(nametype == 's') |
continue; /* skip symbolic colour names */ |
delim = *here; |
*here = '\0'; |
if(delim) |
here++; |
if(!color_to_rgb(colname, &rgb)) |
continue; |
memcpy(nextkey, key, cpp); |
if(indexed) { |
SDL_Color *c = im_colors + index; |
c->r = rgb >> 16; |
c->g = rgb >> 8; |
c->b = rgb; |
add_colorhash(colors, nextkey, cpp, index); |
} else |
add_colorhash(colors, nextkey, cpp, rgb); |
nextkey += cpp; |
if(rgb == 0xffffffff) |
SDL_SetColorKey(image, SDL_SRCCOLORKEY, |
indexed ? index : rgb); |
break; |
} |
} |
/* Read the pixels */ |
pixels_len = w * cpp; |
pixels = malloc(MAX(pixels_len + 5, 20)); |
if(!pixels) { |
error = "Out of memory"; |
goto done; |
} |
dst = image->pixels; |
for (y = 0; y < h; ) { |
char *s; |
char c; |
do { |
if(SDL_RWread(src, &c, 1, 1) <= 0) { |
error = "Premature end of data"; |
goto done; |
} |
} while(c == ' '); |
if(c != '"') { |
/* comment or empty line, skip it */ |
while(c != '\n' && c != '\r') { |
if(SDL_RWread(src, &c, 1, 1) <= 0) { |
error = "Premature end of data"; |
goto done; |
} |
} |
continue; |
} |
if(SDL_RWread(src, pixels, pixels_len + 3, 1) <= 0) { |
error = "Premature end of data"; |
goto done; |
} |
s = pixels; |
if(indexed) { |
/* optimization for some common cases */ |
if(cpp == 1) |
for(x = 0; x < w; x++) |
dst[x] = QUICK_COLORHASH(colors, |
s + x); |
else |
for(x = 0; x < w; x++) |
dst[x] = get_colorhash(colors, |
s + x * cpp, |
cpp); |
} else { |
for (x = 0; x < w; x++) |
((Uint32*)dst)[x] = get_colorhash(colors, |
s + x * cpp, |
cpp); |
} |
dst += image->pitch; |
y++; |
} |
done: |
if(error) { |
if(image) |
SDL_FreeSurface(image); |
image = NULL; |
IMG_SetError(error); |
} |
free(pixels); |
free(keystrings); |
free_colorhash(colors); |
return(image); |
} |
#else |
/* See if an image is contained in a data source */ |
int IMG_isXPM(SDL_RWops *src) |
{ |
return(0); |
} |
/* Load a XPM type image from an SDL datasource */ |
SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src) |
{ |
return(NULL); |
} |
#endif /* LOAD_XPM */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/Makefile |
---|
0,0 → 1,7 |
OBJS = IMG_bmp.o IMG.o IMG_gif.o IMG_jpg.o IMG_pcx.o IMG_png.o IMG_pnm.o \ |
IMG_tga.o IMG_tif.o IMG_xcf.o IMG_xpm.o |
OUTFILE = ../lib/libSDL_image.a |
CFLAGS = -I../include -D_REENTRANT -DLOAD_BMP -DLOAD_GIF -DLOAD_JPG \ |
-DLOAD_PCX -DLOAD_PNG -DLOAD_PNM -DLOAD_TGA -DLOAD_XPM |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/SDL_image.h |
---|
0,0 → 1,93 |
/* |
IMGLIB: An example image loading library for use with SDL |
Copyright (C) 1999 Sam Lantinga |
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 |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* A simple library to load images of various formats as SDL surfaces */ |
#ifndef _IMG_h |
#define _IMG_h |
#include "SDL.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Load an image from an SDL data source. |
The 'type' may be one of: "BMP", "GIF", "PNG", etc. |
If the image format supports a transparent pixel, SDL will set the |
colorkey for the surface. You can enable RLE acceleration on the |
surface afterwards by calling: |
SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey); |
*/ |
extern DECLSPEC SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, |
char *type); |
/* Convenience functions */ |
extern DECLSPEC SDL_Surface *IMG_Load(const char *file); |
extern DECLSPEC SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc); |
/* Invert the alpha of a surface for use with OpenGL |
This function is now a no-op, and only provided for backwards compatibility. |
*/ |
extern DECLSPEC int IMG_InvertAlpha(int on); |
/* Functions to detect a file type, given a seekable source */ |
extern DECLSPEC int IMG_isBMP(SDL_RWops *src); |
extern DECLSPEC int IMG_isPNM(SDL_RWops *src); |
extern DECLSPEC int IMG_isXPM(SDL_RWops *src); |
extern DECLSPEC int IMG_isXCF(SDL_RWops *src); |
extern DECLSPEC int IMG_isPCX(SDL_RWops *src); |
extern DECLSPEC int IMG_isGIF(SDL_RWops *src); |
extern DECLSPEC int IMG_isJPG(SDL_RWops *src); |
extern DECLSPEC int IMG_isTIF(SDL_RWops *src); |
extern DECLSPEC int IMG_isPNG(SDL_RWops *src); |
/* Individual loading functions */ |
extern DECLSPEC SDL_Surface *IMG_LoadBMP_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadXPM_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadTIF_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src); |
extern DECLSPEC SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src); |
/* We'll use SDL for reporting errors */ |
#define IMG_SetError SDL_SetError |
#define IMG_GetError SDL_GetError |
/* used internally, NOT an exported function */ |
extern DECLSPEC int IMG_string_equals(const char *str1, const char *str2); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _IMG_h */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/test/Makefile |
---|
0,0 → 1,6 |
OUTFILE = showimg |
OBJS = showimage.o |
LIBS = -L../../lib -lSDL -lSDL_image -lSDL -lpng -ljpeg -lz |
CFLAGS = -I../../include -I.. |
include $(MENUETDEV)/makefiles/Makefile_for_program |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/test/showimage.c |
---|
0,0 → 1,185 |
/* |
SHOW: A test application for the SDL image loading library. |
Copyright (C) 1999 Sam Lantinga |
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 |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include "SDL.h" |
#include "SDL_image.h" |
/* Draw a Gimpish background pattern to show transparency in the image */ |
void draw_background(SDL_Surface *screen) |
{ |
Uint8 *dst = screen->pixels; |
int x, y; |
int bpp = screen->format->BytesPerPixel; |
Uint32 col[2]; |
col[0] = SDL_MapRGB(screen->format, 0x66, 0x66, 0x66); |
col[1] = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99); |
for(y = 0; y < screen->h; y++) { |
for(x = 0; x < screen->w; x++) { |
/* use an 8x8 checkerboard pattern */ |
Uint32 c = col[((x ^ y) >> 3) & 1]; |
switch(bpp) { |
case 1: |
dst[x] = c; |
break; |
case 2: |
((Uint16 *)dst)[x] = c; |
break; |
case 3: |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { |
dst[x * 3] = c; |
dst[x * 3 + 1] = c >> 8; |
dst[x * 3 + 2] = c >> 16; |
} else { |
dst[x * 3] = c >> 16; |
dst[x * 3 + 1] = c >> 8; |
dst[x * 3 + 2] = c; |
} |
break; |
case 4: |
((Uint32 *)dst)[x] = c; |
break; |
} |
} |
dst += screen->pitch; |
} |
} |
int app_main(int argc, char *argv[]) |
{ |
Uint32 flags; |
SDL_Surface *screen, *image; |
int i, depth, done; |
SDL_Event event; |
argv[1]="../1/test.png"; |
argc=2; |
/* Initialize the SDL library */ |
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { |
SDL_printf("Couldn't initialize SDL: %s\n",SDL_GetError()); |
return(255); |
} |
flags = SDL_SWSURFACE; |
for ( i=1; i<argc; ++i ) { |
SDL_ShowCursor(0); |
image = IMG_Load(argv[i]); |
if ( image == NULL ) { |
SDL_printf("Couldn't load %s: %s\n", |
argv[i], SDL_GetError()); |
continue; |
} |
{ |
static char xttl[128]; |
sprintf(xttl,"Showimage - filename is \"%s\"",argv[1]); |
SDL_WM_SetCaption(xttl, "showimage"); |
} |
/* Create a display for the image */ |
depth = SDL_VideoModeOK(image->w, image->h, 32, flags); |
/* Use the deepest native mode, except that we emulate 32bpp |
for viewing non-indexed images on 8bpp screens */ |
if ( depth == 0 ) { |
if ( image->format->BytesPerPixel > 1 ) { |
depth = 32; |
} else { |
depth = 8; |
} |
} else |
if ( (image->format->BytesPerPixel > 1) && (depth == 8) ) { |
depth = 32; |
} |
if(depth == 8) |
flags |= SDL_HWPALETTE; |
screen = SDL_SetVideoMode(image->w, image->h, depth, flags); |
if ( screen == NULL ) { |
SDL_printf("Couldn't set %dx%dx%d video mode: %s\n", |
image->w, image->h, depth, SDL_GetError()); |
continue; |
} |
/* Set the palette, if one exists */ |
if ( image->format->palette ) { |
SDL_SetColors(screen, image->format->palette->colors, |
0, image->format->palette->ncolors); |
} |
/* Draw a background pattern if the surface has transparency */ |
if(image->flags & (SDL_SRCALPHA | SDL_SRCCOLORKEY)) |
draw_background(screen); |
/* Display the image */ |
SDL_BlitSurface(image, NULL, screen, NULL); |
SDL_UpdateRect(screen, 0, 0, 0, 0); |
done = 0; |
while ( ! done ) { |
if ( SDL_PollEvent(&event) ) { |
switch (event.type) { |
case SDL_KEYUP: |
switch (event.key.keysym.sym) { |
case SDLK_LEFT: |
if ( i > 1 ) { |
i -= 2; |
done = 1; |
} |
break; |
case SDLK_RIGHT: |
if ( argv[i+1] ) { |
done = 1; |
} |
break; |
case SDLK_ESCAPE: |
case SDLK_q: |
argv[i+1] = NULL; |
/* Drop through to done */ |
case SDLK_SPACE: |
case SDLK_TAB: |
done = 1; |
break; |
default: |
break; |
} |
break; |
case SDL_QUIT: |
argv[i+1] = NULL; |
done = 1; |
break; |
default: |
break; |
} |
} else { |
SDL_Delay(3); |
} |
} |
SDL_FreeSurface(image); |
} |
/* We're done! */ |
SDL_Quit(); |
return(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_image/test/test.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/CHANGES |
---|
0,0 → 1,51 |
1.2.2: |
Sam Lantinga - Tue Sep 26 15:04:04 PDT 2000 |
* Added TTF_RenderGlyph_* functions to render a single glyph |
Michael Vance - Tue Sep 12 12:20:03 PDT 2000 |
* Added TTF_GetGlyphMetrics() to retrieve the glyph bounding box |
Sam Lantinga - Tue Sep 12 07:15:34 PDT 2000 |
* Fixed the alpha blending for SDL 1.1.5 |
Michael Vance - Mon Sep 11 15:45:05 PDT 2000 |
* Added TTF_FontAscent() for completeness |
Ray Kelm - Fri, 04 Aug 2000 20:58:00 -0400 |
* Added support for cross-compiling Windows DLL from Linux |
1.2.1: |
Sam Lantinga - Wed May 10 19:54:56 PDT 2000 |
* Fixed bounding box width computation |
Sam Lantinga - Wed May 10 19:52:39 PDT 2000 |
* Fixed compile problem with Visual C++ |
* Don't allocate memory for zero sized glyphs (like space) |
Sam Lantinga - Sat May 6 13:39:15 PDT 2000 |
* Fixed bolding of large fonts |
1.2.0: |
Sam Lantinga - Fri May 5 11:08:24 PDT 2000 |
* Added support for font styles (bold, italic, underline) |
New functions: TTF_GetFontStyle(), TTF_SetFontStyle() |
1.1.1: |
Sam Lantinga - Thu May 4 02:19:36 PDT 2000 |
* Improved the quality of the alpha blended text rendering |
Sam Lantinga - Thu May 4 01:11:00 PDT 2000 |
* Added font glyph caching, speeded up text rendering |
* Added font attribute information. |
New functions: TTF_FontDescent(), TTF_FontLineSkip() |
1.1.0: |
Sam Lantinga - Tue Apr 25 22:36:41 PDT 2000 |
* Added two new styles of font rendering: |
solid colorkey (no dither) and alpha blended dithering |
New functions: TTF_RenderText_Solid(), TTF_RenderText_Blended() |
1.0.2: |
Sam Lantinga - Sun Apr 23 18:01:44 PDT 2000 |
* TTF_OpenFont() takes a const char * argument, instead of char * |
1.0.1: |
Sam Lantinga - Wed Jan 19 22:10:52 PST 2000 |
* Added CHANGES |
* Added rpm spec file contributed by Hakan Tandogan |
* Removed freetype.h header dependency from public headers |
* Added /usr/include/freetype/ directory detection to configure.in |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/COPYING |
---|
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 |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/Makefile |
---|
0,0 → 1,5 |
OUTFILE = ../lib/libSDL_ttf.a |
OBJS = SDL_ttf.o |
CFLAGS = -I../include |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/README |
---|
0,0 → 1,27 |
This library is a wrapper around the excellent FreeType 1.2 library, |
available at: |
http://www.freetype.org/ |
WARNING: There may be patent issues with using the FreeType library. |
Check the FreeType website for up-to-date details. |
This library allows you to use TrueType fonts to render text in SDL |
applications. |
To make the library, first install the FreeType library, then type |
'make' to build the SDL truetype library and 'make all' to build |
the demo application. |
Be careful when including fonts with your application, as many of them |
are copyrighted. The Microsoft fonts, for example, are not freely |
redistributable and even the free "web" fonts they provide are only |
redistributable in their special executable installer form (May 1998). |
There are plenty of freeware and shareware fonts available on the Internet |
though, and may suit your purposes. |
Please see the file "COPYING" for license information for this library. |
Enjoy! |
-Sam Lantinga <slouken@devolution.com> (5/1/98) |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/SDL_ttf.c |
---|
0,0 → 1,1193 |
#include <math.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <assert.h> |
#include <freetype/freetype.h> |
#include "SDL.h" |
#include "SDL_ttf.h" |
/* Macro to convert a character to a Unicode value -- assume already Unicode */ |
#define UNICODE(c) c |
/* Round a float up to the nearest integeter and return that integer */ |
static int round(float x) |
{ |
int value; |
value = (int)x; |
if ( x > value ) { |
value = value + 1; |
} else |
if ( x < value ) { |
value = value - 1; |
} |
return value; |
} |
/* The structure used to hold glyph information (cached) */ |
struct glyph { |
int cached; |
TT_Raster_Map bitmap; |
TT_Raster_Map pixmap; |
int minx; |
int maxx; |
int miny; |
int maxy; |
int advance; |
}; |
/* The structure used to hold internal font information */ |
struct _TTF_Font { |
TT_Face face; |
TT_Instance inst; |
TT_Glyph glyph; |
TT_CharMap map; |
/* Font metrics */ |
int pointsize; |
int height; /* ascent - descent */ |
float ascent; |
float descent; |
float lineskip; |
/* The font style */ |
int style; |
/* Extra width in glyph bounds for text styles */ |
int glyph_overhang; |
float glyph_italics; |
/* For now, support Latin-1 character set caching */ |
struct glyph *current; |
struct glyph cache[256]; |
struct glyph scratch; |
}; |
/* The FreeType font engine */ |
static TT_Engine engine; |
int TTF_Init(void) |
{ |
int error; |
error = TT_Init_FreeType(&engine); |
if ( error ) { |
SDL_SetError("Couldn't init FreeType engine"); |
return(-1); |
} |
return(0); |
} |
TTF_Font *TTF_OpenFont(const char *file, int ptsize) |
{ |
TTF_Font *font; |
TT_Face_Properties properties; |
TT_Instance_Metrics imetrics; |
int i, n; |
TT_UShort platform, encoding; |
TT_Error error; |
font = (TTF_Font *)malloc(sizeof(*font)); |
if ( font == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
memset(font, 0, sizeof(*font)); |
/* Open the font and create ancillary data */ |
error = TT_Open_Face(engine, file, &font->face); |
if ( error ) { |
SDL_SetError("Couldn't load font file"); |
free(font); |
return(NULL); |
} |
error = TT_New_Glyph(font->face, &font->glyph); |
if ( error ) { |
SDL_SetError("Couldn't create glyph container"); |
TTF_CloseFont(font); |
return(NULL); |
} |
error = TT_New_Instance(font->face, &font->inst); |
if ( error ) { |
SDL_SetError("Couldn't create font instance"); |
TTF_CloseFont(font); |
return(NULL); |
} |
/* Set the display resolution */ |
error = TT_Set_Instance_Resolutions(font->inst, 72, 72); |
if ( error ) { |
SDL_SetError("Couldn't set font resolution"); |
TTF_CloseFont(font); |
return(NULL); |
} |
error = TT_Set_Instance_CharSize(font->inst, ptsize*64); |
if ( error ) { |
SDL_SetError("Couldn't set font size"); |
TTF_CloseFont(font); |
return(NULL); |
} |
/* Get a Unicode mapping for this font */ |
n = TT_Get_CharMap_Count(font->face); |
for ( i=0; i<n; ++i ) { |
TT_Get_CharMap_ID(font->face, i, &platform, &encoding); |
if ( ((platform == TT_PLATFORM_MICROSOFT) && |
(encoding == TT_MS_ID_UNICODE_CS)) || |
((platform == TT_PLATFORM_APPLE_UNICODE) && |
(encoding == TT_APPLE_ID_DEFAULT)) ) { |
TT_Get_CharMap(font->face, i, &font->map); |
break; |
} |
} |
if ( i == n ) { |
SDL_SetError("Font doesn't have a Unicode mapping"); |
TTF_CloseFont(font); |
return(NULL); |
} |
/* Get the font metrics for this font */ |
TT_Get_Face_Properties(font->face, &properties ); |
TT_Get_Instance_Metrics(font->inst, &imetrics); |
font->pointsize = imetrics.y_ppem; |
font->ascent = (float)properties.horizontal->Ascender / |
properties.header->Units_Per_EM; |
font->ascent *= font->pointsize; |
font->descent = (float)properties.horizontal->Descender / |
properties.header->Units_Per_EM; |
font->descent *= font->pointsize; |
font->lineskip = (float)properties.horizontal->Line_Gap / |
properties.header->Units_Per_EM; |
font->lineskip *= font->pointsize; |
font->height = round(font->ascent - font->descent); |
/* Set the default font style */ |
font->style = TTF_STYLE_NORMAL; |
font->glyph_overhang = font->pointsize/10; |
/* x offset = cos(((90.0-12)/360)*2*M_PI), or 12 degree angle */ |
font->glyph_italics = 0.207; |
font->glyph_italics *= font->height; |
return(font); |
} |
static void Flush_Glyph(struct glyph *glyph) |
{ |
if ( glyph->bitmap.bitmap ) { |
free(glyph->bitmap.bitmap); |
glyph->bitmap.bitmap = 0; |
} |
if ( glyph->pixmap.bitmap ) { |
free(glyph->pixmap.bitmap); |
glyph->pixmap.bitmap = 0; |
} |
glyph->cached = 0; |
} |
static void Flush_Cache(TTF_Font *font) |
{ |
int i; |
for ( i=0; i<(sizeof font->cache)/(sizeof font->cache[0]); ++i ) { |
if ( font->cache[i].cached ) { |
Flush_Glyph(&font->cache[i]); |
} |
} |
if ( font->scratch.cached ) { |
Flush_Glyph(&font->scratch); |
} |
} |
static TT_Error Load_Glyph(TTF_Font *font, Uint16 ch, struct glyph *glyph) |
{ |
TT_UShort index; |
TT_Glyph_Metrics metrics; |
TT_Outline outline; |
int x_offset; |
int y_offset; |
TT_Error error; |
/* Load the glyph */ |
index = TT_Char_Index(font->map, UNICODE(ch)); |
error = TT_Load_Glyph(font->inst, font->glyph, index, TTLOAD_DEFAULT); |
if ( error ) return error; |
/* Get the bounding box */ |
TT_Get_Glyph_Metrics(font->glyph, &metrics); |
glyph->minx = (metrics.bbox.xMin & -64) / 64; |
glyph->maxx = ((metrics.bbox.xMax + 63) & -64) / 64; |
glyph->miny = (metrics.bbox.yMin & -64) / 64; |
glyph->maxy = ((metrics.bbox.yMax + 63) & -64) / 64; |
glyph->advance = (metrics.advance & -64) / 64; |
/* Adjust for bold and italic text */ |
if ( font->style & TTF_STYLE_BOLD ) { |
glyph->maxx += font->glyph_overhang; |
} |
if ( font->style & TTF_STYLE_ITALIC ) { |
glyph->maxx += round(font->glyph_italics); |
} |
/* Get the bitmap memory */ |
glyph->bitmap.width = ((glyph->maxx - glyph->minx) + 7) & ~7; |
glyph->bitmap.rows = font->height; |
glyph->bitmap.cols = glyph->bitmap.width/8; |
glyph->bitmap.flow = TT_Flow_Down; |
glyph->bitmap.size = (glyph->bitmap.rows * glyph->bitmap.cols); |
if ( glyph->bitmap.size ) { |
glyph->bitmap.bitmap = malloc(glyph->bitmap.size); |
if ( ! glyph->bitmap.bitmap ) { |
error = TT_Err_Out_Of_Memory; |
goto was_error; |
} |
memset(glyph->bitmap.bitmap, 0, glyph->bitmap.size); |
} else { |
glyph->bitmap.bitmap = 0; |
} |
/* Get the pixmap memory */ |
glyph->pixmap.width = ((glyph->maxx - glyph->minx) + 3) & ~3; |
glyph->pixmap.rows = font->height; |
glyph->pixmap.cols = glyph->pixmap.width; |
glyph->pixmap.flow = TT_Flow_Down; |
glyph->pixmap.size = (glyph->pixmap.rows * glyph->pixmap.cols); |
if ( glyph->pixmap.size ) { |
glyph->pixmap.bitmap = malloc(glyph->pixmap.size); |
if ( ! glyph->pixmap.bitmap ) { |
error = TT_Err_Out_Of_Memory; |
goto was_error; |
} |
memset(glyph->pixmap.bitmap, 0, glyph->pixmap.size); |
} else { |
glyph->pixmap.bitmap = 0; |
} |
/* Render the glyph into the bitmap and pixmap */ |
error = TT_Get_Glyph_Outline(font->glyph, &outline); |
/* Handle the italic style */ |
if ( font->style & TTF_STYLE_ITALIC ) { |
TT_Matrix shear; |
shear.xx = 1<<16; |
shear.xy = (int)(font->glyph_italics*(1<<16))/font->height; |
shear.yx = 0; |
shear.yy = 1<<16; |
TT_Transform_Outline(&outline, &shear); |
} |
x_offset = -glyph->minx * 64; |
y_offset = -round(font->descent) * 64; |
TT_Translate_Outline(&outline, x_offset, y_offset); |
error += TT_Get_Outline_Bitmap(engine, &outline, &glyph->bitmap); |
error += TT_Get_Outline_Pixmap(engine, &outline, &glyph->pixmap); |
/* Handle the bold style */ |
if ( font->style & TTF_STYLE_BOLD ) { |
int row, col; |
int offset; |
int pixel; |
Uint8 *pixmap; |
/* The bitmap is easy, just render another copy */ |
for ( offset=0; offset < font->glyph_overhang; ++offset ) { |
TT_Translate_Outline(&outline, 64, 0); |
error += TT_Get_Outline_Bitmap(engine, |
&outline,&glyph->bitmap); |
} |
x_offset += font->glyph_overhang*64; |
/* The pixmap is a little harder, we have to add and clamp */ |
for ( row=glyph->pixmap.rows-1; row >= 0; --row ) { |
pixmap = (Uint8 *)glyph->pixmap.bitmap + |
row*glyph->pixmap.cols; |
for (offset=1; offset<=font->glyph_overhang; ++offset) { |
for (col=glyph->pixmap.cols-1; col > 0; --col) { |
pixel=(pixmap[col]+pixmap[col-1]); |
if ( pixel > 4 ) { |
pixel = 4; |
} |
pixmap[col] = (Uint8)pixel; |
} |
} |
} |
} |
TT_Translate_Outline(&outline, -x_offset, -y_offset); |
was_error: |
if ( error ) { |
if ( glyph->bitmap.bitmap ) { |
free(glyph->bitmap.bitmap); |
glyph->bitmap.bitmap = 0; |
} |
if ( glyph->pixmap.bitmap ) { |
free(glyph->pixmap.bitmap); |
glyph->pixmap.bitmap = 0; |
} |
return error; |
} |
/* We're done, mark this glyph cached */ |
glyph->cached = ch; |
return TT_Err_Ok; |
} |
static TT_Error Find_Glyph(TTF_Font *font, Uint16 ch) |
{ |
int retval; |
retval = 0; |
if ( ch < 256 ) { |
font->current = &font->cache[ch]; |
} else { |
if ( font->scratch.cached != ch ) { |
Flush_Glyph(&font->scratch); |
} |
font->current = &font->scratch; |
} |
if ( ! font->current->cached ) { |
retval = Load_Glyph(font, ch, font->current); |
} |
return retval; |
} |
void TTF_CloseFont(TTF_Font *font) |
{ |
Flush_Cache(font); |
TT_Close_Face(font->face); |
free(font); |
} |
static Uint16 *ASCII_to_UNICODE(Uint16 *unicode, const char *text, int len) |
{ |
int i; |
for ( i=0; i < len; ++i ) { |
unicode[i] = ((const unsigned char *)text)[i]; |
} |
unicode[i] = 0; |
return unicode; |
} |
static Uint16 *UTF8_to_UNICODE(Uint16 *unicode, const char *utf8, int len) |
{ |
int i, j; |
Uint16 ch; |
for ( i=0, j=0; i < len; ++i, ++j ) { |
ch = ((const unsigned char *)utf8)[i]; |
if ( ch >= 0xF0 ) { |
ch = (Uint16)(utf8[i]&0x07) << 18; |
ch |= (Uint16)(utf8[++i]&0x3F) << 12; |
ch |= (Uint16)(utf8[++i]&0x3F) << 6; |
ch |= (Uint16)(utf8[++i]&0x3F); |
} else |
if ( ch >= 0xE0 ) { |
ch = (Uint16)(utf8[i]&0x3F) << 12; |
ch |= (Uint16)(utf8[++i]&0x3F) << 6; |
ch |= (Uint16)(utf8[++i]&0x3F); |
} else |
if ( ch >= 0xC0 ) { |
ch = (Uint16)(utf8[i]&0x3F) << 6; |
ch |= (Uint16)(utf8[++i]&0x3F); |
} |
unicode[j] = ch; |
} |
unicode[j] = 0; |
return unicode; |
} |
int TTF_FontHeight(TTF_Font *font) |
{ |
return(font->height); |
} |
int TTF_FontAscent(TTF_Font *font) |
{ |
return(round(font->ascent)); |
} |
int TTF_FontDescent(TTF_Font *font) |
{ |
return(round(font->descent)); |
} |
int TTF_FontLineSkip(TTF_Font *font) |
{ |
return(round(font->lineskip)); |
} |
int TTF_GlyphMetrics(TTF_Font *font, Uint16 ch, |
int* minx, int* maxx, int* miny, int* maxy, int* advance) |
{ |
TT_Error error; |
error = Find_Glyph(font, ch); |
if ( error ) { |
return -1; |
} |
if ( minx ) { |
*minx = font->current->minx; |
} |
if ( maxx ) { |
*maxx = font->current->maxx; |
} |
if ( miny ) { |
*miny = font->current->miny; |
} |
if ( maxy ) { |
*maxy = font->current->maxy; |
} |
if ( advance ) { |
*advance = font->current->advance; |
} |
return 0; |
} |
int TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h) |
{ |
Uint16 *unicode_text; |
int unicode_len; |
int status; |
/* Copy the Latin-1 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return -1; |
} |
ASCII_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
status = TTF_SizeUNICODE(font, unicode_text, w, h); |
/* Free the text buffer and return */ |
free(unicode_text); |
return status; |
} |
int TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h) |
{ |
Uint16 *unicode_text; |
int unicode_len; |
int status; |
/* Copy the UTF-8 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return -1; |
} |
UTF8_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
status = TTF_SizeUNICODE(font, unicode_text, w, h); |
/* Free the text buffer and return */ |
free(unicode_text); |
return status; |
} |
int TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h) |
{ |
int status; |
const Uint16 *ch; |
int x, z, minx, maxx; |
TT_Error error; |
/* Initialize everything to 0 */ |
status = 0; |
minx = maxx = 0; |
/* Load each character and sum it's bounding box */ |
x= 0; |
for ( ch=text; *ch; ++ch ) { |
error = Find_Glyph(font, *ch); |
if ( ! error ) { |
z = x + font->current->minx; |
if ( minx > z ) { |
minx = z; |
} |
if ( font->style & TTF_STYLE_BOLD ) { |
x += font->glyph_overhang; |
} |
if ( font->current->advance > font->current->maxx ) { |
z = x + font->current->advance; |
} else { |
z = x + font->current->maxx; |
} |
if ( maxx < z ) { |
maxx = z; |
} |
x += font->current->advance; |
} |
} |
/* Fill the bounds rectangle */ |
if ( w ) { |
*w = (maxx - minx); |
} |
if ( h ) { |
*h = font->height; |
} |
return status; |
} |
/* Convert the Latin-1 text to UNICODE and render it |
*/ |
SDL_Surface *TTF_RenderText_Solid(TTF_Font *font, |
const char *text, SDL_Color fg) |
{ |
SDL_Surface *textbuf; |
Uint16 *unicode_text; |
int unicode_len; |
/* Copy the Latin-1 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
ASCII_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
textbuf = TTF_RenderUNICODE_Solid(font, unicode_text, fg); |
/* Free the text buffer and return */ |
free(unicode_text); |
return(textbuf); |
} |
/* Convert the UTF-8 text to UNICODE and render it |
*/ |
SDL_Surface *TTF_RenderUTF8_Solid(TTF_Font *font, |
const char *text, SDL_Color fg) |
{ |
SDL_Surface *textbuf; |
Uint16 *unicode_text; |
int unicode_len; |
/* Copy the UTF-8 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
UTF8_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
textbuf = TTF_RenderUNICODE_Solid(font, unicode_text, fg); |
/* Free the text buffer and return */ |
free(unicode_text); |
return(textbuf); |
} |
SDL_Surface *TTF_RenderUNICODE_Solid(TTF_Font *font, |
const Uint16 *text, SDL_Color fg) |
{ |
int xstart, width; |
int w, h; |
SDL_Surface *textbuf; |
SDL_Palette *palette; |
const Uint16 *ch; |
Uint8 *src, *dst; |
int row, col; |
TT_Error error; |
/* Get the dimensions of the text surface */ |
if ( (TTF_SizeUNICODE(font, text, &w, &h) < 0) || !w ) { |
TTF_SetError("Text has zero width"); |
return(NULL); |
} |
/* Create the target surface */ |
width = w; |
w = (w+7)&~7; |
textbuf = SDL_AllocSurface(SDL_SWSURFACE, w, h, 8, 0, 0, 0, 0); |
if ( textbuf == NULL ) { |
return(NULL); |
} |
/* Fill the palette with the foreground color */ |
palette = textbuf->format->palette; |
palette->colors[0].r = 255-fg.r; |
palette->colors[0].g = 255-fg.g; |
palette->colors[0].b = 255-fg.b; |
palette->colors[1].r = fg.r; |
palette->colors[1].g = fg.g; |
palette->colors[1].b = fg.b; |
SDL_SetColorKey(textbuf, SDL_SRCCOLORKEY, 0); |
/* Load and render each character */ |
xstart = 0; |
for ( ch=text; *ch; ++ch ) { |
error = Find_Glyph(font, *ch); |
if ( ! error ) { |
w = font->current->bitmap.width; |
src = (Uint8 *)font->current->bitmap.bitmap; |
for ( row = 0; row < h; ++row ) { |
dst = (Uint8 *)textbuf->pixels + |
row * textbuf->pitch + |
xstart + font->current->minx; |
for ( col = 0; col < w; col += 8 ) { |
Uint8 c = *src++; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
} |
} |
xstart += font->current->advance; |
if ( font->style & TTF_STYLE_BOLD ) { |
xstart += font->glyph_overhang; |
} |
} |
} |
/* Handle the underline style */ |
if ( font->style & TTF_STYLE_UNDERLINE ) { |
int row_offset; |
row_offset = round(font->ascent) + 1; |
if ( row_offset > font->height ) { |
row_offset = font->height-1; |
} |
memset((Uint8 *)textbuf->pixels+row_offset*textbuf->pitch, |
1, width); |
} |
return(textbuf); |
} |
SDL_Surface *TTF_RenderGlyph_Solid(TTF_Font *font, Uint16 ch, SDL_Color fg) |
{ |
SDL_Surface *textbuf; |
SDL_Palette *palette; |
Uint8 *src, *dst; |
int row, col; |
TT_Error error; |
struct glyph *glyph; |
/* Get the glyph itself */ |
error = Find_Glyph(font, ch); |
if ( error ) { |
return(NULL); |
} |
glyph = font->current; |
/* Create the target surface */ |
textbuf = SDL_CreateRGBSurface(SDL_SWSURFACE, |
glyph->bitmap.width, glyph->bitmap.rows, 8, 0, 0, 0, 0); |
if ( ! textbuf ) { |
return(NULL); |
} |
/* Fill the palette with the foreground color */ |
palette = textbuf->format->palette; |
palette->colors[0].r = 255-fg.r; |
palette->colors[0].g = 255-fg.g; |
palette->colors[0].b = 255-fg.b; |
palette->colors[1].r = fg.r; |
palette->colors[1].g = fg.g; |
palette->colors[1].b = fg.b; |
SDL_SetColorKey(textbuf, SDL_SRCCOLORKEY, 0); |
/* Load and render each character */ |
src = (Uint8 *)font->current->bitmap.bitmap; |
for ( row = 0; row < textbuf->h; ++row ) { |
dst = (Uint8 *)textbuf->pixels + row * textbuf->pitch; |
for ( col = 0; col < textbuf->w; col += 8 ) { |
Uint8 c = *src++; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
c <<= 1; |
*dst++ |= (c&0x80)>>7; |
} |
} |
/* Handle the underline style */ |
if ( font->style & TTF_STYLE_UNDERLINE ) { |
int row_offset; |
row_offset = round(font->ascent) + 1; |
if ( row_offset > font->height ) { |
row_offset = font->height-1; |
} |
memset((Uint8 *)textbuf->pixels+row_offset*textbuf->pitch, |
1, textbuf->w); |
} |
return(textbuf); |
} |
/* Convert the Latin-1 text to UNICODE and render it |
*/ |
SDL_Surface *TTF_RenderText_Shaded(TTF_Font *font, |
const char *text, SDL_Color fg, SDL_Color bg) |
{ |
SDL_Surface *textbuf; |
Uint16 *unicode_text; |
int unicode_len; |
/* Copy the Latin-1 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
ASCII_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
textbuf = TTF_RenderUNICODE_Shaded(font, unicode_text, fg, bg); |
/* Free the text buffer and return */ |
free(unicode_text); |
return(textbuf); |
} |
/* Convert the UTF-8 text to UNICODE and render it |
*/ |
SDL_Surface *TTF_RenderUTF8_Shaded(TTF_Font *font, |
const char *text, SDL_Color fg, SDL_Color bg) |
{ |
SDL_Surface *textbuf; |
Uint16 *unicode_text; |
int unicode_len; |
/* Copy the UTF-8 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
UTF8_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
textbuf = TTF_RenderUNICODE_Shaded(font, unicode_text, fg, bg); |
/* Free the text buffer and return */ |
free(unicode_text); |
return(textbuf); |
} |
SDL_Surface *TTF_RenderUNICODE_Shaded(TTF_Font *font, |
const Uint16 *text, SDL_Color fg, SDL_Color bg) |
{ |
int xstart, width; |
int w, h; |
SDL_Surface *textbuf; |
SDL_Palette *palette; |
int index; |
int rdiff, gdiff, bdiff; |
const Uint16 *ch; |
Uint8 *src, *dst; |
int row, col; |
TT_Error error; |
/* Get the dimensions of the text surface */ |
if ( (TTF_SizeUNICODE(font, text, &w, &h) < 0) || !w ) { |
TTF_SetError("Text has zero width"); |
return(NULL); |
} |
/* Create the target surface */ |
width = w; |
w = (w+3)&~3; |
textbuf = SDL_AllocSurface(SDL_SWSURFACE, w, h, 8, 0, 0, 0, 0); |
if ( textbuf == NULL ) { |
return(NULL); |
} |
/* Fill the palette with 5 levels of shading from bg to fg */ |
palette = textbuf->format->palette; |
rdiff = fg.r - bg.r; |
gdiff = fg.g - bg.g; |
bdiff = fg.b - bg.b; |
for ( index=0; index<5; ++index ) { |
palette->colors[index].r = bg.r + (index*rdiff)/4; |
palette->colors[index].g = bg.g + (index*gdiff)/4; |
palette->colors[index].b = bg.b + (index*bdiff)/4; |
} |
/* The other 3 levels are used as overflow when ORing pixels */ |
for ( ; index<8; ++index ) { |
palette->colors[index] = palette->colors[4]; |
} |
/* Load and render each character */ |
xstart = 0; |
for ( ch=text; *ch; ++ch ) { |
error = Find_Glyph(font, *ch); |
if ( ! error ) { |
w = font->current->pixmap.width; |
src = (Uint8 *)font->current->pixmap.bitmap; |
for ( row = 0; row < h; ++row ) { |
dst = (Uint8 *)textbuf->pixels + |
row * textbuf->pitch + |
xstart + font->current->minx; |
for ( col=w; col>0; col -= 4 ) { |
*dst++ |= *src++; |
*dst++ |= *src++; |
*dst++ |= *src++; |
*dst++ |= *src++; |
} |
} |
xstart += font->current->advance; |
if ( font->style & TTF_STYLE_BOLD ) { |
xstart += font->glyph_overhang; |
} |
} |
} |
/* Handle the underline style */ |
if ( font->style & TTF_STYLE_UNDERLINE ) { |
int row_offset; |
row_offset = round(font->ascent) + 1; |
if ( row_offset > font->height ) { |
row_offset = font->height-1; |
} |
memset((Uint8 *)textbuf->pixels+row_offset*textbuf->pitch, |
4, width); |
} |
return(textbuf); |
} |
SDL_Surface *TTF_RenderGlyph_Shaded(TTF_Font *font, |
Uint16 ch, SDL_Color fg, SDL_Color bg) |
{ |
SDL_Surface *textbuf; |
SDL_Palette *palette; |
int index; |
int rdiff, gdiff, bdiff; |
Uint8 *src, *dst; |
int row, col; |
TT_Error error; |
struct glyph *glyph; |
/* Get the glyph itself */ |
error = Find_Glyph(font, ch); |
if ( error ) { |
return(NULL); |
} |
glyph = font->current; |
/* Create the target surface */ |
textbuf = SDL_CreateRGBSurface(SDL_SWSURFACE, |
glyph->pixmap.width, glyph->pixmap.rows, 8, 0, 0, 0, 0); |
if ( ! textbuf ) { |
return(NULL); |
} |
/* Fill the palette with 5 levels of shading from bg to fg */ |
palette = textbuf->format->palette; |
rdiff = fg.r - bg.r; |
gdiff = fg.g - bg.g; |
bdiff = fg.b - bg.b; |
for ( index=0; index<5; ++index ) { |
palette->colors[index].r = bg.r + (index*rdiff)/4; |
palette->colors[index].g = bg.g + (index*gdiff)/4; |
palette->colors[index].b = bg.b + (index*bdiff)/4; |
} |
/* Copy the character from the pixmap */ |
for ( row=0; row<textbuf->h; ++row ) { |
src = glyph->pixmap.bitmap + row * glyph->pixmap.cols; |
dst = (Uint8 *)textbuf->pixels + row * textbuf->pitch; |
memcpy(dst, src, glyph->pixmap.cols); |
} |
/* Handle the underline style */ |
if ( font->style & TTF_STYLE_UNDERLINE ) { |
int row_offset; |
row_offset = round(font->ascent) + 1; |
if ( row_offset > font->height ) { |
row_offset = font->height-1; |
} |
memset((Uint8 *)textbuf->pixels+row_offset*textbuf->pitch, |
4, glyph->pixmap.cols); |
} |
return(textbuf); |
} |
/* Convert the Latin-1 text to UNICODE and render it |
*/ |
SDL_Surface *TTF_RenderText_Blended(TTF_Font *font, |
const char *text, SDL_Color fg) |
{ |
SDL_Surface *textbuf; |
Uint16 *unicode_text; |
int unicode_len; |
/* Copy the Latin-1 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
ASCII_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
textbuf = TTF_RenderUNICODE_Blended(font, unicode_text, fg); |
/* Free the text buffer and return */ |
free(unicode_text); |
return(textbuf); |
} |
/* Convert the UTF-8 text to UNICODE and render it |
*/ |
SDL_Surface *TTF_RenderUTF8_Blended(TTF_Font *font, |
const char *text, SDL_Color fg) |
{ |
SDL_Surface *textbuf; |
Uint16 *unicode_text; |
int unicode_len; |
/* Copy the UTF-8 text to a UNICODE text buffer */ |
unicode_len = strlen(text); |
unicode_text = (Uint16 *)malloc((unicode_len+1)*(sizeof *unicode_text)); |
if ( unicode_text == NULL ) { |
SDL_SetError("Out of memory"); |
return(NULL); |
} |
UTF8_to_UNICODE(unicode_text, text, unicode_len); |
/* Render the new text */ |
textbuf = TTF_RenderUNICODE_Blended(font, unicode_text, fg); |
/* Free the text buffer and return */ |
free(unicode_text); |
return(textbuf); |
} |
SDL_Surface *TTF_RenderUNICODE_Blended(TTF_Font *font, |
const Uint16 *text, SDL_Color fg) |
{ |
int xstart, width; |
int w, h; |
SDL_Surface *textbuf; |
#if SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) >= \ |
SDL_VERSIONNUM(1, 1, 5) /* The great alpha flip */ |
Uint32 alpha_table[] = { |
(0)<<24, (255-128)<<24, (255-64)<<24, (255-32)<<24, |
(255)<<24, (255)<<24, (255)<<24, (255)<<24 |
}; |
#else |
Uint32 alpha_table[] = { |
(255<<24), (128<<24), (64<<24), (32<<24), 0, 0, 0, 0 |
}; |
#endif |
Uint32 pixel; |
const Uint16 *ch; |
Uint8 *src; |
Uint32 *dst; |
int row, col; |
TT_Error error; |
/* Get the dimensions of the text surface */ |
if ( (TTF_SizeUNICODE(font, text, &w, &h) < 0) || !w ) { |
TTF_SetError("Text has zero width"); |
return(NULL); |
} |
/* Create the target surface, 32-bit ARGB format */ |
width = w; |
w = (w+3)&~3; |
textbuf = SDL_AllocSurface(SDL_SWSURFACE, w, h, 32, |
0x00FF0000, 0x0000FF00, 0x000000FF, |
0xFF000000); |
if ( textbuf == NULL ) { |
return(NULL); |
} |
/* Load and render each character */ |
xstart = 0; |
for ( ch=text; *ch; ++ch ) { |
error = Find_Glyph(font, *ch); |
if ( ! error ) { |
w = font->current->pixmap.width; |
src = (Uint8 *)font->current->pixmap.bitmap; |
for ( row = 0; row < h; ++row ) { |
dst = (Uint32 *)textbuf->pixels + |
row * textbuf->pitch/4 + |
xstart + font->current->minx; |
for ( col=w; col>0; col -= 4 ) { |
*dst++ |= *src++; |
*dst++ |= *src++; |
*dst++ |= *src++; |
*dst++ |= *src++; |
} |
} |
xstart += font->current->advance; |
if ( font->style & TTF_STYLE_BOLD ) { |
xstart += font->glyph_overhang; |
} |
} |
} |
/* Handle the underline style */ |
if ( font->style & TTF_STYLE_UNDERLINE ) { |
int row_offset; |
row_offset = round(font->ascent) + 1; |
if ( row_offset > font->height ) { |
row_offset = font->height-1; |
} |
dst = (Uint32 *)textbuf->pixels+row_offset*textbuf->pitch/4; |
for ( col=width; col > 0; ++col ) { |
*dst++ = 4; |
} |
} |
/* Build the alpha table */ |
pixel = (fg.r<<16)|(fg.g<<8)|fg.b; |
for ( xstart = 0; xstart < 8; ++xstart ) { |
alpha_table[xstart] |= pixel; |
} |
/* Transform the alpha values */ |
for ( row = 0; row < textbuf->h; ++row ) { |
dst = (Uint32 *)textbuf->pixels + row * textbuf->pitch/4; |
for ( col=textbuf->w; col>0; col -= 4 ) { |
*dst = alpha_table[*dst]; |
++dst; |
*dst = alpha_table[*dst]; |
++dst; |
*dst = alpha_table[*dst]; |
++dst; |
*dst = alpha_table[*dst]; |
++dst; |
} |
} |
return(textbuf); |
} |
SDL_Surface *TTF_RenderGlyph_Blended(TTF_Font *font, Uint16 ch, SDL_Color fg) |
{ |
SDL_Surface *textbuf; |
#if SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) >= \ |
SDL_VERSIONNUM(1, 1, 5) /* The great alpha flip */ |
Uint32 alpha_table[] = { |
(0)<<24, (255-128)<<24, (255-64)<<24, (255-32)<<24, |
(255)<<24, (255)<<24, (255)<<24, (255)<<24 |
}; |
#else |
Uint32 alpha_table[] = { |
(255<<24), (128<<24), (64<<24), (32<<24), 0, 0, 0, 0 |
}; |
#endif |
Uint32 pixel; |
Uint8 *src; |
Uint32 *dst; |
int row, col; |
TT_Error error; |
struct glyph *glyph; |
/* Get the glyph itself */ |
error = Find_Glyph(font, ch); |
if ( error ) { |
return(NULL); |
} |
glyph = font->current; |
/* Create the target surface, 32-bit ARGB format */ |
textbuf = SDL_CreateRGBSurface(SDL_SWSURFACE, |
glyph->pixmap.width, glyph->pixmap.rows, 32, |
0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); |
if ( ! textbuf ) { |
return(NULL); |
} |
/* Copy the character from the pixmap */ |
for ( row=0; row<textbuf->h; ++row ) { |
src = glyph->pixmap.bitmap + row * glyph->pixmap.cols; |
dst = (Uint32 *)textbuf->pixels + row * textbuf->pitch/4; |
for ( col=0; col<glyph->pixmap.cols; ++col ) { |
*dst++ = *src++; |
} |
} |
/* Handle the underline style */ |
if ( font->style & TTF_STYLE_UNDERLINE ) { |
int row_offset; |
row_offset = round(font->ascent) + 1; |
if ( row_offset > font->height ) { |
row_offset = font->height-1; |
} |
dst = (Uint32 *)textbuf->pixels+row_offset*textbuf->pitch/4; |
for ( col=glyph->pixmap.cols; col > 0; ++col ) { |
*dst++ = 4; |
} |
} |
/* Build the alpha table */ |
pixel = (fg.r<<16)|(fg.g<<8)|fg.b; |
for ( col = 0; col < 8; ++col ) { |
alpha_table[col] |= pixel; |
} |
/* Transform the alpha values */ |
for ( row = 0; row < textbuf->h; ++row ) { |
dst = (Uint32 *)textbuf->pixels + row * textbuf->pitch/4; |
for ( col=textbuf->w; col>0; col -= 4 ) { |
*dst = alpha_table[*dst]; |
++dst; |
*dst = alpha_table[*dst]; |
++dst; |
*dst = alpha_table[*dst]; |
++dst; |
*dst = alpha_table[*dst]; |
++dst; |
} |
} |
return(textbuf); |
} |
void TTF_SetFontStyle(TTF_Font *font, int style) |
{ |
font->style = style; |
Flush_Cache(font); |
} |
int TTF_GetFontStyle(TTF_Font *font) |
{ |
return(font->style); |
} |
void TTF_Quit(void) |
{ |
TT_Done_FreeType(engine); |
} |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/SDL_ttf.h |
---|
0,0 → 1,176 |
/* |
SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts |
Copyright (C) 1997 Sam Lantinga |
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 |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
/* This library is a wrapper around the excellent FreeType 1.0 library, |
available at: |
http://www.physiol.med.tu-muenchen.de/~robert/freetype.html |
*/ |
#ifndef _SDLttf_h |
#define _SDLttf_h |
#include "SDL.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* The internal structure containing font information */ |
typedef struct _TTF_Font TTF_Font; |
/* Initialize the TTF engine - returns 0 if successful, -1 on error */ |
extern DECLSPEC int TTF_Init(void); |
/* Open a font file and create a font of the specified point size */ |
extern DECLSPEC TTF_Font *TTF_OpenFont(const char *file, int ptsize); |
/* Set and retrieve the font style |
This font style is implemented by modifying the font glyphs, and |
doesn't reflect any inherent properties of the truetype font file. |
*/ |
#define TTF_STYLE_NORMAL 0x00 |
#define TTF_STYLE_BOLD 0x01 |
#define TTF_STYLE_ITALIC 0x02 |
#define TTF_STYLE_UNDERLINE 0x04 |
extern DECLSPEC int TTF_GetFontStyle(TTF_Font *font); |
extern DECLSPEC void TTF_SetFontStyle(TTF_Font *font, int style); |
/* Get the total height of the font - usually equal to point size */ |
extern DECLSPEC int TTF_FontHeight(TTF_Font *font); |
/* Get the offset from the baseline to the top of the font |
This is a positive value, relative to the baseline. |
*/ |
extern DECLSPEC int TTF_FontAscent(TTF_Font *font); |
/* Get the offset from the baseline to the bottom of the font |
This is a negative value, relative to the baseline. |
*/ |
extern DECLSPEC int TTF_FontDescent(TTF_Font *font); |
/* Get the recommended spacing between lines of text for this font */ |
extern DECLSPEC int TTF_FontLineSkip(TTF_Font *font); |
/* Get the metrics (dimensions) of a glyph */ |
extern DECLSPEC int TTF_GlyphMetrics(TTF_Font *font, Uint16 ch, |
int *minx, int *maxx, |
int *miny, int *maxy, int *advance); |
/* Get the dimensions of a rendered string of text */ |
extern DECLSPEC int TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h); |
extern DECLSPEC int TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h); |
extern DECLSPEC int TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h); |
/* Create an 8-bit palettized surface and render the given text at |
fast quality with the given font and color. The 0 pixel is the |
colorkey, giving a transparent background, and the 1 pixel is set |
to the text color. |
This function returns the new surface, or NULL if there was an error. |
*/ |
extern DECLSPEC SDL_Surface *TTF_RenderText_Solid(TTF_Font *font, |
const char *text, SDL_Color fg); |
extern DECLSPEC SDL_Surface *TTF_RenderUTF8_Solid(TTF_Font *font, |
const char *text, SDL_Color fg); |
extern DECLSPEC SDL_Surface *TTF_RenderUNICODE_Solid(TTF_Font *font, |
const Uint16 *text, SDL_Color fg); |
/* Create an 8-bit palettized surface and render the given glyph at |
fast quality with the given font and color. The 0 pixel is the |
colorkey, giving a transparent background, and the 1 pixel is set |
to the text color. The glyph is rendered without any padding or |
centering in the X direction, and aligned normally in the Y direction. |
This function returns the new surface, or NULL if there was an error. |
*/ |
extern DECLSPEC SDL_Surface *TTF_RenderGlyph_Solid(TTF_Font *font, |
Uint16 ch, SDL_Color fg); |
/* Create an 8-bit palettized surface and render the given text at |
high quality with the given font and colors. The 0 pixel is background, |
while other pixels have varying degrees of the foreground color. |
This function returns the new surface, or NULL if there was an error. |
*/ |
extern DECLSPEC SDL_Surface *TTF_RenderText_Shaded(TTF_Font *font, |
const char *text, SDL_Color fg, SDL_Color bg); |
extern DECLSPEC SDL_Surface *TTF_RenderUTF8_Shaded(TTF_Font *font, |
const char *text, SDL_Color fg, SDL_Color bg); |
extern DECLSPEC SDL_Surface *TTF_RenderUNICODE_Shaded(TTF_Font *font, |
const Uint16 *text, SDL_Color fg, SDL_Color bg); |
/* Create an 8-bit palettized surface and render the given glyph at |
high quality with the given font and colors. The 0 pixel is background, |
while other pixels have varying degrees of the foreground color. |
The glyph is rendered without any padding or centering in the X |
direction, and aligned normally in the Y direction. |
This function returns the new surface, or NULL if there was an error. |
*/ |
extern DECLSPEC SDL_Surface *TTF_RenderGlyph_Shaded(TTF_Font *font, |
Uint16 ch, SDL_Color fg, SDL_Color bg); |
/* Create a 32-bit ARGB surface and render the given text at high quality, |
using alpha blending to dither the font with the given color. |
This function returns the new surface, or NULL if there was an error. |
*/ |
extern DECLSPEC SDL_Surface *TTF_RenderText_Blended(TTF_Font *font, |
const char *text, SDL_Color fg); |
extern DECLSPEC SDL_Surface *TTF_RenderUTF8_Blended(TTF_Font *font, |
const char *text, SDL_Color fg); |
extern DECLSPEC SDL_Surface *TTF_RenderUNICODE_Blended(TTF_Font *font, |
const Uint16 *text, SDL_Color fg); |
/* Create a 32-bit ARGB surface and render the given glyph at high quality, |
using alpha blending to dither the font with the given color. |
The glyph is rendered without any padding or centering in the X |
direction, and aligned normally in the Y direction. |
This function returns the new surface, or NULL if there was an error. |
*/ |
extern DECLSPEC SDL_Surface *TTF_RenderGlyph_Blended(TTF_Font *font, |
Uint16 ch, SDL_Color fg); |
/* For compatibility with previous versions, here are the old functions */ |
#define TTF_RenderText(font, text, fg, bg) \ |
TTF_RenderText_Shaded(font, text, fg, bg) |
#define TTF_RenderUTF8(font, text, fg, bg) \ |
TTF_RenderUTF8_Shaded(font, text, fg, bg) |
#define TTF_RenderUNICODE(font, text, fg, bg) \ |
TTF_RenderUNICODE_Shaded(font, text, fg, bg) |
/* Close an opened font file */ |
extern DECLSPEC void TTF_CloseFont(TTF_Font *font); |
/* De-initialize the TTF engine */ |
extern DECLSPEC void TTF_Quit(void); |
/* We'll use SDL for reporting errors */ |
#define TTF_SetError SDL_SetError |
#define TTF_GetError SDL_GetError |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
}; |
#endif |
#include "close_code.h" |
#endif /* _SDLttf_h */ |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/test/Makefile |
---|
0,0 → 1,6 |
OUTFILE = ttftest |
OBJS = ttftest.o |
LIBS = -L../../lib -lSDL -lSDL_ttf -lSDL -lpng -lttf |
CFLAGS = -I../../include -I.. |
include $(MENUETDEV)/makefiles/Makefile_for_program |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/test/hydrogen.ttf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/test/indigo.ttf |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/contrib/sdk/sources/SDL-1.2.2/SDL_ttf/test/ttftest.c |
---|
0,0 → 1,74 |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include "SDL.h" |
#include "SDL_ttf.h" |
int app_main(int argc, char *argv[]) |
{ |
SDL_Surface *screen, *txt; |
static SDL_Color kolor={0xC0,0xC0,0,0}; |
static SDL_Color kolor1={0x00,0xC0,0xC0,0}; |
SDL_Event event; |
SDL_Rect xtmp={x:30,y:30}; |
TTF_Font * fnt, * fnt1; |
static int done=0; |
int i; |
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) |
{ |
SDL_printf("Couldn't initialize SDL: %s\n",SDL_GetError()); |
return(255); |
} |
screen = SDL_SetVideoMode(512,348,24,SDL_SWSURFACE); |
if ( screen == NULL ) |
{ |
SDL_printf("Couldn't set %dx%dx%d video mode: %s\n", |
640,480,24, SDL_GetError()); |
exit(-1); |
} |
if(TTF_Init()!=0) |
{ |
SDL_printf("Couldn't initialize TTF library\n"); |
exit(-1); |
} |
fnt=TTF_OpenFont("/RD/1/INDIGO.TTF",50); |
fnt1=TTF_OpenFont("/RD/1/HYDROGEN.TTF",35); |
TTF_SetFontStyle(fnt,TTF_STYLE_ITALIC|TTF_STYLE_BOLD|TTF_STYLE_UNDERLINE); |
txt=TTF_RenderText_Solid(fnt,"MenuetOS",kolor); |
if(!txt) |
{ |
SDL_printf("Unable to create rendering surface\n"); |
exit(-1); |
} |
xtmp.w=txt->w; |
xtmp.h=txt->h; |
SDL_BlitSurface(txt,NULL,screen,&xtmp); |
SDL_FreeSurface(txt); |
txt=TTF_RenderText_Solid(fnt1,"supports TTF",kolor1); |
xtmp.w=txt->w; |
xtmp.h=txt->h; |
xtmp.x=40; |
xtmp.y=100; |
SDL_BlitSurface(txt,NULL,screen,&xtmp); |
SDL_FreeSurface(txt); |
while ( ! done ) |
{ |
if ( SDL_PollEvent(&event) ) |
{ |
switch (event.type) |
{ |
case SDL_QUIT: |
argv[i+1] = NULL; |
done = 1; |
break; |
default: |
break; |
} |
} else { |
SDL_Delay(3); |
} |
} |
SDL_FreeSurface(txt); |
SDL_Quit(); |
return(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/docs/html/audio.html |
---|
0,0 → 1,234 |
<HTML |
><HEAD |
><TITLE |
>Audio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/cdrom.html |
---|
0,0 → 1,252 |
<HTML |
><HEAD |
><TITLE |
>CD-ROM</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/event.html |
---|
0,0 → 1,208 |
<HTML |
><HEAD |
><TITLE |
>Events</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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#AEN3269" |
>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="AEN3269" |
>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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/eventfunctions.html |
---|
0,0 → 1,236 |
<HTML |
><HEAD |
><TITLE |
>Event Functions.</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/eventstructures.html |
---|
0,0 → 1,220 |
<HTML |
><HEAD |
><TITLE |
>SDL Event Structures.</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/general.html |
---|
0,0 → 1,207 |
<HTML |
><HEAD |
><TITLE |
>General</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guide.html |
---|
0,0 → 1,167 |
<HTML |
><HEAD |
><TITLE |
>SDL Guide</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guideaboutsdldoc.html |
---|
0,0 → 1,140 |
<HTML |
><HEAD |
><TITLE |
>About SDLdoc</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 people working with SDL in their spare time to people who use SDL in their everyday working lives.</P |
><P |
>The latest version of this documentation can always be found here: http://sdldoc.csn.ul.ie Downloadable PS, man pages and html tarballs are available at http://sdldoc.csn.ul.ie/pub/</P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guideaudioexamples.html |
---|
0,0 → 1,220 |
<HTML |
><HEAD |
><TITLE |
>Audio Examples</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN382" |
>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="AEN386" |
>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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidebasicsinit.html |
---|
0,0 → 1,232 |
<HTML |
><HEAD |
><TITLE |
>Initializing SDL</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN60" |
></A |
><P |
><B |
>Example 1-1. Initializing SDL</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
>#include "SDL.h" /* All SDL App's need this */ |
#include <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 |
></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="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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidecdromexamples.html |
---|
0,0 → 1,267 |
<HTML |
><HEAD |
><TITLE |
>CDROM Examples</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN393" |
>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="AEN397" |
>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="AEN401" |
>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="AEN405" |
>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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidecredits.html |
---|
0,0 → 1,187 |
<HTML |
><HEAD |
><TITLE |
>Credits</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
>Sam Lantinga, slouken@libsdl.org</TD |
></TR |
><TR |
><TD |
>Martin Donlon, akawaka@skynet.ie</TD |
></TR |
><TR |
><TD |
>Mattias Engdegård</TD |
></TR |
><TR |
><TD |
>Julian Peterson</TD |
></TR |
><TR |
><TD |
>Ken Jordan</TD |
></TR |
><TR |
><TD |
>Maxim Sobolev</TD |
></TR |
><TR |
><TD |
>Wesley Poole</TD |
></TR |
><TR |
><TD |
>Michael Vance</TD |
></TR |
><TR |
><TD |
>Andreas Umbach</TD |
></TR |
><TR |
><TD |
>Andreas Hofmeister</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guideeventexamples.html |
---|
0,0 → 1,239 |
<HTML |
><HEAD |
><TITLE |
>Event Examples</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Examples" |
HREF="guideexamples.html"><LINK |
REL="PREVIOUS" |
TITLE="Examples" |
HREF="guideexamples.html"><LINK |
REL="NEXT" |
TITLE="Audio Examples" |
HREF="guideaudioexamples.html"></HEAD |
><BODY |
CLASS="SECT1" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
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="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="AEN375" |
>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="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="guideaudioexamples.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" |
>Audio Examples</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guideexamples.html |
---|
0,0 → 1,180 |
<HTML |
><HEAD |
><TITLE |
>Examples</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Guide" |
HREF="guide.html"><LINK |
REL="PREVIOUS" |
TITLE="Handling the Keyboard" |
HREF="guideinputkeyboard.html"><LINK |
REL="NEXT" |
TITLE="Event Examples" |
HREF="guideeventexamples.html"></HEAD |
><BODY |
CLASS="CHAPTER" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
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="guideeventexamples.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#AEN369" |
>Introduction</A |
></DT |
><DT |
><A |
HREF="guideeventexamples.html" |
>Event Examples</A |
></DT |
><DT |
><A |
HREF="guideaudioexamples.html" |
>Audio Examples</A |
></DT |
><DT |
><A |
HREF="guidecdromexamples.html" |
>CDROM Examples</A |
></DT |
><DT |
><A |
HREF="guidetimeexamples.html" |
>Time Examples</A |
></DT |
></DL |
></DIV |
><DIV |
CLASS="SECT1" |
><H1 |
CLASS="SECT1" |
><A |
NAME="AEN369" |
>Introduction</A |
></H1 |
><P |
>For the moment these examples are taken directly from the old SDL documentation. By the 1.2 release these examples should hopefully deal with most common SDL programming problems.</P |
></DIV |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
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="guideeventexamples.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" |
>Event Examples</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guideinput.html |
---|
0,0 → 1,731 |
<HTML |
><HEAD |
><TITLE |
>Input handling</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Guide" |
HREF="guide.html"><LINK |
REL="PREVIOUS" |
TITLE="Using OpenGL With SDL" |
HREF="guidevideoopengl.html"><LINK |
REL="NEXT" |
TITLE="Handling the Keyboard" |
HREF="guideinputkeyboard.html"></HEAD |
><BODY |
CLASS="CHAPTER" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="guidevideoopengl.html" |
>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="AEN135" |
>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.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN141" |
></A |
><P |
><B |
>Example 3-1. Initializing SDL with Joystick Support</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0) |
{ |
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); |
exit(1); |
}</PRE |
></DIV |
><P |
>This will attempt to start SDL with both the video and the joystick subsystems activated.</P |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN145" |
>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.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN154" |
></A |
><P |
><B |
>Example 3-2. Querying the Number of Available Joysticks</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> printf("%i joysticks were found.\n\n", SDL_NumJoysticks() ); |
printf("The names of the joysticks are:\n"); |
for( i=0; i < SDL_NumJoysticks(); i++ ) |
{ |
printf(" %s\n", SDL_JoystickName(i)); |
}</PRE |
></DIV |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN157" |
>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:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN183" |
></A |
><P |
><B |
>Example 3-3. Opening a Joystick</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> SDL_Joystick *joystick; |
SDL_JoystickEventState(SDL_ENABLE); |
joystick = SDL_JoystickOpen(0);</PRE |
></DIV |
><P |
>If we wanted to receive events for other joysticks we would open them with calls to <TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</TT |
> just like we opened joystick 0, except we would store the <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
> structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.</P |
><P |
>Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this: |
<PRE |
CLASS="PROGRAMLISTING" |
> SDL_Event event; |
/* Other initializtion code goes here */ |
/* Start main game loop here */ |
while(SDL_PollEvent(&event)) |
{ |
switch(event.type) |
{ |
case SDL_KEYDOWN: |
/* handle keyboard stuff here */ |
break; |
case SDL_QUIT: |
/* Set whatever flags are necessary to */ |
/* end the main game loop here */ |
break; |
} |
} |
/* End loop here */</PRE |
> |
To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN191" |
></A |
><P |
><B |
>Example 3-4. Joystick Axis Events</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */ |
if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) |
{ |
/* code goes here */ |
} |
break;</PRE |
></DIV |
><P |
>Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN195" |
></A |
><P |
><B |
>Example 3-5. More Joystick Axis Events</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */ |
if ( ( event.jaxis.value < -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 |
></DIV |
><P |
>Ideally the code here should use <TT |
CLASS="STRUCTFIELD" |
><I |
>event.jaxis.value</I |
></TT |
> to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.</P |
><P |
>If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different <TT |
CLASS="STRUCTFIELD" |
><I |
>event.jaxis.axis</I |
></TT |
> values.</P |
><P |
>Button handling is simple compared to the axis checking.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN203" |
></A |
><P |
><B |
>Example 3-6. Joystick Button Events</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> case SDL_JOYBUTTONDOWN: /* Handle Joystick Button Presses */ |
if ( event.jbutton.button == 0 ) |
{ |
/* code goes here */ |
} |
break;</PRE |
></DIV |
><P |
>Button checks are simpler than axis checks because a button can only be pressed or not pressed. The <TT |
CLASS="LITERAL" |
>SDL_JOYBUTTONDOWN</TT |
> event is triggered when a button is pressed and the <TT |
CLASS="LITERAL" |
>SDL_JOYBUTTONUP</TT |
> event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the <TT |
CLASS="STRUCTFIELD" |
><I |
>event.jbutton.button</I |
></TT |
> field.</P |
><P |
>Lastly when we are through using our joysticks we should close them with a call to <A |
HREF="sdljoystickclose.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickClose</TT |
></A |
>. To close our opened joystick 0 we would do this at the end of our program: |
<PRE |
CLASS="PROGRAMLISTING" |
> SDL_JoystickClose(joystick);</PRE |
></P |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN214" |
>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:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN217" |
></A |
><P |
><B |
>Example 3-7. Joystick Ball Events</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> case SDL_JOYBALLMOTION: /* Handle Joyball Motion */ |
if( event.jball.ball == 0 ) |
{ |
/* ball handling */ |
} |
break;</PRE |
></DIV |
><P |
>The above checks the first joyball on the joystick. The change in position will be stored in <TT |
CLASS="STRUCTFIELD" |
><I |
>event.jball.xrel</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>event.jball.yrel</I |
></TT |
>.</P |
><P |
>Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks: |
<P |
></P |
><TABLE |
BORDER="0" |
><TBODY |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_CENTERED</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_UP</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_RIGHT</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_DOWN</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_LEFT</TT |
></TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
> |
Also there are some predefined combinations of the above: |
<P |
></P |
><TABLE |
BORDER="0" |
><TBODY |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_RIGHTUP</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_RIGHTDOWN</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_LEFTUP</TT |
></TD |
></TR |
><TR |
><TD |
><TT |
CLASS="LITERAL" |
>SDL_HAT_LEFTDOWN</TT |
></TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
> |
Our case for the hat may resemble the following:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN244" |
></A |
><P |
><B |
>Example 3-8. Joystick Hat Events</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> case SDL_JOYHATMOTION: /* Handle Hat Motion */ |
if ( event.jhat.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 |
></DIV |
><P |
>In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks: |
<P |
></P |
><TABLE |
BORDER="0" |
><TBODY |
><TR |
><TD |
><A |
HREF="sdljoysticknumaxes.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumAxes</TT |
></A |
></TD |
><TD |
>Returns the number of joysitck axes</TD |
></TR |
><TR |
><TD |
><A |
HREF="sdljoysticknumbuttons.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumButtons</TT |
></A |
></TD |
><TD |
>Returns the number of joysitck buttons</TD |
></TR |
><TR |
><TD |
><A |
HREF="sdljoysticknumballs.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumBalls</TT |
></A |
></TD |
><TD |
>Returns the number of joysitck balls</TD |
></TR |
><TR |
><TD |
><A |
HREF="sdljoysticknumhats.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumHats</TT |
></A |
></TD |
><TD |
>Returns the number of joysitck hats</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
> |
To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN265" |
></A |
><P |
><B |
>Example 3-9. Querying Joystick Characteristics</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> int number_of_buttons; |
SDL_Joystick *joystick; |
joystick = SDL_JoystickOpen(0); |
number_of_buttons = SDL_JoystickNumButtons(joystick);</PRE |
></DIV |
><P |
>This block of code would get the number of buttons on the first joystick in the system. </P |
></DIV |
></DIV |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="guidevideoopengl.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" |
>Using OpenGL With SDL</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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guideinputkeyboard.html |
---|
0,0 → 1,735 |
<HTML |
><HEAD |
><TITLE |
>Handling the Keyboard</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN271" |
>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="AEN274" |
>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="AEN282" |
>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="AEN288" |
>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="AEN307" |
>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="AEN324" |
>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:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN334" |
></A |
><P |
><B |
>Example 3-10. Reading Keyboard Events</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> SDL_Event event; |
. |
. |
/* Poll for events. SDL_PollEvent() returns 0 when there are no */ |
/* more events on the event queue, our while loop will exit when */ |
/* that occurs. */ |
while( SDL_PollEvent( &event ) ){ |
/* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */ |
switch( event.type ){ |
case SDL_KEYDOWN: |
printf( "Key press detected\n" ); |
break; |
case SDL_KEYUP: |
printf( "Key release detected\n" ); |
break; |
default: |
break; |
} |
} |
. |
.</PRE |
></DIV |
><P |
>This is a very basic example. No information about the key press or release is interpreted. We will explore the other extreme out our first full example below - reporting all available information about a keyboard event.</P |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN338" |
>A 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="AEN351" |
></A |
><P |
><B |
>Example 3-11. Interpreting 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 ) < 0){ |
fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() ); |
exit( -1 ); |
} |
/* Set a video mode */ |
if( !SDL_SetVideoMode( 320, 200, 0, 0 ) ){ |
fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() ); |
SDL_Quit(); |
exit( -1 ); |
} |
/* Enable Unicode translation */ |
SDL_EnableUNICODE( 1 ); |
/* Loop until an SDL_QUIT event is found */ |
while( !quit ){ |
/* Poll for events */ |
while( SDL_PollEvent( &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="AEN354" |
>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="AEN357" |
></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:</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN363" |
></A |
><P |
><B |
>Example 3-12. Proper Game Movement</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Alien screen coordinates */ |
int alien_x=0, alien_y=0; |
int alien_xvel=0, alien_yvel=0; |
. |
. |
/* Initialise SDL and video modes and all that */ |
. |
/* Main game loop */ |
/* Check for events */ |
while( SDL_PollEvent( &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 |
></DIV |
><P |
>As can be seen, we use two extra variables, alien_xvel and alien_yvel, which represent the motion of the ship, it is these variables that we update when we detect keypresses and releases.</P |
></DIV |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidepreface.html |
---|
0,0 → 1,170 |
<HTML |
><HEAD |
><TITLE |
>Preface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidethebasics.html |
---|
0,0 → 1,165 |
<HTML |
><HEAD |
><TITLE |
>The Basics</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidetimeexamples.html |
---|
0,0 → 1,173 |
<HTML |
><HEAD |
><TITLE |
>Time Examples</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN412" |
>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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidevideo.html |
---|
0,0 → 1,455 |
<HTML |
><HEAD |
><TITLE |
>Graphics and Video</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Guide" |
HREF="guide.html"><LINK |
REL="PREVIOUS" |
TITLE="Initializing SDL" |
HREF="guidebasicsinit.html"><LINK |
REL="NEXT" |
TITLE="Using OpenGL With SDL" |
HREF="guidevideoopengl.html"></HEAD |
><BODY |
CLASS="CHAPTER" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
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="guidevideoopengl.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="TOC" |
><DL |
><DT |
><B |
>Table of Contents</B |
></DT |
><DT |
><A |
HREF="guidevideo.html#GUIDEVIDEOINTRO" |
>Introduction to SDL Video</A |
></DT |
><DT |
><A |
HREF="guidevideoopengl.html" |
>Using OpenGL With SDL</A |
></DT |
></DL |
></DIV |
><DIV |
CLASS="SECT1" |
><H1 |
CLASS="SECT1" |
><A |
NAME="GUIDEVIDEOINTRO" |
>Introduction to SDL Video</A |
></H1 |
><P |
>Video is probably the most common thing that SDL is used for, and |
so it has the most complete subsystem. Here are a few |
examples to demonstrate the basics.</P |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN68" |
>Initializing the Video Display</A |
></H2 |
><P |
>This is what almost all SDL programs have to do in one way or |
another.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN71" |
></A |
><P |
><B |
>Example 2-1. Initializing the Video Display</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> SDL_Surface *screen; |
/* Initialize the SDL library */ |
if( SDL_Init(SDL_INIT_VIDEO) < 0 ) { |
fprintf(stderr, |
"Couldn't initialize SDL: %s\n", SDL_GetError()); |
exit(1); |
} |
/* Clean up on exit */ |
atexit(SDL_Quit); |
/* |
* Initialize the display in a 640x480 8-bit palettized mode, |
* requesting a software surface |
*/ |
screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE); |
if ( screen == NULL ) { |
fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n", |
SDL_GetError()); |
exit(1); |
}</PRE |
></DIV |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN74" |
>Initializing the Best Video Mode</A |
></H2 |
><P |
>If you have a preference for a certain pixel depth but will accept any |
other, use SDL_SetVideoMode with SDL_ANYFORMAT as below. You can also |
use SDL_VideoModeOK() to find the native video mode that is closest to |
the mode you request.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN77" |
></A |
><P |
><B |
>Example 2-2. Initializing the Best Video Mode</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Have a preference for 8-bit, but accept any depth */ |
screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE|SDL_ANYFORMAT); |
if ( screen == NULL ) { |
fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n", |
SDL_GetError()); |
exit(1); |
} |
printf("Set 640x480 at %d bits-per-pixel mode\n", |
screen->format->BitsPerPixel);</PRE |
></DIV |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN80" |
>Loading and Displaying a BMP File</A |
></H2 |
><P |
>The following function loads and displays a BMP file given as |
argument, once SDL is initialised and a video mode has been set.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN83" |
></A |
><P |
><B |
>Example 2-3. Loading and Displaying a BMP File</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
>void display_bmp(char *file_name) |
{ |
SDL_Surface *image; |
/* Load the BMP file into a surface */ |
image = SDL_LoadBMP(file_name); |
if (image == NULL) { |
fprintf(stderr, "Couldn't load %s: %s\n", file_name, SDL_GetError()); |
return; |
} |
/* |
* Palettized screen modes will have a default palette (a standard |
* 8*8*4 colour cube), but if the image is palettized as well we can |
* use that palette for a nicer colour matching |
*/ |
if (image->format->palette && screen->format->palette) { |
SDL_SetColors(screen, image->format->palette->colors, 0, |
image->format->palette->ncolors); |
} |
/* Blit onto the screen surface */ |
if(SDL_BlitSurface(image, NULL, screen, NULL) < 0) |
fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError()); |
SDL_UpdateRect(screen, 0, 0, image->w, image->h); |
/* Free the allocated BMP surface */ |
SDL_FreeSurface(image); |
}</PRE |
></DIV |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN86" |
>Drawing Directly to the Display</A |
></H2 |
><P |
>The following two functions can be used to get and set single |
pixels of a surface. They are carefully written to work with any depth |
currently supported by SDL. Remember to lock the surface before |
calling them, and to unlock it before calling any other SDL |
functions.</P |
><P |
>To convert between pixel values and their red, green, blue |
components, use SDL_GetRGB() and SDL_MapRGB().</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN90" |
></A |
><P |
><B |
>Example 2-4. getpixel()</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
>/* |
* Return the pixel value at (x, y) |
* NOTE: The surface must be locked before calling this! |
*/ |
Uint32 getpixel(SDL_Surface *surface, int x, int y) |
{ |
int bpp = surface->format->BytesPerPixel; |
/* Here p is the address to the pixel we want to retrieve */ |
Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; |
switch(bpp) { |
case 1: |
return *p; |
case 2: |
return *(Uint16 *)p; |
case 3: |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) |
return p[0] << 16 | p[1] << 8 | p[2]; |
else |
return p[0] | p[1] << 8 | p[2] << 16; |
case 4: |
return *(Uint32 *)p; |
default: |
return 0; /* shouldn't happen, but avoids warnings */ |
} |
}</PRE |
></DIV |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN93" |
></A |
><P |
><B |
>Example 2-5. putpixel()</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
>/* |
* Set the pixel at (x, y) to the given value |
* NOTE: The surface must be locked before calling this! |
*/ |
void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel) |
{ |
int bpp = surface->format->BytesPerPixel; |
/* Here p is the address to the pixel we want to set */ |
Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; |
switch(bpp) { |
case 1: |
*p = pixel; |
break; |
case 2: |
*(Uint16 *)p = pixel; |
break; |
case 3: |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { |
p[0] = (pixel >> 16) & 0xff; |
p[1] = (pixel >> 8) & 0xff; |
p[2] = pixel & 0xff; |
} else { |
p[0] = pixel & 0xff; |
p[1] = (pixel >> 8) & 0xff; |
p[2] = (pixel >> 16) & 0xff; |
} |
break; |
case 4: |
*(Uint32 *)p = pixel; |
break; |
} |
}</PRE |
></DIV |
><P |
>The following code uses the putpixel() function above to set a |
yellow pixel in the middle of the screen.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN97" |
></A |
><P |
><B |
>Example 2-6. Using putpixel()</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Code to set a yellow pixel at the center of the screen */ |
int x, y; |
Uint32 yellow; |
/* Map the color yellow to this display (R=0xff, G=0xFF, B=0x00) |
Note: If the display is palettized, you must set the palette first. |
*/ |
yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00); |
x = screen->w / 2; |
y = screen->h / 2; |
/* Lock the screen for direct access to the pixels */ |
if ( SDL_MUSTLOCK(screen) ) { |
if ( SDL_LockSurface(screen) < 0 ) { |
fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError()); |
return; |
} |
} |
putpixel(screen, x, y, yellow); |
if ( SDL_MUSTLOCK(screen) ) { |
SDL_UnlockSurface(screen); |
} |
/* Update just the part of the display that we've changed */ |
SDL_UpdateRect(screen, x, y, 1, 1); |
return; </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="guidevideoopengl.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" |
>Using OpenGL With SDL</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidevideoexamples.html |
---|
0,0 → 1,473 |
<HTML |
><HEAD |
><TITLE |
>Video Examples</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN375" |
>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="AEN379" |
>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="AEN383" |
>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="AEN387" |
>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="AEN391" |
>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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/guidevideoopengl.html |
---|
0,0 → 1,719 |
<HTML |
><HEAD |
><TITLE |
>Using OpenGL With SDL</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Graphics and Video" |
HREF="guidevideo.html"><LINK |
REL="PREVIOUS" |
TITLE="Graphics and Video" |
HREF="guidevideo.html"><LINK |
REL="NEXT" |
TITLE="Input handling" |
HREF="guideinput.html"></HEAD |
><BODY |
CLASS="SECT1" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
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" |
>Chapter 2. Graphics and Video</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="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="AEN103" |
>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 |
>.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN114" |
></A |
><P |
><B |
>Example 2-7. Initializing SDL with OpenGL</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Information about the current video settings. */ |
const SDL_VideoInfo* info = NULL; |
/* Dimensions of our window. */ |
int width = 0; |
int height = 0; |
/* Color depth in bits of our window. */ |
int bpp = 0; |
/* Flags we will pass into SDL_SetVideoMode. */ |
int flags = 0; |
/* First, initialize SDL's video subsystem. */ |
if( SDL_Init( SDL_INIT_VIDEO ) < 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 |
></DIV |
></DIV |
><DIV |
CLASS="SECT2" |
><H2 |
CLASS="SECT2" |
><A |
NAME="AEN117" |
>Drawing</A |
></H2 |
><P |
>Apart from initialisation, using OpenGL within SDL is the same as using OpenGL |
with any other API, e.g. GLUT. You still use all the same function calls and |
data types. However if you are using a double-buffered display, then you must |
use |
<A |
HREF="sdlglswapbuffers.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SwapBuffers()</TT |
></A |
> |
to swap the buffers and update the display. To request double-buffering |
with OpenGL, use |
<A |
HREF="sdlglsetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SetAttribute</TT |
></A |
> |
with <TT |
CLASS="LITERAL" |
>SDL_GL_DOUBLEBUFFER</TT |
>, and use |
<A |
HREF="sdlglgetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetAttribute</TT |
></A |
> |
to see if you actually got it.</P |
><P |
>A full example code listing is now presented below.</P |
><DIV |
CLASS="EXAMPLE" |
><A |
NAME="AEN128" |
></A |
><P |
><B |
>Example 2-8. SDL and OpenGL</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
>/* |
* SDL OpenGL Tutorial. |
* (c) Michael Vance, 2000 |
* briareos@lokigames.com |
* |
* Distributed under terms of the LGPL. |
*/ |
#include <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 |
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="guideinput.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="guidevideo.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Input handling</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/index.html |
---|
0,0 → 1,1144 |
<HTML |
><HEAD |
><TITLE |
></TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="NEXT" |
TITLE="SDL Guide" |
HREF="guide.html"></HEAD |
><BODY |
CLASS="BOOK" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="BOOK" |
><A |
NAME="AEN1" |
></A |
><DIV |
CLASS="TOC" |
><DL |
><DT |
><B |
>Table of Contents</B |
></DT |
><DT |
>I. <A |
HREF="guide.html" |
>SDL Guide</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="guidepreface.html" |
>Preface</A |
></DT |
><DD |
><DL |
><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 |
></DD |
><DT |
>1. <A |
HREF="guidethebasics.html" |
>The Basics</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="guidethebasics.html#GUIDEINTRODUCTION" |
>Introduction</A |
></DT |
><DT |
><A |
HREF="guidebasicsinit.html" |
>Initializing SDL</A |
></DT |
></DL |
></DD |
><DT |
>2. <A |
HREF="guidevideo.html" |
>Graphics and Video</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="guidevideo.html#GUIDEVIDEOINTRO" |
>Introduction to SDL Video</A |
></DT |
><DT |
><A |
HREF="guidevideoopengl.html" |
>Using OpenGL With SDL</A |
></DT |
></DL |
></DD |
><DT |
>3. <A |
HREF="guideinput.html" |
>Input handling</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="guideinput.html#GUIDEINPUTJOYSTICK" |
>Handling Joysticks</A |
></DT |
><DT |
><A |
HREF="guideinputkeyboard.html" |
>Handling the Keyboard</A |
></DT |
></DL |
></DD |
><DT |
>4. <A |
HREF="guideexamples.html" |
>Examples</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="guideexamples.html#AEN369" |
>Introduction</A |
></DT |
><DT |
><A |
HREF="guideeventexamples.html" |
>Event Examples</A |
></DT |
><DT |
><A |
HREF="guideaudioexamples.html" |
>Audio Examples</A |
></DT |
><DT |
><A |
HREF="guidecdromexamples.html" |
>CDROM Examples</A |
></DT |
><DT |
><A |
HREF="guidetimeexamples.html" |
>Time Examples</A |
></DT |
></DL |
></DD |
></DL |
></DD |
><DT |
>II. <A |
HREF="reference.html" |
>SDL Reference</A |
></DT |
><DD |
><DL |
><DT |
>5. <A |
HREF="general.html" |
>General</A |
></DT |
><DD |
><DL |
><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 |
></DD |
><DT |
>6. <A |
HREF="video.html" |
>Video</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="sdlgetvideosurface.html" |
>SDL_GetVideoSurface</A |
> — returns a pointer to the current display surface</DT |
><DT |
><A |
HREF="sdlgetvideoinfo.html" |
>SDL_GetVideoInfo</A |
> — returns a pointer to information about the video hardware</DT |
><DT |
><A |
HREF="sdlvideodrivername.html" |
>SDL_VideoDriverName</A |
> — Obtain the name of the video driver</DT |
><DT |
><A |
HREF="sdllistmodes.html" |
>SDL_ListModes</A |
> — Returns a pointer to an array of available screen dimensions for |
the given format and video flags</DT |
><DT |
><A |
HREF="sdlvideomodeok.html" |
>SDL_VideoModeOK</A |
> — Check to see if a particular video mode is supported.</DT |
><DT |
><A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
> — Set up a video mode with the specified width, height and bits-per-pixel.</DT |
><DT |
><A |
HREF="sdlupdaterect.html" |
>SDL_UpdateRect</A |
> — Makes sure the given area is updated on the given screen.</DT |
><DT |
><A |
HREF="sdlupdaterects.html" |
>SDL_UpdateRects</A |
> — Makes sure the given list of rectangles is updated on the given screen.</DT |
><DT |
><A |
HREF="sdlflip.html" |
>SDL_Flip</A |
> — Swaps screen buffers</DT |
><DT |
><A |
HREF="sdlsetcolors.html" |
>SDL_SetColors</A |
> — Sets a portion of the colormap for the given 8-bit surface.</DT |
><DT |
><A |
HREF="sdlsetpalette.html" |
>SDL_SetPalette</A |
> — Sets the colors in the palette of an 8-bit surface.</DT |
><DT |
><A |
HREF="sdlsetgamma.html" |
>SDL_SetGamma</A |
> — Sets the color gamma function for the display</DT |
><DT |
><A |
HREF="sdlgetgammaramp.html" |
>SDL_GetGammaRamp</A |
> — Gets the color gamma lookup tables for the display</DT |
><DT |
><A |
HREF="sdlsetgammaramp.html" |
>SDL_SetGammaRamp</A |
> — Sets the color gamma lookup tables for the display</DT |
><DT |
><A |
HREF="sdlmaprgb.html" |
>SDL_MapRGB</A |
> — Map a RGB color value to a pixel format.</DT |
><DT |
><A |
HREF="sdlmaprgba.html" |
>SDL_MapRGBA</A |
> — Map a RGBA color value to a pixel format.</DT |
><DT |
><A |
HREF="sdlgetrgb.html" |
>SDL_GetRGB</A |
> — Get RGB values from a pixel in the specified pixel format.</DT |
><DT |
><A |
HREF="sdlgetrgba.html" |
>SDL_GetRGBA</A |
> — Get RGBA values from a pixel in the specified pixel format.</DT |
><DT |
><A |
HREF="sdlcreatergbsurface.html" |
>SDL_CreateRGBSurface</A |
> — Create an empty SDL_Surface</DT |
><DT |
><A |
HREF="sdlcreatergbsurfacefrom.html" |
>SDL_CreateRGBSurfaceFrom</A |
> — Create an SDL_Surface from pixel data</DT |
><DT |
><A |
HREF="sdlfreesurface.html" |
>SDL_FreeSurface</A |
> — Frees (deletes) a SDL_Surface</DT |
><DT |
><A |
HREF="sdllocksurface.html" |
>SDL_LockSurface</A |
> — Lock a surface for directly access.</DT |
><DT |
><A |
HREF="sdlunlocksurface.html" |
>SDL_UnlockSurface</A |
> — Unlocks a previously locked surface.</DT |
><DT |
><A |
HREF="sdlloadbmp.html" |
>SDL_LoadBMP</A |
> — Load a Windows BMP file into an SDL_Surface.</DT |
><DT |
><A |
HREF="sdlsavebmp.html" |
>SDL_SaveBMP</A |
> — Save an SDL_Surface as a Windows BMP file.</DT |
><DT |
><A |
HREF="sdlsetcolorkey.html" |
>SDL_SetColorKey</A |
> — Sets the color key (transparent pixel) in a blittable surface and |
RLE acceleration.</DT |
><DT |
><A |
HREF="sdlsetalpha.html" |
>SDL_SetAlpha</A |
> — Adjust the alpha properties of a surface</DT |
><DT |
><A |
HREF="sdlsetcliprect.html" |
>SDL_SetClipRect</A |
> — Sets the clipping rectangle for a surface.</DT |
><DT |
><A |
HREF="sdlgetcliprect.html" |
>SDL_GetClipRect</A |
> — Gets the clipping rectangle for a surface.</DT |
><DT |
><A |
HREF="sdlconvertsurface.html" |
>SDL_ConvertSurface</A |
> — Converts a surface to the same format as another surface.</DT |
><DT |
><A |
HREF="sdlblitsurface.html" |
>SDL_BlitSurface</A |
> — This performs a fast blit from the source surface to the destination surface.</DT |
><DT |
><A |
HREF="sdlfillrect.html" |
>SDL_FillRect</A |
> — This function performs a fast fill of the given rectangle with some color</DT |
><DT |
><A |
HREF="sdldisplayformat.html" |
>SDL_DisplayFormat</A |
> — Convert a surface to the display format</DT |
><DT |
><A |
HREF="sdldisplayformatalpha.html" |
>SDL_DisplayFormatAlpha</A |
> — Convert a surface to the display format</DT |
><DT |
><A |
HREF="sdlwarpmouse.html" |
>SDL_WarpMouse</A |
> — Set the position of the mouse cursor.</DT |
><DT |
><A |
HREF="sdlcreatecursor.html" |
>SDL_CreateCursor</A |
> — Creates a new mouse cursor.</DT |
><DT |
><A |
HREF="sdlfreecursor.html" |
>SDL_FreeCursor</A |
> — Frees a cursor created with SDL_CreateCursor.</DT |
><DT |
><A |
HREF="sdlsetcursor.html" |
>SDL_SetCursor</A |
> — Set the currently active mouse cursor.</DT |
><DT |
><A |
HREF="sdlgetcursor.html" |
>SDL_GetCursor</A |
> — Get the currently active mouse cursor.</DT |
><DT |
><A |
HREF="sdlshowcursor.html" |
>SDL_ShowCursor</A |
> — Toggle whether or not the cursor is shown on the screen.</DT |
><DT |
><A |
HREF="sdlglloadlibrary.html" |
>SDL_GL_LoadLibrary</A |
> — Specify an OpenGL library</DT |
><DT |
><A |
HREF="sdlglgetprocaddress.html" |
>SDL_GL_GetProcAddress</A |
> — Get the address of a GL function</DT |
><DT |
><A |
HREF="sdlglgetattribute.html" |
>SDL_GL_GetAttribute</A |
> — Get the value of a special SDL/OpenGL attribute</DT |
><DT |
><A |
HREF="sdlglsetattribute.html" |
>SDL_GL_SetAttribute</A |
> — Set a special SDL/OpenGL attribute</DT |
><DT |
><A |
HREF="sdlglswapbuffers.html" |
>SDL_GL_SwapBuffers</A |
> — Swap OpenGL framebuffers/Update Display</DT |
><DT |
><A |
HREF="sdlcreateyuvoverlay.html" |
>SDL_CreateYUVOverlay</A |
> — Create a YUV video overlay</DT |
><DT |
><A |
HREF="sdllockyuvoverlay.html" |
>SDL_LockYUVOverlay</A |
> — Lock an overlay</DT |
><DT |
><A |
HREF="sdlunlockyuvoverlay.html" |
>SDL_UnlockYUVOverlay</A |
> — Unlock an overlay</DT |
><DT |
><A |
HREF="sdldisplayyuvoverlay.html" |
>SDL_DisplayYUVOverlay</A |
> — Blit the overlay to the display</DT |
><DT |
><A |
HREF="sdlfreeyuvoverlay.html" |
>SDL_FreeYUVOverlay</A |
> — Free a YUV video overlay</DT |
><DT |
><A |
HREF="sdlglattr.html" |
>SDL_GLattr</A |
> — SDL GL Attributes</DT |
><DT |
><A |
HREF="sdlrect.html" |
>SDL_Rect</A |
> — Defines a rectangular area</DT |
><DT |
><A |
HREF="sdlcolor.html" |
>SDL_Color</A |
> — Format independent color description</DT |
><DT |
><A |
HREF="sdlpalette.html" |
>SDL_Palette</A |
> — Color palette for 8-bit pixel formats</DT |
><DT |
><A |
HREF="sdlpixelformat.html" |
>SDL_PixelFormat</A |
> — Stores surface format information</DT |
><DT |
><A |
HREF="sdlsurface.html" |
>SDL_Surface</A |
> — Graphical Surface Structure</DT |
><DT |
><A |
HREF="sdlvideoinfo.html" |
>SDL_VideoInfo</A |
> — Video Target information</DT |
><DT |
><A |
HREF="sdloverlay.html" |
>SDL_Overlay</A |
> — YUV video overlay</DT |
></DL |
></DD |
><DT |
>7. <A |
HREF="wm.html" |
>Window Management</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="sdlwmsetcaption.html" |
>SDL_WM_SetCaption</A |
> — Sets the window tile and icon name.</DT |
><DT |
><A |
HREF="sdlwmgetcaption.html" |
>SDL_WM_GetCaption</A |
> — Gets the window title and icon name.</DT |
><DT |
><A |
HREF="sdlwmseticon.html" |
>SDL_WM_SetIcon</A |
> — Sets the icon for the display window.</DT |
><DT |
><A |
HREF="sdlwmiconifywindow.html" |
>SDL_WM_IconifyWindow</A |
> — Iconify/Minimise the window</DT |
><DT |
><A |
HREF="sdlwmtogglefullscreen.html" |
>SDL_WM_ToggleFullScreen</A |
> — Toggles fullscreen mode</DT |
><DT |
><A |
HREF="sdlwmgrabinput.html" |
>SDL_WM_GrabInput</A |
> — Grabs mouse and keyboard input.</DT |
></DL |
></DD |
><DT |
>8. <A |
HREF="event.html" |
>Events</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="event.html#AEN3269" |
>Introduction</A |
></DT |
><DT |
><A |
HREF="eventstructures.html" |
>SDL Event Structures.</A |
></DT |
><DT |
><A |
HREF="eventfunctions.html" |
>Event Functions.</A |
></DT |
></DL |
></DD |
><DT |
>9. <A |
HREF="joystick.html" |
>Joystick</A |
></DT |
><DD |
><DL |
><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 |
></DD |
><DT |
>10. <A |
HREF="audio.html" |
>Audio</A |
></DT |
><DD |
><DL |
><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 |
></DD |
><DT |
>11. <A |
HREF="cdrom.html" |
>CD-ROM</A |
></DT |
><DD |
><DL |
><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 |
></DD |
><DT |
>12. <A |
HREF="thread.html" |
>Multi-threaded Programming</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="sdlcreatethread.html" |
>SDL_CreateThread</A |
> — Creates a new thread of execution that shares its parent's properties.</DT |
><DT |
><A |
HREF="sdlthreadid.html" |
>SDL_ThreadID</A |
> — Get the 32-bit thread identifier for the current thread.</DT |
><DT |
><A |
HREF="sdlgetthreadid.html" |
>SDL_GetThreadID</A |
> — Get the SDL thread ID of a SDL_Thread</DT |
><DT |
><A |
HREF="sdlwaitthread.html" |
>SDL_WaitThread</A |
> — Wait for a thread to finish.</DT |
><DT |
><A |
HREF="sdlkillthread.html" |
>SDL_KillThread</A |
> — Gracelessly terminates the thread.</DT |
><DT |
><A |
HREF="sdlcreatemutex.html" |
>SDL_CreateMutex</A |
> — Create a mutex</DT |
><DT |
><A |
HREF="sdldestroymutex.html" |
>SDL_DestroyMutex</A |
> — Destroy a mutex</DT |
><DT |
><A |
HREF="sdlmutexp.html" |
>SDL_mutexP</A |
> — Lock a mutex</DT |
><DT |
><A |
HREF="sdlmutexv.html" |
>SDL_mutexV</A |
> — Unlock a mutex</DT |
><DT |
><A |
HREF="sdlcreatesemaphore.html" |
>SDL_CreateSemaphore</A |
> — Creates a new semaphore and assigns an initial value to it.</DT |
><DT |
><A |
HREF="sdldestroysemaphore.html" |
>SDL_DestroySemaphore</A |
> — Destroys a semaphore that was created by <A |
HREF="sdlcreatesemaphore.html" |
>SDL_CreateSemaphore</A |
>.</DT |
><DT |
><A |
HREF="sdlsemwait.html" |
>SDL_SemWait</A |
> — Lock a semaphore and suspend the thread if the semaphore value is zero.</DT |
><DT |
><A |
HREF="sdlsemtrywait.html" |
>SDL_SemTryWait</A |
> — Attempt to lock a semaphore but don't suspend the thread.</DT |
><DT |
><A |
HREF="sdlsemwaittimeout.html" |
>SDL_SemWaitTimeout</A |
> — Lock a semaphore, but only wait up to a specified maximum time.</DT |
><DT |
><A |
HREF="sdlsempost.html" |
>SDL_SemPost</A |
> — Unlock a semaphore.</DT |
><DT |
><A |
HREF="sdlsemvalue.html" |
>SDL_SemValue</A |
> — Return the current value of a semaphore.</DT |
><DT |
><A |
HREF="sdlcreatecond.html" |
>SDL_CreateCond</A |
> — Create a condition variable</DT |
><DT |
><A |
HREF="sdldestroycond.html" |
>SDL_DestroyCond</A |
> — Destroy a condition variable</DT |
><DT |
><A |
HREF="sdlcondsignal.html" |
>SDL_CondSignal</A |
> — Restart a thread wait on a condition variable</DT |
><DT |
><A |
HREF="sdlcondbroadcast.html" |
>SDL_CondBroadcast</A |
> — Restart all threads waiting on a condition variable</DT |
><DT |
><A |
HREF="sdlcondwait.html" |
>SDL_CondWait</A |
> — Wait on a condition variable</DT |
><DT |
><A |
HREF="sdlcondwaittimeout.html" |
>SDL_CondWaitTimeout</A |
> — Wait on a condition variable, with timeout</DT |
></DL |
></DD |
><DT |
>13. <A |
HREF="time.html" |
>Time</A |
></DT |
><DD |
><DL |
><DT |
><A |
HREF="sdlgetticks.html" |
>SDL_GetTicks</A |
> — Get the number of milliseconds since the SDL library initialization.</DT |
><DT |
><A |
HREF="sdldelay.html" |
>SDL_Delay</A |
> — Wait a specified number of milliseconds before returning.</DT |
><DT |
><A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
> — Add a timer which will call a callback after the specified number of milliseconds has |
elapsed.</DT |
><DT |
><A |
HREF="sdlremovetimer.html" |
>SDL_RemoveTimer</A |
> — Remove a timer which was added with |
<A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
>.</DT |
><DT |
><A |
HREF="sdlsettimer.html" |
>SDL_SetTimer</A |
> — Set a callback to run after the specified number of milliseconds has |
elapsed.</DT |
></DL |
></DD |
></DL |
></DD |
></DL |
></DIV |
><DIV |
CLASS="LOT" |
><DL |
CLASS="LOT" |
><DT |
><B |
>List of Tables</B |
></DT |
><DT |
>8-1. <A |
HREF="sdlkey.html#AEN4252" |
>SDL Keysym definitions</A |
></DT |
><DT |
>8-2. <A |
HREF="sdlkey.html#SDLMOD" |
>SDL modifier definitions</A |
></DT |
></DL |
></DIV |
><DIV |
CLASS="LOT" |
><DL |
CLASS="LOT" |
><DT |
><B |
>List of Examples</B |
></DT |
><DT |
>1-1. <A |
HREF="guidebasicsinit.html#AEN60" |
>Initializing SDL</A |
></DT |
><DT |
>2-1. <A |
HREF="guidevideo.html#AEN71" |
>Initializing the Video Display</A |
></DT |
><DT |
>2-2. <A |
HREF="guidevideo.html#AEN77" |
>Initializing the Best Video Mode</A |
></DT |
><DT |
>2-3. <A |
HREF="guidevideo.html#AEN83" |
>Loading and Displaying a BMP File</A |
></DT |
><DT |
>2-4. <A |
HREF="guidevideo.html#AEN90" |
>getpixel()</A |
></DT |
><DT |
>2-5. <A |
HREF="guidevideo.html#AEN93" |
>putpixel()</A |
></DT |
><DT |
>2-6. <A |
HREF="guidevideo.html#AEN97" |
>Using putpixel()</A |
></DT |
><DT |
>2-7. <A |
HREF="guidevideoopengl.html#AEN114" |
>Initializing SDL with OpenGL</A |
></DT |
><DT |
>2-8. <A |
HREF="guidevideoopengl.html#AEN128" |
>SDL and OpenGL</A |
></DT |
><DT |
>3-1. <A |
HREF="guideinput.html#AEN141" |
>Initializing SDL with Joystick Support</A |
></DT |
><DT |
>3-2. <A |
HREF="guideinput.html#AEN154" |
>Querying the Number of Available Joysticks</A |
></DT |
><DT |
>3-3. <A |
HREF="guideinput.html#AEN183" |
>Opening a Joystick</A |
></DT |
><DT |
>3-4. <A |
HREF="guideinput.html#AEN191" |
>Joystick Axis Events</A |
></DT |
><DT |
>3-5. <A |
HREF="guideinput.html#AEN195" |
>More Joystick Axis Events</A |
></DT |
><DT |
>3-6. <A |
HREF="guideinput.html#AEN203" |
>Joystick Button Events</A |
></DT |
><DT |
>3-7. <A |
HREF="guideinput.html#AEN217" |
>Joystick Ball Events</A |
></DT |
><DT |
>3-8. <A |
HREF="guideinput.html#AEN244" |
>Joystick Hat Events</A |
></DT |
><DT |
>3-9. <A |
HREF="guideinput.html#AEN265" |
>Querying Joystick Characteristics</A |
></DT |
><DT |
>3-10. <A |
HREF="guideinputkeyboard.html#AEN334" |
>Reading Keyboard Events</A |
></DT |
><DT |
>3-11. <A |
HREF="guideinputkeyboard.html#AEN351" |
>Interpreting Key Event Information</A |
></DT |
><DT |
>3-12. <A |
HREF="guideinputkeyboard.html#AEN363" |
>Proper Game Movement</A |
></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" |
> </TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
><A |
HREF="guide.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
> </TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL Guide</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/joystick.html |
---|
0,0 → 1,285 |
<HTML |
><HEAD |
><TITLE |
>Joystick</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/reference.html |
---|
0,0 → 1,187 |
<HTML |
><HEAD |
><TITLE |
>SDL Reference</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlactiveevent.html |
---|
0,0 → 1,327 |
<HTML |
><HEAD |
><TITLE |
>SDL_ActiveEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN3522" |
></A |
><H2 |
>Name</H2 |
>SDL_ActiveEvent -- Application visibility event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3525" |
></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="AEN3528" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3530" |
></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="AEN3551" |
></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="AEN3567" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdladdtimer.html |
---|
0,0 → 1,288 |
<HTML |
><HEAD |
><TITLE |
>SDL_AddTimer</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7933" |
></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="AEN7936" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7937" |
></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="AEN7946" |
></A |
><H2 |
>Description</H2 |
><P |
>Adds a callback function to be run after the specified number of |
milliseconds has elapsed. The callback function is passed the current |
timer interval and the user supplied parameter from the |
<TT |
CLASS="FUNCTION" |
>SDL_AddTimer</TT |
> call and returns the next timer |
interval. If the returned value from the callback is the same as the one |
passed in, the periodic alarm continues, otherwise a new alarm is |
scheduled.</P |
><P |
>To cancel a currently running timer call |
<A |
HREF="sdlremovetimer.html" |
>SDL_RemoveTimer</A |
> with the |
timer ID returned from |
<TT |
CLASS="FUNCTION" |
>SDL_AddTimer</TT |
>.</P |
><P |
>The timer callback function may run in a different thread than your |
main program, and so shouldn't call any functions from within itself. |
You may always call <A |
HREF="sdlpushevent.html" |
>SDL_PushEvent</A |
>, however.</P |
><P |
>The granularity of the timer is platform-dependent, but you should count |
on it being at least 10 ms as this is the most common number. |
This means that if |
you request a 16 ms timer, your callback will run approximately 20 ms |
later on an unloaded system. If you wanted to set a flag signaling |
a frame update at 30 frames per second (every 33 ms), you might set a |
timer for 30 ms (see example below). |
If you use this function, you need to pass <TT |
CLASS="LITERAL" |
>SDL_INIT_TIMER</TT |
> |
to <A |
HREF="sdlinit.html" |
>SDL_Init</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7958" |
></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="AEN7962" |
></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="AEN7966" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlremovetimer.html" |
><TT |
CLASS="FUNCTION" |
>SDL_RemoveTimer</TT |
></A |
>, |
<A |
HREF="sdlpushevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PushEvent</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlaudiocvt.html |
---|
0,0 → 1,548 |
<HTML |
><HEAD |
><TITLE |
>SDL_AudioCVT</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6337" |
></A |
><H2 |
>Name</H2 |
>SDL_AudioCVT -- Audio Conversion Structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6340" |
></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="AEN6343" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN6345" |
></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="AEN6397" |
></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="AEN6442" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlaudiospec.html |
---|
0,0 → 1,581 |
<HTML |
><HEAD |
><TITLE |
>SDL_AudioSpec</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN5960" |
></A |
><H2 |
>Name</H2 |
>SDL_AudioSpec -- Audio Specification Structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5963" |
></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="AEN5966" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN5968" |
></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="AEN6003" |
></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="AEN6017" |
></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="AEN6092" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlblitsurface.html |
---|
0,0 → 1,332 |
<HTML |
><HEAD |
><TITLE |
>SDL_BlitSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN1883" |
></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="AEN1886" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1887" |
></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="AEN1893" |
></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 |
><P |
>The results of blitting operations vary greatly depending on whether <TT |
CLASS="LITERAL" |
>SDL_SRCAPLHA</TT |
> is set or not. See <A |
HREF="sdlsetalpha.html" |
>SDL_SetAlpha</A |
> for an explaination of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain. |
<PRE |
CLASS="PROGRAMLISTING" |
>if (source surface has SDL_SRCALPHA set) { |
if (source surface has alpha channel (that is, format->Amask != 0)) |
blit using per-pixel alpha, ignoring any colour key |
else { |
if (source surface has SDL_SRCCOLORKEY set) |
blit using the colour key AND the per-surface alpha value |
else |
blit using the per-surface alpha value |
} |
} else { |
if (source surface has SDL_SRCCOLORKEY set) |
blit using the colour key |
else |
ordinary opaque rectangular blit |
}</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1912" |
></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="AEN1920" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlbuildaudiocvt.html |
---|
0,0 → 1,283 |
<HTML |
><HEAD |
><TITLE |
>SDL_BuildAudioCVT</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6455" |
></A |
><H2 |
>Name</H2 |
>SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6458" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6459" |
></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="AEN6465" |
></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="AEN6481" |
></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="AEN6485" |
></A |
><H2 |
>Examples</H2 |
><P |
>See <A |
HREF="sdlconvertaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_ConvertAudio</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6490" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcd.html |
---|
0,0 → 1,351 |
<HTML |
><HEAD |
><TITLE |
>SDL_CD</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7017" |
></A |
><H2 |
>Name</H2 |
>SDL_CD -- CDROM Drive Information</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7020" |
></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="AEN7023" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN7025" |
></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="AEN7055" |
></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="AEN7065" |
></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="AEN7068" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdclose.html |
---|
0,0 → 1,209 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDClose</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6992" |
></A |
><H2 |
>Name</H2 |
>SDL_CDClose -- Closes a SDL_CD handle</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6995" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6996" |
></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="AEN7002" |
></A |
><H2 |
>Description</H2 |
><P |
>Closes the given <TT |
CLASS="PARAMETER" |
><I |
>cdrom</I |
></TT |
> handle.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7006" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdeject.html |
---|
0,0 → 1,218 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDEject</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6964" |
></A |
><H2 |
>Name</H2 |
>SDL_CDEject -- Ejects a CDROM</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6967" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6968" |
></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="AEN6974" |
></A |
><H2 |
>Description</H2 |
><P |
>Ejects the given <TT |
CLASS="PARAMETER" |
><I |
>cdrom</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6978" |
></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="AEN6983" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdname.html |
---|
0,0 → 1,231 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDName</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6691" |
></A |
><H2 |
>Name</H2 |
>SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6694" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6695" |
></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="AEN6701" |
></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="AEN6706" |
></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="AEN6716" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdnumdrives.html |
---|
0,0 → 1,197 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDNumDrives</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6669" |
></A |
><H2 |
>Name</H2 |
>SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6672" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6673" |
></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="AEN6679" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the number of CD-ROM drives on the system.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6682" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdopen.html |
---|
0,0 → 1,267 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDOpen</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6725" |
></A |
><H2 |
>Name</H2 |
>SDL_CDOpen -- Opens a CD-ROM drive for access.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6728" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6729" |
></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="AEN6735" |
></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="AEN6743" |
></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="AEN6746" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdpause.html |
---|
0,0 → 1,225 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDPause</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6876" |
></A |
><H2 |
>Name</H2 |
>SDL_CDPause -- Pauses a CDROM</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6879" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6880" |
></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="AEN6886" |
></A |
><H2 |
>Description</H2 |
><P |
>Pauses play on the given <TT |
CLASS="PARAMETER" |
><I |
>cdrom</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6890" |
></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="AEN6895" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdplay.html |
---|
0,0 → 1,235 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDPlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6794" |
></A |
><H2 |
>Name</H2 |
>SDL_CDPlay -- Play a CD</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6797" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6798" |
></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="AEN6804" |
></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="AEN6810" |
></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="AEN6815" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdplaytracks.html |
---|
0,0 → 1,317 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDPlayTracks</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6826" |
></A |
><H2 |
>Name</H2 |
>SDL_CDPlayTracks -- Play the given CD track(s)</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6829" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6830" |
></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="AEN6836" |
></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="AEN6854" |
></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="AEN6859" |
></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="AEN6863" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdresume.html |
---|
0,0 → 1,225 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDResume</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6906" |
></A |
><H2 |
>Name</H2 |
>SDL_CDResume -- Resumes a CDROM</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6909" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6910" |
></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="AEN6916" |
></A |
><H2 |
>Description</H2 |
><P |
>Resumes play on the given <TT |
CLASS="PARAMETER" |
><I |
>cdrom</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6920" |
></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="AEN6925" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdstatus.html |
---|
0,0 → 1,265 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDStatus</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6759" |
></A |
><H2 |
>Name</H2 |
>SDL_CDStatus -- Returns the current status of the given drive.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6762" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6763" |
></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="AEN6770" |
></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="AEN6782" |
></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="AEN6785" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdstop.html |
---|
0,0 → 1,218 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDStop</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6936" |
></A |
><H2 |
>Name</H2 |
>SDL_CDStop -- Stops a CDROM</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6939" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6940" |
></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="AEN6946" |
></A |
><H2 |
>Description</H2 |
><P |
>Stops play on the given <TT |
CLASS="PARAMETER" |
><I |
>cdrom</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6950" |
></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="AEN6955" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcdtrack.html |
---|
0,0 → 1,305 |
<HTML |
><HEAD |
><TITLE |
>SDL_CDtrack</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7079" |
></A |
><H2 |
>Name</H2 |
>SDL_CDtrack -- CD Track Information Structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7082" |
></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="AEN7085" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN7087" |
></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="AEN7108" |
></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="AEN7120" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcloseaudio.html |
---|
0,0 → 1,197 |
<HTML |
><HEAD |
><TITLE |
>SDL_CloseAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6631" |
></A |
><H2 |
>Name</H2 |
>SDL_CloseAudio -- Shuts down audio processing and closes the audio device.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6634" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6635" |
></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="AEN6641" |
></A |
><H2 |
>Description</H2 |
><P |
>This function shuts down audio processing and closes the audio device.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6644" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcolor.html |
---|
0,0 → 1,292 |
<HTML |
><HEAD |
><TITLE |
>SDL_Color</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN2660" |
></A |
><H2 |
>Name</H2 |
>SDL_Color -- Format independent color description</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2663" |
></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="AEN2666" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2668" |
></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="AEN2687" |
></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="AEN2694" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcondbroadcast.html |
---|
0,0 → 1,216 |
<HTML |
><HEAD |
><TITLE |
>SDL_CondBroadcast</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7788" |
></A |
><H2 |
>Name</H2 |
>SDL_CondBroadcast -- Restart all threads waiting on a condition variable</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7791" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7792" |
></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="AEN7798" |
></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="AEN7804" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcondsignal.html |
---|
0,0 → 1,216 |
<HTML |
><HEAD |
><TITLE |
>SDL_CondSignal</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7761" |
></A |
><H2 |
>Name</H2 |
>SDL_CondSignal -- Restart a thread wait on a condition variable</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7764" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7765" |
></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="AEN7771" |
></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="AEN7777" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcondwait.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_CondWait</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7815" |
></A |
><H2 |
>Name</H2 |
>SDL_CondWait -- Wait on a condition variable</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7818" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7819" |
></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="AEN7825" |
></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="AEN7831" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcondwaittimeout.html |
---|
0,0 → 1,222 |
<HTML |
><HEAD |
><TITLE |
>SDL_CondWaitTimeout</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7844" |
></A |
><H2 |
>Name</H2 |
>SDL_CondWaitTimeout -- Wait on a condition variable, with timeout</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7847" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7848" |
></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="AEN7854" |
></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="AEN7863" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlconvertaudio.html |
---|
0,0 → 1,399 |
<HTML |
><HEAD |
><TITLE |
>SDL_ConvertAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN6501" |
></A |
><H2 |
>Name</H2 |
>SDL_ConvertAudio -- Convert audio data to a desired audio format.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6504" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6505" |
></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="AEN6511" |
></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="AEN6546" |
></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="AEN6549" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlconvertsurface.html |
---|
0,0 → 1,261 |
<HTML |
><HEAD |
><TITLE |
>SDL_ConvertSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN1843" |
></A |
><H2 |
>Name</H2 |
>SDL_ConvertSurface -- Converts a surface to the same format as another surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1846" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1847" |
></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="AEN1853" |
></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="AEN1864" |
></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="AEN1868" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatecond.html |
---|
0,0 → 1,232 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateCond</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7710" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateCond -- Create a condition variable</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7713" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7714" |
></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="AEN7720" |
></A |
><H2 |
>Description</H2 |
><P |
>Creates a condition variable.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7723" |
></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="AEN7726" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatecursor.html |
---|
0,0 → 1,390 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateCursor</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN2068" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateCursor -- Creates a new mouse cursor.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2071" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2072" |
></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="AEN2078" |
></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="AEN2084" |
></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="AEN2105" |
></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="AEN2108" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatemutex.html |
---|
0,0 → 1,241 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateMutex</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7271" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateMutex -- Create a mutex</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7274" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7275" |
></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="AEN7281" |
></A |
><H2 |
>Description</H2 |
><P |
>Create a new, unlocked mutex.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7284" |
></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="AEN7287" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatergbsurface.html |
---|
0,0 → 1,450 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateRGBSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN1358" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateRGBSurface -- Create an empty SDL_Surface</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1361" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1362" |
></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="AEN1368" |
></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="AEN1380" |
></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" |
>This flag turns on colourkeying for blits from this surface. If |
<TT |
CLASS="LITERAL" |
>SDL_HWSURFACE</TT |
> is also specified and colourkeyed blits |
are hardware-accelerated, then SDL will attempt to place the surface in |
video memory. |
Use <A |
HREF="sdlsetcolorkey.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetColorKey</TT |
></A |
> |
to set or clear this flag after surface creation.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>This flag turns on alpha-blending for blits from this surface. If |
<TT |
CLASS="LITERAL" |
>SDL_HWSURFACE</TT |
> is also specified and alpha-blending blits |
are hardware-accelerated, then the surface will be placed in video memory if |
possible. |
Use <A |
HREF="sdlsetalpha.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetAlpha</TT |
></A |
> to |
set or clear this flag after surface creation.</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>If an alpha-channel is specified (that is, if <TT |
CLASS="PARAMETER" |
><I |
>Amask</I |
></TT |
> is |
nonzero), then the <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
> flag is automatically |
set. You may remove this flag by calling |
<A |
HREF="sdlsetalpha.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetAlpha</TT |
></A |
> |
after surface creation.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1411" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns the created surface, or <SPAN |
CLASS="RETURNVALUE" |
>NULL</SPAN |
> upon error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1415" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order, |
as expected by OpenGL for textures */ |
SDL_Surface *surface; |
Uint32 rmask, gmask, bmask, amask; |
/* SDL interprets each pixel as a 32-bit number, so our masks must depend |
on the endianness (byte order) of the machine */ |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
rmask = 0xff000000; |
gmask = 0x00ff0000; |
bmask = 0x0000ff00; |
amask = 0x000000ff; |
#else |
rmask = 0x000000ff; |
gmask = 0x0000ff00; |
bmask = 0x00ff0000; |
amask = 0xff000000; |
#endif |
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, |
rmask, gmask, bmask, amask); |
if(surface == NULL) { |
fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError()); |
exit(1); |
}</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1418" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatergbsurfacefrom.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateRGBSurfaceFrom</TT |
></A |
>, |
<A |
HREF="sdlfreesurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_FreeSurface</TT |
></A |
>, |
<A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
></A |
>, |
<A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</SPAN |
></A |
>, |
<A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
> |
<A |
HREF="sdlsetalpha.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetAlpha</TT |
></A |
> |
<A |
HREF="sdlsetcolorkey.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetColorKey</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatergbsurfacefrom.html |
---|
0,0 → 1,248 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateRGBSurfaceFrom</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN1441" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1444" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1445" |
></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="AEN1451" |
></A |
><H2 |
>Description</H2 |
><P |
>Creates an SDL_Surface from the provided pixel data.</P |
><P |
>The data stored in <TT |
CLASS="PARAMETER" |
><I |
>pixels</I |
></TT |
> is assumed to be of the <TT |
CLASS="PARAMETER" |
><I |
>depth</I |
></TT |
> specified in the parameter list. The pixel data is not copied into the <SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
> structure so it should not be freed until the surface has been freed with a called to <A |
HREF="sdlfreesurface.html" |
>SDL_FreeSurface</A |
>. <TT |
CLASS="PARAMETER" |
><I |
>pitch</I |
></TT |
> is the length of each scanline in bytes. </P |
><P |
>See <A |
HREF="sdlcreatergbsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateRGBSurface</TT |
></A |
> for a more detailed description of the other parameters.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1463" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns the created surface, or <SPAN |
CLASS="RETURNVALUE" |
>NULL</SPAN |
> upon error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1467" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatesemaphore.html |
---|
0,0 → 1,295 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateSemaphore</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7387" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7390" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7391" |
></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="AEN7397" |
></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="AEN7406" |
></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="AEN7410" |
></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="AEN7414" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreatethread.html |
---|
0,0 → 1,215 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateThread</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7152" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7155" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7156" |
></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="AEN7162" |
></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="AEN7168" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlcreateyuvoverlay.html |
---|
0,0 → 1,248 |
<HTML |
><HEAD |
><TITLE |
>SDL_CreateYUVOverlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN2389" |
></A |
><H2 |
>Name</H2 |
>SDL_CreateYUVOverlay -- Create a YUV video overlay</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2392" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2393" |
></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="AEN2399" |
></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="AEN2412" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldelay.html |
---|
0,0 → 1,217 |
<HTML |
><HEAD |
><TITLE |
>SDL_Delay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7906" |
></A |
><H2 |
>Name</H2 |
>SDL_Delay -- Wait a specified number of milliseconds before returning.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7909" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7910" |
></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="AEN7916" |
></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 |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Count on a delay granularity of <I |
CLASS="EMPHASIS" |
>at least</I |
> 10 ms. |
Some platforms have shorter clock ticks but this is the most common.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7924" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldestroycond.html |
---|
0,0 → 1,198 |
<HTML |
><HEAD |
><TITLE |
>SDL_DestroyCond</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7739" |
></A |
><H2 |
>Name</H2 |
>SDL_DestroyCond -- Destroy 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" |
>void <B |
CLASS="FSFUNC" |
>SDL_DestroyCond</B |
></CODE |
>(SDL_cond *cond);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7749" |
></A |
><H2 |
>Description</H2 |
><P |
>Destroys a condition variable.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7752" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldestroymutex.html |
---|
0,0 → 1,201 |
<HTML |
><HEAD |
><TITLE |
>SDL_DestroyMutex</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7300" |
></A |
><H2 |
>Name</H2 |
>SDL_DestroyMutex -- Destroy a mutex</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7303" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7304" |
></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="AEN7310" |
></A |
><H2 |
>Description</H2 |
><P |
>Destroy a previously <A |
HREF="sdlcreatemutex.html" |
>created</A |
> mutex.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7314" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldestroysemaphore.html |
---|
0,0 → 1,270 |
<HTML |
><HEAD |
><TITLE |
>SDL_DestroySemaphore</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN7433" |
></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="AEN7437" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7438" |
></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="AEN7444" |
></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="AEN7451" |
></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="AEN7455" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldisplayformat.html |
---|
0,0 → 1,254 |
<HTML |
><HEAD |
><TITLE |
>SDL_DisplayFormat</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN1975" |
></A |
><H2 |
>Name</H2 |
>SDL_DisplayFormat -- Convert a surface to the display format</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1978" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1979" |
></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="AEN1985" |
></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="AEN1992" |
></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="AEN1996" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldisplayformatalpha.html |
---|
0,0 → 1,242 |
<HTML |
><HEAD |
><TITLE |
>SDL_DisplayFormatAlpha</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN2013" |
></A |
><H2 |
>Name</H2 |
>SDL_DisplayFormatAlpha -- Convert a surface to the display format</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2016" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2017" |
></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="AEN2023" |
></A |
><H2 |
>Description</H2 |
><P |
>This function takes a surface and copies it to a new surface of the |
pixel format and colors of the video framebuffer plus an alpha channel, |
suitable for fast blitting onto the display surface. It calls |
<A |
HREF="sdlconvertsurface.html" |
>SDL_ConvertSurface</A |
></P |
><P |
>If you want to take advantage of hardware colorkey or alpha blit |
acceleration, you should set the colorkey and alpha value before |
calling this function.</P |
><P |
>This function can be used to convert a colourkey to an alpha channel, |
if the <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> flag is set on the surface. |
The generated surface will then be transparent (alpha=0) where the |
pixels match the colourkey, and opaque (alpha=255) elsewhere.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2030" |
></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="AEN2034" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdldisplayyuvoverlay.html |
---|
0,0 → 1,228 |
<HTML |
><HEAD |
><TITLE |
>SDL_DisplayYUVOverlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN2489" |
></A |
><H2 |
>Name</H2 |
>SDL_DisplayYUVOverlay -- Blit the overlay to the display</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2492" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2493" |
></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="AEN2499" |
></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="AEN2508" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlenablekeyrepeat.html |
---|
0,0 → 1,230 |
<HTML |
><HEAD |
><TITLE |
>SDL_EnableKeyRepeat</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN5292" |
></A |
><H2 |
>Name</H2 |
>SDL_EnableKeyRepeat -- Set keyboard repeat rate.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5295" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5296" |
></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="AEN5302" |
></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="AEN5313" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlenableunicode.html |
---|
0,0 → 1,228 |
<HTML |
><HEAD |
><TITLE |
>SDL_EnableUNICODE</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN5262" |
></A |
><H2 |
>Name</H2 |
>SDL_EnableUNICODE -- Enable UNICODE translation</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5265" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5266" |
></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="AEN5272" |
></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="AEN5280" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns the previous translation mode.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5283" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlevent.html |
---|
0,0 → 1,942 |
<HTML |
><HEAD |
><TITLE |
>SDL_Event</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN3289" |
></A |
><H2 |
>Name</H2 |
>SDL_Event -- General event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3292" |
></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="AEN3295" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3297" |
></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="AEN3364" |
></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="AEN3372" |
></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="AEN3452" |
></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="AEN3509" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdleventstate.html |
---|
0,0 → 1,268 |
<HTML |
><HEAD |
><TITLE |
>SDL_EventState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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="AEN5103" |
></A |
><H2 |
>Name</H2 |
>SDL_EventState -- This function allows you to set the state of processing certain events.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5106" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5107" |
></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="AEN5113" |
></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="AEN5134" |
></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 |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlfillrect.html |
---|
0,0 → 1,270 |
<HTML |
><HEAD |
><TITLE |
>SDL_FillRect</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_BlitSurface" |
HREF="sdlblitsurface.html"><LINK |
REL="NEXT" |
TITLE="SDL_DisplayFormat" |
HREF="sdldisplayformat.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="sdlblitsurface.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdldisplayformat.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLFILLRECT" |
>SDL_FillRect</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1935" |
></A |
><H2 |
>Name</H2 |
>SDL_FillRect -- This function performs a fast fill of the given rectangle with some color</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1938" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1939" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_FillRect</B |
></CODE |
>(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1945" |
></A |
><H2 |
>Description</H2 |
><P |
>This function performs a fast fill of the given rectangle with |
<TT |
CLASS="PARAMETER" |
><I |
>color</I |
></TT |
>. If <TT |
CLASS="PARAMETER" |
><I |
>dstrect</I |
></TT |
> |
is <TT |
CLASS="LITERAL" |
>NULL</TT |
>, the whole surface will be filled with |
<TT |
CLASS="PARAMETER" |
><I |
>color</I |
></TT |
>.</P |
><P |
>The color should be a pixel of the format used by the surface, and |
can be generated by the |
<A |
HREF="sdlmaprgb.html" |
>SDL_MapRGB</A |
> |
function.</P |
><P |
>If there is a clip rectangle set on the destination (set via |
<A |
HREF="sdlsetcliprect.html" |
>SDL_SetClipRect</A |
>) then this |
function will clip based on the intersection of the clip rectangle and |
the <TT |
CLASS="PARAMETER" |
><I |
>dstrect</I |
></TT |
> rectangle.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1957" |
></A |
><H2 |
>Return Value</H2 |
><P |
>This function returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success, or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1962" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlmaprgb.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGB</TT |
></A |
>, |
<A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</TT |
></A |
>, |
<A |
HREF="sdlrect.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Rect</SPAN |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdlblitsurface.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="sdldisplayformat.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_BlitSurface</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_DisplayFormat</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlflip.html |
---|
0,0 → 1,251 |
<HTML |
><HEAD |
><TITLE |
>SDL_Flip</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_UpdateRects" |
HREF="sdlupdaterects.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetColors" |
HREF="sdlsetcolors.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="sdlupdaterects.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetcolors.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLFLIP" |
>SDL_Flip</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1011" |
></A |
><H2 |
>Name</H2 |
>SDL_Flip -- Swaps screen buffers</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1014" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1015" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_Flip</B |
></CODE |
>(SDL_Surface *screen);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1021" |
></A |
><H2 |
>Description</H2 |
><P |
>On hardware that supports double-buffering, this function sets up a flip |
and returns. The hardware will wait for vertical retrace, and then swap |
video buffers before the next video surface blit or lock will return. |
On hardware that doesn't support double-buffering, this is equivalent |
to calling <A |
HREF="sdlupdaterect.html" |
>SDL_UpdateRect</A |
><TT |
CLASS="PARAMETER" |
><I |
>(screen, 0, 0, 0, 0)</I |
></TT |
></P |
><P |
>The <TT |
CLASS="LITERAL" |
>SDL_DOUBLEBUF</TT |
> flag must have been passed to |
<A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
>, |
when |
setting the video mode for this function to perform hardware flipping.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1029" |
></A |
><H2 |
>Return Value</H2 |
><P |
>This function returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if successful, or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if there was an error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1034" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdlupdaterect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UpdateRect</TT |
></A |
>, |
<A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdlupdaterects.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="sdlsetcolors.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_UpdateRects</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetColors</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlfreecursor.html |
---|
0,0 → 1,201 |
<HTML |
><HEAD |
><TITLE |
>SDL_FreeCursor</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_CreateCursor" |
HREF="sdlcreatecursor.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetCursor" |
HREF="sdlsetcursor.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="sdlcreatecursor.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetcursor.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLFREECURSOR" |
>SDL_FreeCursor</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2121" |
></A |
><H2 |
>Name</H2 |
>SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2124" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2125" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_FreeCursor</B |
></CODE |
>(SDL_Cursor *cursor);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2131" |
></A |
><H2 |
>Description</H2 |
><P |
>Frees a <SPAN |
CLASS="STRUCTNAME" |
>SDL_Cursor</SPAN |
> that was created using |
<A |
HREF="sdlcreatecursor.html" |
>SDL_CreateCursor</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2136" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatecursor.html" |
>SDL_CreateCursor</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="sdlcreatecursor.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="sdlsetcursor.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_CreateCursor</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetCursor</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlfreesurface.html |
---|
0,0 → 1,211 |
<HTML |
><HEAD |
><TITLE |
>SDL_FreeSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_CreateRGBSurfaceFrom" |
HREF="sdlcreatergbsurfacefrom.html"><LINK |
REL="NEXT" |
TITLE="SDL_LockSurface" |
HREF="sdllocksurface.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="sdlcreatergbsurfacefrom.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdllocksurface.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLFREESURFACE" |
>SDL_FreeSurface</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1478" |
></A |
><H2 |
>Name</H2 |
>SDL_FreeSurface -- Frees (deletes) a SDL_Surface</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1481" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1482" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_FreeSurface</B |
></CODE |
>(SDL_Surface *surface);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1488" |
></A |
><H2 |
>Description</H2 |
><P |
>Frees the resources used by a previously created <SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
>. If the surface was created using |
<A |
HREF="sdlcreatergbsurfacefrom.html" |
>SDL_CreateRGBSurfaceFrom</A |
> then the pixel data is not freed.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1493" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatergbsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateRGBSurface</TT |
></A |
> |
<A |
HREF="sdlcreatergbsurfacefrom.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateRGBSurfaceFrom</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdlcreatergbsurfacefrom.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="sdllocksurface.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_CreateRGBSurfaceFrom</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_LockSurface</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlfreewav.html |
---|
0,0 → 1,214 |
<HTML |
><HEAD |
><TITLE |
>SDL_FreeWAV</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_LoadWAV" |
HREF="sdlloadwav.html"><LINK |
REL="NEXT" |
TITLE="SDL_AudioCVT" |
HREF="sdlaudiocvt.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="sdlloadwav.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlaudiocvt.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLFREEWAV" |
>SDL_FreeWAV</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6310" |
></A |
><H2 |
>Name</H2 |
>SDL_FreeWAV -- Frees previously opened WAV data</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6313" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6314" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_FreeWAV</B |
></CODE |
>(Uint8 *audio_buf);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6320" |
></A |
><H2 |
>Description</H2 |
><P |
>After a WAVE file has been opened with <A |
HREF="sdlloadwav.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LoadWAV</TT |
></A |
> its data can eventually be freed with <TT |
CLASS="FUNCTION" |
>SDL_FreeWAV</TT |
>. <TT |
CLASS="PARAMETER" |
><I |
>audio_buf</I |
></TT |
> is a pointer to the buffer created by <TT |
CLASS="FUNCTION" |
>SDL_LoadWAV</TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6328" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlloadwav.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LoadWAV</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdlloadwav.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="sdlaudiocvt.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_LoadWAV</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_AudioCVT</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlfreeyuvoverlay.html |
---|
0,0 → 1,225 |
<HTML |
><HEAD |
><TITLE |
>SDL_FreeYUVOverlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_DisplayYUVOverlay" |
HREF="sdldisplayyuvoverlay.html"><LINK |
REL="NEXT" |
TITLE="SDL_GLattr" |
HREF="sdlglattr.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TH |
COLSPAN="3" |
ALIGN="center" |
>SDL Library Documentation</TH |
></TR |
><TR |
><TD |
WIDTH="10%" |
ALIGN="left" |
VALIGN="bottom" |
><A |
HREF="sdldisplayyuvoverlay.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlglattr.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLFREEYUVOVERLAY" |
>SDL_FreeYUVOverlay</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2519" |
></A |
><H2 |
>Name</H2 |
>SDL_FreeYUVOverlay -- Free a YUV video overlay</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2522" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2523" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_FreeYUVOverlay</B |
></CODE |
>(SDL_Overlay *overlay);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2529" |
></A |
><H2 |
>Description</H2 |
><P |
>Frees and <A |
HREF="sdloverlay.html" |
><TT |
CLASS="PARAMETER" |
><I |
>overlay</I |
></TT |
></A |
> created by <A |
HREF="sdlcreateyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateYUVOverlay</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2536" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdloverlay.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Overlay</SPAN |
></A |
>, |
<A |
HREF="sdldisplayyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_DisplayYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdlcreateyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_FreeYUVOverlay</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdldisplayyuvoverlay.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="sdlglattr.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_DisplayYUVOverlay</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GLattr</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetappstate.html |
---|
0,0 → 1,255 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetAppState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetRelativeMouseState" |
HREF="sdlgetrelativemousestate.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickEventState" |
HREF="sdljoystickeventstate.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="sdlgetrelativemousestate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickeventstate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETAPPSTATE" |
>SDL_GetAppState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5384" |
></A |
><H2 |
>Name</H2 |
><TT |
CLASS="FUNCTION" |
>SDL_GetAppState</TT |
> -- Get the state of the application</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5388" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5389" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint8 <B |
CLASS="FSFUNC" |
>SDL_GetAppState</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5395" |
></A |
><H2 |
>Description</H2 |
><P |
>This function returns the current state of the application. The value returned is a bitwise combination of:</P |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN5398" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_APPMOUSEFOCUS</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The application has mouse focus.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_APPINPUTFOCUS</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The application has keyboard focus</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_APPACTIVE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The application is visible</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5413" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlactiveevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_ActiveEvent</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="sdlgetrelativemousestate.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="sdljoystickeventstate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetRelativeMouseState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickEventState</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetaudiostatus.html |
---|
0,0 → 1,213 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetAudioStatus</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_PauseAudio" |
HREF="sdlpauseaudio.html"><LINK |
REL="NEXT" |
TITLE="SDL_LoadWAV" |
HREF="sdlloadwav.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="sdlpauseaudio.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlloadwav.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETAUDIOSTATUS" |
>SDL_GetAudioStatus</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6243" |
></A |
><H2 |
>Name</H2 |
>SDL_GetAudioStatus -- Get the current audio state</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6246" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6247" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_audiostatus<B |
CLASS="FSFUNC" |
>SDL_GetAudioStatus</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6253" |
></A |
><H2 |
>Description</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef enum{ |
SDL_AUDIO_STOPPED, |
SDL_AUDIO_PAUSED, |
SDL_AUDIO_PLAYING |
} SDL_audiostatus;</PRE |
><P |
>Returns either <TT |
CLASS="LITERAL" |
>SDL_AUDIO_STOPPED</TT |
>, <TT |
CLASS="LITERAL" |
>SDL_AUDIO_PAUSED</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_AUDIO_PLAYING</TT |
> depending on the current audio state.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6260" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlpauseaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PauseAudio</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="sdlpauseaudio.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="sdlloadwav.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_PauseAudio</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_LoadWAV</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetcliprect.html |
---|
0,0 → 1,221 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetClipRect</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetClipRect" |
HREF="sdlsetcliprect.html"><LINK |
REL="NEXT" |
TITLE="SDL_ConvertSurface" |
HREF="sdlconvertsurface.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="sdlsetcliprect.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlconvertsurface.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETCLIPRECT" |
>SDL_GetClipRect</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1815" |
></A |
><H2 |
>Name</H2 |
>SDL_GetClipRect -- Gets the clipping rectangle for a surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1818" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1819" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_GetClipRect</B |
></CODE |
>(SDL_Surface *surface, SDL_Rect *rect);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1825" |
></A |
><H2 |
>Description</H2 |
><P |
>Gets the clipping rectangle for a surface. When this surface is the |
destination of a blit, only the area within the clip rectangle is |
drawn into.</P |
><P |
>The rectangle pointed to by <TT |
CLASS="PARAMETER" |
><I |
>rect</I |
></TT |
> will be |
filled with the clipping rectangle of the surface.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1830" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetcliprect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetClipRect</TT |
></A |
>, |
<A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</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="sdlsetcliprect.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="sdlconvertsurface.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetClipRect</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_ConvertSurface</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetcursor.html |
---|
0,0 → 1,211 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetCursor</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetCursor" |
HREF="sdlsetcursor.html"><LINK |
REL="NEXT" |
TITLE="SDL_ShowCursor" |
HREF="sdlshowcursor.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="sdlsetcursor.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlshowcursor.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETCURSOR" |
>SDL_GetCursor</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2170" |
></A |
><H2 |
>Name</H2 |
>SDL_GetCursor -- Get the currently active mouse cursor.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2173" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2174" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_Cursor *<B |
CLASS="FSFUNC" |
>SDL_GetCursor</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2180" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the currently active mouse cursor.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2183" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetcursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetCursor</TT |
></A |
>, |
<A |
HREF="sdlcreatecursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateCursor</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="sdlsetcursor.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="sdlshowcursor.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetCursor</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_ShowCursor</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgeteventfilter.html |
---|
0,0 → 1,227 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetEventFilter</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetEventFilter" |
HREF="sdlseteventfilter.html"><LINK |
REL="NEXT" |
TITLE="SDL_EventState" |
HREF="sdleventstate.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="sdlseteventfilter.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdleventstate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETEVENTFILTER" |
>SDL_GetEventFilter</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5072" |
></A |
><H2 |
>Name</H2 |
>SDL_GetEventFilter -- Retrieves a pointer to he event filter</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5075" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5076" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_EventFilter <B |
CLASS="FSFUNC" |
>SDL_GetEventFilter</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5082" |
></A |
><H2 |
>Description</H2 |
><P |
>This function retrieces a pointer to the event filter that was previously set using <A |
HREF="sdlseteventfilter.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetEventFilter</TT |
></A |
>. An SDL_EventFilter function is defined as: |
<PRE |
CLASS="PROGRAMLISTING" |
>typedef int (*SDL_EventFilter)(const SDL_Event *event);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5088" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns a pointer to the event filter or <TT |
CLASS="LITERAL" |
>NULL</TT |
> if no filter has been set.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5092" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlseteventfilter.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetEventFilter</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdlseteventfilter.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="sdleventstate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetEventFilter</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_EventState</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetgammaramp.html |
---|
0,0 → 1,211 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetGammaRamp</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetGamma" |
HREF="sdlsetgamma.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetGammaRamp" |
HREF="sdlsetgammaramp.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="sdlsetgamma.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetgammaramp.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETGAMMARAMP" |
>SDL_GetGammaRamp</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1183" |
></A |
><H2 |
>Name</H2 |
>SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1186" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1187" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_GetGammaRamp</B |
></CODE |
>(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1193" |
></A |
><H2 |
>Description</H2 |
><P |
>Gets the gamma translation lookup tables currently used by the display. |
Each table is an array of 256 Uint16 values.</P |
><P |
>Not all display hardware is able to change gamma.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1197" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns -1 on error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1200" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetgamma.html" |
>SDL_SetGamma</A |
> |
<A |
HREF="sdlsetgammaramp.html" |
>SDL_SetGammaRamp</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="sdlsetgamma.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="sdlsetgammaramp.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetGamma</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetGammaRamp</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetkeyname.html |
---|
0,0 → 1,208 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetKeyName</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetModState" |
HREF="sdlsetmodstate.html"><LINK |
REL="NEXT" |
TITLE="SDL_EnableUNICODE" |
HREF="sdlenableunicode.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="sdlsetmodstate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlenableunicode.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETKEYNAME" |
>SDL_GetKeyName</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5237" |
></A |
><H2 |
>Name</H2 |
>SDL_GetKeyName -- Get the name of an SDL virtual keysym</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5240" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5241" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>char *<B |
CLASS="FSFUNC" |
>SDL_GetKeyName</B |
></CODE |
>(SDLKey key);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5247" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the SDL-defined name of the <A |
HREF="sdlkey.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDLKey</SPAN |
></A |
> <TT |
CLASS="PARAMETER" |
><I |
>key</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5253" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlkey.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDLKey</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="sdlsetmodstate.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="sdlenableunicode.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetModState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_EnableUNICODE</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetkeystate.html |
---|
0,0 → 1,245 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetKeyState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_EventState" |
HREF="sdleventstate.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetModState" |
HREF="sdlgetmodstate.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="sdleventstate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetmodstate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETKEYSTATE" |
>SDL_GetKeyState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5143" |
></A |
><H2 |
>Name</H2 |
>SDL_GetKeyState -- Get a snapshot of the current keyboard state</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5146" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5147" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint8 *<B |
CLASS="FSFUNC" |
>SDL_GetKeyState</B |
></CODE |
>(int *numkeys);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5153" |
></A |
><H2 |
>Description</H2 |
><P |
>Gets a snapshot of the current keyboard state. The current state is return as a pointer to an array, the size of this array is stored in <TT |
CLASS="PARAMETER" |
><I |
>numkeys</I |
></TT |
>. The array is indexed by the <A |
HREF="sdlkey.html" |
><TT |
CLASS="LITERAL" |
>SDLK_*</TT |
></A |
> symbols. A value of 1 means the key is pressed and a value of 0 means its not.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Use <A |
HREF="sdlpumpevents.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</TT |
></A |
> to update the state array.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5163" |
></A |
><H2 |
>Example</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>Uint8 *keystate = SDL_GetKeyState(NULL); |
if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed.\n");</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5167" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlkey.html" |
><TT |
CLASS="LITERAL" |
>SDL Key Symbols</TT |
></A |
>, |
<A |
HREF="sdlpumpevents.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</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="sdleventstate.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="sdlgetmodstate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_EventState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetModState</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetmodstate.html |
---|
0,0 → 1,249 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetModState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetKeyState" |
HREF="sdlgetkeystate.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetModState" |
HREF="sdlsetmodstate.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="sdlgetkeystate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetmodstate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETMODSTATE" |
>SDL_GetModState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5178" |
></A |
><H2 |
>Name</H2 |
>SDL_GetModState -- Get the state of modifier keys.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5181" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5182" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDLMod <B |
CLASS="FSFUNC" |
>SDL_GetModState</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5188" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the current of the modifier keys (CTRL, ALT, etc.).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5191" |
></A |
><H2 |
>Return Value</H2 |
><P |
>The return value can be an OR'd combination of the SDLMod enum.</P |
><P |
><A |
NAME="AEN5195" |
></A |
><BLOCKQUOTE |
CLASS="BLOCKQUOTE" |
><P |
><B |
>SDLMod</B |
></P |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef enum { |
KMOD_NONE = 0x0000, |
KMOD_LSHIFT= 0x0001, |
KMOD_RSHIFT= 0x0002, |
KMOD_LCTRL = 0x0040, |
KMOD_RCTRL = 0x0080, |
KMOD_LALT = 0x0100, |
KMOD_RALT = 0x0200, |
KMOD_LMETA = 0x0400, |
KMOD_RMETA = 0x0800, |
KMOD_NUM = 0x1000, |
KMOD_CAPS = 0x2000, |
KMOD_MODE = 0x4000, |
} SDLMod;</PRE |
></BLOCKQUOTE |
> |
SDL also defines the following symbols for convenience: |
<A |
NAME="AEN5198" |
></A |
><BLOCKQUOTE |
CLASS="BLOCKQUOTE" |
><PRE |
CLASS="PROGRAMLISTING" |
>#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) |
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) |
#define KMOD_ALT (KMOD_LALT|KMOD_RALT) |
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)</PRE |
></BLOCKQUOTE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5200" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetkeystate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetKeyState</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="sdlgetkeystate.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="sdlsetmodstate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetKeyState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetModState</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetmousestate.html |
---|
0,0 → 1,245 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetMouseState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_EnableKeyRepeat" |
HREF="sdlenablekeyrepeat.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetRelativeMouseState" |
HREF="sdlgetrelativemousestate.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="sdlenablekeyrepeat.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetrelativemousestate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETMOUSESTATE" |
>SDL_GetMouseState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5322" |
></A |
><H2 |
>Name</H2 |
>SDL_GetMouseState -- Retrieve the current state of the mouse</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5325" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5326" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint8 <B |
CLASS="FSFUNC" |
>SDL_GetMouseState</B |
></CODE |
>(int *x, int *y);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5332" |
></A |
><H2 |
>Description</H2 |
><P |
>The current button state is returned as a button bitmask, which can |
be tested using the <TT |
CLASS="LITERAL" |
>SDL_BUTTON(X)</TT |
> macros, and <TT |
CLASS="PARAMETER" |
><I |
>x</I |
></TT |
> and <TT |
CLASS="PARAMETER" |
><I |
>y</I |
></TT |
> are set to the |
current mouse cursor position. You can pass <TT |
CLASS="LITERAL" |
>NULL</TT |
> for either <TT |
CLASS="PARAMETER" |
><I |
>x</I |
></TT |
> or <TT |
CLASS="PARAMETER" |
><I |
>y</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5341" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_PumpEvents(); |
if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1)) |
printf("Mouse Button 1(left) is pressed.\n");</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5344" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetrelativemousestate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetRelativeMouseState</TT |
></A |
>, |
<A |
HREF="sdlpumpevents.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</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="sdlenablekeyrepeat.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="sdlgetrelativemousestate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_EnableKeyRepeat</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetRelativeMouseState</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetrelativemousestate.html |
---|
0,0 → 1,227 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetRelativeMouseState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetMouseState" |
HREF="sdlgetmousestate.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetAppState" |
HREF="sdlgetappstate.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="sdlgetmousestate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetappstate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETRELATIVEMOUSESTATE" |
>SDL_GetRelativeMouseState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5355" |
></A |
><H2 |
>Name</H2 |
>SDL_GetRelativeMouseState -- Retrieve the current state of the mouse</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5358" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5359" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint8 <B |
CLASS="FSFUNC" |
>SDL_GetRelativeMouseState</B |
></CODE |
>(int *x, int *y);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5365" |
></A |
><H2 |
>Description</H2 |
><P |
>The current button state is returned as a button bitmask, which can |
be tested using the <TT |
CLASS="LITERAL" |
>SDL_BUTTON(X)</TT |
> macros, and <TT |
CLASS="PARAMETER" |
><I |
>x</I |
></TT |
> and <TT |
CLASS="PARAMETER" |
><I |
>y</I |
></TT |
> are set to the change in the mouse position since the last call to <TT |
CLASS="FUNCTION" |
>SDL_GetRelativeMouseState</TT |
> or since event initialization. You can pass <TT |
CLASS="LITERAL" |
>NULL</TT |
> for either <TT |
CLASS="PARAMETER" |
><I |
>x</I |
></TT |
> or <TT |
CLASS="PARAMETER" |
><I |
>y</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5375" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetmousestate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetMouseState</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="sdlgetmousestate.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="sdlgetappstate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetMouseState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetAppState</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetrgb.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetRGB</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_MapRGBA" |
HREF="sdlmaprgba.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetRGBA" |
HREF="sdlgetrgba.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="sdlmaprgba.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetrgba.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETRGB" |
>SDL_GetRGB</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1303" |
></A |
><H2 |
>Name</H2 |
>SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1306" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1307" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_GetRGB</B |
></CODE |
>(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1313" |
></A |
><H2 |
>Description</H2 |
><P |
>Get RGB component values from a pixel stored in the specified pixel format.</P |
><P |
>This function uses the entire 8-bit [0..255] range when converting color |
components from pixel formats with less than 8-bits per RGB component |
(e.g., a completely white pixel in 16-bit RGB565 format would return |
[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1317" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetrgba.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetRGBA</TT |
></A |
>, |
<A |
HREF="sdlmaprgb.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGB</TT |
></A |
>, |
<A |
HREF="sdlmaprgba.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGBA</TT |
></A |
>, |
<A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</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="sdlmaprgba.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="sdlgetrgba.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_MapRGBA</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetRGBA</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetrgba.html |
---|
0,0 → 1,214 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetRGBA</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetRGB" |
HREF="sdlgetrgb.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateRGBSurface" |
HREF="sdlcreatergbsurface.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="sdlgetrgb.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreatergbsurface.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETRGBA" |
>SDL_GetRGBA</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1332" |
></A |
><H2 |
>Name</H2 |
>SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1335" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1336" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_GetRGBA</B |
></CODE |
>(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1342" |
></A |
><H2 |
>Description</H2 |
><P |
>Get RGBA component values from a pixel stored in the specified pixel format.</P |
><P |
>This function uses the entire 8-bit [0..255] range when converting color |
components from pixel formats with less than 8-bits per RGB component |
(e.g., a completely white pixel in 16-bit RGB565 format would return |
[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).</P |
><P |
>If the surface has no alpha component, the alpha will be returned as 0xff |
(100% opaque).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1347" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetrgb.html" |
>SDL_GetRGB</A |
>, |
<A |
HREF="sdlmaprgb.html" |
>SDL_MapRGB</A |
>, |
<A |
HREF="sdlmaprgba.html" |
>SDL_MapRGBA</A |
>, |
<A |
HREF="sdlpixelformat.html" |
>SDL_PixelFormat</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="sdlgetrgb.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="sdlcreatergbsurface.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetRGB</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateRGBSurface</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetthreadid.html |
---|
0,0 → 1,201 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetThreadID</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_ThreadID" |
HREF="sdlthreadid.html"><LINK |
REL="NEXT" |
TITLE="SDL_WaitThread" |
HREF="sdlwaitthread.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="sdlthreadid.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwaitthread.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETTHREADID" |
>SDL_GetThreadID</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7194" |
></A |
><H2 |
>Name</H2 |
>SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7197" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7198" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_GetThreadID</B |
></CODE |
>(SDL_Thread *thread);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7204" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the ID of a <SPAN |
CLASS="STRUCTNAME" |
>SDL_Thread</SPAN |
> created by <A |
HREF="sdlcreatethread.html" |
>SDL_CreateThread</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7209" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatethread.html" |
>SDL_CreateThread</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="sdlthreadid.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="sdlwaitthread.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_ThreadID</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WaitThread</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetticks.html |
---|
0,0 → 1,198 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetTicks</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Time" |
HREF="time.html"><LINK |
REL="PREVIOUS" |
TITLE="Time" |
HREF="time.html"><LINK |
REL="NEXT" |
TITLE="SDL_Delay" |
HREF="sdldelay.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="time.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdldelay.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETTICKS" |
>SDL_GetTicks</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7884" |
></A |
><H2 |
>Name</H2 |
>SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7887" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7888" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_GetTicks</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7894" |
></A |
><H2 |
>Description</H2 |
><P |
>Get the number of milliseconds since the SDL library initialization. |
Note that this value wraps if the program runs for more than ~49 days.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7897" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdldelay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Delay</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="time.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="sdldelay.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>Time</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="time.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Delay</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetvideoinfo.html |
---|
0,0 → 1,218 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetVideoInfo</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetVideoSurface" |
HREF="sdlgetvideosurface.html"><LINK |
REL="NEXT" |
TITLE="SDL_VideoDriverName" |
HREF="sdlvideodrivername.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="sdlgetvideosurface.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlvideodrivername.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETVIDEOINFO" |
>SDL_GetVideoInfo</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN695" |
></A |
><H2 |
>Name</H2 |
>SDL_GetVideoInfo -- returns a pointer to information about the video hardware</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN698" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN699" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_VideoInfo *<B |
CLASS="FSFUNC" |
>SDL_GetVideoInfo</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN705" |
></A |
><H2 |
>Description</H2 |
><P |
>This function returns a read-only pointer to <A |
HREF="sdlvideoinfo.html" |
>information</A |
> about the video |
hardware. If this is called before <A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
>, the |
<TT |
CLASS="STRUCTFIELD" |
><I |
>vfmt</I |
></TT |
> member of the returned structure will contain the |
pixel format of the "best" video mode.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN711" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdlvideoinfo.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_VideoInfo</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="sdlgetvideosurface.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="sdlvideodrivername.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetVideoSurface</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_VideoDriverName</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlgetvideosurface.html |
---|
0,0 → 1,200 |
<HTML |
><HEAD |
><TITLE |
>SDL_GetVideoSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetVideoInfo" |
HREF="sdlgetvideoinfo.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="video.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetvideoinfo.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGETVIDEOSURFACE" |
>SDL_GetVideoSurface</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN673" |
></A |
><H2 |
>Name</H2 |
>SDL_GetVideoSurface -- returns a pointer to the current display surface</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN676" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN677" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_Surface *<B |
CLASS="FSFUNC" |
>SDL_GetVideoSurface</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN683" |
></A |
><H2 |
>Description</H2 |
><P |
>This function returns a pointer to the current display surface. |
If SDL is doing format conversion on the display surface, this |
function returns the publicly visible surface, not the real video |
surface.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN686" |
></A |
><H2 |
>See Also</H2 |
><P |
><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="video.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="sdlgetvideoinfo.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>Video</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetVideoInfo</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlglattr.html |
---|
0,0 → 1,368 |
<HTML |
><HEAD |
><TITLE |
>SDL_GLattr</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_FreeYUVOverlay" |
HREF="sdlfreeyuvoverlay.html"><LINK |
REL="NEXT" |
TITLE="SDL_Rect" |
HREF="sdlrect.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="sdlfreeyuvoverlay.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlrect.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGLATTR" |
>SDL_GLattr</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2549" |
></A |
><H2 |
>Name</H2 |
>SDL_GLattr -- SDL GL Attributes</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2552" |
></A |
><H2 |
>Attributes</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2554" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_RED_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the framebuffer red component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_GREEN_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the framebuffer green component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_BLUE_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the framebuffer blue component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_ALPHA_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the framebuffer alpha component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_DOUBLEBUFFER</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>0 or 1, enable or disable double buffering</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_BUFFER_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the framebuffer, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_DEPTH_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the depth buffer, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_STENCIL_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the stencil buffer, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_ACCUM_RED_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the accumulation buffer red component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_ACCUM_GREEN_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the accumulation buffer green component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_ACCUM_BLUE_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the accumulation buffer blue component, in bits</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_GL_ACCUM_ALPHA_SIZE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Size of the accumulation buffer alpha component, in bits</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2605" |
></A |
><H2 |
>Description</H2 |
><P |
>While you can set most OpenGL attributes normally, the attributes list above must be known <I |
CLASS="EMPHASIS" |
>before</I |
> SDL sets the video mode. These attributes a set and read with <A |
HREF="sdlglsetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SetAttribute</TT |
></A |
> and <A |
HREF="sdlglgetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetAttribute</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2613" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlglsetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SetAttribute</TT |
></A |
>, |
<A |
HREF="sdlglgetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetAttribute</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="sdlfreeyuvoverlay.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="sdlrect.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_FreeYUVOverlay</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Rect</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlglgetattribute.html |
---|
0,0 → 1,239 |
<HTML |
><HEAD |
><TITLE |
>SDL_GL_GetAttribute</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GL_GetProcAddress" |
HREF="sdlglgetprocaddress.html"><LINK |
REL="NEXT" |
TITLE="SDL_GL_SetAttribute" |
HREF="sdlglsetattribute.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="sdlglgetprocaddress.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlglsetattribute.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGLGETATTRIBUTE" |
>SDL_GL_GetAttribute</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2289" |
></A |
><H2 |
>Name</H2 |
>SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2292" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2293" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_GL_GetAttribute</B |
></CODE |
>(SDLGLattr attr, int *value);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2299" |
></A |
><H2 |
>Description</H2 |
><P |
>Places the value of the SDL/OpenGL <A |
HREF="sdlglattr.html" |
>attribute</A |
> <TT |
CLASS="PARAMETER" |
><I |
>attr</I |
></TT |
> into <TT |
CLASS="PARAMETER" |
><I |
>value</I |
></TT |
>. This is useful after a call to <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
> to check whether your attributes have been <A |
HREF="sdlglsetattribute.html" |
>set</A |
> as you expected.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2308" |
></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="AEN2313" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlglsetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SetAttribute</TT |
></A |
>, |
<A |
HREF="sdlglattr.html" |
>GL Attributes</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="sdlglgetprocaddress.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="sdlglsetattribute.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GL_GetProcAddress</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GL_SetAttribute</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlglgetprocaddress.html |
---|
0,0 → 1,251 |
<HTML |
><HEAD |
><TITLE |
>SDL_GL_GetProcAddress</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GL_LoadLibrary" |
HREF="sdlglloadlibrary.html"><LINK |
REL="NEXT" |
TITLE="SDL_GL_GetAttribute" |
HREF="sdlglgetattribute.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="sdlglloadlibrary.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlglgetattribute.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGLGETPROCADDRESS" |
>SDL_GL_GetProcAddress</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2259" |
></A |
><H2 |
>Name</H2 |
>SDL_GL_GetProcAddress -- Get the address of a GL function</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2262" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2263" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void *<B |
CLASS="FSFUNC" |
>SDL_GL_GetProcAddress</B |
></CODE |
>(const char* proc);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2269" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the address of the GL function <TT |
CLASS="PARAMETER" |
><I |
>proc</I |
></TT |
>, or <SPAN |
CLASS="RETURNVALUE" |
>NULL</SPAN |
> if the function is not found. If the GL library is loaded at runtime, with <A |
HREF="sdlglloadlibrary.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_LoadLibrary</TT |
></A |
>, then <I |
CLASS="EMPHASIS" |
>all</I |
> GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2277" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef void (*GL_ActiveTextureARB_Func)(unsigned int); |
GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0; |
int has_multitexture=1; |
. |
. |
. |
/* Get function pointer */ |
glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB"); |
/* Check for a valid function ptr */ |
if(!glActiveTextureARB_ptr){ |
fprintf(stderr, "Multitexture Extensions not present.\n"); |
has_multitexture=0; |
} |
. |
. |
. |
. |
if(has_multitexture){ |
glActiveTextureARB_ptr(GL_TEXTURE0_ARB); |
. |
. |
} |
else{ |
. |
. |
}</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2280" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlglloadlibrary.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_LoadLibrary</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="sdlglloadlibrary.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="sdlglgetattribute.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GL_LoadLibrary</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GL_GetAttribute</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlglloadlibrary.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_GL_LoadLibrary</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_ShowCursor" |
HREF="sdlshowcursor.html"><LINK |
REL="NEXT" |
TITLE="SDL_GL_GetProcAddress" |
HREF="sdlglgetprocaddress.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="sdlshowcursor.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlglgetprocaddress.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGLLOADLIBRARY" |
>SDL_GL_LoadLibrary</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2229" |
></A |
><H2 |
>Name</H2 |
>SDL_GL_LoadLibrary -- Specify an OpenGL library</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2232" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2233" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_GL_LoadLibrary</B |
></CODE |
>(const char *path);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2239" |
></A |
><H2 |
>Description</H2 |
><P |
>If you wish, you may load the OpenGL library at runtime, this must be done before <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
> is called. The <TT |
CLASS="PARAMETER" |
><I |
>path</I |
></TT |
> of the GL library is passed to <TT |
CLASS="FUNCTION" |
>SDL_GL_LoadLibrary</TT |
> and it returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success, or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on an error. You must then use <A |
HREF="sdlglgetprocaddress.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetProcAddress</TT |
></A |
> to retrieve function pointers to GL functions.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2250" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlglgetprocaddress.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetProcAddress</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="sdlshowcursor.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="sdlglgetprocaddress.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_ShowCursor</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GL_GetProcAddress</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlglsetattribute.html |
---|
0,0 → 1,278 |
<HTML |
><HEAD |
><TITLE |
>SDL_GL_SetAttribute</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GL_GetAttribute" |
HREF="sdlglgetattribute.html"><LINK |
REL="NEXT" |
TITLE="SDL_GL_SwapBuffers" |
HREF="sdlglswapbuffers.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="sdlglgetattribute.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlglswapbuffers.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGLSETATTRIBUTE" |
>SDL_GL_SetAttribute</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2323" |
></A |
><H2 |
>Name</H2 |
>SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2326" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2327" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_GL_SetAttribute</B |
></CODE |
>(SDL_GLattr attr, int value);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2333" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the OpenGL <A |
HREF="sdlglattr.html" |
>attribute</A |
> <TT |
CLASS="PARAMETER" |
><I |
>attr</I |
></TT |
> to <TT |
CLASS="PARAMETER" |
><I |
>value</I |
></TT |
>. The attributes you set don't take effect until after a call to <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>. You should use <A |
HREF="sdlglgetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetAttribute</TT |
></A |
> to check the values after a <TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
> call.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2344" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success, or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2349" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>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 ); |
if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) { |
fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); |
SDL_Quit(); |
return; |
}</PRE |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>The <TT |
CLASS="LITERAL" |
>SDL_DOUBLEBUF</TT |
> flag is not required to enable double buffering when setting an OpenGL video mode. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2355" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlglgetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_GetAttribute</TT |
></A |
>, |
<A |
HREF="sdlglattr.html" |
>GL Attributes</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="sdlglgetattribute.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="sdlglswapbuffers.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GL_GetAttribute</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GL_SwapBuffers</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlglswapbuffers.html |
---|
0,0 → 1,204 |
<HTML |
><HEAD |
><TITLE |
>SDL_GL_SwapBuffers</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GL_SetAttribute" |
HREF="sdlglsetattribute.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateYUVOverlay" |
HREF="sdlcreateyuvoverlay.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="sdlglsetattribute.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreateyuvoverlay.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLGLSWAPBUFFERS" |
>SDL_GL_SwapBuffers</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2365" |
></A |
><H2 |
>Name</H2 |
>SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2368" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2369" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_GL_SwapBuffers</B |
></CODE |
>(void );</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2375" |
></A |
><H2 |
>Description</H2 |
><P |
>Swap the OpenGL buffers, if double-buffering is supported.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2378" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdlglsetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SetAttribute</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="sdlglsetattribute.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="sdlcreateyuvoverlay.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GL_SetAttribute</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateYUVOverlay</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlinit.html |
---|
0,0 → 1,360 |
<HTML |
><HEAD |
><TITLE |
>SDL_Init</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="General" |
HREF="general.html"><LINK |
REL="PREVIOUS" |
TITLE="General" |
HREF="general.html"><LINK |
REL="NEXT" |
TITLE="SDL_InitSubSystem" |
HREF="sdlinitsubsystem.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="general.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlinitsubsystem.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLINIT" |
>SDL_Init</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN440" |
></A |
><H2 |
>Name</H2 |
>SDL_Init -- Initializes SDL</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN443" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN444" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_Init</B |
></CODE |
>(Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN450" |
></A |
><H2 |
>Description</H2 |
><P |
>Initializes SDL. This should be called before all other SDL functions. The <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> parameter specifies what part(s) of SDL to initialize.</P |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN454" |
></A |
><P |
></P |
><TABLE |
BORDER="1" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_TIMER</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Initializes the <A |
HREF="time.html" |
>timer</A |
> subsystem.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_AUDIO</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Initializes the <A |
HREF="audio.html" |
>audio</A |
> subsystem.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_VIDEO</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Initializes the <A |
HREF="video.html" |
>video</A |
> subsystem.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_CDROM</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Initializes the <A |
HREF="cdrom.html" |
>cdrom</A |
> subsystem.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_JOYSTICK</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Initializes the <A |
HREF="joystick.html" |
>joystick</A |
> subsystem.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_EVERYTHING</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Initialize all of the above.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_NOPARACHUTE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Prevents SDL from catching fatal signals.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_INIT_EVENTTHREAD</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN494" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on an error or <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN499" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlquit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Quit</TT |
></A |
>, |
<A |
HREF="sdlinitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_InitSubSystem</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="general.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="sdlinitsubsystem.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>General</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="general.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_InitSubSystem</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlinitsubsystem.html |
---|
0,0 → 1,275 |
<HTML |
><HEAD |
><TITLE |
>SDL_InitSubSystem</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="General" |
HREF="general.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Init" |
HREF="sdlinit.html"><LINK |
REL="NEXT" |
TITLE="SDL_QuitSubSystem" |
HREF="sdlquitsubsystem.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="sdlinit.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlquitsubsystem.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLINITSUBSYSTEM" |
>SDL_InitSubSystem</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN510" |
></A |
><H2 |
>Name</H2 |
>SDL_InitSubSystem -- Initialize subsystems</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN513" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN514" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_InitSubSystem</B |
></CODE |
>(Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN520" |
></A |
><H2 |
>Description</H2 |
><P |
>After SDL has been initialized with <A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
> you may initialize uninitialized subsystems with <TT |
CLASS="FUNCTION" |
>SDL_InitSubSystem</TT |
>. The <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> parameter is the same as that used in <A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN529" |
></A |
><H2 |
>Examples</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>/* Seperating Joystick and Video initialization. */ |
SDL_Init(SDL_INIT_VIDEO); |
. |
. |
SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN); |
. |
/* Do Some Video stuff */ |
. |
. |
/* Initialize the joystick subsystem */ |
SDL_InitSubSystem(SDL_INIT_JOYSTICK); |
/* Do some stuff with video and joystick */ |
. |
. |
. |
/* Shut them both down */ |
SDL_Quit();</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN532" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on an error or <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN537" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
>, |
<A |
HREF="sdlquit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Quit</TT |
></A |
>, |
<A |
HREF="sdlquitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_QuitSubSystem</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="sdlinit.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="sdlquitsubsystem.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Init</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="general.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_QuitSubSystem</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoyaxisevent.html |
---|
0,0 → 1,322 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoyAxisEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_MouseButtonEvent" |
HREF="sdlmousebuttonevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoyButtonEvent" |
HREF="sdljoybuttonevent.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="sdlmousebuttonevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoybuttonevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYAXISEVENT" |
>SDL_JoyAxisEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3770" |
></A |
><H2 |
>Name</H2 |
>SDL_JoyAxisEvent -- Joystick axis motion event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3773" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 which; |
Uint8 axis; |
Sint16 value; |
} SDL_JoyAxisEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3776" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3778" |
></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_JOYAXISMOTION</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick device index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>axis</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick axis index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>value</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Axis value (range: -32768 to 32767)</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3798" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyAxisEvent</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_JOYAXISMOTION</TT |
> is reported.</P |
><P |
>A <TT |
CLASS="LITERAL" |
>SDL_JOYAXISMOTION</TT |
> event occurs when ever a user moves an axis on the joystick. The field <TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
> is the index of the joystick that reported the event and <TT |
CLASS="STRUCTFIELD" |
><I |
>axis</I |
></TT |
> is the index of the axis (for a more detailed explaination see the <A |
HREF="joystick.html" |
>Joystick section</A |
>). <TT |
CLASS="STRUCTFIELD" |
><I |
>value</I |
></TT |
> is the current position of the axis.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3811" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="joystick.html" |
>Joystick Functions</A |
>, |
<A |
HREF="sdljoystickeventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickEventState</TT |
></A |
>, |
<A |
HREF="sdljoystickgetaxis.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetAxis</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="sdlmousebuttonevent.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="sdljoybuttonevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_MouseButtonEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoyButtonEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoyballevent.html |
---|
0,0 → 1,332 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoyBallEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_JoyHatEvent" |
HREF="sdljoyhatevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_ResizeEvent" |
HREF="sdlresizeevent.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="sdljoyhatevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlresizeevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYBALLEVENT" |
>SDL_JoyBallEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3963" |
></A |
><H2 |
>Name</H2 |
>SDL_JoyBallEvent -- Joystick trackball motion event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3966" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 which; |
Uint8 ball; |
Sint16 xrel, yrel; |
} SDL_JoyBallEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3969" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3971" |
></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_JOYBALLMOTION</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick device index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>ball</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick trackball index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>xrel</I |
></TT |
>, <TT |
CLASS="STRUCTFIELD" |
><I |
>yrel</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The relative motion in the X/Y direction</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3992" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyBallEvent</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_JOYBALLMOTION</TT |
> is reported.</P |
><P |
>A <TT |
CLASS="LITERAL" |
>SDL_JOYBALLMOTION</TT |
> event occurs when a user moves a trackball on the joystick. The field <TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
> is the index of the joystick that reported the event and <TT |
CLASS="STRUCTFIELD" |
><I |
>ball</I |
></TT |
> is the index of the trackball (for a more detailed explaination see the <A |
HREF="joystick.html" |
>Joystick section</A |
>). Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in <TT |
CLASS="STRUCTFIELD" |
><I |
>xrel</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>yrel</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4006" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="joystick.html" |
>Joystick Functions</A |
>, |
<A |
HREF="sdljoystickeventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickEventState</TT |
></A |
>, |
<A |
HREF="sdljoystickgetball.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetBall</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="sdljoyhatevent.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="sdlresizeevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoyHatEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_ResizeEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoybuttonevent.html |
---|
0,0 → 1,343 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoyButtonEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_JoyAxisEvent" |
HREF="sdljoyaxisevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoyHatEvent" |
HREF="sdljoyhatevent.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="sdljoyaxisevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoyhatevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYBUTTONEVENT" |
>SDL_JoyButtonEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3825" |
></A |
><H2 |
>Name</H2 |
>SDL_JoyButtonEvent -- Joystick button event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3828" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 which; |
Uint8 button; |
Uint8 state; |
} SDL_JoyButtonEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3831" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3833" |
></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_JOYBUTTONDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_JOYBUTTONUP</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick device index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>button</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick button index</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_PRESSED</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_RELEASED</TT |
></TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3856" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyButtonEvent</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_JOYBUTTONDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_JOYBUTTONUP</TT |
> is reported.</P |
><P |
>A <TT |
CLASS="LITERAL" |
>SDL_JOYBUTTONDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_JOYBUTTONUP</TT |
> event occurs when ever a user presses or releases a button on a joystick. The field <TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
> is the index of the joystick that reported the event and <TT |
CLASS="STRUCTFIELD" |
><I |
>button</I |
></TT |
> is the index of the button (for a more detailed explaination see the <A |
HREF="joystick.html" |
>Joystick section</A |
>). <TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
> is the current state or the button which is either <TT |
CLASS="LITERAL" |
>SDL_PRESSED</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_RELEASED</TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3873" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="joystick.html" |
>Joystick Functions</A |
>, |
<A |
HREF="sdljoystickeventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickEventState</TT |
></A |
>, |
<A |
HREF="sdljoystickgetbutton.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetButton</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="sdljoyaxisevent.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="sdljoyhatevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoyAxisEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoyHatEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoyhatevent.html |
---|
0,0 → 1,405 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoyHatEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_JoyButtonEvent" |
HREF="sdljoybuttonevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoyBallEvent" |
HREF="sdljoyballevent.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="sdljoybuttonevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoyballevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYHATEVENT" |
>SDL_JoyHatEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3887" |
></A |
><H2 |
>Name</H2 |
>SDL_JoyHatEvent -- Joystick hat position change event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3890" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 which; |
Uint8 hat; |
Uint8 value; |
} SDL_JoyHatEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3893" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3895" |
></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_JOY</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick device index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>hat</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Joystick hat index</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>value</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Hat position</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3915" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyHatEvent</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_JOYHATMOTION</TT |
> is reported.</P |
><P |
>A <TT |
CLASS="LITERAL" |
>SDL_JOYHATMOTION</TT |
> event occurs when ever a user moves a hat on the joystick. The field <TT |
CLASS="STRUCTFIELD" |
><I |
>which</I |
></TT |
> is the index of the joystick that reported the event and <TT |
CLASS="STRUCTFIELD" |
><I |
>hat</I |
></TT |
> is the index of the hat (for a more detailed exlaination see the <A |
HREF="joystick.html" |
>Joystick section</A |
>). <TT |
CLASS="STRUCTFIELD" |
><I |
>value</I |
></TT |
> is the current position of the hat. It is a logically OR'd combination of the following values (whose meanings should be pretty obvious:) :</P |
><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 |
><P |
>The following defines are also provided:</P |
><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 |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3949" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="joystick.html" |
>Joystick Functions</A |
>, |
<A |
HREF="sdljoystickeventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickEventState</TT |
></A |
>, |
<A |
HREF="sdljoystickgetball.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetHat</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="sdljoybuttonevent.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="sdljoyballevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoyButtonEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoyBallEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickclose.html |
---|
0,0 → 1,215 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickClose</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickGetBall" |
HREF="sdljoystickgetball.html"><LINK |
REL="NEXT" |
TITLE="Audio" |
HREF="audio.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="sdljoystickgetball.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="audio.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKCLOSE" |
>SDL_JoystickClose</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5922" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickClose -- Closes a previously opened joystick</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5925" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5926" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_JoystickClose</B |
></CODE |
>(SDL_Joystick *joystick);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5932" |
></A |
><H2 |
>Description</H2 |
><P |
>Close a <TT |
CLASS="PARAMETER" |
><I |
>joystick</I |
></TT |
> that was previously opened with <A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5938" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</TT |
></A |
>, |
<A |
HREF="sdljoystickopened.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpened</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="sdljoystickgetball.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="audio.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickGetBall</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Audio</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickeventstate.html |
---|
0,0 → 1,282 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickEventState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetAppState" |
HREF="sdlgetappstate.html"><LINK |
REL="NEXT" |
TITLE="Joystick" |
HREF="joystick.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="sdlgetappstate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="joystick.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKEVENTSTATE" |
>SDL_JoystickEventState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5422" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickEventState -- Enable/disable joystick event polling</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5425" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5426" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickEventState</B |
></CODE |
>(int state);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5432" |
></A |
><H2 |
>Description</H2 |
><P |
>This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick states with <A |
HREF="sdljoystickupdate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickUpdate</TT |
></A |
> and read the joystick information manually. <TT |
CLASS="PARAMETER" |
><I |
>state</I |
></TT |
> is either <TT |
CLASS="LITERAL" |
>SDL_QUERY</TT |
>, <TT |
CLASS="LITERAL" |
>SDL_ENABLE</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_IGNORE</TT |
>.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Joystick event handling is prefered</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5443" |
></A |
><H2 |
>Return Value</H2 |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>state</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>SDL_QUERY</TT |
> then the current state is returned, otherwise the new processing <TT |
CLASS="PARAMETER" |
><I |
>state</I |
></TT |
> is returned.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5449" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="joystick.html" |
>SDL Joystick Functions</A |
>, |
<A |
HREF="sdljoystickupdate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickUpdate</TT |
></A |
>, |
<A |
HREF="sdljoyaxisevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyAxisEvent</SPAN |
></A |
>, |
<A |
HREF="sdljoyballevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyBallEvent</SPAN |
></A |
>, |
<A |
HREF="sdljoybuttonevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyButtonEvent</SPAN |
></A |
>, |
<A |
HREF="sdljoyhatevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_JoyHatEvent</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="sdlgetappstate.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="joystick.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetAppState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Joystick</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickgetaxis.html |
---|
0,0 → 1,263 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickGetAxis</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickUpdate" |
HREF="sdljoystickupdate.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickGetHat" |
HREF="sdljoystickgethat.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="sdljoystickupdate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickgethat.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKGETAXIS" |
>SDL_JoystickGetAxis</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5773" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickGetAxis -- Get the current state of an axis</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5776" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5777" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Sint16 <B |
CLASS="FSFUNC" |
>SDL_JoystickGetAxis</B |
></CODE |
>(SDL_Joystick *joystick, int axis);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5783" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetAxis</TT |
> returns the current state of the given <TT |
CLASS="PARAMETER" |
><I |
>axis</I |
></TT |
> on the given <TT |
CLASS="PARAMETER" |
><I |
>joystick</I |
></TT |
>.</P |
><P |
>On most modern joysticks the X axis is usually represented by <TT |
CLASS="PARAMETER" |
><I |
>axis</I |
></TT |
> 0 and the Y axis by <TT |
CLASS="PARAMETER" |
><I |
>axis</I |
></TT |
> 1. The value returned by <TT |
CLASS="FUNCTION" |
>SDL_JoystickGetAxis</TT |
> is a signed integer (-32768 to 32768) representing the current position of the <TT |
CLASS="PARAMETER" |
><I |
>axis</I |
></TT |
>, it maybe necessary to impose certain tolerances on these values to account for jitter. It is worth noting that some joysticks use axes 2 and 3 for extra buttons.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5794" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns a 16-bit signed integer representing the current position of the <TT |
CLASS="PARAMETER" |
><I |
>axis</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5798" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>Sint16 x_move, y_move; |
SDL_Joystick *joy1; |
. |
. |
x_move=SDL_JoystickGetAxis(joy1, 0); |
y_move=SDL_JoystickGetAxis(joy1, 1);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5802" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoysticknumaxes.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumAxes</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="sdljoystickupdate.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="sdljoystickgethat.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickUpdate</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickGetHat</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickgetball.html |
---|
0,0 → 1,254 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickGetBall</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickGetButton" |
HREF="sdljoystickgetbutton.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickClose" |
HREF="sdljoystickclose.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="sdljoystickgetbutton.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickclose.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKGETBALL" |
>SDL_JoystickGetBall</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5886" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickGetBall -- Get relative trackball motion</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5889" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5890" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickGetBall</B |
></CODE |
>(SDL_Joystick *joystick, int ball, int *dx, int *dy);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5896" |
></A |
><H2 |
>Description</H2 |
><P |
>Get the <TT |
CLASS="PARAMETER" |
><I |
>ball</I |
></TT |
> axis change.</P |
><P |
>Trackballs can only return relative motion since the last call to <TT |
CLASS="FUNCTION" |
>SDL_JoystickGetBall</TT |
>, these motion deltas a placed into <TT |
CLASS="PARAMETER" |
><I |
>dx</I |
></TT |
> and <TT |
CLASS="PARAMETER" |
><I |
>dy</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5904" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on failure</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5909" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>int delta_x, delta_y; |
SDL_Joystick *joy; |
. |
. |
. |
SDL_JoystickUpdate(); |
if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1) |
printf("TrackBall Read Error!\n"); |
printf("Trackball Delta- X:%d, Y:%d\n", delta_x, delta_y);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5913" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoysticknumballs.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumBalls</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="sdljoystickgetbutton.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="sdljoystickclose.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickGetButton</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickClose</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickgetbutton.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickGetButton</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickGetHat" |
HREF="sdljoystickgethat.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickGetBall" |
HREF="sdljoystickgetball.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="sdljoystickgethat.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickgetball.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKGETBUTTON" |
>SDL_JoystickGetButton</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5857" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickGetButton -- Get the current state of a given button on a given joystick</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5860" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5861" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint8 <B |
CLASS="FSFUNC" |
>SDL_JoystickGetButton</B |
></CODE |
>(SDL_Joystick *joystick, int button);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5867" |
></A |
><H2 |
>Description</H2 |
><P |
>SDL_JoystickGetButton returns the current state of the given <TT |
CLASS="PARAMETER" |
><I |
>button</I |
></TT |
> on the given <TT |
CLASS="PARAMETER" |
><I |
>joystick</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5872" |
></A |
><H2 |
>Return Value</H2 |
><P |
><SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
> if the button is pressed. Otherwise, <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5877" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoysticknumbuttons.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumButtons</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="sdljoystickgethat.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="sdljoystickgetball.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickGetHat</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickGetBall</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickgethat.html |
---|
0,0 → 1,289 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickGetHat</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickGetAxis" |
HREF="sdljoystickgetaxis.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickGetButton" |
HREF="sdljoystickgetbutton.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="sdljoystickgetaxis.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickgetbutton.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKGETHAT" |
>SDL_JoystickGetHat</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5811" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickGetHat -- Get the current state of a joystick hat</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5814" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5815" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint8 <B |
CLASS="FSFUNC" |
>SDL_JoystickGetHat</B |
></CODE |
>(SDL_Joystick *joystick, int hat);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5821" |
></A |
><H2 |
>Description</H2 |
><P |
>SDL_JoystickGetHat returns the current state of the given <TT |
CLASS="PARAMETER" |
><I |
>hat</I |
></TT |
> on the given <TT |
CLASS="PARAMETER" |
><I |
>joystick</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5826" |
></A |
><H2 |
>Return Value</H2 |
><P |
>The current state is returned as a Uint8 which is defined as an OR'd combination of one or more of the following</P |
><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 |
><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 |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5848" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoysticknumhats.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickNumHats</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="sdljoystickgetaxis.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="sdljoystickgetbutton.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickGetAxis</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickGetButton</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickindex.html |
---|
0,0 → 1,210 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickIndex</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickOpened" |
HREF="sdljoystickopened.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickNumAxes" |
HREF="sdljoysticknumaxes.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="sdljoystickopened.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoysticknumaxes.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKINDEX" |
>SDL_JoystickIndex</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5611" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickIndex -- Get the index of an SDL_Joystick.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5614" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5615" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickIndex</B |
></CODE |
>(SDL_Joystick *joystick);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5621" |
></A |
><H2 |
>Description</H2 |
><P |
>Returns the index of a given <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
> structure.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5625" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Index number of the joystick.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5628" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="sdljoystickopened.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="sdljoysticknumaxes.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickOpened</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickNumAxes</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickname.html |
---|
0,0 → 1,230 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickName</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_NumJoysticks" |
HREF="sdlnumjoysticks.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickOpen" |
HREF="sdljoystickopen.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="sdlnumjoysticks.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickopen.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKNAME" |
>SDL_JoystickName</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5519" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickName -- Get joystick name.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5522" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5523" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>const char *<B |
CLASS="FSFUNC" |
>SDL_JoystickName</B |
></CODE |
>(int index);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5529" |
></A |
><H2 |
>Description</H2 |
><P |
>Get the implementation dependent name of joystick. The <TT |
CLASS="PARAMETER" |
><I |
>index</I |
></TT |
> parameter refers to the N'th joystick on the system.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5533" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns a char pointer to the joystick name.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5536" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>/* Print the names of all attached joysticks */ |
int num_joy, i; |
num_joy=SDL_NumJoysticks(); |
printf("%d joysticks found\n", num_joy); |
for(i=0;i<num_joy;i++) |
printf("%s\n", SDL_JoystickName(i);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5540" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="sdlnumjoysticks.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="sdljoystickopen.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_NumJoysticks</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickOpen</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoysticknumaxes.html |
---|
0,0 → 1,217 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickNumAxes</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickIndex" |
HREF="sdljoystickindex.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickNumBalls" |
HREF="sdljoysticknumballs.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="sdljoystickindex.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoysticknumballs.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKNUMAXES" |
>SDL_JoystickNumAxes</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5637" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickNumAxes -- Get the number of joystick axes</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5640" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5641" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickNumAxes</B |
></CODE |
>(SDL_Joystick *joystick);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5647" |
></A |
><H2 |
>Description</H2 |
><P |
>Return the number of axes available from a previously opened <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5651" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Number of axes.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5654" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickgetaxis.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetAxis</TT |
></A |
>, |
<A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="sdljoystickindex.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="sdljoysticknumballs.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickIndex</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickNumBalls</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoysticknumballs.html |
---|
0,0 → 1,217 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickNumBalls</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickNumAxes" |
HREF="sdljoysticknumaxes.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickNumHats" |
HREF="sdljoysticknumhats.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="sdljoysticknumaxes.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoysticknumhats.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKNUMBALLS" |
>SDL_JoystickNumBalls</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5665" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickNumBalls -- Get the number of joystick trackballs</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5668" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5669" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickNumBalls</B |
></CODE |
>(SDL_Joystick *joystick);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5675" |
></A |
><H2 |
>Description</H2 |
><P |
>Return the number of trackballs available from a previously opened <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5679" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Number of trackballs.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5682" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickgetball.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetBall</TT |
></A |
>, |
<A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="sdljoysticknumaxes.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="sdljoysticknumhats.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickNumAxes</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickNumHats</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoysticknumbuttons.html |
---|
0,0 → 1,217 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickNumButtons</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickNumHats" |
HREF="sdljoysticknumhats.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickUpdate" |
HREF="sdljoystickupdate.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="sdljoysticknumhats.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickupdate.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKNUMBUTTONS" |
>SDL_JoystickNumButtons</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5721" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickNumButtons -- Get the number of joysitck buttons</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5724" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5725" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickNumButtons</B |
></CODE |
>(SDL_Joystick *joystick);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5731" |
></A |
><H2 |
>Description</H2 |
><P |
>Return the number of buttons available from a previously opened <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5735" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Number of buttons.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5738" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickgetbutton.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetButton</TT |
></A |
>, |
<A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="sdljoysticknumhats.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="sdljoystickupdate.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickNumHats</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickUpdate</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoysticknumhats.html |
---|
0,0 → 1,217 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickNumHats</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickNumBalls" |
HREF="sdljoysticknumballs.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickNumButtons" |
HREF="sdljoysticknumbuttons.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="sdljoysticknumballs.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoysticknumbuttons.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKNUMHATS" |
>SDL_JoystickNumHats</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5693" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickNumHats -- Get the number of joystick hats</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5696" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5697" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickNumHats</B |
></CODE |
>(SDL_Joystick *joystick);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5703" |
></A |
><H2 |
>Description</H2 |
><P |
>Return the number of hats available from a previously opened <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5707" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Number of hats.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5710" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickgethat.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickGetHat</TT |
></A |
>, |
<A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="sdljoysticknumballs.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="sdljoysticknumbuttons.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickNumBalls</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickNumButtons</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickopen.html |
---|
0,0 → 1,251 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickOpen</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickName" |
HREF="sdljoystickname.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickOpened" |
HREF="sdljoystickopened.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="sdljoystickname.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickopened.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKOPEN" |
>SDL_JoystickOpen</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5549" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickOpen -- Opens a joystick for use.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5552" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5553" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_Joystick *<B |
CLASS="FSFUNC" |
>SDL_JoystickOpen</B |
></CODE |
>(int index);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5559" |
></A |
><H2 |
>Description</H2 |
><P |
>Opens a joystick for use within SDL. The <TT |
CLASS="PARAMETER" |
><I |
>index</I |
></TT |
> refers to the N'th joystick in the system. A joystick must be opened before it game be used.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5563" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns a <SPAN |
CLASS="STRUCTNAME" |
>SDL_Joystick</SPAN |
> structure on success. <SPAN |
CLASS="RETURNVALUE" |
>NULL</SPAN |
> on failure.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5568" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_Joystick *joy; |
// Check for joystick |
if(SDL_NumJoysticks()>0){ |
// Open joystick |
joy=SDL_JoystickOpen(0); |
if(joy) |
{ |
printf("Opened Joystick 0\n"); |
printf("Name: %s\n", SDL_JoystickName(0)); |
printf("Number of Axes: %s\n", SDL_JoystickNumAxes(joy)); |
printf("Number of Buttons: %s\n", SDL_JoystickNumButtons(joy)); |
printf("Number of Balls: %s\n", SDL_JoystickNumBalls(joy)); |
} |
else |
printf("Couldn't open Joystick 0\n"); |
// Close if opened |
if(SDL_JoystickOpened(0)) |
SDL_JoystickClose(joy); |
}</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5572" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickclose.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickClose</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="sdljoystickname.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="sdljoystickopened.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickName</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickOpened</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickopened.html |
---|
0,0 → 1,225 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickOpened</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickOpen" |
HREF="sdljoystickopen.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickIndex" |
HREF="sdljoystickindex.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="sdljoystickopen.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickindex.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKOPENED" |
>SDL_JoystickOpened</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5581" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickOpened -- Determine if a joystick has been opened</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5584" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5585" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_JoystickOpened</B |
></CODE |
>(int index);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5591" |
></A |
><H2 |
>Description</H2 |
><P |
>Determines whether a joystick has already been opened within the application. <TT |
CLASS="PARAMETER" |
><I |
>index</I |
></TT |
> refers to the N'th joystick on the system.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5595" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
> if the joystick has been opened, or <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if it has not.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5600" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</TT |
></A |
>, |
<A |
HREF="sdljoystickclose.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickClose</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="sdljoystickopen.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="sdljoystickindex.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickOpen</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickIndex</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdljoystickupdate.html |
---|
0,0 → 1,203 |
<HTML |
><HEAD |
><TITLE |
>SDL_JoystickUpdate</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_JoystickNumButtons" |
HREF="sdljoysticknumbuttons.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickGetAxis" |
HREF="sdljoystickgetaxis.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="sdljoysticknumbuttons.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickgetaxis.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLJOYSTICKUPDATE" |
>SDL_JoystickUpdate</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5749" |
></A |
><H2 |
>Name</H2 |
>SDL_JoystickUpdate -- Updates the state of all joysticks</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5752" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5753" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_JoystickUpdate</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5759" |
></A |
><H2 |
>Description</H2 |
><P |
>Updates the state(position, buttons, etc.) of all open joysticks. If joystick events have been enabled with <A |
HREF="sdljoystickeventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickEventState</TT |
></A |
> then this is called automatically in the event loop.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5764" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickeventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickEventState</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="sdljoysticknumbuttons.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="sdljoystickgetaxis.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoystickNumButtons</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickGetAxis</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlkey.html |
---|
0,0 → 1,2622 |
<HTML |
><HEAD |
><TITLE |
>SDLKey</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_keysym" |
HREF="sdlkeysym.html"><LINK |
REL="NEXT" |
TITLE="Event Functions." |
HREF="eventfunctions.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="sdlkeysym.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="eventfunctions.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLKEY" |
>SDLKey</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4246" |
></A |
><H2 |
>Name</H2 |
>SDLKey -- Keysym definitions.</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4249" |
></A |
><H2 |
>Description</H2 |
><P |
> <DIV |
CLASS="TABLE" |
><A |
NAME="AEN4252" |
></A |
><P |
><B |
>Table 8-1. SDL Keysym definitions</B |
></P |
><TABLE |
BORDER="1" |
CLASS="CALSTABLE" |
><THEAD |
><TR |
><TH |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLKey</TH |
><TH |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>ASCII value</TH |
><TH |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Common name</TH |
></TR |
></THEAD |
><TBODY |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_BACKSPACE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'\b'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>backspace</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_TAB</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'\t'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>tab</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_CLEAR</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>clear</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RETURN</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'\r'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>return</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_PAUSE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>pause</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_ESCAPE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'^['</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>escape</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_SPACE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>' '</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>space</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_EXCLAIM</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'!'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>exclaim</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_QUOTEDBL</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'"'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>quotedbl</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_HASH</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'#'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>hash</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_DOLLAR</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'$'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>dollar</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_AMPERSAND</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'&'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>ampersand</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_QUOTE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'''</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>quote</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LEFTPAREN</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'('</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left parenthesis</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RIGHTPAREN</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>')'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right parenthesis</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_ASTERISK</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'*'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>asterisk</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_PLUS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'+'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>plus sign</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_COMMA</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>','</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>comma</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_MINUS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'-'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>minus sign</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_PERIOD</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'.'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>period</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_SLASH</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'/'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>forward slash</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_0</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'0'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>0</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_1</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'1'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>1</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_2</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'2'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>2</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_3</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'3'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>3</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_4</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'4'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>4</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_5</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'5'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>5</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_6</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'6'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>6</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_7</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'7'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>7</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_8</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'8'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>8</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_9</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'9'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>9</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_COLON</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>':'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>colon</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_SEMICOLON</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>';'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>semicolon</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LESS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'<'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>less-than sign</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_EQUALS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'='</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>equals sign</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_GREATER</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'>'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>greater-than sign</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_QUESTION</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'?'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>question mark</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_AT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'@'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>at</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LEFTBRACKET</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'['</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left bracket</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_BACKSLASH</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'\'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>backslash</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RIGHTBRACKET</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>']'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right bracket</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_CARET</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'^'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>caret</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_UNDERSCORE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'_'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>underscore</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_BACKQUOTE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'`'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>grave</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_a</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'a'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>a</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_b</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'b'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>b</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_c</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'c'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>c</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_d</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'d'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>d</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_e</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'e'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>e</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_f</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'f'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>f</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_g</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'g'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>g</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_h</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'h'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>h</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_i</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'i'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>i</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_j</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'j'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>j</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_k</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'k'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>k</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_l</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'l'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>l</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_m</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'m'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>m</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_n</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'n'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>n</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_o</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'o'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>o</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_p</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'p'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>p</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_q</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'q'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>q</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_r</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'r'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>r</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_s</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'s'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>s</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_t</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'t'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>t</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_u</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'u'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>u</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_v</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'v'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>v</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_w</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'w'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>w</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_x</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'x'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>x</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_y</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'y'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>y</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_z</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'z'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>z</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_DELETE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'^?'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>delete</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP0</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 0</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP1</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 1</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP2</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 2</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP3</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 3</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP4</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 4</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP5</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 5</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP6</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 6</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP7</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 7</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP8</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 8</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP9</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad 9</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_PERIOD</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'.'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad period</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_DIVIDE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'/'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad divide</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_MULTIPLY</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'*'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad multiply</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_MINUS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'-'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad minus</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_PLUS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'+'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad plus</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_ENTER</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'\r'</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad enter</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_KP_EQUALS</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>'='</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>keypad equals</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_UP</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>up arrow</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_DOWN</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>down arrow</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RIGHT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right arrow</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LEFT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left arrow</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_INSERT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>insert</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_HOME</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>home</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_END</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>end</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_PAGEUP</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>page up</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_PAGEDOWN</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>page down</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F1</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F1</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F2</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F2</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F3</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F3</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F4</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F4</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F5</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F5</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F6</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F6</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F7</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F7</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F8</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F8</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F9</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F9</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F10</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F10</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F11</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F11</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F12</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F12</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F13</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F13</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F14</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F14</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_F15</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>F15</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_NUMLOCK</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>numlock</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_CAPSLOCK</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>capslock</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_SCROLLOCK</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>scrollock</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RSHIFT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right shift</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LSHIFT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left shift</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RCTRL</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right ctrl</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LCTRL</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left ctrl</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RALT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right alt</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LALT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left alt</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RMETA</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right meta</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LMETA</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left meta</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_LSUPER</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>left windows key</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_RSUPER</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>right windows key</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_MODE</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>mode shift</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_HELP</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>help</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_PRINT</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>print-screen</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_SYSREQ</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SysRq</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_BREAK</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>break</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_MENU</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>menu</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_POWER</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>power</TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDLK_EURO</TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
> </TD |
><TD |
WIDTH="33%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>euro</TD |
></TR |
></TBODY |
></TABLE |
></DIV |
> |
<DIV |
CLASS="TABLE" |
><A |
NAME="SDLMOD" |
></A |
><P |
><B |
>Table 8-2. SDL modifier definitions</B |
></P |
><TABLE |
BORDER="1" |
CLASS="CALSTABLE" |
><THEAD |
><TR |
><TH |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDL Modifier</TH |
><TH |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Meaning</TH |
></TR |
></THEAD |
><TBODY |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_NONE</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>No modifiers applicable</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_NUM</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Numlock is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_CAPS</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Capslock is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_LCTRL</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Left Control is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_RCTRL</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Right Control is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_RSHIFT</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Right Shift is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_LSHIFT</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Left Shift is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_RALT</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Right Alt is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_LALT</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>Left Alt is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_CTRL</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>A Control key is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_SHIFT</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>A Shift key is down</TD |
></TR |
><TR |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>KMOD_ALT</TD |
><TD |
WIDTH="50%" |
ALIGN="LEFT" |
VALIGN="TOP" |
>An Alt key is down</TD |
></TR |
></TBODY |
></TABLE |
></DIV |
> </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="sdlkeysym.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="eventfunctions.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_keysym</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Event Functions.</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlkeyboardevent.html |
---|
0,0 → 1,367 |
<HTML |
><HEAD |
><TITLE |
>SDL_KeyboardEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_ActiveEvent" |
HREF="sdlactiveevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_MouseMotionEvent" |
HREF="sdlmousemotionevent.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="sdlactiveevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlmousemotionevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLKEYBOARDEVENT" |
>SDL_KeyboardEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3578" |
></A |
><H2 |
>Name</H2 |
>SDL_KeyboardEvent -- Keyboard event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3581" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 state; |
SDL_keysym keysym; |
} SDL_KeyboardEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3584" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3586" |
></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_KEYDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_KEYUP</TT |
></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_PRESSED</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_RELEASED</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>keysym</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Contains key press information</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3605" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_KeyboardEvent</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_KEYDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_KEYUP</TT |
> is reported.</P |
><P |
>The <TT |
CLASS="STRUCTFIELD" |
><I |
>type</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
> actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (<TT |
CLASS="STRUCTFIELD" |
><I |
>type</I |
></TT |
>=<TT |
CLASS="LITERAL" |
>SDK_KEYUP</TT |
> or <TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
>=<TT |
CLASS="LITERAL" |
>SDL_RELEASED</TT |
>) and when a key is pressed (<TT |
CLASS="STRUCTFIELD" |
><I |
>type</I |
></TT |
>=<TT |
CLASS="LITERAL" |
>SDL_KEYDOWN</TT |
> or <TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
>=<TT |
CLASS="LITERAL" |
>SDL_PRESSED</TT |
>). The information on what key was pressed or released is in the <A |
HREF="sdlkeysym.html" |
><SPAN |
CLASS="STRUCTNAME" |
>keysym</SPAN |
></A |
> structure.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Repeating <TT |
CLASS="LITERAL" |
>SDL_KEYDOWN</TT |
> events will occur if key repeat is enabled (see <A |
HREF="sdlenablekeyrepeat.html" |
><TT |
CLASS="FUNCTION" |
>SDL_EnableKeyRepeat</TT |
></A |
>).</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3631" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlkeysym.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_keysym</SPAN |
></A |
>, |
<A |
HREF="sdlenablekeyrepeat.html" |
><TT |
CLASS="FUNCTION" |
>SDL_EnableKeyRepeat</TT |
></A |
>, |
<A |
HREF="sdlenableunicode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_EnableUNICODE</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="sdlactiveevent.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="sdlmousemotionevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_ActiveEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_MouseMotionEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlkeysym.html |
---|
0,0 → 1,347 |
<HTML |
><HEAD |
><TITLE |
>SDL_keysym</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_QuitEvent" |
HREF="sdlquitevent.html"><LINK |
REL="NEXT" |
TITLE="SDLKey" |
HREF="sdlkey.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="sdlquitevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlkey.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLKEYSYM" |
>SDL_keysym</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4191" |
></A |
><H2 |
>Name</H2 |
>SDL_keysym -- Keysym structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4194" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 scancode; |
SDLKey sym; |
SDLMod mod; |
Uint16 unicode; |
} SDL_keysym;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4197" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN4199" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>scancode</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Hardware specific scancode</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>sym</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDL virtual keysym</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>mod</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Current key modifiers</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>unicode</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Translated character</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4218" |
></A |
><H2 |
>Description</H2 |
><P |
>The <SPAN |
CLASS="STRUCTNAME" |
>SDL_keysym</SPAN |
> structure is used by reporting key presses and releases since it is a part of the <A |
HREF="sdlkeyboardevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_KeyboardEvent</SPAN |
></A |
>.</P |
><P |
>The <TT |
CLASS="STRUCTFIELD" |
><I |
>scancode</I |
></TT |
> field should generally be left alone, it is the hardware dependent scancode returned by the keyboard. The <TT |
CLASS="STRUCTFIELD" |
><I |
>sym</I |
></TT |
> field is extremely useful. It is the SDL-defined value of the key (see <A |
HREF="sdlkey.html" |
>SDL Key Syms</A |
>. This field is very useful when you are checking for certain key presses, like so: |
<PRE |
CLASS="PROGRAMLISTING" |
>. |
. |
while(SDL_PollEvent(&event)){ |
switch(event.type){ |
case SDL_KEYDOWN: |
if(event.key.keysym.sym==SDLK_LEFT) |
move_left(); |
break; |
. |
. |
. |
} |
} |
. |
.</PRE |
> |
<TT |
CLASS="STRUCTFIELD" |
><I |
>mod</I |
></TT |
> stores the current state of the keyboard modifiers as explained in <A |
HREF="sdlgetmodstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetModState</TT |
></A |
>. The <TT |
CLASS="STRUCTFIELD" |
><I |
>unicode</I |
></TT |
> is only used when UNICODE translation is enabled with <A |
HREF="sdlenableunicode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_EnableUNICODE</TT |
></A |
>. If <TT |
CLASS="STRUCTFIELD" |
><I |
>unicode</I |
></TT |
> is non-zero then this a the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: |
<PRE |
CLASS="PROGRAMLISTING" |
>char ch; |
if ( (keysym.unicode & 0xFF80) == 0 ) { |
ch = keysym.unicode & 0x7F; |
} |
else { |
printf("An International Character.\n"); |
}</PRE |
> |
UNICODE translation does have a slight overhead so don't enable it unless its needed.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4237" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlkey.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDLKey</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="sdlquitevent.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="sdlkey.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_QuitEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDLKey</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlkillthread.html |
---|
0,0 → 1,215 |
<HTML |
><HEAD |
><TITLE |
>SDL_KillThread</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_WaitThread" |
HREF="sdlwaitthread.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateMutex" |
HREF="sdlcreatemutex.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="sdlwaitthread.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreatemutex.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLKILLTHREAD" |
>SDL_KillThread</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7245" |
></A |
><H2 |
>Name</H2 |
>SDL_KillThread -- Gracelessly terminates the thread.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7248" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7249" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_KillThread</B |
></CODE |
>(SDL_Thread *thread);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7255" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_KillThread</TT |
> gracelessly terminates the thread |
associated with <TT |
CLASS="PARAMETER" |
><I |
>thread</I |
></TT |
>. If possible, you should |
use some other form of IPC to signal the thread to quit.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7260" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatethread.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateThread</TT |
></A |
>, |
<A |
HREF="sdlwaitthread.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WaitThread</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="sdlwaitthread.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="sdlcreatemutex.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WaitThread</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateMutex</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdllistmodes.html |
---|
0,0 → 1,302 |
<HTML |
><HEAD |
><TITLE |
>SDL_ListModes</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_VideoDriverName" |
HREF="sdlvideodrivername.html"><LINK |
REL="NEXT" |
TITLE="SDL_VideoModeOK" |
HREF="sdlvideomodeok.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="sdlvideodrivername.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlvideomodeok.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLLISTMODES" |
>SDL_ListModes</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN754" |
></A |
><H2 |
>Name</H2 |
>SDL_ListModes -- Returns a pointer to an array of available screen dimensions for |
the given format and video flags</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN757" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN758" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_Rect **<B |
CLASS="FSFUNC" |
>SDL_ListModes</B |
></CODE |
>(SDL_PixelFormat *format, Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN764" |
></A |
><H2 |
>Description</H2 |
><P |
>Return a pointer to an array of available screen dimensions for the given |
format and video flags, sorted largest to smallest. Returns |
<TT |
CLASS="LITERAL" |
>NULL</TT |
> if there are no dimensions available for a particular |
format, or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if any dimension is okay for |
the given format.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>format</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>NULL</TT |
>, the mode list |
will be for the format returned by <A |
HREF="sdlgetvideoinfo.html" |
>SDL_GetVideoInfo()</A |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>vfmt</I |
></TT |
>. The <TT |
CLASS="PARAMETER" |
><I |
>flag</I |
></TT |
> parameter is an OR'd combination of <A |
HREF="sdlsurface.html" |
>surface</A |
> flags. The flags are the same as those used <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
> and they play a strong role in deciding what modes are valid. For instance, if you pass <TT |
CLASS="LITERAL" |
>SDL_HWSURFACE</TT |
> as a flag only modes that support hardware video surfaces will be returned.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN779" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_Rect **modes; |
int i; |
. |
. |
. |
/* Get available fullscreen/hardware modes */ |
modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); |
/* Check is there are any modes available */ |
if(modes == (SDL_Rect **)0){ |
printf("No modes available!\n"); |
exit(-1); |
} |
/* Check if or resolution is restricted */ |
if(modes == (SDL_Rect **)-1){ |
printf("All resolutions available.\n"); |
} |
else{ |
/* Print valid modes */ |
printf("Available Modes\n"); |
for(i=0;modes[i];++i) |
printf(" %d x %d\n", modes[i]->w, modes[i]->h); |
} |
. |
.</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN782" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdlgetvideoinfo.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetVideoInfo</TT |
></A |
>, |
<A |
HREF="sdlrect.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Rect</SPAN |
></A |
>, |
<A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</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="sdlvideodrivername.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="sdlvideomodeok.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_VideoDriverName</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_VideoModeOK</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlloadbmp.html |
---|
0,0 → 1,211 |
<HTML |
><HEAD |
><TITLE |
>SDL_LoadBMP</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_UnlockSurface" |
HREF="sdlunlocksurface.html"><LINK |
REL="NEXT" |
TITLE="SDL_SaveBMP" |
HREF="sdlsavebmp.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="sdlunlocksurface.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsavebmp.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLLOADBMP" |
>SDL_LoadBMP</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1574" |
></A |
><H2 |
>Name</H2 |
>SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1577" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1578" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_Surface *<B |
CLASS="FSFUNC" |
>SDL_LoadBMP</B |
></CODE |
>(const char *file);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1584" |
></A |
><H2 |
>Description</H2 |
><P |
>Loads a surface from a named Windows BMP file.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1587" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns the new surface, or <TT |
CLASS="LITERAL" |
>NULL</TT |
> |
if there was an error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1591" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsavebmp.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SaveBMP</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="sdlunlocksurface.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="sdlsavebmp.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_UnlockSurface</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SaveBMP</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlloadwav.html |
---|
0,0 → 1,288 |
<HTML |
><HEAD |
><TITLE |
>SDL_LoadWAV</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetAudioStatus" |
HREF="sdlgetaudiostatus.html"><LINK |
REL="NEXT" |
TITLE="SDL_FreeWAV" |
HREF="sdlfreewav.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="sdlgetaudiostatus.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlfreewav.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLLOADWAV" |
>SDL_LoadWAV</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6269" |
></A |
><H2 |
>Name</H2 |
>SDL_LoadWAV -- Load a WAVE file</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6272" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6273" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_AudioSpec *<B |
CLASS="FSFUNC" |
>SDL_LoadWAV</B |
></CODE |
>(const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6279" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_LoadWAV</TT |
> |
This function loads a WAVE <TT |
CLASS="PARAMETER" |
><I |
>file</I |
></TT |
> into memory.</P |
><P |
>If this function succeeds, it returns the given |
<A |
HREF="sdlaudiospec.html" |
><TT |
CLASS="FUNCTION" |
>SDL_AudioSpec</TT |
></A |
>, |
filled with the audio data format of the wave data, and sets |
<TT |
CLASS="PARAMETER" |
><I |
>audio_buf</I |
></TT |
> to a <TT |
CLASS="FUNCTION" |
>malloc</TT |
>'d |
buffer containing the audio data, and sets <TT |
CLASS="PARAMETER" |
><I |
>audio_len</I |
></TT |
> |
to the length of that audio buffer, in bytes. You need to free the audio |
buffer with <A |
HREF="sdlfreewav.html" |
><TT |
CLASS="FUNCTION" |
>SDL_FreeWAV</TT |
></A |
> when you are |
done with it.</P |
><P |
>This function returns <TT |
CLASS="LITERAL" |
>NULL</TT |
> and sets the SDL |
error message if the wave file cannot be opened, uses an unknown data format, |
or is corrupt. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6294" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_AudioSpec wav_spec; |
Uint32 wav_length; |
Uint8 *wav_buffer; |
/* Load the WAV */ |
if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){ |
fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError()); |
exit(-1); |
} |
. |
. |
. |
/* Do stuff with the WAV */ |
. |
. |
/* Free It */ |
SDL_FreeWAV(wav_buffer);</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6297" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlaudiospec.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
></A |
>, |
<A |
HREF="sdlopenaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_OpenAudio</TT |
></A |
>, |
<A |
HREF="sdlfreewav.html" |
><TT |
CLASS="FUNCTION" |
>SDL_FreeWAV</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="sdlgetaudiostatus.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="sdlfreewav.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetAudioStatus</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_FreeWAV</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdllockaudio.html |
---|
0,0 → 1,200 |
<HTML |
><HEAD |
><TITLE |
>SDL_LockAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_MixAudio" |
HREF="sdlmixaudio.html"><LINK |
REL="NEXT" |
TITLE="SDL_UnlockAudio" |
HREF="sdlunlockaudio.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="sdlmixaudio.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlunlockaudio.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLLOCKAUDIO" |
>SDL_LockAudio</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6585" |
></A |
><H2 |
>Name</H2 |
>SDL_LockAudio -- Lock out the callback function</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6588" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6589" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_LockAudio</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6595" |
></A |
><H2 |
>Description</H2 |
><P |
>The lock manipulated by these functions protects the callback function. |
During a LockAudio period, you can be guaranteed that the |
callback function is not running. Do not call these from the callback |
function or you will cause deadlock.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6598" |
></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="sdlmixaudio.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="sdlunlockaudio.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_MixAudio</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_UnlockAudio</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdllocksurface.html |
---|
0,0 → 1,299 |
<HTML |
><HEAD |
><TITLE |
>SDL_LockSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_FreeSurface" |
HREF="sdlfreesurface.html"><LINK |
REL="NEXT" |
TITLE="SDL_UnlockSurface" |
HREF="sdlunlocksurface.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="sdlfreesurface.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlunlocksurface.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLLOCKSURFACE" |
>SDL_LockSurface</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1504" |
></A |
><H2 |
>Name</H2 |
>SDL_LockSurface -- Lock a surface for directly access.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1507" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1508" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_LockSurface</B |
></CODE |
>(SDL_Surface *surface);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1514" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
> sets up a surface for directly |
accessing the pixels. Between calls to <TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
> |
and <TT |
CLASS="FUNCTION" |
>SDL_UnlockSurface</TT |
>, you can write to and read from |
<TT |
CLASS="PARAMETER" |
><I |
>surface-><TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
></I |
></TT |
>, using the pixel format stored in |
<TT |
CLASS="PARAMETER" |
><I |
>surface-><TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
></I |
></TT |
>. Once you are done accessing the |
surface, you should use <TT |
CLASS="FUNCTION" |
>SDL_UnlockSurface</TT |
> to release it.</P |
><P |
>Not all surfaces require locking. |
If <TT |
CLASS="LITERAL" |
>SDL_MUSTLOCK</TT |
>(<TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
>) |
evaluates to <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, then you can read and write to the |
surface at any time, and the pixel format of the surface will not change. </P |
><P |
>No operating system or library calls should be made between lock/unlock |
pairs, as critical system locks may be held during this time.</P |
><P |
>It should be noted, that since SDL 1.1.8 surface locks are recursive. This means that you can lock a surface multiple times, but each lock must have a match unlock. |
<PRE |
CLASS="PROGRAMLISTING" |
> . |
. |
SDL_LockSurface( surface ); |
. |
/* Surface is locked */ |
/* Direct pixel access on surface here */ |
. |
SDL_LockSurface( surface ); |
. |
/* More direct pixel access on surface */ |
. |
SDL_UnlockSurface( surface ); |
/* Surface is still locked */ |
/* Note: Is versions < 1.1.8, the surface would have been */ |
/* no longer locked at this stage */ |
. |
SDL_UnlockSurface( surface ); |
/* Surface is now unlocked */ |
. |
.</PRE |
> |
</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1532" |
></A |
><H2 |
>Return Value</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
> returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, |
or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if the surface couldn't be locked.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1538" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlunlocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UnlockSurface</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="sdlfreesurface.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="sdlunlocksurface.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_FreeSurface</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_UnlockSurface</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdllockyuvoverlay.html |
---|
0,0 → 1,244 |
<HTML |
><HEAD |
><TITLE |
>SDL_LockYUVOverlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_CreateYUVOverlay" |
HREF="sdlcreateyuvoverlay.html"><LINK |
REL="NEXT" |
TITLE="SDL_UnlockYUVOverlay" |
HREF="sdlunlockyuvoverlay.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="sdlcreateyuvoverlay.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlunlockyuvoverlay.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLLOCKYUVOVERLAY" |
>SDL_LockYUVOverlay</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2425" |
></A |
><H2 |
>Name</H2 |
>SDL_LockYUVOverlay -- Lock an overlay</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2428" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2429" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_LockYUVOverlay</B |
></CODE |
>(SDL_Overlay *overlay);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2435" |
></A |
><H2 |
>Description</H2 |
><P |
>Much the same as <A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
></A |
>, <TT |
CLASS="FUNCTION" |
>SDL_LockYUVOverlay</TT |
> locks the <A |
HREF="sdloverlay.html" |
><TT |
CLASS="PARAMETER" |
><I |
>overlay</I |
></TT |
></A |
> for direct access to pixel data.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2443" |
></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="AEN2448" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlunlockyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UnlockYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdlcreateyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdloverlay.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Overlay</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="sdlcreateyuvoverlay.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="sdlunlockyuvoverlay.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_CreateYUVOverlay</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_UnlockYUVOverlay</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmaprgb.html |
---|
0,0 → 1,246 |
<HTML |
><HEAD |
><TITLE |
>SDL_MapRGB</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetGammaRamp" |
HREF="sdlsetgammaramp.html"><LINK |
REL="NEXT" |
TITLE="SDL_MapRGBA" |
HREF="sdlmaprgba.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="sdlsetgammaramp.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlmaprgba.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMAPRGB" |
>SDL_MapRGB</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1237" |
></A |
><H2 |
>Name</H2 |
>SDL_MapRGB -- Map a RGB color value to a pixel format.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1240" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1241" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_MapRGB</B |
></CODE |
>(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1247" |
></A |
><H2 |
>Description</H2 |
><P |
>Maps the RGB color value to the specified pixel format and returns the |
pixel value as a 32-bit int.</P |
><P |
>If the format has a palette (8-bit) the index of the closest matching |
color in the palette will be returned.</P |
><P |
>If the specified pixel format has an alpha component it will be returned |
as all 1 bits (fully opaque).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1252" |
></A |
><H2 |
>Return Value</H2 |
><P |
>A pixel value best approximating the given RGB color value for a given |
pixel format. If the pixel format bpp (color depth) is less than 32-bpp |
then the unused upper bits of the return value can safely be ignored |
(e.g., with a 16-bpp format the return value can be assigned to a |
<SPAN |
CLASS="TYPE" |
>Uint16</SPAN |
>, and similarly a <SPAN |
CLASS="TYPE" |
>Uint8</SPAN |
> for an 8-bpp |
format).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1257" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetrgb.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetRGB</TT |
></A |
>, |
<A |
HREF="sdlgetrgba.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetRGBA</TT |
></A |
>, |
<A |
HREF="sdlmaprgba.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGBA</TT |
></A |
>, |
<A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</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="sdlsetgammaramp.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="sdlmaprgba.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetGammaRamp</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_MapRGBA</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmaprgba.html |
---|
0,0 → 1,234 |
<HTML |
><HEAD |
><TITLE |
>SDL_MapRGBA</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_MapRGB" |
HREF="sdlmaprgb.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetRGB" |
HREF="sdlgetrgb.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="sdlmaprgb.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetrgb.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMAPRGBA" |
>SDL_MapRGBA</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1272" |
></A |
><H2 |
>Name</H2 |
>SDL_MapRGBA -- Map a RGBA color value to a pixel format.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1275" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1276" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_MapRGBA</B |
></CODE |
>(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1282" |
></A |
><H2 |
>Description</H2 |
><P |
>Maps the RGBA color value to the specified pixel format and returns the |
pixel value as a 32-bit int.</P |
><P |
>If the format has a palette (8-bit) the index of the closest matching |
color in the palette will be returned.</P |
><P |
>If the specified pixel format has no alpha component the alpha value |
will be ignored (as it will be in formats with a palette).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1287" |
></A |
><H2 |
>Return Value</H2 |
><P |
>A pixel value best approximating the given RGBA color value for a given |
pixel format. If the pixel format bpp (color depth) is less than 32-bpp |
then the unused upper bits of the return value can safely be ignored |
(e.g., with a 16-bpp format the return value can be assigned to a |
<SPAN |
CLASS="TYPE" |
>Uint16</SPAN |
>, and similarly a <SPAN |
CLASS="TYPE" |
>Uint8</SPAN |
> for an 8-bpp |
format).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1292" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetrgb.html" |
>SDL_GetRGB</A |
>, |
<A |
HREF="sdlgetrgba.html" |
>SDL_GetRGBA</A |
>, |
<A |
HREF="sdlmaprgb.html" |
>SDL_MapRGB</A |
>, |
<A |
HREF="sdlpixelformat.html" |
>SDL_PixelFormat</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="sdlmaprgb.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="sdlgetrgb.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_MapRGB</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetRGB</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmixaudio.html |
---|
0,0 → 1,215 |
<HTML |
><HEAD |
><TITLE |
>SDL_MixAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_ConvertAudio" |
HREF="sdlconvertaudio.html"><LINK |
REL="NEXT" |
TITLE="SDL_LockAudio" |
HREF="sdllockaudio.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="sdlconvertaudio.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdllockaudio.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMIXAUDIO" |
>SDL_MixAudio</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6560" |
></A |
><H2 |
>Name</H2 |
>SDL_MixAudio -- Mix audio data</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6563" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6564" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_MixAudio</B |
></CODE |
>(Uint8 *dst, Uint8 *src, Uint32 len, int volume);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6570" |
></A |
><H2 |
>Description</H2 |
><P |
>This function takes two audio buffers of <TT |
CLASS="PARAMETER" |
><I |
>len</I |
></TT |
> bytes each |
of the playing audio format and mixes them, performing addition, volume |
adjustment, and overflow clipping. The <TT |
CLASS="PARAMETER" |
><I |
>volume</I |
></TT |
> ranges |
from 0 to <TT |
CLASS="LITERAL" |
>SDL_MIX_MAXVOLUME</TT |
> and should be set to the maximum |
value for full audio volume. Note this does not change hardware volume. This is |
provided for convenience -- you can mix your own audio data.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6576" |
></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="sdlconvertaudio.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="sdllockaudio.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_ConvertAudio</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_LockAudio</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmousebuttonevent.html |
---|
0,0 → 1,338 |
<HTML |
><HEAD |
><TITLE |
>SDL_MouseButtonEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_MouseMotionEvent" |
HREF="sdlmousemotionevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoyAxisEvent" |
HREF="sdljoyaxisevent.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="sdlmousemotionevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoyaxisevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMOUSEBUTTONEVENT" |
>SDL_MouseButtonEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3711" |
></A |
><H2 |
>Name</H2 |
>SDL_MouseButtonEvent -- Mouse button event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3714" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 button; |
Uint8 state; |
Uint16 x, y; |
} SDL_MouseButtonEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3717" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3719" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>type</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_MOUSEBUTTONDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_MOUSEBUTTONUP</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>button</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)</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_PRESSED</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_RELEASED</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>x</I |
></TT |
>, <TT |
CLASS="STRUCTFIELD" |
><I |
>y</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The X/Y coordinates of the mouse at press/release time</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3743" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_MouseButtonEvent</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_MOUSEBUTTONDOWN</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_MOUSEBUTTONUP</TT |
> is reported.</P |
><P |
>When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into <TT |
CLASS="STRUCTFIELD" |
><I |
>button</I |
></TT |
>, the position of the mouse when this event occured is stored in the <TT |
CLASS="STRUCTFIELD" |
><I |
>x</I |
></TT |
> and the <TT |
CLASS="STRUCTFIELD" |
><I |
>y</I |
></TT |
> fields. Like <A |
HREF="sdlkeyboardevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_KeyboardEvent</SPAN |
></A |
>, information on whether the event was a press or a release event is stored in both the <TT |
CLASS="STRUCTFIELD" |
><I |
>type</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
> fields, but this should be obvious.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3759" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlmousemotionevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_MouseMotionEvent</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="sdlmousemotionevent.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="sdljoyaxisevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_MouseMotionEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoyAxisEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmousemotionevent.html |
---|
0,0 → 1,357 |
<HTML |
><HEAD |
><TITLE |
>SDL_MouseMotionEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_KeyboardEvent" |
HREF="sdlkeyboardevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_MouseButtonEvent" |
HREF="sdlmousebuttonevent.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="sdlkeyboardevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlmousebuttonevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMOUSEMOTIONEVENT" |
>SDL_MouseMotionEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3646" |
></A |
><H2 |
>Name</H2 |
>SDL_MouseMotionEvent -- Mouse motion event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3649" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
Uint8 state; |
Uint16 x, y; |
Sint16 xrel, yrel; |
} SDL_MouseMotionEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3652" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3654" |
></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_MOUSEMOTION</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The current button state</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>x</I |
></TT |
>, <TT |
CLASS="STRUCTFIELD" |
><I |
>y</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The X/Y coordinates of the mouse</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>xrel</I |
></TT |
>, <TT |
CLASS="STRUCTFIELD" |
><I |
>yrel</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Relative motion in the X/Y direction</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3676" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_MouseMotionEvent</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_MOUSEMOTION</TT |
> is reported.</P |
><P |
>Simply put, a <TT |
CLASS="LITERAL" |
>SDL_MOUSEMOTION</TT |
> type event occurs when a user moves the mouse within the application window or when <A |
HREF="sdlwarpmouse.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WarpMouse</TT |
></A |
> is called. Both the absolute (<TT |
CLASS="STRUCTFIELD" |
><I |
>x</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>y</I |
></TT |
>) and relative (<TT |
CLASS="STRUCTFIELD" |
><I |
>xrel</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>yrel</I |
></TT |
>) coordinates are reported along with the current button states (<TT |
CLASS="STRUCTFIELD" |
><I |
>state</I |
></TT |
>). The button state can be interpreted using the <TT |
CLASS="LITERAL" |
>SDL_BUTTON</TT |
> macro (see <A |
HREF="sdlgetmousestate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetMouseState</TT |
></A |
>).</P |
><P |
>If the cursor is hidden (<A |
HREF="sdlshowcursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_ShowCursor</TT |
>(0)</A |
>) and the input is grabbed (<A |
HREF="sdlwmgrabinput.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WM_GrabInput</TT |
>(SDL_GRAB_ON)</A |
>), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3700" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlmousebuttonevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_MouseButtonEvent</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="sdlkeyboardevent.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="sdlmousebuttonevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_KeyboardEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_MouseButtonEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmutexp.html |
---|
0,0 → 1,233 |
<HTML |
><HEAD |
><TITLE |
>SDL_mutexP</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_DestroyMutex" |
HREF="sdldestroymutex.html"><LINK |
REL="NEXT" |
TITLE="SDL_mutexV" |
HREF="sdlmutexv.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="sdldestroymutex.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlmutexv.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMUTEXP" |
>SDL_mutexP</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7323" |
></A |
><H2 |
>Name</H2 |
>SDL_mutexP -- Lock a mutex</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7326" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7327" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_mutexP</B |
></CODE |
>(SDL_mutex *mutex);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7333" |
></A |
><H2 |
>Description</H2 |
><P |
>Locks the <TT |
CLASS="PARAMETER" |
><I |
>mutex</I |
></TT |
>, which was previously created with <A |
HREF="sdlcreatemutex.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateMutex</TT |
></A |
>. If the mutex is already locked then <TT |
CLASS="FUNCTION" |
>SDL_mutexP</TT |
> will not return until it is <A |
HREF="sdlmutexv.html" |
>unlocked</A |
>. Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success, or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on an error.</P |
><P |
>SDL also defines a macro <TT |
CLASS="LITERAL" |
>#define SDL_LockMutex(m) SDL_mutexP(m)</TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7345" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatemutex.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateMutex</TT |
></A |
>, |
<A |
HREF="sdlmutexv.html" |
><TT |
CLASS="FUNCTION" |
>SDL_mutexV</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="sdldestroymutex.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="sdlmutexv.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_DestroyMutex</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_mutexV</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlmutexv.html |
---|
0,0 → 1,227 |
<HTML |
><HEAD |
><TITLE |
>SDL_mutexV</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_mutexP" |
HREF="sdlmutexp.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateSemaphore" |
HREF="sdlcreatesemaphore.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="sdlmutexp.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreatesemaphore.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLMUTEXV" |
>SDL_mutexV</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7356" |
></A |
><H2 |
>Name</H2 |
>SDL_mutexV -- Unlock a mutex</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7359" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7360" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_mutexV</B |
></CODE |
>(SDL_mutex *mutex);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7366" |
></A |
><H2 |
>Description</H2 |
><P |
>Unlocks the <TT |
CLASS="PARAMETER" |
><I |
>mutex</I |
></TT |
>, which was previously created with <A |
HREF="sdlcreatemutex.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateMutex</TT |
></A |
>. Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success, or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> on an error.</P |
><P |
>SDL also defines a macro <TT |
CLASS="LITERAL" |
>#define SDL_UnlockMutex(m) SDL_mutexV(m)</TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7376" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatemutex.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateMutex</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="sdlmutexp.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="sdlcreatesemaphore.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_mutexP</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateSemaphore</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlnumjoysticks.html |
---|
0,0 → 1,214 |
<HTML |
><HEAD |
><TITLE |
>SDL_NumJoysticks</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="PREVIOUS" |
TITLE="Joystick" |
HREF="joystick.html"><LINK |
REL="NEXT" |
TITLE="SDL_JoystickName" |
HREF="sdljoystickname.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="joystick.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdljoystickname.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLNUMJOYSTICKS" |
>SDL_NumJoysticks</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5492" |
></A |
><H2 |
>Name</H2 |
>SDL_NumJoysticks -- Count available joysticks.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5495" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5496" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_NumJoysticks</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5502" |
></A |
><H2 |
>Description</H2 |
><P |
>Counts the number of joysticks attached to the system.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5505" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns the number of attached joysticks</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5508" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdljoystickname.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickName</TT |
></A |
>, |
<A |
HREF="sdljoystickopen.html" |
><TT |
CLASS="FUNCTION" |
>SDL_JoystickOpen</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="joystick.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="sdljoystickname.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>Joystick</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="joystick.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_JoystickName</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlopenaudio.html |
---|
0,0 → 1,567 |
<HTML |
><HEAD |
><TITLE |
>SDL_OpenAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_AudioSpec" |
HREF="sdlaudiospec.html"><LINK |
REL="NEXT" |
TITLE="SDL_PauseAudio" |
HREF="sdlpauseaudio.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="sdlaudiospec.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlpauseaudio.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLOPENAUDIO" |
>SDL_OpenAudio</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6103" |
></A |
><H2 |
>Name</H2 |
>SDL_OpenAudio -- Opens the audio device with the desired parameters.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6106" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6107" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_OpenAudio</B |
></CODE |
>(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6113" |
></A |
><H2 |
>Description</H2 |
><P |
>This function opens the audio device with the <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
> parameters, and |
returns 0 if successful, placing the actual hardware parameters in the |
structure pointed to by <TT |
CLASS="PARAMETER" |
><I |
>obtained</I |
></TT |
>. If <TT |
CLASS="PARAMETER" |
><I |
>obtained</I |
></TT |
> is NULL, the audio |
data passed to the callback function will be guaranteed to be in the |
requested format, and will be automatically converted to the hardware |
audio format if necessary. This function returns -1 if it failed |
to open the audio device, or couldn't set up the audio thread.</P |
><P |
>To open the audio device a <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
> <A |
HREF="sdlaudiospec.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
></A |
> must be created. |
<PRE |
CLASS="PROGRAMLISTING" |
>SDL_AudioSpec *desired; |
. |
. |
desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));</PRE |
> |
You must then fill this structure with your desired audio specifications.</P |
><P |
></P |
><DIV |
CLASS="VARIABLELIST" |
><DL |
><DT |
><SPAN |
CLASS="STRUCTNAME" |
>desired</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>freq</I |
></TT |
></DT |
><DD |
><P |
>The desired audio frequency in samples-per-second.</P |
></DD |
><DT |
><SPAN |
CLASS="STRUCTNAME" |
>desired</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
></DT |
><DD |
><P |
>The desired audio format (see <A |
HREF="sdlaudiospec.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
></A |
>)</P |
></DD |
><DT |
><SPAN |
CLASS="STRUCTNAME" |
>desired</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>samples</I |
></TT |
></DT |
><DD |
><P |
>The desired size of the audio buffer in samples. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time. A stereo sample consists of both right and left channels in LR ordering. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq</P |
></DD |
><DT |
><SPAN |
CLASS="STRUCTNAME" |
>desired</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>callback</I |
></TT |
></DT |
><DD |
><P |
>This should be set to a function that will be called when the audio device is ready for more data. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling <A |
HREF="sdllockaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockAudio</TT |
></A |
> and <A |
HREF="sdlunlockaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UnlockAudio</TT |
></A |
> in your code. The callback prototype is: |
<PRE |
CLASS="PROGRAMLISTING" |
>void callback(void *userdata, Uint8 *stream, int len);</PRE |
> |
<TT |
CLASS="PARAMETER" |
><I |
>userdata</I |
></TT |
> is the pointer stored in <TT |
CLASS="STRUCTFIELD" |
><I |
>userdata</I |
></TT |
> field of the <SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
>. <TT |
CLASS="PARAMETER" |
><I |
>stream</I |
></TT |
> is a pointer to the audio buffer you want to fill with information and <TT |
CLASS="PARAMETER" |
><I |
>len</I |
></TT |
> is the length of the audio buffer in bytes.</P |
></DD |
><DT |
><SPAN |
CLASS="STRUCTNAME" |
>desired</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>userdata</I |
></TT |
></DT |
><DD |
><P |
>This pointer is passed as the first parameter to the <TT |
CLASS="FUNCTION" |
>callback</TT |
> function.</P |
></DD |
></DL |
></DIV |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_OpenAudio</TT |
> reads these fields from the <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
> <SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
> structure pass to the function and attempts to find an audio configuration matching your <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
>. As mentioned above, if the <TT |
CLASS="PARAMETER" |
><I |
>obtained</I |
></TT |
> parameter is <TT |
CLASS="LITERAL" |
>NULL</TT |
> then SDL with convert from your <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
> audio settings to the hardware settings as it plays.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>obtained</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>NULL</TT |
> then the <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
> <SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
> is your working specification, otherwise the <TT |
CLASS="PARAMETER" |
><I |
>obtained</I |
></TT |
> <SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioSpec</SPAN |
> becomes the working specification and the <TT |
CLASS="PARAMETER" |
><I |
>desirec</I |
></TT |
> specification can be deleted. The data in the working specification is used when building <SPAN |
CLASS="STRUCTNAME" |
>SDL_AudioCVT</SPAN |
>'s for converting loaded data to the hardware format.</P |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_OpenAudio</TT |
> calculates the <TT |
CLASS="STRUCTFIELD" |
><I |
>size</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>silence</I |
></TT |
> fields for both the <TT |
CLASS="PARAMETER" |
><I |
>desired</I |
></TT |
> and <TT |
CLASS="PARAMETER" |
><I |
>obtained</I |
></TT |
> specifications. The <TT |
CLASS="STRUCTFIELD" |
><I |
>size</I |
></TT |
> field stores the total size of the audio buffer in bytes, while the <TT |
CLASS="STRUCTFIELD" |
><I |
>silence</I |
></TT |
> stores the value used to represent silence in the audio buffer</P |
><P |
>The audio device starts out playing <TT |
CLASS="STRUCTFIELD" |
><I |
>silence</I |
></TT |
> when it's opened, and should be enabled for playing by calling <A |
HREF="sdlpauseaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PauseAudio</TT |
>(<TT |
CLASS="PARAMETER" |
><I |
>0</I |
></TT |
>)</A |
> when you are ready for your audio <TT |
CLASS="STRUCTFIELD" |
><I |
>callback</I |
></TT |
> function to be called. Since the audio driver may modify the requested <TT |
CLASS="STRUCTFIELD" |
><I |
>size</I |
></TT |
> of the audio buffer, you should allocate any local mixing buffers after you open the audio device.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6200" |
></A |
><H2 |
>Examples</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>/* Prototype of our callback function */ |
void my_audio_callback(void *userdata, Uint8 *stream, int len); |
/* Open the audio device */ |
SDL_AudioSpec *desired, *obtained; |
SDL_AudioSpec *hardware_spec; |
/* Allocate a desired SDL_AudioSpec */ |
desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); |
/* Allocate space for the obtained SDL_AudioSpec */ |
obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); |
/* 22050Hz - FM Radio quality */ |
desired->freq=22050; |
/* 16-bit signed audio */ |
desired->format=AUDIO_S16LSB; |
/* Large audio buffer reduces risk of dropouts but increases response time */ |
desired->samples=8192; |
/* Our callback function */ |
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); |
} |
/* desired spec is no longer needed */ |
free(desired); |
hardware_spec=obtained; |
. |
. |
/* Prepare callback for playing */ |
. |
. |
. |
/* Start playing */ |
SDL_PauseAudio(0);</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6203" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlaudiospec.html" |
><TT |
CLASS="FUNCTION" |
>SDL_AudioSpec</TT |
></A |
>, |
<A |
HREF="sdllockaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockAudio</TT |
></A |
>, |
<A |
HREF="sdlunlockaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UnlockAudio</TT |
></A |
>, |
<A |
HREF="sdlpauseaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PauseAudio</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="sdlaudiospec.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="sdlpauseaudio.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_AudioSpec</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_PauseAudio</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdloverlay.html |
---|
0,0 → 1,354 |
<HTML |
><HEAD |
><TITLE |
>SDL_Overlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_VideoInfo" |
HREF="sdlvideoinfo.html"><LINK |
REL="NEXT" |
TITLE="Window Management" |
HREF="wm.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="sdlvideoinfo.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="wm.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLOVERLAY" |
>SDL_Overlay</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3042" |
></A |
><H2 |
>Name</H2 |
>SDL_Overlay -- YUV video overlay</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3045" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint32 format; |
int w, h; |
int planes; |
Uint16 *pitches; |
Uint8 **pixels; |
Uint32 hw_overlay:1; |
} SDL_Overlay;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3048" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN3050" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Overlay format (see below)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>w, h</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Width and height of overlay</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>planes</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Number of planes in the overlay. Usually either 1 or 3</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>pitches</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>An array of pitches, one for each plane. Pitch is the length of a row in bytes.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>An array of pointers to teh data of each plane. The overlay should be locked before these pointers are used.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>hw_overlay</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>This will be set to 1 if the overlay is hardware accelerated.</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3077" |
></A |
><H2 |
>Description</H2 |
><P |
>A <SPAN |
CLASS="STRUCTNAME" |
>SDL_Overlay</SPAN |
> is similar to a <A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
> except it stores a YUV overlay. All the fields are read only, except for <TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
> which should be <A |
HREF="sdllockyuvoverlay.html" |
>locked</A |
> before use. The <TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
> field stores the format of the overlay which is one of the following: |
<PRE |
CLASS="PROGRAMLISTING" |
>#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */ |
#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */ |
#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */ |
#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */ |
#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */</PRE |
> |
More information on YUV formats can be found at <A |
HREF="http://www.webartz.com/fourcc/indexyuv.htm" |
TARGET="_top" |
>http://www.webartz.com/fourcc/indexyuv.htm</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3088" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreateyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdllockyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdlunlockyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UnlockYUVOverlay</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="sdlvideoinfo.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="wm.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_VideoInfo</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Window Management</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpalette.html |
---|
0,0 → 1,293 |
<HTML |
><HEAD |
><TITLE |
>SDL_Palette</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Color" |
HREF="sdlcolor.html"><LINK |
REL="NEXT" |
TITLE="SDL_PixelFormat" |
HREF="sdlpixelformat.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="sdlcolor.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlpixelformat.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPALETTE" |
>SDL_Palette</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2707" |
></A |
><H2 |
>Name</H2 |
>SDL_Palette -- Color palette for 8-bit pixel formats</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2710" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
int ncolors; |
SDL_Color *colors; |
} SDL_Palette;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2713" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2715" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>ncolors</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Number of colors used in this palette</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>colors</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Pointer to <A |
HREF="sdlcolor.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Color</SPAN |
></A |
> structures that make up the palette.</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2728" |
></A |
><H2 |
>Description</H2 |
><P |
>Each pixel in an 8-bit surface is an index into the <TT |
CLASS="STRUCTFIELD" |
><I |
>colors</I |
></TT |
> field of the <SPAN |
CLASS="STRUCTNAME" |
>SDL_Palette</SPAN |
> structure store in <A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</SPAN |
></A |
>. A <SPAN |
CLASS="STRUCTNAME" |
>SDL_Palette</SPAN |
> should never need to be created manually. It is automatically created when SDL allocates a <SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</SPAN |
> for a surface. The colors values of a <A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>s palette can be set with the <A |
HREF="sdlsetcolors.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2741" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcolor.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Color</SPAN |
></A |
>, |
<A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>, |
<A |
HREF="sdlsetcolors.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
></A |
> |
<A |
HREF="sdlsetpalette.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetPalette</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="sdlcolor.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="sdlpixelformat.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Color</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_PixelFormat</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpauseaudio.html |
---|
0,0 → 1,213 |
<HTML |
><HEAD |
><TITLE |
>SDL_PauseAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_OpenAudio" |
HREF="sdlopenaudio.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetAudioStatus" |
HREF="sdlgetaudiostatus.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="sdlopenaudio.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetaudiostatus.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPAUSEAUDIO" |
>SDL_PauseAudio</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6218" |
></A |
><H2 |
>Name</H2 |
>SDL_PauseAudio -- Pauses and unpauses the audio callback processing</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6221" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6222" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_PauseAudio</B |
></CODE |
>(int pause_on);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6228" |
></A |
><H2 |
>Description</H2 |
><P |
>This function pauses and unpauses the audio callback processing. |
It should be called with <TT |
CLASS="PARAMETER" |
><I |
>pause_on</I |
></TT |
>=0 after opening the audio |
device to start playing sound. This is so you can safely initialize |
data for your callback function after opening the audio device. |
Silence will be written to the audio device during the pause.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6232" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetaudiostatus.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetAudioStatus</TT |
></A |
>, |
<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="sdlopenaudio.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="sdlgetaudiostatus.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_OpenAudio</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetAudioStatus</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpeepevents.html |
---|
0,0 → 1,296 |
<HTML |
><HEAD |
><TITLE |
>SDL_PeepEvents</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_PumpEvents" |
HREF="sdlpumpevents.html"><LINK |
REL="NEXT" |
TITLE="SDL_PollEvent" |
HREF="sdlpollevent.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="sdlpumpevents.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlpollevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPEEPEVENTS" |
>SDL_PeepEvents</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4882" |
></A |
><H2 |
>Name</H2 |
>SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN4885" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN4886" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_PeepEvents</B |
></CODE |
>(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4892" |
></A |
><H2 |
>Description</H2 |
><P |
>Checks the event queue for messages and optionally returns them.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>action</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>SDL_ADDEVENT</TT |
>, up to |
<TT |
CLASS="PARAMETER" |
><I |
>numevents</I |
></TT |
> events will be added to the back of the event |
queue.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>action</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>SDL_PEEKEVENT</TT |
>, up to |
<TT |
CLASS="PARAMETER" |
><I |
>numevents</I |
></TT |
> events at the front of the event queue, |
matching <A |
HREF="sdlevent.html" |
><TT |
CLASS="PARAMETER" |
><I |
>mask</I |
></TT |
></A |
>, |
will be returned and will not be removed from the queue.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>action</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>SDL_GETEVENT</TT |
>, up to |
<TT |
CLASS="PARAMETER" |
><I |
>numevents</I |
></TT |
> events at the front of the event queue, |
matching <A |
HREF="sdlevent.html" |
><TT |
CLASS="PARAMETER" |
><I |
>mask</I |
></TT |
></A |
>, |
will be returned and will be removed from the queue.</P |
><P |
>This function is thread-safe.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4912" |
></A |
><H2 |
>Return Value</H2 |
><P |
>This function returns the number of events actually stored, or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if there was an error. </P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4916" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlpollevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PollEvent</TT |
></A |
>, |
<A |
HREF="sdlpushevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PushEvent</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="sdlpumpevents.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="sdlpollevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_PumpEvents</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_PollEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpixelformat.html |
---|
0,0 → 1,520 |
<HTML |
><HEAD |
><TITLE |
>SDL_PixelFormat</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Palette" |
HREF="sdlpalette.html"><LINK |
REL="NEXT" |
TITLE="SDL_Surface" |
HREF="sdlsurface.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="sdlpalette.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsurface.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPIXELFORMAT" |
>SDL_PixelFormat</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2756" |
></A |
><H2 |
>Name</H2 |
>SDL_PixelFormat -- Stores surface format information</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2759" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
SDL_Palette *palette; |
Uint8 BitsPerPixel; |
Uint8 BytesPerPixel; |
Uint32 Rmask, Gmask, Bmask, Amask; |
Uint8 Rshift, Gshift, Bshift, Ashift; |
Uint8 Rloss, Gloss, Bloss, Aloss; |
Uint32 colorkey; |
Uint8 alpha; |
} SDL_PixelFormat;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2762" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2764" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>palette</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Pointer to the <A |
HREF="sdlpalette.html" |
>palette</A |
>, or <TT |
CLASS="LITERAL" |
>NULL</TT |
> if the <TT |
CLASS="STRUCTFIELD" |
><I |
>BitsPerPixel</I |
></TT |
>>8</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>BitsPerPixel</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>BytesPerPixel</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The number of bytes used to represent each pixel in a surface. Usually one to four.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>[RGBA]mask</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Binary mask used to retrieve individual color values</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>[RGBA]loss</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Precision loss of each color component (2<SUP |
>[RGBA]loss</SUP |
>)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>[RGBA]shift</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Binary left shift of each color component in the pixel value</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>colorkey</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Pixel value of transparent pixels</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>alpha</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Overall surface alpha value</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2803" |
></A |
><H2 |
>Description</H2 |
><P |
>A <SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</SPAN |
> describes the format of the pixel data stored at the <TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
> field of a <A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>. Every surface stores a <SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</SPAN |
> in the <TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
> field.</P |
><P |
>If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.</P |
><P |
>8-bit pixel formats are the easiest to understand. Since its an 8-bit format, we have 8 <TT |
CLASS="STRUCTFIELD" |
><I |
>BitsPerPixel</I |
></TT |
> and 1 <TT |
CLASS="STRUCTFIELD" |
><I |
>BytesPerPixel</I |
></TT |
>. Since <TT |
CLASS="STRUCTFIELD" |
><I |
>BytesPerPixel</I |
></TT |
> is 1, all pixels are represented by a Uint8 which contains an index into <TT |
CLASS="STRUCTFIELD" |
><I |
>palette</I |
></TT |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>colors</I |
></TT |
>. So, to determine the color of a pixel in a 8-bit surface: we read the color index from <SPAN |
CLASS="STRUCTNAME" |
>surface</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
> and we use that index to read the <A |
HREF="sdlcolor.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Color</SPAN |
></A |
> structure from <SPAN |
CLASS="STRUCTNAME" |
>surface</SPAN |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>palette</I |
></TT |
>-><TT |
CLASS="STRUCTFIELD" |
><I |
>colors</I |
></TT |
>. Like so: |
<PRE |
CLASS="PROGRAMLISTING" |
>SDL_Surface *surface; |
SDL_PixelFormat *fmt; |
SDL_Color *color; |
Uint8 index; |
. |
. |
/* Create surface */ |
. |
. |
fmt=surface->format; |
/* Check the bitdepth of the surface */ |
if(fmt->BitsPerPixel!=8){ |
fprintf(stderr, "Not an 8-bit surface.\n"); |
return(-1); |
} |
/* Lock the surface */ |
SDL_LockSurface(surface); |
/* Get the topleft pixel */ |
index=*(Uint8 *)surface->pixels; |
color=fmt->palette->colors[index]; |
/* Unlock the surface */ |
SDL_UnlockSurface(surface); |
printf("Pixel Color-> Red: %d, Green: %d, Blue: %d. Index: %d\n", |
color->r, color->g, color->b, index); |
. |
.</PRE |
></P |
><P |
>Pixel formats above 8-bit are an entirely different experience. They are |
considered to be "TrueColor" formats and the color information is stored in the |
pixels themselves, not in a palette. The mask, shift and loss fields tell us |
how the color information is encoded. The mask fields allow us to isolate each |
color component, the shift fields tell us the number of bits to the right of |
each component in the pixel value and the loss fields tell us the number of |
bits lost from each component when packing 8-bit color component in a pixel. |
<PRE |
CLASS="PROGRAMLISTING" |
>/* Extracting color components from a 32-bit color value */ |
SDL_PixelFormat *fmt; |
SDL_Surface *surface; |
Uint32 temp, pixel; |
Uint8 red, green, blue, alpha; |
. |
. |
. |
fmt=surface->format; |
SDL_LockSurface(surface); |
pixel=*((Uint32*)surface->pixels); |
SDL_UnlockSurface(surface); |
/* Get Red component */ |
temp=pixel&fmt->Rmask; /* Isolate red component */ |
temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */ |
temp=temp<<fmt->Rloss; /* Expand to a full 8-bit number */ |
red=(Uint8)temp; |
/* Get Green component */ |
temp=pixel&fmt->Gmask; /* Isolate green component */ |
temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */ |
temp=temp<<fmt->Gloss; /* Expand to a full 8-bit number */ |
green=(Uint8)temp; |
/* Get Blue component */ |
temp=pixel&fmt->Bmask; /* Isolate blue component */ |
temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */ |
temp=temp<<fmt->Bloss; /* Expand to a full 8-bit number */ |
blue=(Uint8)temp; |
/* Get Alpha component */ |
temp=pixel&fmt->Amask; /* Isolate alpha component */ |
temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */ |
temp=temp<<fmt->Aloss; /* Expand to a full 8-bit number */ |
alpha=(Uint8)temp; |
printf("Pixel Color -> R: %d, G: %d, B: %d, A: %d\n", red, green, blue, alpha); |
. |
. |
.</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2830" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>, |
<A |
HREF="sdlmaprgb.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGB</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="sdlpalette.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="sdlsurface.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Palette</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Surface</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpollevent.html |
---|
0,0 → 1,261 |
<HTML |
><HEAD |
><TITLE |
>SDL_PollEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_PeepEvents" |
HREF="sdlpeepevents.html"><LINK |
REL="NEXT" |
TITLE="SDL_WaitEvent" |
HREF="sdlwaitevent.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="sdlpeepevents.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwaitevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPOLLEVENT" |
>SDL_PollEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4929" |
></A |
><H2 |
>Name</H2 |
>SDL_PollEvent -- Polls for currently pending events.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN4932" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN4933" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_PollEvent</B |
></CODE |
>(SDL_Event *event);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4939" |
></A |
><H2 |
>Description</H2 |
><P |
>Polls for currently pending events, and returns <SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
> |
if there are any pending events, or <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if there |
are none available. </P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>event</I |
></TT |
> is not <TT |
CLASS="LITERAL" |
>NULL</TT |
>, the next |
event is removed from the queue and stored in that area.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4947" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_Event event; /* Event structure */ |
. |
. |
. |
/* Check for events */ |
while(SDL_PollEvent(&event)){ /* Loop until there are no events left on the queue */ |
switch(event.type){ /* Process the appropiate event type */ |
case SDL_KEYDOWN: /* Handle a KEYDOWN event */ |
printf("Oh! Key press\n"); |
break; |
case SDL_MOUSEMOTION: |
. |
. |
. |
default: /* Report an unhandled event */ |
printf("I don't know what this event is!\n"); |
} |
}</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4951" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlwaitevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WaitEvent</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="sdlpeepevents.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="sdlwaitevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_PeepEvents</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WaitEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpumpevents.html |
---|
0,0 → 1,236 |
<HTML |
><HEAD |
><TITLE |
>SDL_PumpEvents</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="NEXT" |
TITLE="SDL_PeepEvents" |
HREF="sdlpeepevents.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="eventfunctions.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlpeepevents.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPUMPEVENTS" |
>SDL_PumpEvents</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4848" |
></A |
><H2 |
>Name</H2 |
>SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN4851" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN4852" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_PumpEvents</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4858" |
></A |
><H2 |
>Description</H2 |
><P |
>Pumps the event loop, gathering events from the input devices.</P |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</TT |
> gathers all the pending input information from devices and places it on the event queue. Without calls to <TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</TT |
> no events would ever be placed on the queue. Often calls the need for <TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</TT |
> is hidden from the user since <A |
HREF="sdlpollevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PollEvent</TT |
></A |
> and <A |
HREF="sdlwaitevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WaitEvent</TT |
></A |
> implicitly call <TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</TT |
>. However, if you are not polling or waiting for events (e.g. your filtering them), then you must call <TT |
CLASS="FUNCTION" |
>SDL_PumpEvents</TT |
> to force an event queue update.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>You can only call this function in the thread that set the video mode.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4873" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlpollevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PollEvent</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="eventfunctions.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="sdlpeepevents.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>Event Functions.</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_PeepEvents</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlpushevent.html |
---|
0,0 → 1,258 |
<HTML |
><HEAD |
><TITLE |
>SDL_PushEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WaitEvent" |
HREF="sdlwaitevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetEventFilter" |
HREF="sdlseteventfilter.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="sdlwaitevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlseteventfilter.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLPUSHEVENT" |
>SDL_PushEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4993" |
></A |
><H2 |
>Name</H2 |
>SDL_PushEvent -- Pushes an event onto the event queue</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN4996" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN4997" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_PushEvent</B |
></CODE |
>(SDL_Event *event);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5003" |
></A |
><H2 |
>Description</H2 |
><P |
>The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. <TT |
CLASS="PARAMETER" |
><I |
>event</I |
></TT |
> is a pointer to the event structure you wish to push onto the queue.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Pushing device input events onto the queue doesn't modify the state of the device within SDL.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5009" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on success or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if the event couldn't be pushed.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5014" |
></A |
><H2 |
>Examples</H2 |
><P |
>See <A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5019" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlpollevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PollEvent</TT |
></A |
>, |
<A |
HREF="sdlpeepevents.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PeepEvents</TT |
></A |
>, |
<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="sdlwaitevent.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="sdlseteventfilter.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WaitEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetEventFilter</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlquit.html |
---|
0,0 → 1,236 |
<HTML |
><HEAD |
><TITLE |
>SDL_Quit</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="General" |
HREF="general.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_QuitSubSystem" |
HREF="sdlquitsubsystem.html"><LINK |
REL="NEXT" |
TITLE="SDL_WasInit" |
HREF="sdlwasinit.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="sdlquitsubsystem.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwasinit.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLQUIT" |
>SDL_Quit</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN585" |
></A |
><H2 |
>Name</H2 |
>SDL_Quit -- Shut down SDL</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN588" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN589" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_Quit</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN595" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_Quit</TT |
> shuts down all SDL subsystems and frees the resources allocated to them. This should always be called before you exit. For the sake of simplicity you can set <TT |
CLASS="FUNCTION" |
>SDL_Quit</TT |
> as your <TT |
CLASS="FUNCTION" |
>atexit</TT |
> call, like: |
<PRE |
CLASS="PROGRAMLISTING" |
>SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); |
atexit(SDL_Quit); |
. |
.</PRE |
></P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>While using <TT |
CLASS="FUNCTION" |
>atexit</TT |
> maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code. Plus, using <TT |
CLASS="FUNCTION" |
>atexit</TT |
> in a library is a sure way to crash dynamically loaded code</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN606" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlquitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_QuitSubsystem</TT |
></A |
>, |
<A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</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="sdlquitsubsystem.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="sdlwasinit.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_QuitSubSystem</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="general.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WasInit</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlquitevent.html |
---|
0,0 → 1,255 |
<HTML |
><HEAD |
><TITLE |
>SDL_QuitEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_UserEvent" |
HREF="sdluserevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_keysym" |
HREF="sdlkeysym.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="sdluserevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlkeysym.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLQUITEVENT" |
>SDL_QuitEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4153" |
></A |
><H2 |
>Name</H2 |
>SDL_QuitEvent -- Quit requested event</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4156" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type |
} SDL_QuitEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4159" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN4161" |
></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_QUIT</TT |
></TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4169" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_QuitEvent</SPAN |
> is a member of the <A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
> union and is used whan an event of type <TT |
CLASS="LITERAL" |
>SDL_QUIT</TT |
> is reported.</P |
><P |
>As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand, is very important. If you filter out or ignore a quit event then it is impossible for the user to close the window. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>The macro <TT |
CLASS="FUNCTION" |
>SDL_QuitRequested</TT |
> will return non-zero if a quit event is pending</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4180" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlseteventfilter.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetEventFilter</TT |
></A |
></P |
></DIV |
><DIV |
CLASS="NAVFOOTER" |
><HR |
ALIGN="LEFT" |
WIDTH="100%"><TABLE |
WIDTH="100%" |
BORDER="0" |
CELLPADDING="0" |
CELLSPACING="0" |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
><A |
HREF="sdluserevent.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="sdlkeysym.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_UserEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_keysym</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlquitsubsystem.html |
---|
0,0 → 1,240 |
<HTML |
><HEAD |
><TITLE |
>SDL_QuitSubSystem</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="General" |
HREF="general.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_InitSubSystem" |
HREF="sdlinitsubsystem.html"><LINK |
REL="NEXT" |
TITLE="SDL_Quit" |
HREF="sdlquit.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="sdlinitsubsystem.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlquit.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLQUITSUBSYSTEM" |
>SDL_QuitSubSystem</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN550" |
></A |
><H2 |
>Name</H2 |
>SDL_QuitSubSystem -- Shut down a subsystem</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN553" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN554" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_QuitSubSystem</B |
></CODE |
>(Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN560" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_QuitSubSystem</TT |
> allows you to shut down a subsystem that has been previously initialized by <A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
> or <A |
HREF="sdlinitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_InitSubSystem</TT |
></A |
>. The <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> tells <TT |
CLASS="FUNCTION" |
>SDL_QuitSubSystem</TT |
> which subsystems to shut down, it uses the same values that are passed to <A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN572" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlquit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Quit</TT |
></A |
>, |
<A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
>, |
<A |
HREF="sdlinitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_InitSubSystem</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="sdlinitsubsystem.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="sdlquit.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_InitSubSystem</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="general.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Quit</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlrect.html |
---|
0,0 → 1,250 |
<HTML |
><HEAD |
><TITLE |
>SDL_Rect</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GLattr" |
HREF="sdlglattr.html"><LINK |
REL="NEXT" |
TITLE="SDL_Color" |
HREF="sdlcolor.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="sdlglattr.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcolor.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLRECT" |
>SDL_Rect</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2624" |
></A |
><H2 |
>Name</H2 |
>SDL_Rect -- Defines a rectangular area</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2627" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Sint16 x, y; |
Uint16 w, h; |
} SDL_Rect;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2630" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2632" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>x, y</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Position of the upper-left corner of the rectangle</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>w, h</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>The width and height of the rectangle</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2643" |
></A |
><H2 |
>Description</H2 |
><P |
>A <SPAN |
CLASS="STRUCTNAME" |
>SDL_Rect</SPAN |
> defines a rectangular area of pixels. It is used by <A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</TT |
></A |
> to define blitting regions and by several other video functions.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2649" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</TT |
></A |
>, |
<A |
HREF="sdlupdaterect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UpdateRect</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="sdlglattr.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="sdlcolor.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GLattr</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Color</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlremovetimer.html |
---|
0,0 → 1,228 |
<HTML |
><HEAD |
><TITLE |
>SDL_RemoveTimer</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Time" |
HREF="time.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_AddTimer" |
HREF="sdladdtimer.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetTimer" |
HREF="sdlsettimer.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="sdladdtimer.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsettimer.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLREMOVETIMER" |
>SDL_RemoveTimer</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7977" |
></A |
><H2 |
>Name</H2 |
>SDL_RemoveTimer -- Remove a timer which was added with |
<A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
>.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7981" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7982" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_bool <B |
CLASS="FSFUNC" |
>SDL_RemoveTimer</B |
></CODE |
>(SDL_TimerID id);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7988" |
></A |
><H2 |
>Description</H2 |
><P |
>Removes a timer callback previously added with |
<A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7992" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns a boolean value indicating success.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7995" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_RemoveTimer(my_timer_id);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7999" |
></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="sdladdtimer.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="sdlsettimer.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_AddTimer</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="time.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetTimer</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlresizeevent.html |
---|
0,0 → 1,299 |
<HTML |
><HEAD |
><TITLE |
>SDL_ResizeEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_JoyBallEvent" |
HREF="sdljoyballevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_SysWMEvent" |
HREF="sdlsyswmevent.html"></HEAD |
><BODY |
CLASS="REFENTRY" |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
><TABLE |
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="sdljoyballevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsyswmevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLRESIZEEVENT" |
>SDL_ResizeEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4020" |
></A |
><H2 |
>Name</H2 |
>SDL_ResizeEvent -- Window resize event structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4023" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
int w, h; |
} SDL_ResizeEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4026" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN4028" |
></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_VIDEORESIZE</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>w</I |
></TT |
>, <TT |
CLASS="STRUCTFIELD" |
><I |
>h</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>New width and height of the window</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4041" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_ResizeEvent</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_VIDEORESIZE</TT |
> is reported.</P |
><P |
>When <TT |
CLASS="LITERAL" |
>SDL_RESIZABLE</TT |
> is passed as a <TT |
CLASS="PARAMETER" |
><I |
>flag</I |
></TT |
> to <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
> the user is allowed to resize the applications window. When the window is resized an <TT |
CLASS="LITERAL" |
>SDL_VIDEORESIZE</TT |
> is report, with the new window width and height values stored in <TT |
CLASS="STRUCTFIELD" |
><I |
>w</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>h</I |
></TT |
>, respectively. When an <TT |
CLASS="LITERAL" |
>SDL_VIDEORESIZE</TT |
> is recieved the window should be resized to the new dimensions using <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4059" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</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="sdljoyballevent.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="sdlsyswmevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_JoyBallEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SysWMEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsavebmp.html |
---|
0,0 → 1,228 |
<HTML |
><HEAD |
><TITLE |
>SDL_SaveBMP</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_LoadBMP" |
HREF="sdlloadbmp.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetColorKey" |
HREF="sdlsetcolorkey.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="sdlloadbmp.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetcolorkey.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSAVEBMP" |
>SDL_SaveBMP</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1600" |
></A |
><H2 |
>Name</H2 |
>SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1603" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1604" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SaveBMP</B |
></CODE |
>(SDL_Surface *surface, const char *file);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1610" |
></A |
><H2 |
>Description</H2 |
><P |
>Saves the <SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
> <TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
> as a Windows BMP file named <TT |
CLASS="PARAMETER" |
><I |
>file</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1616" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if successful or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> |
if there was an error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1621" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlloadbmp.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LoadBMP</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="sdlloadbmp.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="sdlsetcolorkey.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_LoadBMP</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetColorKey</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsempost.html |
---|
0,0 → 1,291 |
<HTML |
><HEAD |
><TITLE |
>SDL_SemPost</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_SemWaitTimeout" |
HREF="sdlsemwaittimeout.html"><LINK |
REL="NEXT" |
TITLE="SDL_SemValue" |
HREF="sdlsemvalue.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="sdlsemwaittimeout.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsemvalue.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSEMPOST" |
>SDL_SemPost</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7621" |
></A |
><H2 |
>Name</H2 |
>SDL_SemPost -- Unlock a semaphore.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7624" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7625" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SemPost</B |
></CODE |
>(SDL_sem *sem);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7631" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SemPost</TT |
> unlocks the semaphore pointed to by |
<TT |
CLASS="PARAMETER" |
><I |
>sem</I |
></TT |
> and atomically increments the semaphores value. |
Threads that were blocking on the semaphore may be scheduled after this call |
succeeds.</P |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SemPost</TT |
> should be called after a semaphore is locked by a successful call to |
<A |
HREF="sdlsemwait.html" |
>SDL_SemWait</A |
>, |
<A |
HREF="sdlsemtrywait.html" |
>SDL_SemTryWait</A |
> or |
<A |
HREF="sdlsemwaittimeout.html" |
>SDL_SemWaitTimeout</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7641" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if successful or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if there was an error (leaving the semaphore unchanged).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7646" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_SemPost(my_sem);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7650" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatesemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateSemaphore</TT |
></A |
>, |
<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="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="sdlsemwaittimeout.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="sdlsemvalue.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SemWaitTimeout</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SemValue</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsemtrywait.html |
---|
0,0 → 1,311 |
<HTML |
><HEAD |
><TITLE |
>SDL_SemTryWait</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_SemWait" |
HREF="sdlsemwait.html"><LINK |
REL="NEXT" |
TITLE="SDL_SemWaitTimeout" |
HREF="sdlsemwaittimeout.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="sdlsemwait.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsemwaittimeout.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSEMTRYWAIT" |
>SDL_SemTryWait</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7520" |
></A |
><H2 |
>Name</H2 |
>SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7523" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7524" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SemTryWait</B |
></CODE |
>(SDL_sem *sem);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7530" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SemTryWait</TT |
> is a non-blocking varient of |
<A |
HREF="sdlsemwait.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SemWait</TT |
></A |
>. If the value of the semaphore |
pointed to by <TT |
CLASS="PARAMETER" |
><I |
>sem</I |
></TT |
> is positive it will atomically |
decrement the semaphore value and return 0, otherwise it will return |
<SPAN |
CLASS="RETURNVALUE" |
>SDL_MUTEX_TIMEOUT</SPAN |
> instead of suspending the thread.</P |
><P |
>After <TT |
CLASS="FUNCTION" |
>SDL_SemTryWait</TT |
> is successful, the semaphore |
can be released and its count atomically incremented by a successful call to |
<A |
HREF="sdlsempost.html" |
>SDL_SemPost</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7541" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if the semaphore was successfully locked or |
either <SPAN |
CLASS="RETURNVALUE" |
>SDL_MUTEX_TIMEOUT</SPAN |
> or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> |
if the thread would have suspended or there was an error, respectivly.</P |
><P |
>If the semaphore was not successfully locked, the semaphore will be unchanged.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7548" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>res = SDL_SemTryWait(my_sem); |
if (res == SDL_MUTEX_TIMEOUT) { |
return TRY_AGAIN; |
} |
if (res == -1) { |
return WAIT_ERROR; |
} |
... |
SDL_SemPost(my_sem);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7552" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatesemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateSemaphore</TT |
></A |
>, |
<A |
HREF="sdldestroysemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_DestroySemaphore</TT |
></A |
>, |
<A |
HREF="sdlsemwait.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SemWait</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="sdlsemwait.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="sdlsemwaittimeout.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SemWait</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SemWaitTimeout</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsemvalue.html |
---|
0,0 → 1,265 |
<HTML |
><HEAD |
><TITLE |
>SDL_SemValue</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_SemPost" |
HREF="sdlsempost.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateCond" |
HREF="sdlcreatecond.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="sdlsempost.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreatecond.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSEMVALUE" |
>SDL_SemValue</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7669" |
></A |
><H2 |
>Name</H2 |
>SDL_SemValue -- Return the current value of a semaphore.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7672" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7673" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL/SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_SemValue</B |
></CODE |
>(SDL_sem *sem);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7679" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SemValue()</TT |
> returns the current semaphore value from |
the semaphore pointed to by <TT |
CLASS="PARAMETER" |
><I |
>sem</I |
></TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7684" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns current value of the semaphore.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7687" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
> sem_value = SDL_SemValue(my_sem);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7691" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatesemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateSemaphore</TT |
></A |
>, |
<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 |
></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="sdlsempost.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="sdlcreatecond.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SemPost</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateCond</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsemwait.html |
---|
0,0 → 1,290 |
<HTML |
><HEAD |
><TITLE |
>SDL_SemWait</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_DestroySemaphore" |
HREF="sdldestroysemaphore.html"><LINK |
REL="NEXT" |
TITLE="SDL_SemTryWait" |
HREF="sdlsemtrywait.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="sdldestroysemaphore.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsemtrywait.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSEMWAIT" |
>SDL_SemWait</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7474" |
></A |
><H2 |
>Name</H2 |
>SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7477" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7478" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SemWait</B |
></CODE |
>(SDL_sem *sem);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7484" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SemWait()</TT |
> suspends the calling thread until either |
the semaphore pointed to by <TT |
CLASS="PARAMETER" |
><I |
>sem</I |
></TT |
> has a positive value, |
the call is interrupted by a signal or error. If the call is successful it |
will atomically decrement the semaphore value.</P |
><P |
>After <TT |
CLASS="FUNCTION" |
>SDL_SemWait()</TT |
> is successful, the semaphore |
can be released and its count atomically incremented by a successful call to |
<A |
HREF="sdlsempost.html" |
>SDL_SemPost</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7492" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if successful or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if there was an error (leaving the semaphore unchanged).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7497" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>if (SDL_SemWait(my_sem) == -1) { |
return WAIT_FAILED; |
} |
... |
SDL_SemPost(my_sem);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7501" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatesemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateSemaphore</TT |
></A |
>, |
<A |
HREF="sdldestroysemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_DestroySemaphore</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="sdldestroysemaphore.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="sdlsemtrywait.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_DestroySemaphore</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SemTryWait</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsemwaittimeout.html |
---|
0,0 → 1,314 |
<HTML |
><HEAD |
><TITLE |
>SDL_SemWaitTimeout</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_SemTryWait" |
HREF="sdlsemtrywait.html"><LINK |
REL="NEXT" |
TITLE="SDL_SemPost" |
HREF="sdlsempost.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="sdlsemtrywait.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsempost.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSEMWAITTIMEOUT" |
>SDL_SemWaitTimeout</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7571" |
></A |
><H2 |
>Name</H2 |
>SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7574" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7575" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SemWaitTimeout</B |
></CODE |
>(SDL_sem *sem, Uint32 timeout);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7581" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SemWaitTimeout()</TT |
> is a varient of |
<A |
HREF="sdlsemwait.html" |
>SDL_SemWait</A |
> |
with a maximum timeout value. |
If the value of the semaphore pointed to by <TT |
CLASS="PARAMETER" |
><I |
>sem</I |
></TT |
> is |
positive (greater than zero) it will atomically decrement the semaphore value |
and return 0, otherwise it will wait up to <TT |
CLASS="PARAMETER" |
><I |
>timeout</I |
></TT |
> |
milliseconds trying to lock the semaphore. This function is to be avoided if |
possible since on some platforms it is implemented by polling the semaphore |
every millisecond in a busy loop.</P |
><P |
>After <TT |
CLASS="FUNCTION" |
>SDL_SemWaitTimeout()</TT |
> is successful, the semaphore |
can be released and its count atomically incremented by a successful call to |
<A |
HREF="sdlsempost.html" |
>SDL_SemPost</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7591" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if the semaphore was successfully locked or |
either <SPAN |
CLASS="RETURNVALUE" |
>SDL_MUTEX_TIMEOUT</SPAN |
> or <SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> |
if the timeout period was exceeded or there was an error, respectivly.</P |
><P |
>If the semaphore was not successfully locked, the semaphore will be unchanged.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7598" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>res = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC); |
if (res == SDL_MUTEX_TIMEOUT) { |
return TRY_AGAIN; |
} |
if (res == -1) { |
return WAIT_ERROR; |
} |
... |
SDL_SemPost(my_sem);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7602" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatesemaphore.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateSemaphore</TT |
></A |
>, |
<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="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="sdlsemtrywait.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="sdlsempost.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SemTryWait</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SemPost</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetalpha.html |
---|
0,0 → 1,492 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetAlpha</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetColorKey" |
HREF="sdlsetcolorkey.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetClipRect" |
HREF="sdlsetcliprect.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="sdlsetcolorkey.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetcliprect.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETALPHA" |
>SDL_SetAlpha</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1681" |
></A |
><H2 |
>Name</H2 |
>SDL_SetAlpha -- Adjust the alpha properties of a surface</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1684" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1685" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetAlpha</B |
></CODE |
>(SDL_Surface *surface, Uint32 flag, Uint8 alpha);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1691" |
></A |
><H2 |
>Description</H2 |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent. This has now been inverted: 0 (<TT |
CLASS="LITERAL" |
>SDL_ALPHA_TRANSPARENT</TT |
>) is now considered transparent and 255 (<TT |
CLASS="LITERAL" |
>SDL_ALPHA_OPAQUE</TT |
>) is now considered opaque.</P |
></BLOCKQUOTE |
></DIV |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_SetAlpha</TT |
> is used for setting the per-surface alpha |
value and/or enabling and disabling alpha blending.</P |
><P |
>The<TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
> parameter specifies which surface whose alpha |
attributes you wish to adjust. <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> is used to specify |
whether alpha blending should be used (<TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
>) and |
whether the surface should use RLE acceleration for blitting |
(<TT |
CLASS="LITERAL" |
>SDL_RLEACCEL</TT |
>). <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> can be an OR'd |
combination of these two options, one of these options or 0. If |
<TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
> is not passed as a flag then all alpha |
information is ignored when blitting the surface. The |
<TT |
CLASS="PARAMETER" |
><I |
>alpha</I |
></TT |
> parameter is the per-surface alpha value; a |
surface need not have an alpha channel to use per-surface alpha and blitting |
can still be accelerated with <TT |
CLASS="LITERAL" |
>SDL_RLEACCEL</TT |
>.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>The per-surface alpha value of 128 is considered a special case and |
is optimised, so it's much faster than other per-surface values.</P |
></BLOCKQUOTE |
></DIV |
><P |
>Alpha effects surface blitting in the following ways:</P |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN1711" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGBA->RGB with <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The source is alpha-blended with the destination, using the alpha channel. <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> and the per-surface alpha are ignored.</P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGBA->RGB without <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.</P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGB->RGBA with <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The source is alpha-blended with the destination using the per-surface alpha |
value. If <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> is set, only the pixels not |
matching the colorkey value are copied. The alpha channel of the copied pixels |
is set to opaque.</P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGB->RGBA without <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The RGB data is copied from the source and the alpha value of the copied pixels |
is set to opaque. If <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> is set, only the pixels |
not matching the colorkey value are copied. </P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGBA->RGBA with <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The source is alpha-blended with the destination using the source alpha |
channel. The alpha channel in the destination surface is left untouched. |
<TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> is ignored.</P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGBA->RGBA without <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The RGBA data is copied to the destination surface. If <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> is set, only the pixels not matching the colorkey value are copied.</P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGB->RGB with <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The source is alpha-blended with the destination using the per-surface alpha value. If <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> is set, only the pixels not matching the colorkey value are copied.</P |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>RGB->RGB without <TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><P |
>The RGB data is copied from the source. If <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> is set, only the pixels not matching the colorkey value are copied.</P |
></TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
> Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha |
of the destination surface. This means that you cannot compose two arbitrary |
RGBA surfaces this way and get the result you would expect from "overlaying" |
them; the destination alpha will work as a mask.</P |
><P |
>Also note that per-pixel and per-surface alpha cannot be combined; |
the per-pixel alpha is always used if available</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1764" |
></A |
><H2 |
>Return Value</H2 |
><P |
>This function returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if there was an error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1769" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlmaprgba.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGBA</TT |
></A |
>, |
<A |
HREF="sdlgetrgba.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetRGBA</TT |
></A |
>, |
<A |
HREF="sdldisplayformatalpha.html" |
><TT |
CLASS="FUNCTION" |
>SDL_DisplayFormatAlpha</TT |
></A |
>, |
<A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</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="sdlsetcolorkey.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="sdlsetcliprect.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetColorKey</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetClipRect</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetcliprect.html |
---|
0,0 → 1,233 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetClipRect</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetAlpha" |
HREF="sdlsetalpha.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetClipRect" |
HREF="sdlgetcliprect.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="sdlsetalpha.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetcliprect.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETCLIPRECT" |
>SDL_SetClipRect</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1784" |
></A |
><H2 |
>Name</H2 |
>SDL_SetClipRect -- Sets the clipping rectangle for a surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1787" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1788" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_SetClipRect</B |
></CODE |
>(SDL_Surface *surface, SDL_Rect *rect);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1794" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the clipping rectangle for a surface. When this surface is the |
destination of a blit, only the area within the clip rectangle will be |
drawn into.</P |
><P |
>The rectangle pointed to by <TT |
CLASS="PARAMETER" |
><I |
>rect</I |
></TT |
> will be |
clipped to the edges of the surface so that the clip rectangle for a |
surface can never fall outside the edges of the surface.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>rect</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>NULL</TT |
> the clipping |
rectangle will be set to the full size of the surface.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1802" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetcliprect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetClipRect</TT |
></A |
>, |
<A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</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="sdlsetalpha.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="sdlgetcliprect.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetAlpha</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetClipRect</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetcolorkey.html |
---|
0,0 → 1,313 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetColorKey</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SaveBMP" |
HREF="sdlsavebmp.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetAlpha" |
HREF="sdlsetalpha.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="sdlsavebmp.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetalpha.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETCOLORKEY" |
>SDL_SetColorKey</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1630" |
></A |
><H2 |
>Name</H2 |
>SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and |
RLE acceleration.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1633" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1634" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetColorKey</B |
></CODE |
>(SDL_Surface *surface, Uint32 flag, Uint32 key);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1640" |
></A |
><H2 |
>Description</H2 |
><P |
> Sets the color key (transparent pixel) in a blittable surface and enables or |
disables RLE blit acceleration.</P |
><P |
>RLE acceleration can substantially speed up blitting of images with large |
horizontal runs of transparent pixels (i.e., pixels that match the |
<TT |
CLASS="PARAMETER" |
><I |
>key</I |
></TT |
> value). The <TT |
CLASS="PARAMETER" |
><I |
>key</I |
></TT |
> must be of the same pixel format as the <TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
>, <A |
HREF="sdlmaprgb.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGB</TT |
></A |
> is often useful for obtaining an acceptable value.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>flag</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
> then |
<TT |
CLASS="PARAMETER" |
><I |
>key</I |
></TT |
> is the transparent pixel value in the source image of a |
blit.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>flag</I |
></TT |
> is OR'd with |
<TT |
CLASS="LITERAL" |
>SDL_RLEACCEL</TT |
> then the surface will be draw using RLE |
acceleration when drawn with |
<A |
HREF="sdlblitsurface.html" |
>SDL_BlitSurface</A |
>. The surface will |
actually be encoded for RLE acceleration the first time |
<A |
HREF="sdlblitsurface.html" |
>SDL_BlitSurface</A |
> or |
<A |
HREF="sdldisplayformat.html" |
>SDL_DisplayFormat</A |
> is called on the |
surface.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>flag</I |
></TT |
> is 0, this function clears |
any current color key.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1661" |
></A |
><H2 |
>Return Value</H2 |
><P |
>This function returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, or |
<SPAN |
CLASS="RETURNVALUE" |
>-1</SPAN |
> if there was an error.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1666" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlblitsurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_BlitSurface</TT |
></A |
>, |
<A |
HREF="sdldisplayformat.html" |
><TT |
CLASS="FUNCTION" |
>SDL_DisplayFormat</TT |
></A |
>, |
<A |
HREF="sdlmaprgb.html" |
><TT |
CLASS="FUNCTION" |
>SDL_MapRGB</TT |
></A |
>, |
<A |
HREF="sdlsetalpha.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetAlpha</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="sdlsavebmp.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="sdlsetalpha.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SaveBMP</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetAlpha</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetcolors.html |
---|
0,0 → 1,350 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetColors</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Flip" |
HREF="sdlflip.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetPalette" |
HREF="sdlsetpalette.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="sdlflip.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetpalette.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETCOLORS" |
>SDL_SetColors</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1047" |
></A |
><H2 |
>Name</H2 |
>SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1050" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1051" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetColors</B |
></CODE |
>(SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1057" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets a portion of the colormap for the given 8-bit surface.</P |
><P |
>When <TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
> is the surface associated with the current |
display, the display colormap will be updated with the requested colors. If |
<TT |
CLASS="LITERAL" |
>SDL_HWPALETTE</TT |
> was set in <A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
> flags, |
<TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
> will always return <SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
>, |
and the palette is guaranteed to be set the way you desire, even if the window |
colormap has to be warped or run under emulation.</P |
><P |
>The color components of a |
<A |
HREF="sdlcolor.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Color</SPAN |
></A |
> |
structure are 8-bits in size, giving you a total of 256<SUP |
>3</SUP |
> |
=16777216 colors.</P |
><P |
>Palettized (8-bit) screen surfaces with the <TT |
CLASS="LITERAL" |
>SDL_HWPALETTE</TT |
> |
flag have two palettes, a logical palette that is used for mapping blits |
to/from the surface and a physical palette (that determines how the |
hardware will map the colors to the display). <TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
> |
modifies both palettes (if present), and is equivalent to calling |
<A |
HREF="sdlsetpalette.html" |
>SDL_SetPalette</A |
> with the |
<TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> set to |
<TT |
CLASS="LITERAL" |
>(SDL_LOGPAL | SDL_PHYSPAL)</TT |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1076" |
></A |
><H2 |
>Return Value</H2 |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
> is not a palettized surface, this function |
does nothing, returning <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>. If all of the colors were set |
as passed to <TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
>, it will return |
<SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
>. If not all the color entries were set exactly as |
given, it will return <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, and you should look at the |
surface palette to determine the actual color palette.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1084" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>/* Create a display surface with a grayscale palette */ |
SDL_Surface *screen; |
SDL_Color colors[256]; |
int i; |
. |
. |
. |
/* Fill colors with color information */ |
for(i=0;i<256;i++){ |
colors[i].r=i; |
colors[i].g=i; |
colors[i].b=i; |
} |
/* Create display */ |
screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE); |
if(!screen){ |
printf("Couldn't set video mode: %s\n", SDL_GetError()); |
exit(-1); |
} |
/* Set palette */ |
SDL_SetColors(screen, colors, 0, 256); |
. |
. |
. |
.</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1087" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcolor.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Color</SPAN |
></A |
> |
<A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>, |
<A |
HREF="sdlsetpalette.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetPalette</TT |
></A |
>, |
<A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</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="sdlflip.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="sdlsetpalette.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Flip</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetPalette</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetcursor.html |
---|
0,0 → 1,214 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetCursor</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_FreeCursor" |
HREF="sdlfreecursor.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetCursor" |
HREF="sdlgetcursor.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="sdlfreecursor.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetcursor.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETCURSOR" |
>SDL_SetCursor</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2144" |
></A |
><H2 |
>Name</H2 |
>SDL_SetCursor -- Set the currently active mouse cursor.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2147" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2148" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void *<B |
CLASS="FSFUNC" |
>SDL_SetCursor</B |
></CODE |
>(SDL_Cursor *cursor);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2154" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the currently active cursor to |
the specified one. |
If the cursor is currently visible, the change will be immediately |
represented on the display.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2157" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetcursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetCursor</TT |
></A |
>, |
<A |
HREF="sdlcreatecursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateCursor</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="sdlfreecursor.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="sdlgetcursor.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_FreeCursor</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetCursor</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlseteventfilter.html |
---|
0,0 → 1,273 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetEventFilter</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_PushEvent" |
HREF="sdlpushevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetEventFilter" |
HREF="sdlgeteventfilter.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="sdlpushevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgeteventfilter.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETEVENTFILTER" |
>SDL_SetEventFilter</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5032" |
></A |
><H2 |
>Name</H2 |
>SDL_SetEventFilter -- Sets up a filter to process all events before they are posted |
to the event queue.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5035" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5036" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_SetEventFilter</B |
></CODE |
>(SDL_EventFilter filter);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5042" |
></A |
><H2 |
>Description</H2 |
><P |
>This function sets up a filter to process all events before they are posted |
to the event queue. This is a very powerful and flexible feature. The filter |
is prototyped as: |
<PRE |
CLASS="PROGRAMLISTING" |
>typedef int (*SDL_EventFilter)(const SDL_Event *event);</PRE |
> |
If the filter returns <SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
>, then the event will be |
added to the internal queue. If it returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, |
then the event will be dropped from the queue. This allows selective |
filtering of dynamically.</P |
><P |
>There is one caveat when dealing with the <TT |
CLASS="LITERAL" |
>SDL_QUITEVENT</TT |
> event type. The |
event filter is only called when the window manager desires to close the |
application window. If the event filter returns 1, then the window will |
be closed, otherwise the window will remain open if possible. |
If the quit event is generated by an interrupt signal, it will bypass the |
internal queue and be delivered to the application at the next event poll.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Events pushed onto the queue with <A |
HREF="sdlpushevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PushEvent</TT |
></A |
> or <A |
HREF="sdlpeepevents.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PeepEvents</TT |
></A |
> do not get passed through the event filter.</P |
></BLOCKQUOTE |
></DIV |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
><I |
CLASS="EMPHASIS" |
>Be Careful!</I |
> The event filter function may run in a different thread so be careful what you do within it.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5059" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlgeteventfilter.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetEventFilter</TT |
></A |
>, |
<A |
HREF="sdlpushevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PushEvent</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="sdlpushevent.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="sdlgeteventfilter.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_PushEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetEventFilter</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetgamma.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetGamma</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetPalette" |
HREF="sdlsetpalette.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetGammaRamp" |
HREF="sdlgetgammaramp.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="sdlsetpalette.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetgammaramp.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETGAMMA" |
>SDL_SetGamma</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1154" |
></A |
><H2 |
>Name</H2 |
>SDL_SetGamma -- Sets the color gamma function for the display</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1157" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1158" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetGamma</B |
></CODE |
>(float redgamma, float greengamma, float bluegamma);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1164" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the "gamma function" for the display of each color component. Gamma |
controls the brightness/contrast of colors displayed on the screen. |
A gamma value of <TT |
CLASS="CONSTANT" |
>1.0</TT |
> is identity (i.e., no adjustment |
is made).</P |
><P |
>This function adjusts the gamma based on the "gamma function" parameter, |
you can directly specify lookup tables for gamma adjustment with |
<A |
HREF="sdlsetgammaramp.html" |
>SDL_SetGammaRamp</A |
>.</P |
><P |
>Not all display hardware is able to change gamma.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1171" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns -1 on error (or if gamma adjustment is not supported).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1174" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetgammaramp.html" |
>SDL_GetGammaRamp</A |
> |
<A |
HREF="sdlsetgammaramp.html" |
>SDL_SetGammaRamp</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="sdlsetpalette.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="sdlgetgammaramp.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetPalette</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetGammaRamp</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetgammaramp.html |
---|
0,0 → 1,222 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetGammaRamp</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetGammaRamp" |
HREF="sdlgetgammaramp.html"><LINK |
REL="NEXT" |
TITLE="SDL_MapRGB" |
HREF="sdlmaprgb.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="sdlgetgammaramp.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlmaprgb.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETGAMMARAMP" |
>SDL_SetGammaRamp</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1209" |
></A |
><H2 |
>Name</H2 |
>SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1212" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1213" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetGammaRamp</B |
></CODE |
>(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1219" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the gamma lookup tables for the display for each color component. |
Each table is an array of 256 Uint16 values, representing a mapping |
between the input and output for that channel. The input is the index |
into the array, and the output is the 16-bit gamma value at that index, |
scaled to the output color precision. You may pass NULL to any of the |
channels to leave them unchanged.</P |
><P |
>This function adjusts the gamma based on lookup tables, you can also |
have the gamma calculated based on a "gamma function" parameter with |
<A |
HREF="sdlsetgamma.html" |
>SDL_SetGamma</A |
>.</P |
><P |
>Not all display hardware is able to change gamma.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1225" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns -1 on error (or if gamma adjustment is not supported).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1228" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetgamma.html" |
>SDL_SetGamma</A |
> |
<A |
HREF="sdlgetgammaramp.html" |
>SDL_GetGammaRamp</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="sdlgetgammaramp.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="sdlmaprgb.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetGammaRamp</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_MapRGB</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetmodstate.html |
---|
0,0 → 1,229 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetModState</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetModState" |
HREF="sdlgetmodstate.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetKeyName" |
HREF="sdlgetkeyname.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="sdlgetmodstate.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetkeyname.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETMODSTATE" |
>SDL_SetModState</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN5209" |
></A |
><H2 |
>Name</H2 |
>SDL_SetModState -- Set the current key modifier state</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN5212" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN5213" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_SetModState</B |
></CODE |
>(SDLMod modstate);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5219" |
></A |
><H2 |
>Description</H2 |
><P |
>The inverse of <A |
HREF="sdlgetmodstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetModState</TT |
></A |
>, <TT |
CLASS="FUNCTION" |
>SDL_SetModState</TT |
> allows you to impose modifier key states on your application.</P |
><P |
>Simply pass your desired modifier states into <TT |
CLASS="PARAMETER" |
><I |
>modstate</I |
></TT |
>. This value my be a logical OR'd combination of the following:</P |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef enum { |
KMOD_NONE = 0x0000, |
KMOD_LSHIFT= 0x0001, |
KMOD_RSHIFT= 0x0002, |
KMOD_LCTRL = 0x0040, |
KMOD_RCTRL = 0x0080, |
KMOD_LALT = 0x0100, |
KMOD_RALT = 0x0200, |
KMOD_LMETA = 0x0400, |
KMOD_RMETA = 0x0800, |
KMOD_NUM = 0x1000, |
KMOD_CAPS = 0x2000, |
KMOD_MODE = 0x4000, |
} SDLMod;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN5228" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlgetmodstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetModState</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="sdlgetmodstate.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="sdlgetkeyname.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetModState</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetKeyName</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetpalette.html |
---|
0,0 → 1,344 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetPalette</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetColors" |
HREF="sdlsetcolors.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetGamma" |
HREF="sdlsetgamma.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="sdlsetcolors.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetgamma.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETPALETTE" |
>SDL_SetPalette</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1102" |
></A |
><H2 |
>Name</H2 |
>SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1105" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1106" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetPalette</B |
></CODE |
>(SDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1112" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets a portion of the palette for the given 8-bit surface.</P |
><P |
>Palettized (8-bit) screen surfaces with the |
<TT |
CLASS="LITERAL" |
>SDL_HWPALETTE</TT |
> flag have two palettes, a logical |
palette that is used for mapping blits to/from the surface and a |
physical palette (that determines how the hardware will map the colors |
to the display). <A |
HREF="sdlblitsurface.html" |
>SDL_BlitSurface</A |
> |
always uses the logical palette when blitting surfaces (if it has to |
convert between surface pixel formats). Because of this, it is often |
useful to modify only one or the other palette to achieve various |
special color effects (e.g., screen fading, color flashes, screen dimming).</P |
><P |
>This function can modify either the logical or physical palette by |
specifing <TT |
CLASS="LITERAL" |
>SDL_LOGPAL</TT |
> or |
<TT |
CLASS="LITERAL" |
>SDL_PHYSPAL</TT |
>the in the <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> |
parameter.</P |
><P |
>When <TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
> is the surface associated with the current |
display, the display colormap will be updated with the requested colors. If |
<TT |
CLASS="LITERAL" |
>SDL_HWPALETTE</TT |
> was set in <A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
> flags, |
<TT |
CLASS="FUNCTION" |
>SDL_SetPalette</TT |
> will always return <SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
>, |
and the palette is guaranteed to be set the way you desire, even if the window |
colormap has to be warped or run under emulation.</P |
><P |
>The color components of a |
<A |
HREF="sdlcolor.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Color</SPAN |
></A |
> structure |
are 8-bits in size, giving you a total of |
256<SUP |
>3</SUP |
>=16777216 colors.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1132" |
></A |
><H2 |
>Return Value</H2 |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>surface</I |
></TT |
> is not a palettized surface, this function |
does nothing, returning <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>. If all of the colors were set |
as passed to <TT |
CLASS="FUNCTION" |
>SDL_SetPalette</TT |
>, it will return |
<SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
>. If not all the color entries were set exactly as |
given, it will return <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, and you should look at the |
surface palette to determine the actual color palette.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1140" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Create a display surface with a grayscale palette */ |
SDL_Surface *screen; |
SDL_Color colors[256]; |
int i; |
. |
. |
. |
/* Fill colors with color information */ |
for(i=0;i<256;i++){ |
colors[i].r=i; |
colors[i].g=i; |
colors[i].b=i; |
} |
/* Create display */ |
screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE); |
if(!screen){ |
printf("Couldn't set video mode: %s\n", SDL_GetError()); |
exit(-1); |
} |
/* Set palette */ |
SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256); |
. |
. |
. |
.</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1143" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetcolors.html" |
>SDL_SetColors</A |
>, |
<A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
>, |
<A |
HREF="sdlsurface.html" |
>SDL_Surface</A |
>, |
<A |
HREF="sdlcolor.html" |
>SDL_Color</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="sdlsetcolors.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="sdlsetgamma.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetColors</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetGamma</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsettimer.html |
---|
0,0 → 1,261 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetTimer</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Time" |
HREF="time.html"><LINK |
REL="PREVIOUS" |
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="sdlremovetimer.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
> </TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETTIMER" |
>SDL_SetTimer</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN8008" |
></A |
><H2 |
>Name</H2 |
>SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has |
elapsed.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN8011" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN8012" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_SetTimer</B |
></CODE |
>(Uint32 interval, SDL_TimerCallback callback);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="SDLTIMERCALLBACK" |
></A |
><H2 |
>Callback</H2 |
><P |
>/* Function prototype for the timer callback function */ |
typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN8021" |
></A |
><H2 |
>Description</H2 |
><P |
>Set a callback to run after the specified number of milliseconds has |
elapsed. The callback function is passed the current timer interval |
and returns the next timer interval. If the returned value is the |
same as the one passed in, the periodic alarm continues, otherwise a |
new alarm is scheduled.</P |
><P |
>To cancel a currently running timer, call |
<TT |
CLASS="FUNCTION" |
>SDL_SetTimer(0, NULL);</TT |
></P |
><P |
>The timer callback function may run in a different thread than your |
main constant, 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).</P |
><P |
>If you use this function, you need to pass <TT |
CLASS="LITERAL" |
>SDL_INIT_TIMER</TT |
> |
to <TT |
CLASS="FUNCTION" |
>SDL_Init()</TT |
>.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>This function is kept for compatibility but has been superseded |
by the new timer functions |
<A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
> and |
<A |
HREF="sdlremovetimer.html" |
>SDL_RemoveTimer</A |
> which support |
multiple timers.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN8035" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_SetTimer((33/10)*10, my_callback);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN8039" |
></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="sdlremovetimer.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" |
> </TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_RemoveTimer</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="time.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
> </TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsetvideomode.html |
---|
0,0 → 1,486 |
<HTML |
><HEAD |
><TITLE |
>SDL_SetVideoMode</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_VideoModeOK" |
HREF="sdlvideomodeok.html"><LINK |
REL="NEXT" |
TITLE="SDL_UpdateRect" |
HREF="sdlupdaterect.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="sdlvideomodeok.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlupdaterect.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSETVIDEOMODE" |
>SDL_SetVideoMode</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN834" |
></A |
><H2 |
>Name</H2 |
>SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN837" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN838" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_Surface *<B |
CLASS="FSFUNC" |
>SDL_SetVideoMode</B |
></CODE |
>(int width, int height, int bpp, Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN844" |
></A |
><H2 |
>Description</H2 |
><P |
>Set up a video mode with the specified width, height and bits-per-pixel.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>bpp</I |
></TT |
> is 0, it is treated as the |
current display bits per pixel.</P |
><P |
>The <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> parameter is the same as the <TT |
CLASS="STRUCTFIELD" |
><I |
>flags</I |
></TT |
> field of the <A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
> structure. OR'd combinations of the following values are valid.</P |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN854" |
></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" |
>Create the video surface in system memory</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_HWSURFACE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Create the video surface in video memory</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_ASYNCBLIT</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Enables the use of asynchronous to the display surface. This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_ANYFORMAT</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Normally, if a video surface of the requested depth (<TT |
CLASS="PARAMETER" |
><I |
>bpp</I |
></TT |
>) is not available, SDL will emulate one with a shadow surface. Passing <TT |
CLASS="LITERAL" |
>SDL_ANYFORMAT</TT |
> prevents this and causes SDL to use the video surface, regardless of its depth.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_HWPALETTE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Give SDL exclusive palette access. Without this flag you may not always get the the colors you request with <A |
HREF="sdlsetcolors.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
></A |
>.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_DOUBLEBUF</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Enable double buffering; only valid with SDL_HWSURFACE. Calling <A |
HREF="sdlflip.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Flip</TT |
></A |
> will flip the buffers and update the screen. If double buffering could not be enabled then <TT |
CLASS="FUNCTION" |
>SDL_Flip</TT |
> will just perform a <A |
HREF="sdlupdaterect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UpdateRect</TT |
></A |
> on the entire screen.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_FULLSCREEN</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>SDL will attempt to use a fullscreen mode</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_OPENGL</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Create an OpenGL rendering context. You should have previously set OpenGL video attributes with <A |
HREF="sdlglsetattribute.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GL_SetAttribute</TT |
></A |
>.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_OPENGLBLIT</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Create an OpenGL rendering context, like above, but allow normal blitting operations.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_RESIZABLE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Create a resizable window. When the window is resized by the user a <A |
HREF="sdlresizeevent.html" |
><TT |
CLASS="LITERAL" |
>SDL_VIDEORESIZE</TT |
></A |
> event is generated and <TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
> can be called again with the new size.</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_NOFRAME</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>If possible, <TT |
CLASS="LITERAL" |
>SDL_NOFRAME</TT |
> causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>Whatever <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> <TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
> could satisfy are set in the <TT |
CLASS="STRUCTFIELD" |
><I |
>flags</I |
></TT |
> member of the returned surface.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN921" |
></A |
><H2 |
>Return Value</H2 |
><P |
>The framebuffer surface, or <SPAN |
CLASS="RETURNVALUE" |
>NULL</SPAN |
> if it fails.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN925" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
></A |
>, |
<A |
HREF="sdlsetcolors.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetColors</TT |
></A |
>, |
<A |
HREF="sdlflip.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Flip</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="sdlvideomodeok.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="sdlupdaterect.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_VideoModeOK</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_UpdateRect</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlshowcursor.html |
---|
0,0 → 1,231 |
<HTML |
><HEAD |
><TITLE |
>SDL_ShowCursor</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetCursor" |
HREF="sdlgetcursor.html"><LINK |
REL="NEXT" |
TITLE="SDL_GL_LoadLibrary" |
HREF="sdlglloadlibrary.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="sdlgetcursor.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlglloadlibrary.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSHOWCURSOR" |
>SDL_ShowCursor</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2196" |
></A |
><H2 |
>Name</H2 |
>SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2199" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2200" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_ShowCursor</B |
></CODE |
>(int toggle);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2206" |
></A |
><H2 |
>Description</H2 |
><P |
>Toggle whether or not the cursor is shown on the screen. Passing <TT |
CLASS="LITERAL" |
>SDL_ENABLE</TT |
> displays the cursor and passing <TT |
CLASS="LITERAL" |
>SDL_DISABLE</TT |
> hides it. The current state of the mouse cursor can be queried by passing <TT |
CLASS="LITERAL" |
>SDL_QUERY</TT |
>, either <TT |
CLASS="LITERAL" |
>SDL_DISABLE</TT |
> or <TT |
CLASS="LITERAL" |
>SDL_ENABLE</TT |
> will be returned.</P |
><P |
>The cursor starts off displayed, but can be turned off.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2215" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns the current state of the cursor.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2218" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatecursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateCursor</TT |
></A |
>, |
<A |
HREF="sdlsetcursor.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetCursor</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="sdlgetcursor.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="sdlglloadlibrary.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetCursor</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GL_LoadLibrary</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsurface.html |
---|
0,0 → 1,589 |
<HTML |
><HEAD |
><TITLE |
>SDL_Surface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_PixelFormat" |
HREF="sdlpixelformat.html"><LINK |
REL="NEXT" |
TITLE="SDL_VideoInfo" |
HREF="sdlvideoinfo.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="sdlpixelformat.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlvideoinfo.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSURFACE" |
>SDL_Surface</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2841" |
></A |
><H2 |
>Name</H2 |
>SDL_Surface -- Graphical Surface Structure</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2844" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct SDL_Surface { |
Uint32 flags; /* Read-only */ |
SDL_PixelFormat *format; /* Read-only */ |
int w, h; /* Read-only */ |
Uint16 pitch; /* Read-only */ |
void *pixels; /* Read-write */ |
/* clipping information */ |
SDL_Rect clip_rect; /* Read-only */ |
/* Reference count -- used when freeing surface */ |
int refcount; /* Read-mostly */ |
/* This structure also contains private fields not shown here */ |
} SDL_Surface;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2847" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2849" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>flags</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface flags</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>format</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Pixel <A |
HREF="sdlpixelformat.html" |
>format</A |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>w, h</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Width and height of the surface</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>pitch</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Length of a surface scanline in bytes</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Pointer to the actual pixel data</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>clip_rect</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>surface clip <A |
HREF="sdlrect.html" |
>rectangle</A |
></TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2878" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
>'s represent areas of "graphical" |
memory, memory that can be drawn to. The video framebuffer is returned |
as a <SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
> by |
<A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
> |
and <A |
HREF="sdlgetvideosurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetVideoSurface</TT |
></A |
>. |
Most of the fields should be pretty obvious. |
<TT |
CLASS="STRUCTFIELD" |
><I |
>w</I |
></TT |
> and <TT |
CLASS="STRUCTFIELD" |
><I |
>h</I |
></TT |
> are the |
width and height of the surface in pixels. |
<TT |
CLASS="STRUCTFIELD" |
><I |
>pixels</I |
></TT |
> is a pointer to the actual pixel data, |
the surface should be <A |
HREF="sdllocksurface.html" |
>locked</A |
> |
before accessing this field. The <TT |
CLASS="STRUCTFIELD" |
><I |
>clip_rect</I |
></TT |
> field |
is the clipping rectangle as set by |
<A |
HREF="sdlsetcliprect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetClipRect</TT |
></A |
>.</P |
><P |
>The following are supported in the |
<TT |
CLASS="STRUCTFIELD" |
><I |
>flags</I |
></TT |
> field.</P |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2896" |
></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" |
>Surface is stored in system memory</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_HWSURFACE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface is stored in video memory</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_ASYNCBLIT</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface uses asynchronous blits if possible</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_ANYFORMAT</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Allows any pixel-format (Display surface)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_HWPALETTE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface has exclusive palette</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_DOUBLEBUF</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface is double buffered (Display surface)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_FULLSCREEN</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface is full screen (Display Surface)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_OPENGL</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface has an OpenGL context (Display Surface)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_OPENGLBLIT</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface supports OpenGL blitting (Display Surface)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_RESIZABLE</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface is resizable (Display Surface)</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_HWACCEL</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface blit uses hardware acceleration</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_SRCCOLORKEY</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface use colorkey blitting</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_RLEACCEL</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Colorkey blitting is accelerated with RLE</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_SRCALPHA</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface blit uses alpha blending</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="LITERAL" |
>SDL_PREALLOC</TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Surface uses preallocated memory</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2959" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</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="sdlpixelformat.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="sdlvideoinfo.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_PixelFormat</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_VideoInfo</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlsyswmevent.html |
---|
0,0 → 1,224 |
<HTML |
><HEAD |
><TITLE |
>SDL_SysWMEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Event Structures." |
HREF="eventstructures.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_ResizeEvent" |
HREF="sdlresizeevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_UserEvent" |
HREF="sdluserevent.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="sdlresizeevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdluserevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLSYSWMEVENT" |
>SDL_SysWMEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4070" |
></A |
><H2 |
>Name</H2 |
>SDL_SysWMEvent -- Platform-dependent window manager event.</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4073" |
></A |
><H2 |
>Description</H2 |
><P |
>The system window manager event contains a pointer to system-specific |
information about unknown window manager events. If you enable this event |
using |
<A |
HREF="sdleventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_EventState()</TT |
></A |
>, |
it will be generated whenever unhandled events are received from the window |
manager. This can be used, for example, to implement cut-and-paste in your |
application. |
<PRE |
CLASS="PROGRAMLISTING" |
>typedef struct { |
Uint8 type; /* Always SDL_SysWM */ |
} SDL_SysWMEvent;</PRE |
> |
If you want to obtain system-specific information about the window manager, |
you can fill the version member of a <SPAN |
CLASS="STRUCTNAME" |
>SDL_SysWMinfo</SPAN |
> |
structure (details can be found in <TT |
CLASS="FILENAME" |
>SDL_syswm.h</TT |
>, which must be included) using the <TT |
CLASS="FUNCTION" |
>SDL_VERSION()</TT |
> macro found in |
<TT |
CLASS="FILENAME" |
>SDL_version.h</TT |
>, and pass it to the |
function: |
<DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN4083" |
></A |
><P |
></P |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_GetWMInfo</B |
></CODE |
>(SDL_SysWMinfo *info);</CODE |
></P |
><P |
></P |
></DIV |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4088" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdleventstate.html" |
><TT |
CLASS="FUNCTION" |
>SDL_EventState</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="sdlresizeevent.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="sdluserevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_ResizeEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_UserEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlthreadid.html |
---|
0,0 → 1,182 |
<HTML |
><HEAD |
><TITLE |
>SDL_ThreadID</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_CreateThread" |
HREF="sdlcreatethread.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetThreadID" |
HREF="sdlgetthreadid.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="sdlcreatethread.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetthreadid.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLTHREADID" |
>SDL_ThreadID</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7177" |
></A |
><H2 |
>Name</H2 |
>SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7180" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7181" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_ThreadID</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7187" |
></A |
><H2 |
>Description</H2 |
><P |
>Get the 32-bit thread identifier for the current thread.</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="sdlcreatethread.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="sdlgetthreadid.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_CreateThread</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetThreadID</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlunlockaudio.html |
---|
0,0 → 1,203 |
<HTML |
><HEAD |
><TITLE |
>SDL_UnlockAudio</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Audio" |
HREF="audio.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_LockAudio" |
HREF="sdllockaudio.html"><LINK |
REL="NEXT" |
TITLE="SDL_CloseAudio" |
HREF="sdlcloseaudio.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="sdllockaudio.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcloseaudio.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLUNLOCKAUDIO" |
>SDL_UnlockAudio</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN6607" |
></A |
><H2 |
>Name</H2 |
>SDL_UnlockAudio -- Unlock the callback function</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN6610" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN6611" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_UnlockAudio</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6617" |
></A |
><H2 |
>Description</H2 |
><P |
>Unlocks a previous <A |
HREF="sdllockaudio.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockAudio</TT |
></A |
> call.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN6622" |
></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="sdllockaudio.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="sdlcloseaudio.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_LockAudio</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="audio.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CloseAudio</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlunlocksurface.html |
---|
0,0 → 1,211 |
<HTML |
><HEAD |
><TITLE |
>SDL_UnlockSurface</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_LockSurface" |
HREF="sdllocksurface.html"><LINK |
REL="NEXT" |
TITLE="SDL_LoadBMP" |
HREF="sdlloadbmp.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="sdllocksurface.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlloadbmp.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLUNLOCKSURFACE" |
>SDL_UnlockSurface</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN1547" |
></A |
><H2 |
>Name</H2 |
>SDL_UnlockSurface -- Unlocks a previously locked surface.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN1550" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN1551" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_UnlockSurface</B |
></CODE |
>(SDL_Surface *surface);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1557" |
></A |
><H2 |
>Description</H2 |
><P |
>Surfaces that were previously locked using <TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
> must be unlocked with <TT |
CLASS="FUNCTION" |
>SDL_UnlockSurface</TT |
>. Surfaces should be unlocked as soon as possible.</P |
><P |
>It should be noted that since 1.1.8, surface locks are recursive. See <A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</TT |
></A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN1565" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</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="sdllocksurface.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="sdlloadbmp.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_LockSurface</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_LoadBMP</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlunlockyuvoverlay.html |
---|
0,0 → 1,217 |
<HTML |
><HEAD |
><TITLE |
>SDL_UnlockYUVOverlay</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_LockYUVOverlay" |
HREF="sdllockyuvoverlay.html"><LINK |
REL="NEXT" |
TITLE="SDL_DisplayYUVOverlay" |
HREF="sdldisplayyuvoverlay.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="sdllockyuvoverlay.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdldisplayyuvoverlay.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLUNLOCKYUVOVERLAY" |
>SDL_UnlockYUVOverlay</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2461" |
></A |
><H2 |
>Name</H2 |
>SDL_UnlockYUVOverlay -- Unlock an overlay</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2464" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2465" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_UnlockYUVOverlay</B |
></CODE |
>(SDL_Overlay *overlay);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2471" |
></A |
><H2 |
>Description</H2 |
><P |
>The opposite to <A |
HREF="sdllockyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockYUVOverlay</TT |
></A |
>. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2476" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdllockyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UnlockYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdlcreateyuvoverlay.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateYUVOverlay</TT |
></A |
>, |
<A |
HREF="sdloverlay.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Overlay</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="sdllockyuvoverlay.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="sdldisplayyuvoverlay.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_LockYUVOverlay</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_DisplayYUVOverlay</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlupdaterect.html |
---|
0,0 → 1,258 |
<HTML |
><HEAD |
><TITLE |
>SDL_UpdateRect</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_SetVideoMode" |
HREF="sdlsetvideomode.html"><LINK |
REL="NEXT" |
TITLE="SDL_UpdateRects" |
HREF="sdlupdaterects.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="sdlsetvideomode.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlupdaterects.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLUPDATERECT" |
>SDL_UpdateRect</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN940" |
></A |
><H2 |
>Name</H2 |
>SDL_UpdateRect -- Makes sure the given area is updated on the given screen.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN943" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN944" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_UpdateRect</B |
></CODE |
>(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN950" |
></A |
><H2 |
>Description</H2 |
><P |
>Makes sure the given area is updated on the given screen. The rectangle must |
be confined within the screen boundaries (no clipping is done).</P |
><P |
>If '<TT |
CLASS="PARAMETER" |
><I |
>x</I |
></TT |
>', '<TT |
CLASS="PARAMETER" |
><I |
>y</I |
></TT |
>', '<TT |
CLASS="PARAMETER" |
><I |
>w</I |
></TT |
>' |
and '<TT |
CLASS="PARAMETER" |
><I |
>h</I |
></TT |
>' are all 0, |
<TT |
CLASS="FUNCTION" |
>SDL_UpdateRect</TT |
> will update the |
entire screen.</P |
><P |
>This function should not be called while '<TT |
CLASS="PARAMETER" |
><I |
>screen</I |
></TT |
>' is |
<A |
HREF="sdllocksurface.html" |
>locked</A |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN962" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlupdaterects.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UpdateRects</TT |
></A |
>, |
<A |
HREF="sdlrect.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Rect</SPAN |
></A |
>, |
<A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>, |
<A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</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="sdlsetvideomode.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="sdlupdaterects.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SetVideoMode</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_UpdateRects</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlupdaterects.html |
---|
0,0 → 1,247 |
<HTML |
><HEAD |
><TITLE |
>SDL_UpdateRects</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_UpdateRect" |
HREF="sdlupdaterect.html"><LINK |
REL="NEXT" |
TITLE="SDL_Flip" |
HREF="sdlflip.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="sdlupdaterect.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlflip.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLUPDATERECTS" |
>SDL_UpdateRects</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN977" |
></A |
><H2 |
>Name</H2 |
>SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN980" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN981" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_UpdateRects</B |
></CODE |
>(SDL_Surface *screen, int numrects, SDL_Rect *rects);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN987" |
></A |
><H2 |
>Description</H2 |
><P |
>Makes sure the given list of rectangles is updated on the given screen. |
The rectangles must all be confined within the screen boundaries (no |
clipping is done).</P |
><P |
>This function should not be called while <TT |
CLASS="PARAMETER" |
><I |
>screen</I |
></TT |
> is |
<A |
HREF="sdllocksurface.html" |
>locked</A |
>.</P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>It is adviced to call this function only once per frame, since each |
call has some processing overhead. This is no restriction since you |
can pass any number of rectangles each time.</P |
><P |
>The rectangles are not automatically merged or checked for overlap. In |
general, the programmer can use his knowledge about his particular |
rectangles to merge them in an efficient way, to avoid overdraw.</P |
></BLOCKQUOTE |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN996" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlupdaterect.html" |
><TT |
CLASS="FUNCTION" |
>SDL_UpdateRect</TT |
></A |
>, |
<A |
HREF="sdlrect.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Rect</SPAN |
></A |
>, |
<A |
HREF="sdlsurface.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Surface</SPAN |
></A |
>, |
<A |
HREF="sdllocksurface.html" |
><TT |
CLASS="FUNCTION" |
>SDL_LockSurface</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="sdlupdaterect.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="sdlflip.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_UpdateRect</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Flip</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdluserevent.html |
---|
0,0 → 1,329 |
<HTML |
><HEAD |
><TITLE |
>SDL_UserEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_SysWMEvent" |
HREF="sdlsyswmevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_QuitEvent" |
HREF="sdlquitevent.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="sdlsyswmevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlquitevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLUSEREVENT" |
>SDL_UserEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4097" |
></A |
><H2 |
>Name</H2 |
>SDL_UserEvent -- A user-defined event type</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4100" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint8 type; |
int code; |
void *data1; |
void *data2; |
} SDL_UserEvent;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4103" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN4105" |
></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_USEREVENT</TT |
> through to <TT |
CLASS="LITERAL" |
>SDL_NUMEVENTS-1</TT |
></TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>code</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>User defined event code</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>data1</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>User defined data pointer</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>data2</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>User defined data pointer</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4126" |
></A |
><H2 |
>Description</H2 |
><P |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_UserEvent</SPAN |
> is in the <TT |
CLASS="STRUCTFIELD" |
><I |
>user</I |
></TT |
> member of the structure <A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>. This event is unique, it is never created by SDL but only by the user. The event can be pushed onto the event queue using <A |
HREF="sdlpushevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PushEvent</TT |
></A |
>. The contents of the structure members or completely up to the programmer, the only requirement is that <TT |
CLASS="STRUCTFIELD" |
><I |
>type</I |
></TT |
> is a value from <TT |
CLASS="LITERAL" |
>SDL_USEREVENT</TT |
> to <TT |
CLASS="LITERAL" |
>SDL_NUMEVENTS-1</TT |
> (inclusive).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4138" |
></A |
><H2 |
>Examples</H2 |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>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);</PRE |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4142" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlpushevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PushEvent</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="sdlsyswmevent.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="sdlquitevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_SysWMEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventstructures.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_QuitEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlvideodrivername.html |
---|
0,0 → 1,235 |
<HTML |
><HEAD |
><TITLE |
>SDL_VideoDriverName</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_GetVideoInfo" |
HREF="sdlgetvideoinfo.html"><LINK |
REL="NEXT" |
TITLE="SDL_ListModes" |
HREF="sdllistmodes.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="sdlgetvideoinfo.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdllistmodes.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLVIDEODRIVERNAME" |
>SDL_VideoDriverName</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN722" |
></A |
><H2 |
>Name</H2 |
>SDL_VideoDriverName -- Obtain the name of the video driver</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN725" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN726" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>char *<B |
CLASS="FSFUNC" |
>SDL_VideoDriverName</B |
></CODE |
>(char *namebuf, int maxlen);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN732" |
></A |
><H2 |
>Description</H2 |
><P |
>The buffer pointed to by <TT |
CLASS="PARAMETER" |
><I |
>namebuf</I |
></TT |
> is filled up to a maximum of <TT |
CLASS="PARAMETER" |
><I |
>maxlen</I |
></TT |
> characters (include the NULL terminator) with the name of the initialised video driver. The driver name is a simple one word identifier like "x11" or "windib".</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN737" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <TT |
CLASS="LITERAL" |
>NULL</TT |
> if video has not been initialised with <TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
> or a pointer to <TT |
CLASS="PARAMETER" |
><I |
>namebuf</I |
></TT |
> otherwise.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN743" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
> |
<A |
HREF="sdlinitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_InitSubSystem</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="sdlgetvideoinfo.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="sdllistmodes.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetVideoInfo</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_ListModes</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlvideoinfo.html |
---|
0,0 → 1,400 |
<HTML |
><HEAD |
><TITLE |
>SDL_VideoInfo</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Surface" |
HREF="sdlsurface.html"><LINK |
REL="NEXT" |
TITLE="SDL_Overlay" |
HREF="sdloverlay.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="sdlsurface.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdloverlay.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLVIDEOINFO" |
>SDL_VideoInfo</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2968" |
></A |
><H2 |
>Name</H2 |
>SDL_VideoInfo -- Video Target information</DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2971" |
></A |
><H2 |
>Structure Definition</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef struct{ |
Uint32 hw_available:1; |
Uint32 wm_available:1; |
Uint32 blit_hw:1; |
Uint32 blit_hw_CC:1; |
Uint32 blit_hw_A:1; |
Uint32 blit_sw:1; |
Uint32 blit_sw_CC:1; |
Uint32 blit_sw_A:1; |
Uint32 blit_fill; |
Uint32 video_mem; |
SDL_PixelFormat *vfmt; |
} SDL_VideoInfo;</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2974" |
></A |
><H2 |
>Structure Data</H2 |
><DIV |
CLASS="INFORMALTABLE" |
><A |
NAME="AEN2976" |
></A |
><P |
></P |
><TABLE |
BORDER="0" |
CLASS="CALSTABLE" |
><TBODY |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>hw_available</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Is it possible to create hardware surfaces?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>wm_available</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Is there a window manager available</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_hw</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are hardware to hardware blits accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_hw_CC</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are hardware to hardware colorkey blits accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_hw_A</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are hardware to hardware alpha blits accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_sw</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are software to hardware blits accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_sw_CC</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are software to hardware colorkey blits accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_sw_A</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are software to hardware alpha blits accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>blit_fill</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Are color fills accelerated?</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>video_mem</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
>Total amount of video memory in Kilobytes</TD |
></TR |
><TR |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><TT |
CLASS="STRUCTFIELD" |
><I |
>vfmt</I |
></TT |
></TD |
><TD |
ALIGN="LEFT" |
VALIGN="TOP" |
><A |
HREF="sdlpixelformat.html" |
>Pixel format</A |
> of the video device</TD |
></TR |
></TBODY |
></TABLE |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3024" |
></A |
><H2 |
>Description</H2 |
><P |
>This (read-only) structure is returned by <A |
HREF="sdlgetvideoinfo.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetVideoInfo</TT |
></A |
>. It contains information on either the 'best' available mode (if called before <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>) or the current video mode.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3031" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlpixelformat.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_PixelFormat</SPAN |
></A |
>, |
<A |
HREF="sdlgetvideoinfo.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetVideoInfo</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="sdlsurface.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="sdloverlay.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Surface</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_Overlay</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlvideomodeok.html |
---|
0,0 → 1,262 |
<HTML |
><HEAD |
><TITLE |
>SDL_VideoModeOK</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_ListModes" |
HREF="sdllistmodes.html"><LINK |
REL="NEXT" |
TITLE="SDL_SetVideoMode" |
HREF="sdlsetvideomode.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="sdllistmodes.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlsetvideomode.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLVIDEOMODEOK" |
>SDL_VideoModeOK</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN797" |
></A |
><H2 |
>Name</H2 |
>SDL_VideoModeOK -- Check to see if a particular video mode is supported.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN800" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN801" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_VideoModeOK</B |
></CODE |
>(int width, int height, int bpp, Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN807" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_VideoModeOK</TT |
> returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> |
if the requested mode is not supported under any bit depth, or returns the |
bits-per-pixel of the closest available mode with the given width, height and requested <A |
HREF="sdlsurface.html" |
>surface</A |
> flags (see <A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>).</P |
><P |
>The bits-per-pixel value returned is only a suggested mode. You can usually request and bpp you want when <A |
HREF="sdlsetvideomode.html" |
>setting</A |
> the video mode and SDL will emulate that color depth with a shadow video surface.</P |
><P |
>The arguments to <TT |
CLASS="FUNCTION" |
>SDL_VideoModeOK</TT |
> are the same ones you |
would pass to <A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
></P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN820" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_Surface *screen; |
Uint32 bpp; |
. |
. |
. |
printf("Checking mode 640x480@16bpp.\n"); |
bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE); |
if(!bpp){ |
printf("Mode not available.\n"); |
exit(-1); |
} |
printf("SDL Recommends 640x480@%dbpp.\n", bpp); |
screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE); |
. |
.</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN823" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdlgetvideoinfo.html" |
><TT |
CLASS="FUNCTION" |
>SDL_GetVideoInfo</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="sdllistmodes.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="sdlsetvideomode.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_ListModes</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_SetVideoMode</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwaitevent.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_WaitEvent</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Event Functions." |
HREF="eventfunctions.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_PollEvent" |
HREF="sdlpollevent.html"><LINK |
REL="NEXT" |
TITLE="SDL_PushEvent" |
HREF="sdlpushevent.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="sdlpollevent.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlpushevent.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWAITEVENT" |
>SDL_WaitEvent</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN4964" |
></A |
><H2 |
>Name</H2 |
>SDL_WaitEvent -- Waits indefinitely for the next available event.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN4967" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN4968" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_WaitEvent</B |
></CODE |
>(SDL_Event *event);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4974" |
></A |
><H2 |
>Description</H2 |
><P |
>Waits indefinitely for the next available event, returning |
<SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
>, or <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if there was |
an error while waiting for events. </P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>event</I |
></TT |
> is not <TT |
CLASS="LITERAL" |
>NULL</TT |
>, the next |
event is removed from the queue and stored in that area.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN4982" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_Event</SPAN |
></A |
>, |
<A |
HREF="sdlpollevent.html" |
><TT |
CLASS="FUNCTION" |
>SDL_PollEvent</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="sdlpollevent.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="sdlpushevent.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_PollEvent</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="eventfunctions.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_PushEvent</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwaitthread.html |
---|
0,0 → 1,223 |
<HTML |
><HEAD |
><TITLE |
>SDL_WaitThread</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><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_GetThreadID" |
HREF="sdlgetthreadid.html"><LINK |
REL="NEXT" |
TITLE="SDL_KillThread" |
HREF="sdlkillthread.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="sdlgetthreadid.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlkillthread.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWAITTHREAD" |
>SDL_WaitThread</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN7217" |
></A |
><H2 |
>Name</H2 |
>SDL_WaitThread -- Wait for a thread to finish.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN7220" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN7221" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h" |
#include "SDL_thread.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_WaitThread</B |
></CODE |
>(SDL_Thread *thread, int *status);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7227" |
></A |
><H2 |
>Description</H2 |
><P |
>Wait for a thread to finish (timeouts are not supported).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7230" |
></A |
><H2 |
>Return Value</H2 |
><P |
>The return code for the thread function is placed in the area pointed to by |
<TT |
CLASS="PARAMETER" |
><I |
>status</I |
></TT |
>, if <TT |
CLASS="PARAMETER" |
><I |
>status</I |
></TT |
> is not |
<SPAN |
CLASS="RETURNVALUE" |
>NULL</SPAN |
>.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN7236" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlcreatethread.html" |
><TT |
CLASS="FUNCTION" |
>SDL_CreateThread</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="sdlgetthreadid.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="sdlkillthread.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_GetThreadID</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="thread.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_KillThread</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwarpmouse.html |
---|
0,0 → 1,197 |
<HTML |
><HEAD |
><TITLE |
>SDL_WarpMouse</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Video" |
HREF="video.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_DisplayFormatAlpha" |
HREF="sdldisplayformatalpha.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateCursor" |
HREF="sdlcreatecursor.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="sdldisplayformatalpha.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreatecursor.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWARPMOUSE" |
>SDL_WarpMouse</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN2046" |
></A |
><H2 |
>Name</H2 |
>SDL_WarpMouse -- Set the position of the mouse cursor.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN2049" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN2050" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_WarpMouse</B |
></CODE |
>(Uint16 x, Uint16 y);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2056" |
></A |
><H2 |
>Description</H2 |
><P |
>Set the position of the mouse cursor (generates a mouse motion event).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN2059" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlmousemotionevent.html" |
><SPAN |
CLASS="STRUCTNAME" |
>SDL_MouseMotionEvent</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="sdldisplayformatalpha.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="sdlcreatecursor.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_DisplayFormatAlpha</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="video.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateCursor</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwasinit.html |
---|
0,0 → 1,276 |
<HTML |
><HEAD |
><TITLE |
>SDL_WasInit</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="General" |
HREF="general.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Quit" |
HREF="sdlquit.html"><LINK |
REL="NEXT" |
TITLE="Video" |
HREF="video.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="sdlquit.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="video.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWASINIT" |
>SDL_WasInit</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN617" |
></A |
><H2 |
>Name</H2 |
>SDL_WasInit -- Check which subsystems are initialized</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN620" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN621" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>Uint32 <B |
CLASS="FSFUNC" |
>SDL_WasInit</B |
></CODE |
>(Uint32 flags);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN627" |
></A |
><H2 |
>Description</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_WasInit</TT |
> allows you to see which SDL subsytems have been <A |
HREF="sdlinit.html" |
>initialized</A |
>. <TT |
CLASS="PARAMETER" |
><I |
>flags</I |
></TT |
> is a bitwise OR'd combination of the subsystems you wish to check (see <A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
> for a list of subsystem flags).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN635" |
></A |
><H2 |
>Return Value</H2 |
><P |
><TT |
CLASS="FUNCTION" |
>SDL_WasInit</TT |
> returns a bitwised OR'd combination of the initialized subsystems.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN639" |
></A |
><H2 |
>Examples</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
> /* Here are several ways you can use SDL_WasInit() */ |
/* Get init data on all the subsystems */ |
Uint32 subsystem_init; |
subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING); |
if(subsystem_init&SDL_INIT_VIDEO) |
printf("Video is initialized.\n"); |
else |
printf("Video is not initialized.\n"); |
/* Just check for one specfic subsystem */ |
if(SDL_WasInit(SDL_INIT_VIDEO)!=0) |
printf("Video is initialized.\n"); |
else |
printf("Video is not initialized.\n"); |
/* Check for two subsystems */ |
Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO; |
if(SDL_WasInit(subsystem_mask)==subsystem_mask) |
printf("Video and Audio initialized.\n"); |
else |
printf("Video and Audio not initialized.\n"); </PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN642" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlinit.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Init</TT |
></A |
>, |
<A |
HREF="sdlinitsubsystem.html" |
><TT |
CLASS="FUNCTION" |
>SDL_Subsystem</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="sdlquit.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="video.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Quit</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="general.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Video</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwmgetcaption.html |
---|
0,0 → 1,214 |
<HTML |
><HEAD |
><TITLE |
>SDL_WM_GetCaption</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WM_SetCaption" |
HREF="sdlwmsetcaption.html"><LINK |
REL="NEXT" |
TITLE="SDL_WM_SetIcon" |
HREF="sdlwmseticon.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="sdlwmsetcaption.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwmseticon.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWMGETCAPTION" |
>SDL_WM_GetCaption</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3134" |
></A |
><H2 |
>Name</H2 |
>SDL_WM_GetCaption -- Gets the window title and icon name.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN3137" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN3138" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_WM_GetCaption</B |
></CODE |
>(char **title, char **icon);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3144" |
></A |
><H2 |
>Description</H2 |
><P |
>Set pointers to the window <TT |
CLASS="PARAMETER" |
><I |
>title</I |
></TT |
> and <TT |
CLASS="PARAMETER" |
><I |
>icon</I |
></TT |
> name.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3149" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlwmsetcaption.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WM_SetCaption</TT |
></A |
>, |
<A |
HREF="sdlwmseticon.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WM_SetIcon</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="sdlwmsetcaption.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="sdlwmseticon.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WM_SetCaption</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="wm.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WM_SetIcon</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwmgrabinput.html |
---|
0,0 → 1,216 |
<HTML |
><HEAD |
><TITLE |
>SDL_WM_GrabInput</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WM_ToggleFullScreen" |
HREF="sdlwmtogglefullscreen.html"><LINK |
REL="NEXT" |
TITLE="Events" |
HREF="event.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="sdlwmtogglefullscreen.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="event.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWMGRABINPUT" |
>SDL_WM_GrabInput</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3241" |
></A |
><H2 |
>Name</H2 |
>SDL_WM_GrabInput -- Grabs mouse and keyboard input.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN3244" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN3245" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>SDL_GrabMode <B |
CLASS="FSFUNC" |
>SDL_WM_GrabInput</B |
></CODE |
>(SDL_GrabMode mode);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3251" |
></A |
><H2 |
>Description</H2 |
><P |
>Grabbing means that the mouse is confined to the application window, |
and nearly all keyboard input is passed directly to the application, |
and not interpreted by a window manager, if any.</P |
><P |
>When <TT |
CLASS="PARAMETER" |
><I |
>mode</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>SDL_GRAB_QUERY</TT |
> the grab mode is not changed, but the current grab mode is returned.</P |
><P |
><PRE |
CLASS="PROGRAMLISTING" |
>typedef enum { |
SDL_GRAB_QUERY, |
SDL_GRAB_OFF, |
SDL_GRAB_ON |
} SDL_GrabMode;</PRE |
> |
</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3259" |
></A |
><H2 |
>Return Value</H2 |
><P |
>The current/new <SPAN |
CLASS="STRUCTNAME" |
>SDL_GrabMode</SPAN |
>.</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="sdlwmtogglefullscreen.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="event.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WM_ToggleFullScreen</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="wm.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>Events</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwmiconifywindow.html |
---|
0,0 → 1,203 |
<HTML |
><HEAD |
><TITLE |
>SDL_WM_IconifyWindow</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WM_SetIcon" |
HREF="sdlwmseticon.html"><LINK |
REL="NEXT" |
TITLE="SDL_WM_ToggleFullScreen" |
HREF="sdlwmtogglefullscreen.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="sdlwmseticon.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwmtogglefullscreen.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWMICONIFYWINDOW" |
>SDL_WM_IconifyWindow</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3195" |
></A |
><H2 |
>Name</H2 |
>SDL_WM_IconifyWindow -- Iconify/Minimise the window</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN3198" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN3199" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_WM_IconifyWindow</B |
></CODE |
>(void);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3205" |
></A |
><H2 |
>Description</H2 |
><P |
>If the application is running in a window managed environment SDL attempts to iconify/minimise it. If <TT |
CLASS="FUNCTION" |
>SDL_WM_IconifyWindow</TT |
> is successful, the application will receive a <A |
HREF="sdlactiveevent.html" |
><TT |
CLASS="LITERAL" |
>SDL_APPACTIVE</TT |
></A |
> loss event.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3211" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns non-zero on success or <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> if iconification is not support or was refused by the window manager.</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="sdlwmseticon.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="sdlwmtogglefullscreen.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WM_SetIcon</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="wm.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WM_ToggleFullScreen</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwmsetcaption.html |
---|
0,0 → 1,204 |
<HTML |
><HEAD |
><TITLE |
>SDL_WM_SetCaption</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="PREVIOUS" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="NEXT" |
TITLE="SDL_WM_GetCaption" |
HREF="sdlwmgetcaption.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="wm.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwmgetcaption.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWMSETCAPTION" |
>SDL_WM_SetCaption</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3110" |
></A |
><H2 |
>Name</H2 |
>SDL_WM_SetCaption -- Sets the window tile and icon name.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN3113" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN3114" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_WM_SetCaption</B |
></CODE |
>(const char *title, const char *icon);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3120" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the title-bar and icon name of the display window.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3123" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlwmgetcaption.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WM_GetCaption</TT |
></A |
>, |
<A |
HREF="sdlwmseticon.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WM_SetIcon</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="wm.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="sdlwmgetcaption.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>Window Management</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="wm.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WM_GetCaption</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwmseticon.html |
---|
0,0 → 1,244 |
<HTML |
><HEAD |
><TITLE |
>SDL_WM_SetIcon</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WM_GetCaption" |
HREF="sdlwmgetcaption.html"><LINK |
REL="NEXT" |
TITLE="SDL_WM_IconifyWindow" |
HREF="sdlwmiconifywindow.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="sdlwmgetcaption.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwmiconifywindow.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWMSETICON" |
>SDL_WM_SetIcon</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3160" |
></A |
><H2 |
>Name</H2 |
>SDL_WM_SetIcon -- Sets the icon for the display window.</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN3163" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN3164" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>void <B |
CLASS="FSFUNC" |
>SDL_WM_SetIcon</B |
></CODE |
>(SDL_Surface *icon, Uint8 *mask);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3170" |
></A |
><H2 |
>Description</H2 |
><P |
>Sets the icon for the display window.</P |
><P |
>This function must be called before the first call to |
<A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
>.</P |
><P |
>It takes an <TT |
CLASS="PARAMETER" |
><I |
>icon</I |
></TT |
> surface, and a <TT |
CLASS="PARAMETER" |
><I |
>mask</I |
></TT |
> in MSB format.</P |
><P |
>If <TT |
CLASS="PARAMETER" |
><I |
>mask</I |
></TT |
> is <TT |
CLASS="LITERAL" |
>NULL</TT |
>, the entire |
icon surface will be used as the icon.</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3181" |
></A |
><H2 |
>Example</H2 |
><PRE |
CLASS="PROGRAMLISTING" |
>SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);</PRE |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3184" |
></A |
><H2 |
>See Also</H2 |
><P |
><A |
HREF="sdlsetvideomode.html" |
><TT |
CLASS="FUNCTION" |
>SDL_SetVideoMode</TT |
></A |
>, |
<A |
HREF="sdlwmsetcaption.html" |
><TT |
CLASS="FUNCTION" |
>SDL_WM_SetCaption</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="sdlwmgetcaption.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="sdlwmiconifywindow.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WM_GetCaption</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="wm.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WM_IconifyWindow</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/sdlwmtogglefullscreen.html |
---|
0,0 → 1,197 |
<HTML |
><HEAD |
><TITLE |
>SDL_WM_ToggleFullScreen</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="Window Management" |
HREF="wm.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WM_IconifyWindow" |
HREF="sdlwmiconifywindow.html"><LINK |
REL="NEXT" |
TITLE="SDL_WM_GrabInput" |
HREF="sdlwmgrabinput.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="sdlwmiconifywindow.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwmgrabinput.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><H1 |
><A |
NAME="SDLWMTOGGLEFULLSCREEN" |
>SDL_WM_ToggleFullScreen</A |
></H1 |
><DIV |
CLASS="REFNAMEDIV" |
><A |
NAME="AEN3219" |
></A |
><H2 |
>Name</H2 |
>SDL_WM_ToggleFullScreen -- Toggles fullscreen mode</DIV |
><DIV |
CLASS="REFSYNOPSISDIV" |
><A |
NAME="AEN3222" |
></A |
><H2 |
>Synopsis</H2 |
><DIV |
CLASS="FUNCSYNOPSIS" |
><A |
NAME="AEN3223" |
></A |
><P |
></P |
><PRE |
CLASS="FUNCSYNOPSISINFO" |
>#include "SDL.h"</PRE |
><P |
><CODE |
><CODE |
CLASS="FUNCDEF" |
>int <B |
CLASS="FSFUNC" |
>SDL_WM_ToggleFullScreen</B |
></CODE |
>(SDL_Surface *surface);</CODE |
></P |
><P |
></P |
></DIV |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3229" |
></A |
><H2 |
>Description</H2 |
><P |
>Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental).</P |
></DIV |
><DIV |
CLASS="REFSECT1" |
><A |
NAME="AEN3232" |
></A |
><H2 |
>Return Value</H2 |
><P |
>Returns <SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
> on failure or <SPAN |
CLASS="RETURNVALUE" |
>1</SPAN |
> on success.</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="sdlwmiconifywindow.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="sdlwmgrabinput.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WM_IconifyWindow</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="wm.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WM_GrabInput</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/thread.html |
---|
0,0 → 1,305 |
<HTML |
><HEAD |
><TITLE |
>Multi-threaded Programming</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Reference" |
HREF="reference.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_CDtrack" |
HREF="sdlcdtrack.html"><LINK |
REL="NEXT" |
TITLE="SDL_CreateThread" |
HREF="sdlcreatethread.html"><META |
NAME="KEYWORD" |
CONTENT="threads"><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="sdlcdtrack.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlcreatethread.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><DIV |
CLASS="CHAPTER" |
><H1 |
><A |
NAME="THREAD" |
>Chapter 12. Multi-threaded Programming</A |
></H1 |
><DIV |
CLASS="TOC" |
><DL |
><DT |
><B |
>Table of Contents</B |
></DT |
><DT |
><A |
HREF="sdlcreatethread.html" |
>SDL_CreateThread</A |
> — Creates a new thread of execution that shares its parent's properties.</DT |
><DT |
><A |
HREF="sdlthreadid.html" |
>SDL_ThreadID</A |
> — Get the 32-bit thread identifier for the current thread.</DT |
><DT |
><A |
HREF="sdlgetthreadid.html" |
>SDL_GetThreadID</A |
> — Get the SDL thread ID of a SDL_Thread</DT |
><DT |
><A |
HREF="sdlwaitthread.html" |
>SDL_WaitThread</A |
> — Wait for a thread to finish.</DT |
><DT |
><A |
HREF="sdlkillthread.html" |
>SDL_KillThread</A |
> — Gracelessly terminates the thread.</DT |
><DT |
><A |
HREF="sdlcreatemutex.html" |
>SDL_CreateMutex</A |
> — Create a mutex</DT |
><DT |
><A |
HREF="sdldestroymutex.html" |
>SDL_DestroyMutex</A |
> — Destroy a mutex</DT |
><DT |
><A |
HREF="sdlmutexp.html" |
>SDL_mutexP</A |
> — Lock a mutex</DT |
><DT |
><A |
HREF="sdlmutexv.html" |
>SDL_mutexV</A |
> — Unlock a mutex</DT |
><DT |
><A |
HREF="sdlcreatesemaphore.html" |
>SDL_CreateSemaphore</A |
> — Creates a new semaphore and assigns an initial value to it.</DT |
><DT |
><A |
HREF="sdldestroysemaphore.html" |
>SDL_DestroySemaphore</A |
> — Destroys a semaphore that was created by <A |
HREF="sdlcreatesemaphore.html" |
>SDL_CreateSemaphore</A |
>.</DT |
><DT |
><A |
HREF="sdlsemwait.html" |
>SDL_SemWait</A |
> — Lock a semaphore and suspend the thread if the semaphore value is zero.</DT |
><DT |
><A |
HREF="sdlsemtrywait.html" |
>SDL_SemTryWait</A |
> — Attempt to lock a semaphore but don't suspend the thread.</DT |
><DT |
><A |
HREF="sdlsemwaittimeout.html" |
>SDL_SemWaitTimeout</A |
> — Lock a semaphore, but only wait up to a specified maximum time.</DT |
><DT |
><A |
HREF="sdlsempost.html" |
>SDL_SemPost</A |
> — Unlock a semaphore.</DT |
><DT |
><A |
HREF="sdlsemvalue.html" |
>SDL_SemValue</A |
> — Return the current value of a semaphore.</DT |
><DT |
><A |
HREF="sdlcreatecond.html" |
>SDL_CreateCond</A |
> — Create a condition variable</DT |
><DT |
><A |
HREF="sdldestroycond.html" |
>SDL_DestroyCond</A |
> — Destroy a condition variable</DT |
><DT |
><A |
HREF="sdlcondsignal.html" |
>SDL_CondSignal</A |
> — Restart a thread wait on a condition variable</DT |
><DT |
><A |
HREF="sdlcondbroadcast.html" |
>SDL_CondBroadcast</A |
> — Restart all threads waiting on a condition variable</DT |
><DT |
><A |
HREF="sdlcondwait.html" |
>SDL_CondWait</A |
> — Wait on a condition variable</DT |
><DT |
><A |
HREF="sdlcondwaittimeout.html" |
>SDL_CondWaitTimeout</A |
> — Wait on a condition variable, with timeout</DT |
></DL |
></DIV |
><P |
>SDL provides functions for creating threads, mutexes, semphores and condition variables.</P |
><P |
>In general, you must be very aware of concurrency and data integrity issues |
when writing multi-threaded programs. Some good guidelines include: |
<P |
></P |
><UL |
><LI |
><P |
>Don't call SDL video/event functions from separate threads</P |
></LI |
><LI |
><P |
>Don't use any library functions in separate threads</P |
></LI |
><LI |
><P |
>Don't perform any memory management in separate threads</P |
></LI |
><LI |
><P |
>Lock global variables which may be accessed by multiple threads</P |
></LI |
><LI |
><P |
>Never terminate threads, always set a flag and wait for them to quit</P |
></LI |
><LI |
><P |
>Think very carefully about all possible ways your code may interact</P |
></LI |
></UL |
></P |
><DIV |
CLASS="NOTE" |
><BLOCKQUOTE |
CLASS="NOTE" |
><P |
><B |
>Note: </B |
>SDL's threading is not implemented on MacOS, due to that lack of preemptive thread support (eck!)</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="sdlcdtrack.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="sdlcreatethread.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_CDtrack</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="reference.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_CreateThread</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/time.html |
---|
0,0 → 1,198 |
<HTML |
><HEAD |
><TITLE |
>Time</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Reference" |
HREF="reference.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_CondWaitTimeout" |
HREF="sdlcondwaittimeout.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetTicks" |
HREF="sdlgetticks.html"><META |
NAME="KEYWORD" |
CONTENT="time"><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="sdlcondwaittimeout.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetticks.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><DIV |
CLASS="CHAPTER" |
><H1 |
><A |
NAME="TIME" |
>Chapter 13. Time</A |
></H1 |
><DIV |
CLASS="TOC" |
><DL |
><DT |
><B |
>Table of Contents</B |
></DT |
><DT |
><A |
HREF="sdlgetticks.html" |
>SDL_GetTicks</A |
> — Get the number of milliseconds since the SDL library initialization.</DT |
><DT |
><A |
HREF="sdldelay.html" |
>SDL_Delay</A |
> — Wait a specified number of milliseconds before returning.</DT |
><DT |
><A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
> — Add a timer which will call a callback after the specified number of milliseconds has |
elapsed.</DT |
><DT |
><A |
HREF="sdlremovetimer.html" |
>SDL_RemoveTimer</A |
> — Remove a timer which was added with |
<A |
HREF="sdladdtimer.html" |
>SDL_AddTimer</A |
>.</DT |
><DT |
><A |
HREF="sdlsettimer.html" |
>SDL_SetTimer</A |
> — Set a callback to run after the specified number of milliseconds has |
elapsed.</DT |
></DL |
></DIV |
><P |
>SDL provides several cross-platform functions for dealing with time. |
It provides a way to get the current time, a way to wait a little while, |
and a simple timer mechanism. These functions give you two ways of moving an |
object every x milliseconds: |
<P |
></P |
><UL |
><LI |
><P |
>Use a timer callback function. This may have the bad effect that it runs in a seperate thread or uses alarm signals, but it's easier to implement.</P |
></LI |
><LI |
><P |
>Or you can get the number of milliseconds passed, and move the object if, for example, 30 ms passed.</P |
></LI |
></UL |
> </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="sdlcondwaittimeout.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="sdlgetticks.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_CondWaitTimeout</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="reference.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetTicks</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/video.html |
---|
0,0 → 1,499 |
<HTML |
><HEAD |
><TITLE |
>Video</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Reference" |
HREF="reference.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_WasInit" |
HREF="sdlwasinit.html"><LINK |
REL="NEXT" |
TITLE="SDL_GetVideoSurface" |
HREF="sdlgetvideosurface.html"><META |
NAME="KEYWORD" |
CONTENT="video"><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="sdlwasinit.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlgetvideosurface.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><DIV |
CLASS="CHAPTER" |
><H1 |
><A |
NAME="VIDEO" |
>Chapter 6. Video</A |
></H1 |
><DIV |
CLASS="TOC" |
><DL |
><DT |
><B |
>Table of Contents</B |
></DT |
><DT |
><A |
HREF="sdlgetvideosurface.html" |
>SDL_GetVideoSurface</A |
> — returns a pointer to the current display surface</DT |
><DT |
><A |
HREF="sdlgetvideoinfo.html" |
>SDL_GetVideoInfo</A |
> — returns a pointer to information about the video hardware</DT |
><DT |
><A |
HREF="sdlvideodrivername.html" |
>SDL_VideoDriverName</A |
> — Obtain the name of the video driver</DT |
><DT |
><A |
HREF="sdllistmodes.html" |
>SDL_ListModes</A |
> — Returns a pointer to an array of available screen dimensions for |
the given format and video flags</DT |
><DT |
><A |
HREF="sdlvideomodeok.html" |
>SDL_VideoModeOK</A |
> — Check to see if a particular video mode is supported.</DT |
><DT |
><A |
HREF="sdlsetvideomode.html" |
>SDL_SetVideoMode</A |
> — Set up a video mode with the specified width, height and bits-per-pixel.</DT |
><DT |
><A |
HREF="sdlupdaterect.html" |
>SDL_UpdateRect</A |
> — Makes sure the given area is updated on the given screen.</DT |
><DT |
><A |
HREF="sdlupdaterects.html" |
>SDL_UpdateRects</A |
> — Makes sure the given list of rectangles is updated on the given screen.</DT |
><DT |
><A |
HREF="sdlflip.html" |
>SDL_Flip</A |
> — Swaps screen buffers</DT |
><DT |
><A |
HREF="sdlsetcolors.html" |
>SDL_SetColors</A |
> — Sets a portion of the colormap for the given 8-bit surface.</DT |
><DT |
><A |
HREF="sdlsetpalette.html" |
>SDL_SetPalette</A |
> — Sets the colors in the palette of an 8-bit surface.</DT |
><DT |
><A |
HREF="sdlsetgamma.html" |
>SDL_SetGamma</A |
> — Sets the color gamma function for the display</DT |
><DT |
><A |
HREF="sdlgetgammaramp.html" |
>SDL_GetGammaRamp</A |
> — Gets the color gamma lookup tables for the display</DT |
><DT |
><A |
HREF="sdlsetgammaramp.html" |
>SDL_SetGammaRamp</A |
> — Sets the color gamma lookup tables for the display</DT |
><DT |
><A |
HREF="sdlmaprgb.html" |
>SDL_MapRGB</A |
> — Map a RGB color value to a pixel format.</DT |
><DT |
><A |
HREF="sdlmaprgba.html" |
>SDL_MapRGBA</A |
> — Map a RGBA color value to a pixel format.</DT |
><DT |
><A |
HREF="sdlgetrgb.html" |
>SDL_GetRGB</A |
> — Get RGB values from a pixel in the specified pixel format.</DT |
><DT |
><A |
HREF="sdlgetrgba.html" |
>SDL_GetRGBA</A |
> — Get RGBA values from a pixel in the specified pixel format.</DT |
><DT |
><A |
HREF="sdlcreatergbsurface.html" |
>SDL_CreateRGBSurface</A |
> — Create an empty SDL_Surface</DT |
><DT |
><A |
HREF="sdlcreatergbsurfacefrom.html" |
>SDL_CreateRGBSurfaceFrom</A |
> — Create an SDL_Surface from pixel data</DT |
><DT |
><A |
HREF="sdlfreesurface.html" |
>SDL_FreeSurface</A |
> — Frees (deletes) a SDL_Surface</DT |
><DT |
><A |
HREF="sdllocksurface.html" |
>SDL_LockSurface</A |
> — Lock a surface for directly access.</DT |
><DT |
><A |
HREF="sdlunlocksurface.html" |
>SDL_UnlockSurface</A |
> — Unlocks a previously locked surface.</DT |
><DT |
><A |
HREF="sdlloadbmp.html" |
>SDL_LoadBMP</A |
> — Load a Windows BMP file into an SDL_Surface.</DT |
><DT |
><A |
HREF="sdlsavebmp.html" |
>SDL_SaveBMP</A |
> — Save an SDL_Surface as a Windows BMP file.</DT |
><DT |
><A |
HREF="sdlsetcolorkey.html" |
>SDL_SetColorKey</A |
> — Sets the color key (transparent pixel) in a blittable surface and |
RLE acceleration.</DT |
><DT |
><A |
HREF="sdlsetalpha.html" |
>SDL_SetAlpha</A |
> — Adjust the alpha properties of a surface</DT |
><DT |
><A |
HREF="sdlsetcliprect.html" |
>SDL_SetClipRect</A |
> — Sets the clipping rectangle for a surface.</DT |
><DT |
><A |
HREF="sdlgetcliprect.html" |
>SDL_GetClipRect</A |
> — Gets the clipping rectangle for a surface.</DT |
><DT |
><A |
HREF="sdlconvertsurface.html" |
>SDL_ConvertSurface</A |
> — Converts a surface to the same format as another surface.</DT |
><DT |
><A |
HREF="sdlblitsurface.html" |
>SDL_BlitSurface</A |
> — This performs a fast blit from the source surface to the destination surface.</DT |
><DT |
><A |
HREF="sdlfillrect.html" |
>SDL_FillRect</A |
> — This function performs a fast fill of the given rectangle with some color</DT |
><DT |
><A |
HREF="sdldisplayformat.html" |
>SDL_DisplayFormat</A |
> — Convert a surface to the display format</DT |
><DT |
><A |
HREF="sdldisplayformatalpha.html" |
>SDL_DisplayFormatAlpha</A |
> — Convert a surface to the display format</DT |
><DT |
><A |
HREF="sdlwarpmouse.html" |
>SDL_WarpMouse</A |
> — Set the position of the mouse cursor.</DT |
><DT |
><A |
HREF="sdlcreatecursor.html" |
>SDL_CreateCursor</A |
> — Creates a new mouse cursor.</DT |
><DT |
><A |
HREF="sdlfreecursor.html" |
>SDL_FreeCursor</A |
> — Frees a cursor created with SDL_CreateCursor.</DT |
><DT |
><A |
HREF="sdlsetcursor.html" |
>SDL_SetCursor</A |
> — Set the currently active mouse cursor.</DT |
><DT |
><A |
HREF="sdlgetcursor.html" |
>SDL_GetCursor</A |
> — Get the currently active mouse cursor.</DT |
><DT |
><A |
HREF="sdlshowcursor.html" |
>SDL_ShowCursor</A |
> — Toggle whether or not the cursor is shown on the screen.</DT |
><DT |
><A |
HREF="sdlglloadlibrary.html" |
>SDL_GL_LoadLibrary</A |
> — Specify an OpenGL library</DT |
><DT |
><A |
HREF="sdlglgetprocaddress.html" |
>SDL_GL_GetProcAddress</A |
> — Get the address of a GL function</DT |
><DT |
><A |
HREF="sdlglgetattribute.html" |
>SDL_GL_GetAttribute</A |
> — Get the value of a special SDL/OpenGL attribute</DT |
><DT |
><A |
HREF="sdlglsetattribute.html" |
>SDL_GL_SetAttribute</A |
> — Set a special SDL/OpenGL attribute</DT |
><DT |
><A |
HREF="sdlglswapbuffers.html" |
>SDL_GL_SwapBuffers</A |
> — Swap OpenGL framebuffers/Update Display</DT |
><DT |
><A |
HREF="sdlcreateyuvoverlay.html" |
>SDL_CreateYUVOverlay</A |
> — Create a YUV video overlay</DT |
><DT |
><A |
HREF="sdllockyuvoverlay.html" |
>SDL_LockYUVOverlay</A |
> — Lock an overlay</DT |
><DT |
><A |
HREF="sdlunlockyuvoverlay.html" |
>SDL_UnlockYUVOverlay</A |
> — Unlock an overlay</DT |
><DT |
><A |
HREF="sdldisplayyuvoverlay.html" |
>SDL_DisplayYUVOverlay</A |
> — Blit the overlay to the display</DT |
><DT |
><A |
HREF="sdlfreeyuvoverlay.html" |
>SDL_FreeYUVOverlay</A |
> — Free a YUV video overlay</DT |
><DT |
><A |
HREF="sdlglattr.html" |
>SDL_GLattr</A |
> — SDL GL Attributes</DT |
><DT |
><A |
HREF="sdlrect.html" |
>SDL_Rect</A |
> — Defines a rectangular area</DT |
><DT |
><A |
HREF="sdlcolor.html" |
>SDL_Color</A |
> — Format independent color description</DT |
><DT |
><A |
HREF="sdlpalette.html" |
>SDL_Palette</A |
> — Color palette for 8-bit pixel formats</DT |
><DT |
><A |
HREF="sdlpixelformat.html" |
>SDL_PixelFormat</A |
> — Stores surface format information</DT |
><DT |
><A |
HREF="sdlsurface.html" |
>SDL_Surface</A |
> — Graphical Surface Structure</DT |
><DT |
><A |
HREF="sdlvideoinfo.html" |
>SDL_VideoInfo</A |
> — Video Target information</DT |
><DT |
><A |
HREF="sdloverlay.html" |
>SDL_Overlay</A |
> — YUV video overlay</DT |
></DL |
></DIV |
><P |
>SDL presents a very simple interface to the display framebuffer. The |
framebuffer is represented as an offscreen surface to which you can write |
directly. If you want the screen to show what you have written, call the <A |
HREF="sdlupdaterects.html" |
>update</A |
> function which will |
guarantee that the desired portion of the screen is updated.</P |
><P |
>Before you call any of the SDL video functions, you must first call |
<SPAN |
CLASS="TOKEN" |
>SDL_Init(SDL_INIT_VIDEO)</SPAN |
>, which initializes the video |
and events in the SDL library. Check the return code, which should be |
<SPAN |
CLASS="RETURNVALUE" |
>0</SPAN |
>, to see if there were any errors in starting up.</P |
><P |
>If you use both sound and video in your application, you need to call |
<SPAN |
CLASS="TOKEN" |
>SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO)</SPAN |
> before opening the |
sound device, otherwise under Win32 DirectX, you won't be able to set |
full-screen display modes.</P |
><P |
>After you have initialized the library, you can start up the video display in a |
number of ways. The easiest way is to pick a common screen resolution and |
depth and just initialize the video, checking for errors. You will probably |
get what you want, but SDL may be emulating your requested mode and converting |
the display on update. The best way is to |
<A |
HREF="sdlgetvideoinfo.html" |
>query</A |
>, for the best |
video mode closest to the desired one, and then |
<A |
HREF="sdldisplayformat.html" |
>convert</A |
> |
your images to that pixel format.</P |
><P |
>SDL currently supports any bit depth >= 8 bits per pixel. 8 bpp formats are |
considered 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel |
are considered "packed pixel" modes, meaning each pixel contains the RGB color |
components packed in the bits of the pixel.</P |
><P |
>After you have initialized your video mode, you can take the surface that was |
returned, and write to it like any other framebuffer, calling the update |
routine as you go.</P |
><P |
>When you have finished your video access and are ready to quit your |
application, you should call "<SPAN |
CLASS="TOKEN" |
>SDL_Quit()</SPAN |
>" to shutdown the |
video and events.</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="sdlwasinit.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="sdlgetvideosurface.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_WasInit</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="reference.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_GetVideoSurface</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/html/wm.html |
---|
0,0 → 1,180 |
<HTML |
><HEAD |
><TITLE |
>Window Management</TITLE |
><META |
NAME="GENERATOR" |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
"><LINK |
REL="HOME" |
TITLE="SDL Library Documentation" |
HREF="index.html"><LINK |
REL="UP" |
TITLE="SDL Reference" |
HREF="reference.html"><LINK |
REL="PREVIOUS" |
TITLE="SDL_Overlay" |
HREF="sdloverlay.html"><LINK |
REL="NEXT" |
TITLE="SDL_WM_SetCaption" |
HREF="sdlwmsetcaption.html"><META |
NAME="KEYWORD" |
CONTENT="wm"><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="sdloverlay.html" |
>Prev</A |
></TD |
><TD |
WIDTH="80%" |
ALIGN="center" |
VALIGN="bottom" |
></TD |
><TD |
WIDTH="10%" |
ALIGN="right" |
VALIGN="bottom" |
><A |
HREF="sdlwmsetcaption.html" |
>Next</A |
></TD |
></TR |
></TABLE |
><HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><DIV |
CLASS="CHAPTER" |
><H1 |
><A |
NAME="WM" |
>Chapter 7. Window Management</A |
></H1 |
><DIV |
CLASS="TOC" |
><DL |
><DT |
><B |
>Table of Contents</B |
></DT |
><DT |
><A |
HREF="sdlwmsetcaption.html" |
>SDL_WM_SetCaption</A |
> — Sets the window tile and icon name.</DT |
><DT |
><A |
HREF="sdlwmgetcaption.html" |
>SDL_WM_GetCaption</A |
> — Gets the window title and icon name.</DT |
><DT |
><A |
HREF="sdlwmseticon.html" |
>SDL_WM_SetIcon</A |
> — Sets the icon for the display window.</DT |
><DT |
><A |
HREF="sdlwmiconifywindow.html" |
>SDL_WM_IconifyWindow</A |
> — Iconify/Minimise the window</DT |
><DT |
><A |
HREF="sdlwmtogglefullscreen.html" |
>SDL_WM_ToggleFullScreen</A |
> — Toggles fullscreen mode</DT |
><DT |
><A |
HREF="sdlwmgrabinput.html" |
>SDL_WM_GrabInput</A |
> — Grabs mouse and keyboard input.</DT |
></DL |
></DIV |
><P |
>SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)</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="sdloverlay.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="sdlwmsetcaption.html" |
>Next</A |
></TD |
></TR |
><TR |
><TD |
WIDTH="33%" |
ALIGN="left" |
VALIGN="top" |
>SDL_Overlay</TD |
><TD |
WIDTH="34%" |
ALIGN="center" |
VALIGN="top" |
><A |
HREF="reference.html" |
>Up</A |
></TD |
><TD |
WIDTH="33%" |
ALIGN="right" |
VALIGN="top" |
>SDL_WM_SetCaption</TD |
></TR |
></TABLE |
></DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/docs/index.html |
---|
0,0 → 1,121 |
<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN"> |
<HTML |
><HEAD |
><TITLE |
>Introduction</TITLE |
> |
</HEAD |
><BODY |
BGCOLOR="#FFF8DC" |
TEXT="#000000" |
LINK="#0000ee" |
VLINK="#551a8b" |
ALINK="#ff0000" |
><DIV |
CLASS="NAVHEADER" |
> |
<HR |
ALIGN="LEFT" |
WIDTH="100%"></DIV |
><DIV |
CLASS="PREFACE" |
><H1 |
><A |
NAME="AEN8" |
>Introduction</A |
></H1 |
><P |
>This library is designed to make it easy to write games that run on Linux, |
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. This is a fairly low level API, but using this, completely |
portable applications can be written with a great deal of flexibility.</P |
><P |
>The library is loaded as a dynamically linked library on its native |
platform, and is currently compiled natively for Linux, compiled for |
Win32 using a Linux hosted GCC |
<A |
HREF="http://www.libsdl.org/Xmingw32/" |
TARGET="_top" |
>cross-compilation</A |
> |
environment, and compiled using the EGCS C++ compiler under BeOS.</P |
><P |
>An introduction to SDL can be found online at: |
<A |
HREF="http://www.libsdl.org/intro/toc.html" |
TARGET="_top" |
>http://www.libsdl.org/intro/</A |
> </P |
><P |
>There are code examples on each of the main library pages, and there are |
fully fleshed example C++ classes and programs in the examples archive, |
available on the |
<A |
HREF="http://www.libsdl.org/download.html" |
TARGET="_top" |
>SDL download page</A |
>.</P |
><P |
>For an introduction to basic multi-media programming concepts, you might try |
some of the following links: |
<P |
></P |
><UL |
><LI |
><P |
><A |
HREF="http://www.ziron.com/links/" |
TARGET="_top" |
>Game Programming Links</A |
></P |
></LI |
><LI |
><P |
><A |
HREF="http://developer.dungeon-crawl.com/" |
TARGET="_top" |
>Game Developer Search Engine</A |
></P |
></LI |
></UL |
></P |
><P |
>Enjoy!</P |
><P |
> Sam Lantinga |
<TT |
CLASS="EMAIL" |
><<A |
HREF="mailto:slouken@libsdl.org" |
><A |
HREF="mailto:slouken@libsdl.org" |
TARGET="_top" |
>slouken@libsdl.org</A |
></A |
>></TT |
></P |
> |
<P> |
<br><br><HR> |
<H1>Table of Contents</H1> |
<UL> |
<LI><A HREF="html/index.html">Full Table of Contents</A></LI> |
<LI><A HREF="html/guide.html">The SDL Guide</A></LI> |
<LI><A HREF="html/reference.html">The SDL Reference</A></LI> |
<UL> |
<LI><A HREF="html/general.html">Initialization</A></LI> |
<LI><A HREF="html/video.html">Video</A></LI> |
<LI><A HREF="html/wm.html">Window Manager</A></LI> |
<LI><A HREF="html/event.html">Event Handling</A></LI> |
<LI><A HREF="html/joystick.html">Joystick</A></LI> |
<LI><A HREF="html/audio.html">Audio</A></LI> |
<LI><A HREF="html/cdrom.html">CDROM</A></LI> |
<LI><A HREF="html/thread.html">Threads</A></LI> |
<LI><A HREF="html/time.html">Timers</A></LI> |
</UL> |
</UL> |
</DIV |
></BODY |
></HTML |
> |
/contrib/sdk/sources/SDL-1.2.2/fire-1.0/Makefile |
---|
0,0 → 1,6 |
OUTFILE = sdlfire |
OBJS = fire.o |
LIBS = -L../lib -lSDL |
CFLAGS = -I../include -I. |
include $(MENUETDEV)/makefiles/Makefile_for_program |
/contrib/sdk/sources/SDL-1.2.2/fire-1.0/README |
---|
0,0 → 1,5 |
Fire demo by David Ashley. |
dash@xdr.com |
http://www.xdr.com/dash |
See the start of the fire.c program for more details. |
/contrib/sdk/sources/SDL-1.2.2/fire-1.0/Tupfile.lua |
---|
0,0 → 1,11 |
if tup.getconfig("NO_GCC") ~= "" then return end |
if tup.getconfig("HELPERDIR") == "" |
then |
if tup.getconfig("NO_NASM") ~= "" then return end -- required for SDL compilation |
HELPERDIR = "../../../../../programs" |
end |
tup.include(HELPERDIR .. "/use_gcc.lua") |
tup.include(HELPERDIR .. "/use_menuetlibc.lua") |
tup.include(HELPERDIR .. "/use_sdl.lua") |
compile_gcc{"fire.c"} |
link_gcc("fire") |
/contrib/sdk/sources/SDL-1.2.2/fire-1.0/fire.c |
---|
0,0 → 1,508 |
/* Fireworks demo written by Dave Ashley */ |
/* dash@xdr.com */ |
/* http://www.xdr.com/dash */ |
/* Sat Jun 13 02:46:09 PDT 1998 */ |
/* This is my first attempt at an SDL program */ |
/* See the SDL home page http://www.devolution.com/~slouken/projects/SDL/ */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <time.h> |
#include "SDL.h" |
#define XSIZE 640 |
#define YSIZE 480 |
SDL_Surface *thescreen; |
unsigned char *vmem1, *vmem2; |
int mousex,mousey; |
SDL_Color themap[256]; |
int scrlock() |
{ |
if(SDL_MUSTLOCK(thescreen)) |
{ |
if ( SDL_LockSurface(thescreen) < 0 ) |
{ |
SDL_printf("Couldn't lock display surface: %s\n", |
SDL_GetError()); |
return -1; |
} |
} |
return 0; |
} |
void scrunlock(void) |
{ |
if(SDL_MUSTLOCK(thescreen)) |
SDL_UnlockSurface(thescreen); |
SDL_UpdateRect(thescreen, 0, 0, 0, 0); |
} |
#define MOUSEFRAC 2 |
#define MAXBLOBS 512 |
#define BLOBFRAC 6 |
#define BLOBGRAVITY 5 |
#define THRESHOLD 20 |
#define SMALLSIZE 3 |
#define BIGSIZE 6 |
#define ABS(x) ((x)<0 ? -(x) : (x)) |
int explodenum; |
char sizes[]={2,3,4,5,8,5,4,3}; |
struct blob { |
struct blob *blobnext; |
int blobx; |
int bloby; |
int blobdx; |
int blobdy; |
int bloblife; |
int blobsize; |
} *blobs,*freeblobs,*activeblobs; |
unsigned char **mul640; |
int oldmode; |
char sqrttab[]={ |
0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3, |
4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5, |
5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6, |
6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, |
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, |
8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, |
9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10, |
10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11, |
11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, |
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, |
12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13, |
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, |
13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14, |
14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, |
14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, |
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 |
}; |
void nomem(void) |
{ |
SDL_printf("Not enough low memory!\n"); |
SDL_Quit(); |
exit(1); |
} |
void fire(unsigned char *p1,unsigned char *p2,int pitch,char *map) |
{ |
int x,y; |
unsigned char *p3, *p4; |
for(y=2;y<YSIZE;y++) |
{ |
for(x=0;x<XSIZE;x++) |
{ |
p3 = p1+y*XSIZE+x; |
p4 = p2+y*pitch+x; |
*p4=map[*p3+p3[-XSIZE]+p3[-XSIZE-1]+p3[-XSIZE+1]+p3[-1]+p3[1]+p3[-XSIZE-XSIZE-1]+p3[-XSIZE-XSIZE]+p3[-XSIZE-XSIZE+1]]; |
} |
} |
} |
void disk(x,y,rad) |
{ |
unsigned char *p; |
int i,j,k,aj; |
int rad2=rad*rad; |
int w; |
for(j=-rad;j<=rad;j++) |
{ |
w=sqrttab[rad2-j*j]; |
aj=ABS(j)<<2; |
if(w) |
{ |
p=mul640[y+j]+x-w; |
k=w+w+1; |
i=-w; |
while(k--) {*p++=255-(ABS(i)<<2)-aj;i++;} |
} |
} |
} |
void trydisk(void) |
{ |
if(mousex>10 && mousex<XSIZE-10 && mousey>10 && mousey<YSIZE-10) |
disk(mousex,mousey,8); |
} |
void addblob(void) |
{ |
int dx,dy; |
struct blob *ablob; |
if(!freeblobs) return; |
dx=(rand()&255)-128; |
dy=(rand()%200)+340; |
ablob=freeblobs; |
freeblobs=freeblobs->blobnext; |
ablob->bloblife=(rand()&511)+256; |
ablob->blobdx=dx; |
ablob->blobdy=dy; |
ablob->blobx=(256+(rand()&127))<<BLOBFRAC; |
ablob->bloby=2<<BLOBFRAC; |
ablob->blobnext=activeblobs; |
ablob->blobsize=BIGSIZE; |
activeblobs=ablob; |
} |
void moveblobs(void) |
{ |
struct blob **lastblob,*ablob; |
int x,y; |
lastblob=&activeblobs; |
while(ablob=*lastblob) |
{ |
x=ablob->blobx>>BLOBFRAC; |
y=ablob->bloby>>BLOBFRAC; |
if(!--ablob->bloblife || y<0 || x<10 || x>XSIZE-10) |
{ |
*lastblob=ablob->blobnext; |
ablob->blobnext=freeblobs; |
freeblobs=ablob; |
continue; |
} |
ablob->blobx+=ablob->blobdx; |
ablob->bloby+=ablob->blobdy; |
ablob->blobdy-=BLOBGRAVITY; |
lastblob=&ablob->blobnext; |
} |
} |
void putblobs(void) |
{ |
struct blob *ablob,*ablob2,*temp; |
int x,y,dy; |
int i,size; |
long x2,y2,vel; |
ablob=activeblobs; |
activeblobs=0; |
while(ablob) |
{ |
dy=ablob->blobdy; |
if(ablob->blobsize!=SMALLSIZE && (dy>-THRESHOLD && dy<THRESHOLD && !(rand()&7) || (rand()&127)==63)) |
{ |
i=explodenum; |
while(i-- && freeblobs) |
{ |
ablob2=freeblobs; |
freeblobs=freeblobs->blobnext; |
ablob2->blobx=ablob->blobx; |
ablob2->bloby=ablob->bloby; |
for(;;) |
{ |
x2=(rand()&511)-256; |
y2=(rand()&511)-256; |
vel=x2*x2+y2*y2; |
if(vel>0x3000 && vel<0x10000L) break; |
} |
ablob2->blobdx=ablob->blobdx+x2; |
ablob2->blobdy=ablob->blobdy+y2; |
ablob2->bloblife=16+(rand()&31); |
ablob2->blobsize=SMALLSIZE; |
ablob2->blobnext=activeblobs; |
activeblobs=ablob2; |
ablob->bloblife=1; |
} |
} |
x=ablob->blobx>>BLOBFRAC; |
y=ablob->bloby>>BLOBFRAC; |
size=ablob->blobsize; |
if(size==BIGSIZE && ablob->blobdy>0 && ablob->blobdy<200) |
size=sizes[ablob->bloblife&7]; |
if(x>10 && x<XSIZE-10 && y>10 && y<YSIZE-10) |
disk(x,YSIZE-1-y,size); |
temp=ablob; |
ablob=ablob->blobnext; |
temp->blobnext=activeblobs; |
activeblobs=temp; |
} |
} |
#define RATE 1 |
void normal(char *map) |
{ |
int i,j; |
for(i=0;i<8192;i++) |
{ |
j=i/9; |
map[i]=j<256 ? (j>=RATE ? j-RATE : 0) : 255; |
} |
} |
void bright(char *map) |
{ |
int i; |
for(i=0;i<8192;i++) map[i]=i>>3<255 ? (i>>3) : 255; |
} |
void updatemap(void) |
{ |
SDL_SetColors(thescreen, themap, 0, 256); |
} |
void loadcolor(int n,int r,int g,int b) |
{ |
themap[n].r=r<<2; |
themap[n].g=g<<2; |
themap[n].b=b<<2; |
} |
void loadcolors(unsigned int which) |
{ |
int i,j; |
int r,g,b; |
which%=11; |
for(i=0;i<256;i++) |
{ |
switch(which) |
{ |
case 0: |
if(i<64) loadcolor(i,0,0,0); |
else if(i<128) loadcolor(i,i-64,0,0); |
else if(i<192) loadcolor(i,63,i-128,0); |
else loadcolor(i,63,63,i-192); |
break; |
case 1: |
if(i<64) loadcolor(i,0,0,0); |
else if(i<128) loadcolor(i,0,0,i-64); |
else loadcolor(i,(i-128)>>1,(i-128)>>1,63); |
break; |
case 2: |
loadcolor(i,i>>2,i>>2,i>>2); |
break; |
case 3: |
r=rand()&0x3f; |
g=rand()&0x3f; |
b=rand()&0x3f; |
loadcolor(i,r*i>>8,g*i>>8,b*i>>8); |
break; |
case 4: |
loadcolor(i,i>>2,0,0); |
break; |
case 5: |
loadcolor(i,0,i>>2,0); |
break; |
case 6: |
loadcolor(i,0,0,i>>2); |
break; |
case 7: |
j=i&15; |
if(i&16) j=15-j; |
j=(i>>2)*j/16; |
loadcolor(i,j,j,j); |
break; |
case 8: |
j=0; |
if(i>8 && i<128) j=63; |
loadcolor(i,j,j,j); |
break; |
case 9: |
j=31-(i&31)<<1; |
r=i&32 ? j : 0; |
g=i&64 ? j : 0; |
b=i&128 ? j : 0; |
loadcolor(i,r,g,b); |
break; |
case 10: |
j=(i&15)<<2; |
if(i&16) j=63-j; |
r=i&32 ? j : 0; |
g=i&64 ? j : 0; |
b=i&128 ? j : 0; |
loadcolor(i,r,g,b); |
break; |
} |
} |
updatemap(); |
} |
int main(int argc, char *argv[]) |
{ |
int i,k; |
char *remap,*remap2; |
unsigned char *p1, *p2; |
long frames; |
int flash; |
int whichmap; |
int key; |
int ispaused; |
unsigned long videoflags; |
int done; |
int now; |
SDL_Event event; |
long starttime; |
int buttonstate; |
srand(time(NULL)); |
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) |
{ |
SDL_printf("Couldn't initialize SDL: %s\n",SDL_GetError()); |
exit(1); |
} |
videoflags = SDL_SWSURFACE; |
thescreen = SDL_SetVideoMode(XSIZE, YSIZE, 8, videoflags); |
if ( thescreen == NULL ) |
{ |
SDL_printf("Couldn't set display mode: %s\n", |
SDL_GetError()); |
SDL_Quit(); |
exit(5); |
} |
vmem1=NULL; |
vmem2=malloc(XSIZE*YSIZE); |
if(!vmem2) nomem(); |
mul640=malloc(YSIZE*sizeof(char *)); |
if(!mul640) nomem(); |
remap=malloc(16384); |
if(!remap) nomem(); |
remap2=malloc(16384); |
if(!remap2) nomem(); |
blobs=malloc(MAXBLOBS*sizeof(struct blob)); |
if(!blobs) nomem(); |
SDL_printf("Fire demo by David Ashley (dash@xdr.com)"); |
SDL_printf("1 = Change color map"); |
SDL_printf("2 = Randomly change color map"); |
SDL_printf("p = Pause"); |
SDL_printf("spc = Fire"); |
SDL_printf("esc = Exit"); |
SDL_printf("Left mouse button = paint"); |
SDL_printf("Right mouse button, CR = ignite atmosphere"); |
freeblobs=activeblobs=0; |
for(i=0;i<MAXBLOBS;i++) |
{ |
blobs[i].blobnext=freeblobs; |
freeblobs=blobs+i; |
} |
normal(remap); |
bright(remap2); |
flash=0; |
whichmap=0; |
loadcolors(whichmap); |
frames=0; |
ispaused=0; |
addblob(); |
done = 0; |
now=0; |
starttime=SDL_GetTicks(); |
buttonstate=0; |
mousex=mousey=0; |
while(!done) |
{ |
if ( scrlock() < 0 ) continue; |
frames++; |
if ( vmem1 != (unsigned char *)thescreen->pixels ) |
{ |
p1=vmem1=thescreen->pixels; |
for (i=0;i<YSIZE;i++) |
{ |
mul640[i]=i*thescreen->pitch+vmem1; |
memset(p1,0,XSIZE); |
p1+=thescreen->pitch; |
} |
} |
if(!ispaused) |
{ |
now++; |
if(!flash) |
{ |
if(explodenum>96 && explodenum<160 && !(rand()&511) || (buttonstate&8)) |
flash=60; |
} else --flash; |
explodenum=(now>>4)+1;if(explodenum==320) now=0; |
if(explodenum>256) explodenum=256; |
if(!(rand()&31)) |
addblob(); |
moveblobs(); |
putblobs(); |
if(buttonstate&2) trydisk(); |
p1=vmem1; |
p2=vmem2; |
k=thescreen->pitch; |
for(i=0;i<YSIZE;i++) |
{ |
memcpy(p2,p1,XSIZE); |
p2+=XSIZE; |
p1+=k; |
} |
fire(vmem2,vmem1,k,flash ? remap2 :remap); |
} |
scrunlock(); |
while(SDL_PollEvent(&event)) |
{ |
switch (event.type) |
{ |
case SDL_MOUSEBUTTONDOWN: |
case SDL_MOUSEBUTTONUP: |
if ( event.button.state == SDL_PRESSED ) |
buttonstate|=1<<event.button.button; |
else |
buttonstate&=~(1<<event.button.button); |
mousex=event.button.x; |
mousey=event.button.y; |
if(!ispaused && buttonstate&2) trydisk(); |
break; |
case SDL_MOUSEMOTION: |
mousex=event.motion.x; |
mousey=event.motion.y; |
if(!ispaused && buttonstate&2) trydisk(); |
break; |
case SDL_KEYDOWN: |
key=event.key.keysym.sym; |
if(key==SDLK_RETURN) {flash=60;break;} |
if(key==SDLK_1 || key==SDLK_2) |
{ |
if(key==SDLK_1) |
++whichmap; |
else |
whichmap=rand(); |
loadcolors(whichmap); |
break; |
} |
if(key==SDLK_ESCAPE) {done=1;break;} |
if(key==SDLK_SPACE && !ispaused) {addblob();break;} |
if(key==SDLK_p) {ispaused=!ispaused;break;} |
break; |
case SDL_QUIT: |
done = 1; |
break; |
default: |
break; |
} |
} |
} |
starttime=SDL_GetTicks()-starttime; |
if(!starttime) starttime=1; |
SDL_Quit(); |
SDL_printf("fps = %d\n",1000*frames/starttime); |
exit(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/include/SDL.h |
---|
0,0 → 1,97 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Main include header for the SDL library */ |
#ifndef _SDL_H |
#define _SDL_H |
#include "SDL_main.h" |
#include "SDL_types.h" |
#include "SDL_getenv.h" |
#include "SDL_error.h" |
#include "SDL_rwops.h" |
#include "SDL_timer.h" |
#include "SDL_audio.h" |
#include "SDL_cdrom.h" |
#include "SDL_joystick.h" |
#include "SDL_events.h" |
#include "SDL_video.h" |
#include "SDL_byteorder.h" |
#include "SDL_version.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* As of version 0.5, SDL is loaded dynamically into the application */ |
/* These are the flags which may be passed to SDL_Init() -- you should |
specify the subsystems which you will be using in your application. |
*/ |
#define SDL_INIT_TIMER 0x00000001 |
#define SDL_INIT_AUDIO 0x00000010 |
#define SDL_INIT_VIDEO 0x00000020 |
#define SDL_INIT_CDROM 0x00000100 |
#define SDL_INIT_JOYSTICK 0x00000200 |
#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */ |
#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */ |
#define SDL_INIT_EVERYTHING 0x0000FFFF |
/* This function loads the SDL dynamically linked library and initializes |
* the subsystems specified by 'flags' (and those satisfying dependencies) |
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup |
* signal handlers for some commonly ignored fatal signals (like SIGSEGV) |
*/ |
extern DECLSPEC int SDL_Init(Uint32 flags); |
/* This function initializes specific SDL subsystems */ |
extern DECLSPEC int SDL_InitSubSystem(Uint32 flags); |
/* This function cleans up specific SDL subsystems */ |
extern DECLSPEC void SDL_QuitSubSystem(Uint32 flags); |
/* This function returns mask of the specified subsystems which have |
been initialized. |
If 'flags' is 0, it returns a mask of all initialized subsystems. |
*/ |
extern DECLSPEC Uint32 SDL_WasInit(Uint32 flags); |
/* This function cleans up all initialized subsystems and unloads the |
* dynamically linked library. You should call it upon all exit conditions. |
*/ |
extern DECLSPEC void SDL_Quit(void); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_H */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_active.h |
---|
0,0 → 1,60 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_active.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Include file for SDL application focus event handling */ |
#ifndef _SDL_active_h |
#define _SDL_active_h |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* The available application states */ |
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */ |
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */ |
#define SDL_APPACTIVE 0x04 /* The application is active */ |
/* Function prototypes */ |
/* |
* This function returns the current state of the application, which is a |
* bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and |
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to |
* see your application, otherwise it has been iconified or disabled. |
*/ |
extern DECLSPEC Uint8 SDL_GetAppState(void); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_active_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_audio.h |
---|
0,0 → 1,260 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_audio.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Access to the raw audio mixing buffer for the SDL library */ |
#ifndef _SDL_audio_h |
#define _SDL_audio_h |
#include <stdio.h> |
#include "SDL_main.h" |
#include "SDL_types.h" |
#include "SDL_error.h" |
#include "SDL_rwops.h" |
#include "SDL_byteorder.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* The calculated values in this structure are calculated by SDL_OpenAudio() */ |
typedef struct { |
int freq; /* DSP frequency -- samples per second */ |
Uint16 format; /* Audio data format */ |
Uint8 channels; /* Number of channels: 1 mono, 2 stereo */ |
Uint8 silence; /* Audio buffer silence value (calculated) */ |
Uint16 samples; /* Audio buffer size in samples */ |
Uint16 padding; /* Necessary for some compile environments */ |
Uint32 size; /* Audio buffer size in bytes (calculated) */ |
/* This function is called when the audio device needs more data. |
'stream' is a pointer to the audio data buffer |
'len' is the length of that buffer in bytes. |
Once the callback returns, the buffer will no longer be valid. |
Stereo samples are stored in a LRLRLR ordering. |
*/ |
void (*callback)(void *userdata, Uint8 *stream, int len); |
void *userdata; |
} SDL_AudioSpec; |
/* Audio format flags (defaults to LSB byte order) */ |
#define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */ |
#define AUDIO_S8 0x8008 /* Signed 8-bit samples */ |
#define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */ |
#define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */ |
#define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */ |
#define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */ |
#define AUDIO_U16 AUDIO_U16LSB |
#define AUDIO_S16 AUDIO_S16LSB |
/* Native audio byte ordering */ |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
#define AUDIO_U16SYS AUDIO_U16LSB |
#define AUDIO_S16SYS AUDIO_S16LSB |
#else |
#define AUDIO_U16SYS AUDIO_U16MSB |
#define AUDIO_S16SYS AUDIO_S16MSB |
#endif |
/* A structure to hold a set of audio conversion filters and buffers */ |
typedef struct SDL_AudioCVT { |
int needed; /* Set to 1 if conversion possible */ |
Uint16 src_format; /* Source audio format */ |
Uint16 dst_format; /* Target audio format */ |
double rate_incr; /* Rate conversion increment */ |
Uint8 *buf; /* Buffer to hold entire audio data */ |
int len; /* Length of original audio buffer */ |
int len_cvt; /* Length of converted audio buffer */ |
int len_mult; /* buffer must be len*len_mult big */ |
double len_ratio; /* Given len, final size is len*len_ratio */ |
void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); |
int filter_index; /* Current audio conversion function */ |
} SDL_AudioCVT; |
/* Function prototypes */ |
/* These functions are used internally, and should not be used unless you |
* have a specific need to specify the audio driver you want to use. |
* You should normally use SDL_Init() or SDL_InitSubSystem(). |
*/ |
extern DECLSPEC int SDL_AudioInit(const char *driver_name); |
extern DECLSPEC void SDL_AudioQuit(void); |
/* This function fills the given character buffer with the name of the |
* current audio driver, and returns a pointer to it if the audio driver has |
* been initialized. It returns NULL if no driver has been initialized. |
*/ |
extern DECLSPEC char *SDL_AudioDriverName(char *namebuf, int maxlen); |
/* |
* This function opens the audio device with the desired parameters, and |
* returns 0 if successful, placing the actual hardware parameters in the |
* structure pointed to by 'obtained'. If 'obtained' is NULL, the audio |
* data passed to the callback function will be guaranteed to be in the |
* requested format, and will be automatically converted to the hardware |
* audio format if necessary. This function returns -1 if it failed |
* to open the audio device, or couldn't set up the audio thread. |
* |
* When filling in the desired audio spec structure, |
* 'desired->freq' should be the desired audio frequency in samples-per-second. |
* 'desired->format' should be the desired audio format. |
* 'desired->samples' is the desired size of the audio buffer, in samples. |
* This number should be a power of two, and may be adjusted by the audio |
* driver to a value more suitable for the hardware. Good values seem to |
* range between 512 and 8096 inclusive, depending on the application and |
* CPU speed. Smaller values yield faster response time, but can lead |
* to underflow if the application is doing heavy processing and cannot |
* fill the audio buffer in time. A stereo sample consists of both right |
* and left channels in LR ordering. |
* Note that the number of samples is directly related to time by the |
* following formula: ms = (samples*1000)/freq |
* 'desired->size' is the size in bytes of the audio buffer, and is |
* calculated by SDL_OpenAudio(). |
* 'desired->silence' is the value used to set the buffer to silence, |
* and is calculated by SDL_OpenAudio(). |
* 'desired->callback' should be set to a function that will be called |
* when the audio device is ready for more data. It is passed a pointer |
* to the audio buffer, and the length in bytes of the audio buffer. |
* This function usually runs in a separate thread, and so you should |
* protect data structures that it accesses by calling SDL_LockAudio() |
* and SDL_UnlockAudio() in your code. |
* 'desired->userdata' is passed as the first parameter to your callback |
* function. |
* |
* The audio device starts out playing silence when it's opened, and should |
* be enabled for playing by calling SDL_PauseAudio(0) when you are ready |
* for your audio callback function to be called. Since the audio driver |
* may modify the requested size of the audio buffer, you should allocate |
* any local mixing buffers after you open the audio device. |
*/ |
extern DECLSPEC int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); |
/* |
* Get the current audio state: |
*/ |
typedef enum { |
SDL_AUDIO_STOPPED = 0, |
SDL_AUDIO_PLAYING, |
SDL_AUDIO_PAUSED |
} SDL_audiostatus; |
extern DECLSPEC SDL_audiostatus SDL_GetAudioStatus(void); |
/* |
* This function pauses and unpauses the audio callback processing. |
* It should be called with a parameter of 0 after opening the audio |
* device to start playing sound. This is so you can safely initialize |
* data for your callback function after opening the audio device. |
* Silence will be written to the audio device during the pause. |
*/ |
extern DECLSPEC void SDL_PauseAudio(int pause_on); |
/* |
* This function loads a WAVE from the data source, automatically freeing |
* that source if 'freesrc' is non-zero. For example, to load a WAVE file, |
* you could do: |
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); |
* |
* If this function succeeds, it returns the given SDL_AudioSpec, |
* filled with the audio data format of the wave data, and sets |
* 'audio_buf' to a malloc()'d buffer containing the audio data, |
* and sets 'audio_len' to the length of that audio buffer, in bytes. |
* You need to free the audio buffer with SDL_FreeWAV() when you are |
* done with it. |
* |
* This function returns NULL and sets the SDL error message if the |
* wave file cannot be opened, uses an unknown data format, or is |
* corrupt. Currently raw and MS-ADPCM WAVE files are supported. |
*/ |
extern DECLSPEC SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, |
SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); |
/* Compatibility convenience function -- loads a WAV from a file */ |
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ |
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) |
/* |
* This function frees data previously allocated with SDL_LoadWAV_RW() |
*/ |
extern DECLSPEC void SDL_FreeWAV(Uint8 *audio_buf); |
/* |
* This function takes a source format and rate and a destination format |
* and rate, and initializes the 'cvt' structure with information needed |
* by SDL_ConvertAudio() to convert a buffer of audio data from one format |
* to the other. |
* This function returns 0, or -1 if there was an error. |
*/ |
extern DECLSPEC int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, |
Uint16 src_format, Uint8 src_channels, int src_rate, |
Uint16 dst_format, Uint8 dst_channels, int dst_rate); |
/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), |
* created an audio buffer cvt->buf, and filled it with cvt->len bytes of |
* audio data in the source format, this function will convert it in-place |
* to the desired format. |
* The data conversion may expand the size of the audio data, so the buffer |
* cvt->buf should be allocated after the cvt structure is initialized by |
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. |
*/ |
extern DECLSPEC int SDL_ConvertAudio(SDL_AudioCVT *cvt); |
/* |
* This takes two audio buffers of the playing audio format and mixes |
* them, performing addition, volume adjustment, and overflow clipping. |
* The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME |
* for full audio volume. Note this does not change hardware volume. |
* This is provided for convenience -- you can mix your own audio data. |
*/ |
#define SDL_MIX_MAXVOLUME 128 |
extern DECLSPEC void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); |
/* |
* The lock manipulated by these functions protects the callback function. |
* During a LockAudio/UnlockAudio pair, you can be guaranteed that the |
* callback function is not running. Do not call these from the callback |
* function or you will cause deadlock. |
*/ |
extern DECLSPEC void SDL_LockAudio(void); |
extern DECLSPEC void SDL_UnlockAudio(void); |
/* |
* This function shuts down audio processing and closes the audio device. |
*/ |
extern DECLSPEC void SDL_CloseAudio(void); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_audio_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_byteorder.h |
---|
0,0 → 1,52 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_byteorder.h,v 1.3 2001/05/10 20:25:51 hercules Exp $"; |
#endif |
/* Macros for determining the byte-order of this platform */ |
#ifndef _SDL_byteorder_h |
#define _SDL_byteorder_h |
/* The two types of endianness */ |
#define SDL_LIL_ENDIAN 1234 |
#define SDL_BIG_ENDIAN 4321 |
/* Pardon the mess, I'm trying to determine the endianness of this host. |
I'm doing it by preprocessor defines rather than some sort of configure |
script so that application code can use this too. The "right" way would |
be to dynamically generate this file on install, but that's a lot of work. |
*/ |
#if defined(__i386__) || defined(__ia64__) || defined(WIN32UNDEFINED) || \ |
(defined(__alpha__) || defined(__alpha)) || \ |
defined(__arm__) || \ |
(defined(__mips__) && defined(__MIPSEL__)) || \ |
defined(__LITTLE_ENDIAN__) |
#define SDL_BYTEORDER SDL_LIL_ENDIAN |
#else |
#define SDL_BYTEORDER SDL_BIG_ENDIAN |
#endif |
#endif /* _SDL_byteorder_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_byteorder.h.BAK |
---|
0,0 → 1,52 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_byteorder.h,v 1.3 2001/05/10 20:25:51 hercules Exp $"; |
#endif |
/* Macros for determining the byte-order of this platform */ |
#ifndef _SDL_byteorder_h |
#define _SDL_byteorder_h |
/* The two types of endianness */ |
#define SDL_LIL_ENDIAN 1234 |
#define SDL_BIG_ENDIAN 4321 |
/* Pardon the mess, I'm trying to determine the endianness of this host. |
I'm doing it by preprocessor defines rather than some sort of configure |
script so that application code can use this too. The "right" way would |
be to dynamically generate this file on install, but that's a lot of work. |
*/ |
#if defined(__i386__) || defined(__ia64__) || defined(WIN32) || \ |
(defined(__alpha__) || defined(__alpha)) || \ |
defined(__arm__) || \ |
(defined(__mips__) && defined(__MIPSEL__)) || \ |
defined(__LITTLE_ENDIAN__) |
#define SDL_BYTEORDER SDL_LIL_ENDIAN |
#else |
#define SDL_BYTEORDER SDL_BIG_ENDIAN |
#endif |
#endif /* _SDL_byteorder_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_cdrom.h |
---|
0,0 → 1,175 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_cdrom.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* This is the CD-audio control API for Simple DirectMedia Layer */ |
#ifndef _SDL_cdrom_h |
#define _SDL_cdrom_h |
#include "SDL_types.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* In order to use these functions, SDL_Init() must have been called |
with the SDL_INIT_CDROM flag. This causes SDL to scan the system |
for CD-ROM drives, and load appropriate drivers. |
*/ |
/* The maximum number of CD-ROM tracks on a disk */ |
#define SDL_MAX_TRACKS 99 |
/* The types of CD-ROM track possible */ |
#define SDL_AUDIO_TRACK 0x00 |
#define SDL_DATA_TRACK 0x04 |
/* The possible states which a CD-ROM drive can be in. */ |
typedef enum { |
CD_TRAYEMPTY, |
CD_STOPPED, |
CD_PLAYING, |
CD_PAUSED, |
CD_ERROR = -1 |
} CDstatus; |
/* Given a status, returns true if there's a disk in the drive */ |
#define CD_INDRIVE(status) ((int)status > 0) |
typedef struct { |
Uint8 id; /* Track number */ |
Uint8 type; /* Data or audio track */ |
Uint16 unused; |
Uint32 length; /* Length, in frames, of this track */ |
Uint32 offset; /* Offset, in frames, from start of disk */ |
} SDL_CDtrack; |
/* This structure is only current as of the last call to SDL_CDStatus() */ |
typedef struct SDL_CD { |
int id; /* Private drive identifier */ |
CDstatus status; /* Current drive status */ |
/* The rest of this structure is only valid if there's a CD in drive */ |
int numtracks; /* Number of tracks on disk */ |
int cur_track; /* Current track position */ |
int cur_frame; /* Current frame offset within current track */ |
SDL_CDtrack track[SDL_MAX_TRACKS+1]; |
} SDL_CD; |
/* Conversion functions from frames to Minute/Second/Frames and vice versa */ |
#define CD_FPS 75 |
#define FRAMES_TO_MSF(f, M,S,F) { \ |
int value = f; \ |
*(F) = value%CD_FPS; \ |
value /= CD_FPS; \ |
*(S) = value%60; \ |
value /= 60; \ |
*(M) = value; \ |
} |
#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) |
/* CD-audio API functions: */ |
/* Returns the number of CD-ROM drives on the system, or -1 if |
SDL_Init() has not been called with the SDL_INIT_CDROM flag. |
*/ |
extern DECLSPEC int SDL_CDNumDrives(void); |
/* Returns a human-readable, system-dependent identifier for the CD-ROM. |
Example: |
"/dev/cdrom" |
"E:" |
"/dev/disk/ide/1/master" |
*/ |
extern DECLSPEC const char * SDL_CDName(int drive); |
/* Opens a CD-ROM drive for access. It returns a drive handle on success, |
or NULL if the drive was invalid or busy. This newly opened CD-ROM |
becomes the default CD used when other CD functions are passed a NULL |
CD-ROM handle. |
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. |
*/ |
extern DECLSPEC SDL_CD * SDL_CDOpen(int drive); |
/* This function returns the current status of the given drive. |
If the drive has a CD in it, the table of contents of the CD and current |
play position of the CD will be stored in the SDL_CD structure. |
*/ |
extern DECLSPEC CDstatus SDL_CDStatus(SDL_CD *cdrom); |
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' |
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play |
until the end of the CD. This function will skip data tracks. |
This function should only be called after calling SDL_CDStatus() to |
get track information about the CD. |
For example: |
// Play entire CD: |
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) |
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); |
// Play last track: |
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { |
SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); |
} |
// Play first and second track and 10 seconds of third track: |
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) |
SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); |
This function returns 0, or -1 if there was an error. |
*/ |
extern DECLSPEC int SDL_CDPlayTracks(SDL_CD *cdrom, |
int start_track, int start_frame, int ntracks, int nframes); |
/* Play the given CD starting at 'start' frame for 'length' frames. |
It returns 0, or -1 if there was an error. |
*/ |
extern DECLSPEC int SDL_CDPlay(SDL_CD *cdrom, int start, int length); |
/* Pause play -- returns 0, or -1 on error */ |
extern DECLSPEC int SDL_CDPause(SDL_CD *cdrom); |
/* Resume play -- returns 0, or -1 on error */ |
extern DECLSPEC int SDL_CDResume(SDL_CD *cdrom); |
/* Stop play -- returns 0, or -1 on error */ |
extern DECLSPEC int SDL_CDStop(SDL_CD *cdrom); |
/* Eject CD-ROM -- returns 0, or -1 on error */ |
extern DECLSPEC int SDL_CDEject(SDL_CD *cdrom); |
/* Closes the handle for the CD-ROM drive */ |
extern DECLSPEC void SDL_CDClose(SDL_CD *cdrom); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_video_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_copying.h |
---|
0,0 → 1,27 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_copying.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_endian.h |
---|
0,0 → 1,138 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_endian.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Functions for reading and writing endian-specific values */ |
#ifndef _SDL_endian_h |
#define _SDL_endian_h |
/* These functions read and write data of the specified endianness, |
dynamically translating to the host machine endianness. |
e.g.: If you want to read a 16 bit value on big-endian machine from |
an open file containing little endian values, you would use: |
value = SDL_ReadLE16(rp); |
Note that the read/write functions use SDL_RWops pointers |
instead of FILE pointers. This allows you to read and write |
endian values from large chunks of memory as well as files |
and other data sources. |
*/ |
#include <stdio.h> |
#include "SDL_types.h" |
#include "SDL_rwops.h" |
#include "SDL_byteorder.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Use inline functions for compilers that support them, and static |
functions for those that do not. Because these functions become |
static for compilers that do not support inline functions, this |
header should only be included in files that actually use them. |
*/ |
#ifndef SDL_Swap16 |
static __inline__ Uint16 SDL_Swap16(Uint16 D) { |
return((D<<8)|(D>>8)); |
} |
#endif |
#ifndef SDL_Swap32 |
static __inline__ Uint32 SDL_Swap32(Uint32 D) { |
return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24)); |
} |
#endif |
#ifdef SDL_HAS_64BIT_TYPE |
#ifndef SDL_Swap64 |
static __inline__ Uint64 SDL_Swap64(Uint64 val) { |
Uint32 hi, lo; |
/* Separate into high and low 32-bit values and swap them */ |
lo = (Uint32)(val&0xFFFFFFFF); |
val >>= 32; |
hi = (Uint32)(val&0xFFFFFFFF); |
val = SDL_Swap32(lo); |
val <<= 32; |
val |= SDL_Swap32(hi); |
return(val); |
} |
#endif |
#else |
#ifndef SDL_Swap64 |
/* This is mainly to keep compilers from complaining in SDL code. |
If there is no real 64-bit datatype, then compilers will complain about |
the fake 64-bit datatype that SDL provides when it compiles user code. |
*/ |
#define SDL_Swap64(X) (X) |
#endif |
#endif /* SDL_HAS_64BIT_TYPE */ |
/* Byteswap item from the specified endianness to the native endianness */ |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
#define SDL_SwapLE16(X) (X) |
#define SDL_SwapLE32(X) (X) |
#define SDL_SwapLE64(X) (X) |
#define SDL_SwapBE16(X) SDL_Swap16(X) |
#define SDL_SwapBE32(X) SDL_Swap32(X) |
#define SDL_SwapBE64(X) SDL_Swap64(X) |
#else |
#define SDL_SwapLE16(X) SDL_Swap16(X) |
#define SDL_SwapLE32(X) SDL_Swap32(X) |
#define SDL_SwapLE64(X) SDL_Swap64(X) |
#define SDL_SwapBE16(X) (X) |
#define SDL_SwapBE32(X) (X) |
#define SDL_SwapBE64(X) (X) |
#endif |
/* Read an item of the specified endianness and return in native format */ |
extern DECLSPEC Uint16 SDL_ReadLE16(SDL_RWops *src); |
extern DECLSPEC Uint16 SDL_ReadBE16(SDL_RWops *src); |
extern DECLSPEC Uint32 SDL_ReadLE32(SDL_RWops *src); |
extern DECLSPEC Uint32 SDL_ReadBE32(SDL_RWops *src); |
extern DECLSPEC Uint64 SDL_ReadLE64(SDL_RWops *src); |
extern DECLSPEC Uint64 SDL_ReadBE64(SDL_RWops *src); |
/* Write an item of native format to the specified endianness */ |
extern DECLSPEC int SDL_WriteLE16(SDL_RWops *dst, Uint16 value); |
extern DECLSPEC int SDL_WriteBE16(SDL_RWops *dst, Uint16 value); |
extern DECLSPEC int SDL_WriteLE32(SDL_RWops *dst, Uint32 value); |
extern DECLSPEC int SDL_WriteBE32(SDL_RWops *dst, Uint32 value); |
extern DECLSPEC int SDL_WriteLE64(SDL_RWops *dst, Uint64 value); |
extern DECLSPEC int SDL_WriteBE64(SDL_RWops *dst, Uint64 value); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_endian_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_error.h |
---|
0,0 → 1,62 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_error.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Simple error message routines for SDL */ |
#ifndef _SDL_error_h |
#define _SDL_error_h |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Public functions */ |
extern DECLSPEC void SDL_SetError(const char *fmt, ...); |
extern DECLSPEC char * SDL_GetError(void); |
extern DECLSPEC void SDL_ClearError(void); |
/* Private error message function - used internally */ |
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) |
typedef enum { |
SDL_ENOMEM, |
SDL_EFREAD, |
SDL_EFWRITE, |
SDL_EFSEEK, |
SDL_LASTERROR |
} SDL_errorcode; |
extern void SDL_Error(SDL_errorcode code); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_error_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_events.h |
---|
0,0 → 1,335 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_events.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Include file for SDL event handling */ |
#ifndef _SDL_events_h |
#define _SDL_events_h |
#include "SDL_types.h" |
#include "SDL_active.h" |
#include "SDL_keyboard.h" |
#include "SDL_mouse.h" |
#include "SDL_joystick.h" |
#include "SDL_quit.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Event enumerations */ |
enum { SDL_NOEVENT = 0, /* Unused (do not remove) */ |
SDL_ACTIVEEVENT, /* Application loses/gains visibility */ |
SDL_KEYDOWN, /* Keys pressed */ |
SDL_KEYUP, /* Keys released */ |
SDL_MOUSEMOTION, /* Mouse moved */ |
SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */ |
SDL_MOUSEBUTTONUP, /* Mouse button released */ |
SDL_JOYAXISMOTION, /* Joystick axis motion */ |
SDL_JOYBALLMOTION, /* Joystick trackball motion */ |
SDL_JOYHATMOTION, /* Joystick hat position change */ |
SDL_JOYBUTTONDOWN, /* Joystick button pressed */ |
SDL_JOYBUTTONUP, /* Joystick button released */ |
SDL_QUIT, /* User-requested quit */ |
SDL_SYSWMEVENT, /* System specific event */ |
SDL_EVENT_RESERVEDA, /* Reserved for future use.. */ |
SDL_EVENT_RESERVEDB, /* Reserved for future use.. */ |
SDL_VIDEORESIZE, /* User resized video mode */ |
SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */ |
SDL_EVENT_RESERVED2, /* Reserved for future use.. */ |
SDL_EVENT_RESERVED3, /* Reserved for future use.. */ |
SDL_EVENT_RESERVED4, /* Reserved for future use.. */ |
SDL_EVENT_RESERVED5, /* Reserved for future use.. */ |
SDL_EVENT_RESERVED6, /* Reserved for future use.. */ |
SDL_EVENT_RESERVED7, /* Reserved for future use.. */ |
/* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ |
SDL_USEREVENT = 24, |
SDL_PAINT_WND = 31, |
/* This last event is only for bounding internal arrays |
It is the number of bits in the event mask datatype -- Uint32 |
*/ |
SDL_NUMEVENTS = 32 |
}; |
/* Predefined event masks */ |
#define SDL_EVENTMASK(X) (1<<(X)) |
enum { |
SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), |
SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), |
SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), |
SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), |
SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), |
SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), |
SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| |
SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| |
SDL_EVENTMASK(SDL_MOUSEBUTTONUP), |
SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), |
SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), |
SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), |
SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), |
SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), |
SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| |
SDL_EVENTMASK(SDL_JOYBALLMOTION)| |
SDL_EVENTMASK(SDL_JOYHATMOTION)| |
SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| |
SDL_EVENTMASK(SDL_JOYBUTTONUP), |
SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), |
SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), |
SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), |
SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) |
}; |
#define SDL_ALLEVENTS 0xFFFFFFFF |
/* Application visibility event structure */ |
typedef struct { |
Uint8 type; /* SDL_ACTIVEEVENT */ |
Uint8 gain; /* Whether given states were gained or lost (1/0) */ |
Uint8 state; /* A mask of the focus states */ |
} SDL_ActiveEvent; |
/* Keyboard event structure */ |
typedef struct { |
Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */ |
Uint8 which; /* The keyboard device index */ |
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ |
SDL_keysym keysym; |
} SDL_KeyboardEvent; |
/* Mouse motion event structure */ |
typedef struct { |
Uint8 type; /* SDL_MOUSEMOTION */ |
Uint8 which; /* The mouse device index */ |
Uint8 state; /* The current button state */ |
Uint16 x, y; /* The X/Y coordinates of the mouse */ |
Sint16 xrel; /* The relative motion in the X direction */ |
Sint16 yrel; /* The relative motion in the Y direction */ |
} SDL_MouseMotionEvent; |
/* Mouse button event structure */ |
typedef struct { |
Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ |
Uint8 which; /* The mouse device index */ |
Uint8 button; /* The mouse button index */ |
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ |
Uint16 x, y; /* The X/Y coordinates of the mouse at press time */ |
} SDL_MouseButtonEvent; |
/* Joystick axis motion event structure */ |
typedef struct { |
Uint8 type; /* SDL_JOYAXISMOTION */ |
Uint8 which; /* The joystick device index */ |
Uint8 axis; /* The joystick axis index */ |
Sint16 value; /* The axis value (range: -32768 to 32767) */ |
} SDL_JoyAxisEvent; |
/* Joystick trackball motion event structure */ |
typedef struct { |
Uint8 type; /* SDL_JOYBALLMOTION */ |
Uint8 which; /* The joystick device index */ |
Uint8 ball; /* The joystick trackball index */ |
Sint16 xrel; /* The relative motion in the X direction */ |
Sint16 yrel; /* The relative motion in the Y direction */ |
} SDL_JoyBallEvent; |
/* Joystick hat position change event structure */ |
typedef struct { |
Uint8 type; /* SDL_JOYHATMOTION */ |
Uint8 which; /* The joystick device index */ |
Uint8 hat; /* The joystick hat index */ |
Uint8 value; /* The hat position value: |
8 1 2 |
7 0 3 |
6 5 4 |
Note that zero means the POV is centered. |
*/ |
} SDL_JoyHatEvent; |
/* Joystick button event structure */ |
typedef struct { |
Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ |
Uint8 which; /* The joystick device index */ |
Uint8 button; /* The joystick button index */ |
Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ |
} SDL_JoyButtonEvent; |
/* The "window resized" event |
When you get this event, you are responsible for setting a new video |
mode with the new width and height. |
*/ |
typedef struct { |
Uint8 type; /* SDL_VIDEORESIZE */ |
int w; /* New width */ |
int h; /* New height */ |
} SDL_ResizeEvent; |
/* The "screen redraw" event */ |
typedef struct { |
Uint8 type; /* SDL_VIDEOEXPOSE */ |
} SDL_ExposeEvent; |
/* The "quit requested" event */ |
typedef struct { |
Uint8 type; /* SDL_QUIT */ |
} SDL_QuitEvent; |
/* A user-defined event type */ |
typedef struct { |
Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */ |
int code; /* User defined event code */ |
void *data1; /* User defined data pointer */ |
void *data2; /* User defined data pointer */ |
} SDL_UserEvent; |
/* If you want to use this event, you should include SDL_syswm.h */ |
struct SDL_SysWMmsg; |
typedef struct SDL_SysWMmsg SDL_SysWMmsg; |
typedef struct { |
Uint8 type; |
SDL_SysWMmsg *msg; |
} SDL_SysWMEvent; |
/* General event structure */ |
typedef union { |
Uint8 type; |
SDL_ActiveEvent active; |
SDL_KeyboardEvent key; |
SDL_MouseMotionEvent motion; |
SDL_MouseButtonEvent button; |
SDL_JoyAxisEvent jaxis; |
SDL_JoyBallEvent jball; |
SDL_JoyHatEvent jhat; |
SDL_JoyButtonEvent jbutton; |
SDL_ResizeEvent resize; |
SDL_ExposeEvent expose; |
SDL_QuitEvent quit; |
SDL_UserEvent user; |
SDL_SysWMEvent syswm; |
} SDL_Event; |
/* Function prototypes */ |
/* Pumps the event loop, gathering events from the input devices. |
This function updates the event queue and internal input device state. |
This should only be run in the thread that sets the video mode. |
*/ |
extern DECLSPEC void SDL_PumpEvents(void); |
/* Checks the event queue for messages and optionally returns them. |
If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to |
the back of the event queue. |
If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front |
of the event queue, matching 'mask', will be returned and will not |
be removed from the queue. |
If 'action' is SDL_GETEVENT, up to 'numevents' events at the front |
of the event queue, matching 'mask', will be returned and will be |
removed from the queue. |
This function returns the number of events actually stored, or -1 |
if there was an error. This function is thread-safe. |
*/ |
typedef enum { |
SDL_ADDEVENT, |
SDL_PEEKEVENT, |
SDL_GETEVENT |
} SDL_eventaction; |
/* */ |
extern DECLSPEC int SDL_PeepEvents(SDL_Event *events, int numevents, |
SDL_eventaction action, Uint32 mask); |
/* Polls for currently pending events, and returns 1 if there are any pending |
events, or 0 if there are none available. If 'event' is not NULL, the next |
event is removed from the queue and stored in that area. |
*/ |
extern DECLSPEC int SDL_PollEvent(SDL_Event *event); |
/* Waits indefinitely for the next available event, returning 1, or 0 if there |
was an error while waiting for events. If 'event' is not NULL, the next |
event is removed from the queue and stored in that area. |
*/ |
extern DECLSPEC int SDL_WaitEvent(SDL_Event *event); |
/* Add an event to the event queue. |
This function returns 0, or -1 if the event couldn't be added to |
the event queue. If the event queue is full, this function fails. |
*/ |
extern DECLSPEC int SDL_PushEvent(SDL_Event *event); |
/* |
This function sets up a filter to process all events before they |
change internal state and are posted to the internal event queue. |
The filter is protypted as: |
*/ |
typedef int (*SDL_EventFilter)(const SDL_Event *event); |
/* |
If the filter returns 1, then the event will be added to the internal queue. |
If it returns 0, then the event will be dropped from the queue, but the |
internal state will still be updated. This allows selective filtering of |
dynamically arriving events. |
WARNING: Be very careful of what you do in the event filter function, as |
it may run in a different thread! |
There is one caveat when dealing with the SDL_QUITEVENT event type. The |
event filter is only called when the window manager desires to close the |
application window. If the event filter returns 1, then the window will |
be closed, otherwise the window will remain open if possible. |
If the quit event is generated by an interrupt signal, it will bypass the |
internal queue and be delivered to the application at the next event poll. |
*/ |
extern DECLSPEC void SDL_SetEventFilter(SDL_EventFilter filter); |
/* |
Return the current event filter - can be used to "chain" filters. |
If there is no event filter set, this function returns NULL. |
*/ |
extern DECLSPEC SDL_EventFilter SDL_GetEventFilter(void); |
/* |
This function allows you to set the state of processing certain events. |
If 'state' is set to SDL_IGNORE, that event will be automatically dropped |
from the event queue and will not event be filtered. |
If 'state' is set to SDL_ENABLE, that event will be processed normally. |
If 'state' is set to SDL_QUERY, SDL_EventState() will return the |
current processing state of the specified event. |
*/ |
#define SDL_QUERY -1 |
#define SDL_IGNORE 0 |
#define SDL_DISABLE 0 |
#define SDL_ENABLE 1 |
extern DECLSPEC Uint8 SDL_EventState(Uint8 type, int state); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_events_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_getenv.h |
---|
0,0 → 1,30 |
/* Not all environments have a working getenv()/putenv() */ |
#if defined(macintosh) || defined(_WIN32_WCE) |
#define NEED_SDL_GETENV |
#endif |
#ifdef NEED_SDL_GETENV |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Put a variable of the form "name=value" into the environment */ |
extern DECLSPEC int SDL_putenv(const char *variable); |
#define putenv(X) SDL_putenv(X) |
/* Retrieve a variable named "name" from the environment */ |
extern DECLSPEC char *SDL_getenv(const char *name); |
#define getenv(X) SDL_getenv(X) |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* NEED_GETENV */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_joystick.h |
---|
0,0 → 1,171 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_joystick.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Include file for SDL joystick event handling */ |
#ifndef _SDL_joystick_h |
#define _SDL_joystick_h |
#include "SDL_types.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* In order to use these functions, SDL_Init() must have been called |
with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system |
for joysticks, and load appropriate drivers. |
*/ |
/* The joystick structure used to identify an SDL joystick */ |
struct _SDL_Joystick; |
typedef struct _SDL_Joystick SDL_Joystick; |
/* Function prototypes */ |
/* |
* Count the number of joysticks attached to the system |
*/ |
extern DECLSPEC int SDL_NumJoysticks(void); |
/* |
* Get the implementation dependent name of a joystick. |
* This can be called before any joysticks are opened. |
* If no name can be found, this function returns NULL. |
*/ |
extern DECLSPEC const char *SDL_JoystickName(int device_index); |
/* |
* Open a joystick for use - the index passed as an argument refers to |
* the N'th joystick on the system. This index is the value which will |
* identify this joystick in future joystick events. |
* |
* This function returns a joystick identifier, or NULL if an error occurred. |
*/ |
extern DECLSPEC SDL_Joystick *SDL_JoystickOpen(int device_index); |
/* |
* Returns 1 if the joystick has been opened, or 0 if it has not. |
*/ |
extern DECLSPEC int SDL_JoystickOpened(int device_index); |
/* |
* Get the device index of an opened joystick. |
*/ |
extern DECLSPEC int SDL_JoystickIndex(SDL_Joystick *joystick); |
/* |
* Get the number of general axis controls on a joystick |
*/ |
extern DECLSPEC int SDL_JoystickNumAxes(SDL_Joystick *joystick); |
/* |
* Get the number of trackballs on a joystick |
* Joystick trackballs have only relative motion events associated |
* with them and their state cannot be polled. |
*/ |
extern DECLSPEC int SDL_JoystickNumBalls(SDL_Joystick *joystick); |
/* |
* Get the number of POV hats on a joystick |
*/ |
extern DECLSPEC int SDL_JoystickNumHats(SDL_Joystick *joystick); |
/* |
* Get the number of buttons on a joystick |
*/ |
extern DECLSPEC int SDL_JoystickNumButtons(SDL_Joystick *joystick); |
/* |
* Update the current state of the open joysticks. |
* This is called automatically by the event loop if any joystick |
* events are enabled. |
*/ |
extern DECLSPEC void SDL_JoystickUpdate(void); |
/* |
* Enable/disable joystick event polling. |
* If joystick events are disabled, you must call SDL_JoystickUpdate() |
* yourself and check the state of the joystick when you want joystick |
* information. |
* The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. |
*/ |
extern DECLSPEC int SDL_JoystickEventState(int state); |
/* |
* Get the current state of an axis control on a joystick |
* The state is a value ranging from -32768 to 32767. |
* The axis indices start at index 0. |
*/ |
extern DECLSPEC Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); |
/* |
* Get the current state of a POV hat on a joystick |
* The return value is one of the following positions: |
*/ |
#define SDL_HAT_CENTERED 0x00 |
#define SDL_HAT_UP 0x01 |
#define SDL_HAT_RIGHT 0x02 |
#define SDL_HAT_DOWN 0x04 |
#define SDL_HAT_LEFT 0x08 |
#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) |
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) |
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) |
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) |
/* |
* The hat indices start at index 0. |
*/ |
extern DECLSPEC Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); |
/* |
* Get the ball axis change since the last poll |
* This returns 0, or -1 if you passed it invalid parameters. |
* The ball indices start at index 0. |
*/ |
extern DECLSPEC int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); |
/* |
* Get the current state of a button on a joystick |
* The button indices start at index 0. |
*/ |
extern DECLSPEC Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button); |
/* |
* Close a joystick previously opened with SDL_JoystickOpen() |
*/ |
extern DECLSPEC void SDL_JoystickClose(SDL_Joystick *joystick); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_joystick_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_keyboard.h |
---|
0,0 → 1,124 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_keyboard.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Include file for SDL keyboard event handling */ |
#ifndef _SDL_keyboard_h |
#define _SDL_keyboard_h |
#include "SDL_types.h" |
#include "SDL_keysym.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Keysym structure |
- The scancode is hardware dependent, and should not be used by general |
applications. If no hardware scancode is available, it will be 0. |
- The 'unicode' translated character is only available when character |
translation is enabled by the SDL_EnableUNICODE() API. If non-zero, |
this is a UNICODE character corresponding to the keypress. If the |
high 9 bits of the character are 0, then this maps to the equivalent |
ASCII character: |
char ch; |
if ( (keysym.unicode & 0xFF80) == 0 ) { |
ch = keysym.unicode & 0x7F; |
} else { |
An international character.. |
} |
*/ |
typedef struct { |
Uint8 scancode; /* hardware specific scancode */ |
SDLKey sym; /* SDL virtual keysym */ |
SDLMod mod; /* current key modifiers */ |
Uint16 unicode; /* translated character */ |
} SDL_keysym; |
/* This is the mask which refers to all hotkey bindings */ |
#define SDL_ALL_HOTKEYS 0xFFFFFFFF |
/* Function prototypes */ |
/* |
* Enable/Disable UNICODE translation of keyboard input. |
* This translation has some overhead, so translation defaults off. |
* If 'enable' is 1, translation is enabled. |
* If 'enable' is 0, translation is disabled. |
* If 'enable' is -1, the translation state is not changed. |
* It returns the previous state of keyboard translation. |
*/ |
extern DECLSPEC int SDL_EnableUNICODE(int enable); |
/* |
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off. |
* 'delay' is the initial delay in ms between the time when a key is |
* pressed, and keyboard repeat begins. |
* 'interval' is the time in ms between keyboard repeat events. |
*/ |
#define SDL_DEFAULT_REPEAT_DELAY 500 |
#define SDL_DEFAULT_REPEAT_INTERVAL 30 |
/* |
* If 'delay' is set to 0, keyboard repeat is disabled. |
*/ |
extern DECLSPEC int SDL_EnableKeyRepeat(int delay, int interval); |
/* |
* Get a snapshot of the current state of the keyboard. |
* Returns an array of keystates, indexed by the SDLK_* syms. |
* Used: |
* Uint8 *keystate = SDL_GetKeyState(NULL); |
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed. |
*/ |
extern DECLSPEC Uint8 * SDL_GetKeyState(int *numkeys); |
/* |
* Get the current key modifier state |
*/ |
extern DECLSPEC SDLMod SDL_GetModState(void); |
/* |
* Set the current key modifier state |
* This does not change the keyboard state, only the key modifier flags. |
*/ |
extern DECLSPEC void SDL_SetModState(SDLMod modstate); |
/* |
* Get the name of an SDL virtual keysym |
*/ |
extern DECLSPEC char * SDL_GetKeyName(SDLKey key); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_keyboard_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_keysym.h |
---|
0,0 → 1,315 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_keysym.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
#ifndef _SDL_keysym_h |
#define _SDL_keysym_h |
/* What we really want is a mapping of every raw key on the keyboard. |
To support international keyboards, we use the range 0xA1 - 0xFF |
as international virtual keycodes. We'll follow in the footsteps of X11... |
The names of the keys |
*/ |
typedef enum { |
/* The keyboard syms have been cleverly chosen to map to ASCII */ |
SDLK_UNKNOWN = 0, |
SDLK_FIRST = 0, |
SDLK_BACKSPACE = 8, |
SDLK_TAB = 9, |
SDLK_CLEAR = 12, |
SDLK_RETURN = 13, |
SDLK_PAUSE = 19, |
SDLK_ESCAPE = 27, |
SDLK_SPACE = 32, |
SDLK_EXCLAIM = 33, |
SDLK_QUOTEDBL = 34, |
SDLK_HASH = 35, |
SDLK_DOLLAR = 36, |
SDLK_AMPERSAND = 38, |
SDLK_QUOTE = 39, |
SDLK_LEFTPAREN = 40, |
SDLK_RIGHTPAREN = 41, |
SDLK_ASTERISK = 42, |
SDLK_PLUS = 43, |
SDLK_COMMA = 44, |
SDLK_MINUS = 45, |
SDLK_PERIOD = 46, |
SDLK_SLASH = 47, |
SDLK_0 = 48, |
SDLK_1 = 49, |
SDLK_2 = 50, |
SDLK_3 = 51, |
SDLK_4 = 52, |
SDLK_5 = 53, |
SDLK_6 = 54, |
SDLK_7 = 55, |
SDLK_8 = 56, |
SDLK_9 = 57, |
SDLK_COLON = 58, |
SDLK_SEMICOLON = 59, |
SDLK_LESS = 60, |
SDLK_EQUALS = 61, |
SDLK_GREATER = 62, |
SDLK_QUESTION = 63, |
SDLK_AT = 64, |
/* |
Skip uppercase letters |
*/ |
SDLK_LEFTBRACKET = 91, |
SDLK_BACKSLASH = 92, |
SDLK_RIGHTBRACKET = 93, |
SDLK_CARET = 94, |
SDLK_UNDERSCORE = 95, |
SDLK_BACKQUOTE = 96, |
SDLK_a = 97, |
SDLK_b = 98, |
SDLK_c = 99, |
SDLK_d = 100, |
SDLK_e = 101, |
SDLK_f = 102, |
SDLK_g = 103, |
SDLK_h = 104, |
SDLK_i = 105, |
SDLK_j = 106, |
SDLK_k = 107, |
SDLK_l = 108, |
SDLK_m = 109, |
SDLK_n = 110, |
SDLK_o = 111, |
SDLK_p = 112, |
SDLK_q = 113, |
SDLK_r = 114, |
SDLK_s = 115, |
SDLK_t = 116, |
SDLK_u = 117, |
SDLK_v = 118, |
SDLK_w = 119, |
SDLK_x = 120, |
SDLK_y = 121, |
SDLK_z = 122, |
SDLK_DELETE = 127, |
/* End of ASCII mapped keysyms */ |
/* International keyboard syms */ |
SDLK_WORLD_0 = 160, /* 0xA0 */ |
SDLK_WORLD_1 = 161, |
SDLK_WORLD_2 = 162, |
SDLK_WORLD_3 = 163, |
SDLK_WORLD_4 = 164, |
SDLK_WORLD_5 = 165, |
SDLK_WORLD_6 = 166, |
SDLK_WORLD_7 = 167, |
SDLK_WORLD_8 = 168, |
SDLK_WORLD_9 = 169, |
SDLK_WORLD_10 = 170, |
SDLK_WORLD_11 = 171, |
SDLK_WORLD_12 = 172, |
SDLK_WORLD_13 = 173, |
SDLK_WORLD_14 = 174, |
SDLK_WORLD_15 = 175, |
SDLK_WORLD_16 = 176, |
SDLK_WORLD_17 = 177, |
SDLK_WORLD_18 = 178, |
SDLK_WORLD_19 = 179, |
SDLK_WORLD_20 = 180, |
SDLK_WORLD_21 = 181, |
SDLK_WORLD_22 = 182, |
SDLK_WORLD_23 = 183, |
SDLK_WORLD_24 = 184, |
SDLK_WORLD_25 = 185, |
SDLK_WORLD_26 = 186, |
SDLK_WORLD_27 = 187, |
SDLK_WORLD_28 = 188, |
SDLK_WORLD_29 = 189, |
SDLK_WORLD_30 = 190, |
SDLK_WORLD_31 = 191, |
SDLK_WORLD_32 = 192, |
SDLK_WORLD_33 = 193, |
SDLK_WORLD_34 = 194, |
SDLK_WORLD_35 = 195, |
SDLK_WORLD_36 = 196, |
SDLK_WORLD_37 = 197, |
SDLK_WORLD_38 = 198, |
SDLK_WORLD_39 = 199, |
SDLK_WORLD_40 = 200, |
SDLK_WORLD_41 = 201, |
SDLK_WORLD_42 = 202, |
SDLK_WORLD_43 = 203, |
SDLK_WORLD_44 = 204, |
SDLK_WORLD_45 = 205, |
SDLK_WORLD_46 = 206, |
SDLK_WORLD_47 = 207, |
SDLK_WORLD_48 = 208, |
SDLK_WORLD_49 = 209, |
SDLK_WORLD_50 = 210, |
SDLK_WORLD_51 = 211, |
SDLK_WORLD_52 = 212, |
SDLK_WORLD_53 = 213, |
SDLK_WORLD_54 = 214, |
SDLK_WORLD_55 = 215, |
SDLK_WORLD_56 = 216, |
SDLK_WORLD_57 = 217, |
SDLK_WORLD_58 = 218, |
SDLK_WORLD_59 = 219, |
SDLK_WORLD_60 = 220, |
SDLK_WORLD_61 = 221, |
SDLK_WORLD_62 = 222, |
SDLK_WORLD_63 = 223, |
SDLK_WORLD_64 = 224, |
SDLK_WORLD_65 = 225, |
SDLK_WORLD_66 = 226, |
SDLK_WORLD_67 = 227, |
SDLK_WORLD_68 = 228, |
SDLK_WORLD_69 = 229, |
SDLK_WORLD_70 = 230, |
SDLK_WORLD_71 = 231, |
SDLK_WORLD_72 = 232, |
SDLK_WORLD_73 = 233, |
SDLK_WORLD_74 = 234, |
SDLK_WORLD_75 = 235, |
SDLK_WORLD_76 = 236, |
SDLK_WORLD_77 = 237, |
SDLK_WORLD_78 = 238, |
SDLK_WORLD_79 = 239, |
SDLK_WORLD_80 = 240, |
SDLK_WORLD_81 = 241, |
SDLK_WORLD_82 = 242, |
SDLK_WORLD_83 = 243, |
SDLK_WORLD_84 = 244, |
SDLK_WORLD_85 = 245, |
SDLK_WORLD_86 = 246, |
SDLK_WORLD_87 = 247, |
SDLK_WORLD_88 = 248, |
SDLK_WORLD_89 = 249, |
SDLK_WORLD_90 = 250, |
SDLK_WORLD_91 = 251, |
SDLK_WORLD_92 = 252, |
SDLK_WORLD_93 = 253, |
SDLK_WORLD_94 = 254, |
SDLK_WORLD_95 = 255, /* 0xFF */ |
/* Numeric keypad */ |
SDLK_KP0 = 256, |
SDLK_KP1 = 257, |
SDLK_KP2 = 258, |
SDLK_KP3 = 259, |
SDLK_KP4 = 260, |
SDLK_KP5 = 261, |
SDLK_KP6 = 262, |
SDLK_KP7 = 263, |
SDLK_KP8 = 264, |
SDLK_KP9 = 265, |
SDLK_KP_PERIOD = 266, |
SDLK_KP_DIVIDE = 267, |
SDLK_KP_MULTIPLY = 268, |
SDLK_KP_MINUS = 269, |
SDLK_KP_PLUS = 270, |
SDLK_KP_ENTER = 271, |
SDLK_KP_EQUALS = 272, |
/* Arrows + Home/End pad */ |
SDLK_UP = 273, |
SDLK_DOWN = 274, |
SDLK_RIGHT = 275, |
SDLK_LEFT = 276, |
SDLK_INSERT = 277, |
SDLK_HOME = 278, |
SDLK_END = 279, |
SDLK_PAGEUP = 280, |
SDLK_PAGEDOWN = 281, |
/* Function keys */ |
SDLK_F1 = 282, |
SDLK_F2 = 283, |
SDLK_F3 = 284, |
SDLK_F4 = 285, |
SDLK_F5 = 286, |
SDLK_F6 = 287, |
SDLK_F7 = 288, |
SDLK_F8 = 289, |
SDLK_F9 = 290, |
SDLK_F10 = 291, |
SDLK_F11 = 292, |
SDLK_F12 = 293, |
SDLK_F13 = 294, |
SDLK_F14 = 295, |
SDLK_F15 = 296, |
/* Key state modifier keys */ |
SDLK_NUMLOCK = 300, |
SDLK_CAPSLOCK = 301, |
SDLK_SCROLLOCK = 302, |
SDLK_RSHIFT = 303, |
SDLK_LSHIFT = 304, |
SDLK_RCTRL = 305, |
SDLK_LCTRL = 306, |
SDLK_RALT = 307, |
SDLK_LALT = 308, |
SDLK_RMETA = 309, |
SDLK_LMETA = 310, |
SDLK_LSUPER = 311, /* Left "Windows" key */ |
SDLK_RSUPER = 312, /* Right "Windows" key */ |
SDLK_MODE = 313, /* "Alt Gr" key */ |
SDLK_COMPOSE = 314, /* Multi-key compose key */ |
/* Miscellaneous function keys */ |
SDLK_HELP = 315, |
SDLK_PRINT = 316, |
SDLK_SYSREQ = 317, |
SDLK_BREAK = 318, |
SDLK_MENU = 319, |
SDLK_POWER = 320, /* Power Macintosh power key */ |
SDLK_EURO = 321, /* Some european keyboards */ |
/* Add any other keys here */ |
SDLK_LAST |
} SDLKey; |
/* Enumeration of valid key mods (possibly OR'd together) */ |
typedef enum { |
KMOD_NONE = 0x0000, |
KMOD_LSHIFT= 0x0001, |
KMOD_RSHIFT= 0x0002, |
KMOD_LCTRL = 0x0040, |
KMOD_RCTRL = 0x0080, |
KMOD_LALT = 0x0100, |
KMOD_RALT = 0x0200, |
KMOD_LMETA = 0x0400, |
KMOD_RMETA = 0x0800, |
KMOD_NUM = 0x1000, |
KMOD_CAPS = 0x2000, |
KMOD_MODE = 0x4000, |
KMOD_RESERVED = 0x8000 |
} SDLMod; |
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) |
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) |
#define KMOD_ALT (KMOD_LALT|KMOD_RALT) |
#define KMOD_META (KMOD_LMETA|KMOD_RMETA) |
#endif /* _SDL_keysym_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_main.h |
---|
0,0 → 1,97 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_main.h,v 1.3 2001/06/07 14:28:11 hercules Exp $"; |
#endif |
#ifndef _SDL_main_h |
#define _SDL_main_h |
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */ |
#if defined(WIN32UNDEFINED) || (defined(__MWERKS__) && !defined(__BEOS__)) || \ |
defined(macintosh) || defined(__APPLE__) |
#ifdef __cplusplus |
#define C_LINKAGE "C" |
#else |
#define C_LINKAGE |
#endif /* __cplusplus */ |
/* The application's main() function must be called with C linkage, |
and should be declared like this: |
#ifdef __cplusplus |
extern "C" |
#endif |
int main(int argc, char *argv[]) |
{ |
} |
*/ |
#define main SDL_main |
/* The prototype for the application's main() function */ |
extern C_LINKAGE int SDL_main(int argc, char *argv[]); |
/* From the SDL library code -- needed for registering the app on Win32 */ |
#if defined(WIN32UNDEFINED) |
#include "SDL_types.h" |
#include "begin_code.h" |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* This should be called from your WinMain() function, if any */ |
extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst); |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif |
/* From the SDL library code -- needed for registering QuickDraw on MacOS */ |
#if defined(macintosh) |
#include "begin_code.h" |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Forward declaration so we don't need to include QuickDraw.h */ |
struct QDGlobals; |
/* This should be called from your main() function, if any */ |
extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd); |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif |
#endif /* Need to redefine main()? */ |
#endif /* _SDL_main_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_main.h.BAK |
---|
0,0 → 1,97 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_main.h,v 1.3 2001/06/07 14:28:11 hercules Exp $"; |
#endif |
#ifndef _SDL_main_h |
#define _SDL_main_h |
/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */ |
#if defined(WIN32) || (defined(__MWERKS__) && !defined(__BEOS__)) || \ |
defined(macintosh) || defined(__APPLE__) |
#ifdef __cplusplus |
#define C_LINKAGE "C" |
#else |
#define C_LINKAGE |
#endif /* __cplusplus */ |
/* The application's main() function must be called with C linkage, |
and should be declared like this: |
#ifdef __cplusplus |
extern "C" |
#endif |
int main(int argc, char *argv[]) |
{ |
} |
*/ |
#define main SDL_main |
/* The prototype for the application's main() function */ |
extern C_LINKAGE int SDL_main(int argc, char *argv[]); |
/* From the SDL library code -- needed for registering the app on Win32 */ |
#if defined(WIN32) |
#include "SDL_types.h" |
#include "begin_code.h" |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* This should be called from your WinMain() function, if any */ |
extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst); |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif |
/* From the SDL library code -- needed for registering QuickDraw on MacOS */ |
#if defined(macintosh) |
#include "begin_code.h" |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Forward declaration so we don't need to include QuickDraw.h */ |
struct QDGlobals; |
/* This should be called from your main() function, if any */ |
extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd); |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif |
#endif /* Need to redefine main()? */ |
#endif /* _SDL_main_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_mouse.h |
---|
0,0 → 1,136 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_mouse.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Include file for SDL mouse event handling */ |
#ifndef _SDL_mouse_h |
#define _SDL_mouse_h |
#include "SDL_types.h" |
#include "SDL_video.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
typedef struct WMcursor WMcursor; /* Implementation dependent */ |
typedef struct { |
SDL_Rect area; /* The area of the mouse cursor */ |
Sint16 hot_x, hot_y; /* The "tip" of the cursor */ |
Uint8 *data; /* B/W cursor data */ |
Uint8 *mask; /* B/W cursor mask */ |
Uint8 *save[2]; /* Place to save cursor area */ |
WMcursor *wm_cursor; /* Window-manager cursor */ |
} SDL_Cursor; |
/* Function prototypes */ |
/* |
* Retrieve the current state of the mouse. |
* The current button state is returned as a button bitmask, which can |
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
* current mouse cursor position. You can pass NULL for either x or y. |
*/ |
extern DECLSPEC Uint8 SDL_GetMouseState(int *x, int *y); |
/* |
* Retrieve the current state of the mouse. |
* The current button state is returned as a button bitmask, which can |
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
* mouse deltas since the last call to SDL_GetRelativeMouseState(). |
*/ |
extern DECLSPEC Uint8 SDL_GetRelativeMouseState(int *x, int *y); |
/* |
* Set the position of the mouse cursor (generates a mouse motion event) |
*/ |
extern DECLSPEC void SDL_WarpMouse(Uint16 x, Uint16 y); |
/* |
* Create a cursor using the specified data and mask (in MSB format). |
* The cursor width must be a multiple of 8 bits. |
* |
* The cursor is created in black and white according to the following: |
* data mask resulting pixel on screen |
* 0 1 White |
* 1 1 Black |
* 0 0 Transparent |
* 1 0 Inverted color if possible, black if not. |
* |
* Cursors created with this function must be freed with SDL_FreeCursor(). |
*/ |
extern DECLSPEC SDL_Cursor *SDL_CreateCursor |
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); |
/* |
* Set the currently active cursor to the specified one. |
* If the cursor is currently visible, the change will be immediately |
* represented on the display. |
*/ |
extern DECLSPEC void SDL_SetCursor(SDL_Cursor *cursor); |
/* |
* Returns the currently active cursor. |
*/ |
extern DECLSPEC SDL_Cursor * SDL_GetCursor(void); |
/* |
* Deallocates a cursor created with SDL_CreateCursor(). |
*/ |
extern DECLSPEC void SDL_FreeCursor(SDL_Cursor *cursor); |
/* |
* Toggle whether or not the cursor is shown on the screen. |
* The cursor start off displayed, but can be turned off. |
* SDL_ShowCursor() returns 1 if the cursor was being displayed |
* before the call, or 0 if it was not. You can query the current |
* state by passing a 'toggle' value of -1. |
*/ |
extern DECLSPEC int SDL_ShowCursor(int toggle); |
/* Used as a mask when testing buttons in buttonstate |
Button 1: Left mouse button |
Button 2: Middle mouse button |
Button 3: Right mouse button |
*/ |
#define SDL_BUTTON(X) (SDL_PRESSED<<(X-1)) |
#define SDL_BUTTON_LEFT 1 |
#define SDL_BUTTON_MIDDLE 2 |
#define SDL_BUTTON_RIGHT 3 |
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) |
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) |
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_mouse_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_mutex.h |
---|
0,0 → 1,163 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_mutex.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
#ifndef _SDL_mutex_h |
#define _SDL_mutex_h |
/* Functions to provide thread synchronization primitives |
These are independent of the other SDL routines. |
*/ |
#include "SDL_main.h" |
#include "SDL_types.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Synchronization functions which can time out return this value |
if they time out. |
*/ |
#define SDL_MUTEX_TIMEDOUT 1 |
/* This is the timeout value which corresponds to never time out */ |
#define SDL_MUTEX_MAXWAIT (~(Uint32)0) |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* Mutex functions */ |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* The SDL mutex structure, defined in SDL_mutex.c */ |
struct SDL_mutex; |
typedef struct SDL_mutex SDL_mutex; |
/* Create a mutex, initialized unlocked */ |
extern DECLSPEC SDL_mutex * SDL_CreateMutex(void); |
/* Lock the mutex (Returns 0, or -1 on error) */ |
#define SDL_LockMutex(m) SDL_mutexP(m) |
extern DECLSPEC int SDL_mutexP(SDL_mutex *mutex); |
/* Unlock the mutex (Returns 0, or -1 on error) */ |
#define SDL_UnlockMutex(m) SDL_mutexV(m) |
extern DECLSPEC int SDL_mutexV(SDL_mutex *mutex); |
/* Destroy a mutex */ |
extern DECLSPEC void SDL_DestroyMutex(SDL_mutex *mutex); |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* Semaphore functions */ |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* The SDL semaphore structure, defined in SDL_sem.c */ |
struct SDL_semaphore; |
typedef struct SDL_semaphore SDL_sem; |
/* Create a semaphore, initialized with value, returns NULL on failure. */ |
extern DECLSPEC SDL_sem * SDL_CreateSemaphore(Uint32 initial_value); |
/* Destroy a semaphore */ |
extern DECLSPEC void SDL_DestroySemaphore(SDL_sem *sem); |
/* This function suspends the calling thread until the semaphore pointed |
* to by sem has a positive count. It then atomically decreases the semaphore |
* count. |
*/ |
extern DECLSPEC int SDL_SemWait(SDL_sem *sem); |
/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds, |
SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. |
*/ |
extern DECLSPEC int SDL_SemTryWait(SDL_sem *sem); |
/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if |
the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in |
the allotted time, and -1 on error. |
On some platforms this function is implemented by looping with a delay |
of 1 ms, and so should be avoided if possible. |
*/ |
extern DECLSPEC int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); |
/* Atomically increases the semaphore's count (not blocking), returns 0, |
or -1 on error. |
*/ |
extern DECLSPEC int SDL_SemPost(SDL_sem *sem); |
/* Returns the current count of the semaphore */ |
extern DECLSPEC Uint32 SDL_SemValue(SDL_sem *sem); |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* Condition variable functions */ |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* The SDL condition variable structure, defined in SDL_cond.c */ |
struct SDL_cond; |
typedef struct SDL_cond SDL_cond; |
/* Create a condition variable */ |
extern DECLSPEC SDL_cond * SDL_CreateCond(void); |
/* Destroy a condition variable */ |
extern DECLSPEC void SDL_DestroyCond(SDL_cond *cond); |
/* Restart one of the threads that are waiting on the condition variable, |
returns 0 or -1 on error. |
*/ |
extern DECLSPEC int SDL_CondSignal(SDL_cond *cond); |
/* Restart all threads that are waiting on the condition variable, |
returns 0 or -1 on error. |
*/ |
extern DECLSPEC int SDL_CondBroadcast(SDL_cond *cond); |
/* Wait on the condition variable, unlocking the provided mutex. |
The mutex must be locked before entering this function! |
Returns 0 when it is signaled, or -1 on error. |
*/ |
extern DECLSPEC int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); |
/* Waits for at most 'ms' milliseconds, and returns 0 if the condition |
variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not |
signaled in the allotted time, and -1 on error. |
On some platforms this function is implemented by looping with a delay |
of 1 ms, and so should be avoided if possible. |
*/ |
extern DECLSPEC int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_mutex_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_quit.h |
---|
0,0 → 1,52 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_quit.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Include file for SDL quit event handling */ |
#ifndef _SDL_quit_h |
#define _SDL_quit_h |
/* |
An SDL_QUITEVENT is generated when the user tries to close the application |
window. If it is ignored or filtered out, the window will remain open. |
If it is not ignored or filtered, it is queued normally and the window |
is allowed to close. When the window is closed, screen updates will |
complete, but have no effect. |
SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) |
and SIGTERM (system termination request), if handlers do not already |
exist, that generate SDL_QUITEVENT events as well. There is no way |
to determine the cause of an SDL_QUITEVENT, but setting a signal |
handler in your application will override the default generation of |
quit events for that signal. |
*/ |
/* There are no functions directly affecting the quit event */ |
#define SDL_QuitRequested() \ |
(SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) |
#endif /* _SDL_quit_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_rwops.h |
---|
0,0 → 1,113 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_rwops.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* This file provides a general interface for SDL to read and write |
data sources. It can easily be extended to files, memory, etc. |
*/ |
#ifndef _SDL_RWops_h |
#define _SDL_RWops_h |
#include <stdio.h> |
#include "SDL_types.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* This is the read/write operation structure -- very basic */ |
typedef struct SDL_RWops { |
/* Seek to 'offset' relative to whence, one of stdio's whence values: |
SEEK_SET, SEEK_CUR, SEEK_END |
Returns the final offset in the data source. |
*/ |
int (*seek)(struct SDL_RWops *context, int offset, int whence); |
/* Read up to 'num' objects each of size 'objsize' from the data |
source to the area pointed at by 'ptr'. |
Returns the number of objects read, or -1 if the read failed. |
*/ |
int (*read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); |
/* Write exactly 'num' objects each of size 'objsize' from the area |
pointed at by 'ptr' to data source. |
Returns 'num', or -1 if the write failed. |
*/ |
int (*write)(struct SDL_RWops *context, const void *ptr, int size, int num); |
/* Close and free an allocated SDL_FSops structure */ |
int (*close)(struct SDL_RWops *context); |
Uint32 type; |
union { |
struct { |
int autoclose; |
FILE *fp; |
} stdio; |
struct { |
Uint8 *base; |
Uint8 *here; |
Uint8 *stop; |
} mem; |
struct { |
void *data1; |
} unknown; |
} hidden; |
} SDL_RWops; |
/* Functions to create SDL_RWops structures from various data sources */ |
extern DECLSPEC SDL_RWops * SDL_RWFromFile(const char *file, const char *mode); |
extern DECLSPEC SDL_RWops * SDL_RWFromFP(FILE *fp, int autoclose); |
extern DECLSPEC SDL_RWops * SDL_RWFromMem(void *mem, int size); |
extern DECLSPEC SDL_RWops * SDL_AllocRW(void); |
extern DECLSPEC void SDL_FreeRW(SDL_RWops *area); |
/* Macros to easily read and write from an SDL_RWops structure */ |
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) |
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, SEEK_CUR) |
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) |
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) |
#define SDL_RWclose(ctx) (ctx)->close(ctx) |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_RWops_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_syswm.h |
---|
0,0 → 1,165 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_syswm.h,v 1.5 2001/07/08 09:00:06 hercules Exp $"; |
#endif |
/* Include file for SDL custom system window manager hooks */ |
#ifndef _SDL_syswm_h |
#define _SDL_syswm_h |
#include "SDL_version.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Your application has access to a special type of event 'SDL_SYSWMEVENT', |
which contains window-manager specific information and arrives whenever |
an unhandled window event occurs. This event is ignored by default, but |
you can enable it with SDL_EventState() |
*/ |
#ifdef SDL_PROTOTYPES_ONLY |
struct SDL_SysWMinfo; |
typedef struct SDL_SysWMinfo SDL_SysWMinfo; |
#else |
/* This is the structure for custom window manager events */ |
#if (defined(unix) || defined(__unix__) || defined(_AIX) || defined(__OpenBSD__)) && \ |
(!defined(DISABLE_X11) && !defined(__CYGWIN32__)) |
/* AIX is unix, of course, but the native compiler CSet doesn't define unix */ |
#include <X11/Xlib.h> |
#include <X11/Xatom.h> |
/* These are the various supported subsystems under UNIX */ |
typedef enum { |
SDL_SYSWM_X11 |
} SDL_SYSWM_TYPE; |
/* The UNIX custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
SDL_SYSWM_TYPE subsystem; |
union { |
XEvent xevent; |
} event; |
}; |
/* The UNIX custom window manager information structure. |
When this structure is returned, it holds information about which |
low level system it is using, and will be one of SDL_SYSWM_TYPE. |
*/ |
typedef struct { |
SDL_version version; |
SDL_SYSWM_TYPE subsystem; |
union { |
struct { |
Display *display; /* The X11 display */ |
Window window; /* The X11 display window */ |
/* These locking functions should be called around |
any X11 functions using the display variable. |
They lock the event thread, so should not be |
called around event functions or from event filters. |
*/ |
void (*lock_func)(void); |
void (*unlock_func)(void); |
/* Introduced in SDL 1.0.2 */ |
Window fswindow; /* The X11 fullscreen window */ |
Window wmwindow; /* The X11 managed input window */ |
} x11; |
} info; |
} SDL_SysWMinfo; |
#elif defined(ENABLE_NANOX) |
#include <microwin/nano-X.h> |
/* The generic custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
int data; |
}; |
/* The windows custom window manager information structure */ |
typedef struct { |
SDL_version version ; |
GR_WINDOW_ID window ; /* The display window */ |
} SDL_SysWMinfo; |
#elif defined(WIN32UNDEFINED) |
#include <windows.h> |
/* The windows custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
HWND hwnd; /* The window for the message */ |
UINT msg; /* The type of message */ |
WPARAM wParam; /* WORD message parameter */ |
LPARAM lParam; /* LONG message parameter */ |
}; |
/* The windows custom window manager information structure */ |
typedef struct { |
SDL_version version; |
HWND window; /* The Win32 display window */ |
} SDL_SysWMinfo; |
#else |
/* The generic custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
int data; |
}; |
/* The generic custom window manager information structure */ |
typedef struct { |
SDL_version version; |
int data; |
} SDL_SysWMinfo; |
#endif /* OS type */ |
#endif /* SDL_PROTOTYPES_ONLY */ |
/* Function prototypes */ |
/* |
* This function gives you custom hooks into the window manager information. |
* It fills the structure pointed to by 'info' with custom information and |
* returns 1 if the function is implemented. If it's not implemented, or |
* the version member of the 'info' structure is invalid, it returns 0. |
*/ |
extern DECLSPEC int SDL_GetWMInfo(SDL_SysWMinfo *info); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_syswm_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_syswm.h.BAK |
---|
0,0 → 1,165 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_syswm.h,v 1.5 2001/07/08 09:00:06 hercules Exp $"; |
#endif |
/* Include file for SDL custom system window manager hooks */ |
#ifndef _SDL_syswm_h |
#define _SDL_syswm_h |
#include "SDL_version.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Your application has access to a special type of event 'SDL_SYSWMEVENT', |
which contains window-manager specific information and arrives whenever |
an unhandled window event occurs. This event is ignored by default, but |
you can enable it with SDL_EventState() |
*/ |
#ifdef SDL_PROTOTYPES_ONLY |
struct SDL_SysWMinfo; |
typedef struct SDL_SysWMinfo SDL_SysWMinfo; |
#else |
/* This is the structure for custom window manager events */ |
#if (defined(unix) || defined(__unix__) || defined(_AIX) || defined(__OpenBSD__)) && \ |
(!defined(DISABLE_X11) && !defined(__CYGWIN32__)) |
/* AIX is unix, of course, but the native compiler CSet doesn't define unix */ |
#include <X11/Xlib.h> |
#include <X11/Xatom.h> |
/* These are the various supported subsystems under UNIX */ |
typedef enum { |
SDL_SYSWM_X11 |
} SDL_SYSWM_TYPE; |
/* The UNIX custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
SDL_SYSWM_TYPE subsystem; |
union { |
XEvent xevent; |
} event; |
}; |
/* The UNIX custom window manager information structure. |
When this structure is returned, it holds information about which |
low level system it is using, and will be one of SDL_SYSWM_TYPE. |
*/ |
typedef struct { |
SDL_version version; |
SDL_SYSWM_TYPE subsystem; |
union { |
struct { |
Display *display; /* The X11 display */ |
Window window; /* The X11 display window */ |
/* These locking functions should be called around |
any X11 functions using the display variable. |
They lock the event thread, so should not be |
called around event functions or from event filters. |
*/ |
void (*lock_func)(void); |
void (*unlock_func)(void); |
/* Introduced in SDL 1.0.2 */ |
Window fswindow; /* The X11 fullscreen window */ |
Window wmwindow; /* The X11 managed input window */ |
} x11; |
} info; |
} SDL_SysWMinfo; |
#elif defined(ENABLE_NANOX) |
#include <microwin/nano-X.h> |
/* The generic custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
int data; |
}; |
/* The windows custom window manager information structure */ |
typedef struct { |
SDL_version version ; |
GR_WINDOW_ID window ; /* The display window */ |
} SDL_SysWMinfo; |
#elif defined(WIN32) |
#include <windows.h> |
/* The windows custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
HWND hwnd; /* The window for the message */ |
UINT msg; /* The type of message */ |
WPARAM wParam; /* WORD message parameter */ |
LPARAM lParam; /* LONG message parameter */ |
}; |
/* The windows custom window manager information structure */ |
typedef struct { |
SDL_version version; |
HWND window; /* The Win32 display window */ |
} SDL_SysWMinfo; |
#else |
/* The generic custom event structure */ |
struct SDL_SysWMmsg { |
SDL_version version; |
int data; |
}; |
/* The generic custom window manager information structure */ |
typedef struct { |
SDL_version version; |
int data; |
} SDL_SysWMinfo; |
#endif /* OS type */ |
#endif /* SDL_PROTOTYPES_ONLY */ |
/* Function prototypes */ |
/* |
* This function gives you custom hooks into the window manager information. |
* It fills the structure pointed to by 'info' with custom information and |
* returns 1 if the function is implemented. If it's not implemented, or |
* the version member of the 'info' structure is invalid, it returns 0. |
*/ |
extern DECLSPEC int SDL_GetWMInfo(SDL_SysWMinfo *info); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_syswm_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_thread.h |
---|
0,0 → 1,79 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_thread.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
#ifndef _SDL_thread_h |
#define _SDL_thread_h |
/* Header for the SDL thread management routines |
These are independent of the other SDL routines. |
*/ |
#include "SDL_main.h" |
#include "SDL_types.h" |
/* Thread synchronization primitives */ |
#include "SDL_mutex.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* The SDL thread structure, defined in SDL_thread.c */ |
struct SDL_Thread; |
typedef struct SDL_Thread SDL_Thread; |
/* Create a thread */ |
extern DECLSPEC SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data); |
/* Get the 32-bit thread identifier for the current thread */ |
extern DECLSPEC Uint32 SDL_ThreadID(void); |
/* Get the 32-bit thread identifier for the specified thread, |
equivalent to SDL_ThreadID() if the specified thread is NULL. |
*/ |
extern DECLSPEC Uint32 SDL_GetThreadID(SDL_Thread *thread); |
/* Wait for a thread to finish. |
The return code for the thread function is placed in the area |
pointed to by 'status', if 'status' is not NULL. |
*/ |
extern DECLSPEC void SDL_WaitThread(SDL_Thread *thread, int *status); |
/* Forcefully kill a thread without worrying about its state */ |
extern DECLSPEC void SDL_KillThread(SDL_Thread *thread); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_thread_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_timer.h |
---|
0,0 → 1,118 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_timer.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
#ifndef _SDL_timer_h |
#define _SDL_timer_h |
/* Header for the SDL time management routines */ |
#include "SDL_main.h" |
#include "SDL_types.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* This is the OS scheduler timeslice, in milliseconds */ |
#define SDL_TIMESLICE 10 |
/* This is the maximum resolution of the SDL timer on all platforms */ |
#define TIMER_RESOLUTION 10 /* Experimentally determined */ |
/* Get the number of milliseconds since the SDL library initialization. |
* Note that this value wraps if the program runs for more than ~49 days. |
*/ |
extern DECLSPEC Uint32 SDL_GetTicks(void); |
/* Wait a specified number of milliseconds before returning */ |
extern DECLSPEC void SDL_Delay(Uint32 ms); |
/* Function prototype for the timer callback function */ |
typedef Uint32 (*SDL_TimerCallback)(Uint32 interval); |
/* Set a callback to run after the specified number of milliseconds has |
* elapsed. The callback function is passed the current timer interval |
* and returns the next timer interval. If the returned value is the |
* same as the one passed in, the periodic alarm continues, otherwise a |
* new alarm is scheduled. If the callback returns 0, the periodic alarm |
* is cancelled. |
* |
* To cancel a currently running timer, call SDL_SetTimer(0, NULL); |
* |
* The timer callback function may run in a different thread than your |
* main code, and so shouldn't call any functions from within itself. |
* |
* The maximum resolution of this timer is 10 ms, which means that if |
* you request a 16 ms timer, your callback will run approximately 20 ms |
* later on an unloaded system. If you wanted to set a flag signaling |
* a frame update at 30 frames per second (every 33 ms), you might set a |
* timer for 30 ms: |
* SDL_SetTimer((33/10)*10, flag_update); |
* |
* If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). |
* |
* Under UNIX, you should not use raise or use SIGALRM and this function |
* in the same program, as it is implemented using setitimer(). You also |
* should not use this function in multi-threaded applications as signals |
* to multi-threaded apps have undefined behavior in some implementations. |
*/ |
extern DECLSPEC int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); |
/* New timer API, supports multiple timers |
* Written by Stephane Peter <megastep@lokigames.com> |
*/ |
/* Function prototype for the new timer callback function. |
* The callback function is passed the current timer interval and returns |
* the next timer interval. If the returned value is the same as the one |
* passed in, the periodic alarm continues, otherwise a new alarm is |
* scheduled. If the callback returns 0, the periodic alarm is cancelled. |
*/ |
typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param); |
/* Definition of the timer ID type */ |
typedef struct _SDL_TimerID *SDL_TimerID; |
/* Add a new timer to the pool of timers already running. |
Returns a timer ID, or NULL when an error occurs. |
*/ |
extern DECLSPEC SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); |
/* Remove one of the multiple timers knowing its ID. |
* Returns a boolean value indicating success. |
*/ |
extern DECLSPEC SDL_bool SDL_RemoveTimer(SDL_TimerID t); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_timer_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_types.h |
---|
0,0 → 1,87 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_types.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* General data types used by the SDL library */ |
#ifndef _SDL_types_h |
#define _SDL_types_h |
/* The number of elements in a table */ |
#define SDL_TABLESIZE(table) (sizeof(table)/sizeof(table[0])) |
/* Basic data types */ |
typedef enum { |
SDL_FALSE = 0, |
SDL_TRUE = 1 |
} SDL_bool; |
typedef unsigned char Uint8; |
typedef signed char Sint8; |
typedef unsigned short Uint16; |
typedef signed short Sint16; |
typedef unsigned int Uint32; |
typedef signed int Sint32; |
/* Figure out how to support 64-bit datatypes */ |
#if !defined(__STRICT_ANSI__) |
#if defined(__GNUC__) || defined(__MWERKS__) /* MJS */ |
#define SDL_HAS_64BIT_TYPE long long |
#elif defined(_MSC_VER) /* VC++ */ |
#define SDL_HAS_64BIT_TYPE __int64 |
#endif |
#endif /* !__STRICT_ANSI__ */ |
/* The 64-bit datatype isn't supported on all platforms */ |
#ifdef SDL_HAS_64BIT_TYPE |
typedef unsigned SDL_HAS_64BIT_TYPE Uint64; |
typedef SDL_HAS_64BIT_TYPE Sint64; |
#else |
/* This is really just a hack to prevent the compiler from complaining */ |
typedef struct { |
Uint32 hi; |
Uint32 lo; |
} Uint64, Sint64; |
#endif |
/* Make sure the types really have the right sizes */ |
#define SDL_COMPILE_TIME_ASSERT(name, x) \ |
typedef int SDL_dummy_ ## name[(x) * 2 - 1] |
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); |
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); |
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); |
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); |
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); |
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); |
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); |
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); |
#undef SDL_COMPILE_TIME_ASSERT |
/* General keyboard/mouse state definitions */ |
enum { SDL_PRESSED = 0x01, SDL_RELEASED = 0x00 }; |
#endif |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_version.h |
---|
0,0 → 1,90 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_version.h,v 1.3 2001/06/19 13:35:05 hercules Exp $"; |
#endif |
/* This header defines the current SDL version */ |
#ifndef _SDL_version_h |
#define _SDL_version_h |
#include "SDL_types.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL |
*/ |
#define SDL_MAJOR_VERSION 1 |
#define SDL_MINOR_VERSION 2 |
#define SDL_PATCHLEVEL 2 |
typedef struct { |
Uint8 major; |
Uint8 minor; |
Uint8 patch; |
} SDL_version; |
/* This macro can be used to fill a version structure with the compile-time |
* version of the SDL library. |
*/ |
#define SDL_VERSION(X) \ |
{ \ |
(X)->major = SDL_MAJOR_VERSION; \ |
(X)->minor = SDL_MINOR_VERSION; \ |
(X)->patch = SDL_PATCHLEVEL; \ |
} |
/* This macro turns the version numbers into a numeric value: |
(1,2,3) -> (1203) |
This assumes that there will never be more than 100 patchlevels |
*/ |
#define SDL_VERSIONNUM(X, Y, Z) \ |
(X)*1000 + (Y)*100 + (Z) |
/* This is the version number macro for the current SDL version */ |
#define SDL_COMPILEDVERSION \ |
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) |
/* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ |
#define SDL_VERSION_ATLEAST(X, Y, Z) \ |
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) |
/* This function gets the version of the dynamically linked SDL library. |
it should NOT be used to fill a version structure, instead you should |
use the SDL_Version() macro. |
*/ |
extern DECLSPEC const SDL_version * SDL_Linked_Version(void); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_version_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/SDL_video.h |
---|
0,0 → 1,891 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_video.h,v 1.3 2001/06/07 14:28:11 hercules Exp $"; |
#endif |
/* Header file for access to the SDL raw framebuffer window */ |
#ifndef _SDL_video_h |
#define _SDL_video_h |
#include <stdio.h> |
#include "SDL_types.h" |
#include "SDL_mutex.h" |
#include "SDL_rwops.h" |
#include "begin_code.h" |
/* Set up for C function definitions, even when using C++ */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
/* Transparency definitions: These define alpha as the opacity of a surface */ |
#define SDL_ALPHA_OPAQUE 255 |
#define SDL_ALPHA_TRANSPARENT 0 |
/* Useful data types */ |
typedef struct { |
Sint16 x, y; |
Uint16 w, h; |
} SDL_Rect; |
typedef struct { |
Uint8 r; |
Uint8 g; |
Uint8 b; |
Uint8 unused; |
} SDL_Color; |
typedef struct { |
int ncolors; |
SDL_Color *colors; |
} SDL_Palette; |
/* Everything in the pixel format structure is read-only */ |
typedef struct SDL_PixelFormat { |
SDL_Palette *palette; |
Uint8 BitsPerPixel; |
Uint8 BytesPerPixel; |
Uint8 Rloss; |
Uint8 Gloss; |
Uint8 Bloss; |
Uint8 Aloss; |
Uint8 Rshift; |
Uint8 Gshift; |
Uint8 Bshift; |
Uint8 Ashift; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
Uint32 Amask; |
/* RGB color key information */ |
Uint32 colorkey; |
/* Alpha value information (per-surface alpha) */ |
Uint8 alpha; |
} SDL_PixelFormat; |
/* typedef for private surface blitting functions */ |
struct SDL_Surface; |
typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, |
struct SDL_Surface *dst, SDL_Rect *dstrect); |
/* This structure should be treated as read-only, except for 'pixels', |
which, if not NULL, contains the raw pixel data for the surface. |
*/ |
typedef struct SDL_Surface { |
Uint32 flags; /* Read-only */ |
SDL_PixelFormat *format; /* Read-only */ |
int w, h; /* Read-only */ |
Uint16 pitch; /* Read-only */ |
void *pixels; /* Read-write */ |
int offset; /* Private */ |
/* Hardware-specific surface info */ |
struct private_hwdata *hwdata; |
/* clipping information */ |
SDL_Rect clip_rect; /* Read-only */ |
Uint32 unused1; /* for binary compatibility */ |
/* Allow recursive locks */ |
Uint32 locked; /* Private */ |
/* info for fast blit mapping to other surfaces */ |
struct SDL_BlitMap *map; /* Private */ |
/* format version, bumped at every change to invalidate blit maps */ |
unsigned int format_version; /* Private */ |
/* Reference count -- used when freeing surface */ |
int refcount; /* Read-mostly */ |
} SDL_Surface; |
/* These are the currently supported flags for the SDL_surface */ |
/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ |
#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */ |
#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */ |
#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */ |
/* Available for SDL_SetVideoMode() */ |
#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */ |
#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */ |
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */ |
#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */ |
#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */ |
#define SDL_OPENGLBLIT 0x0000000A /* Create an OpenGL rendering context and use it for blitting */ |
#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */ |
#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */ |
/* Used internally (read-only) */ |
#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */ |
#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */ |
#define SDL_RLEACCELOK 0x00002000 /* Private flag */ |
#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */ |
#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */ |
#define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */ |
/* Evaluates to true if the surface needs to be locked before access */ |
#define SDL_MUSTLOCK(surface) \ |
(surface->offset || \ |
((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) |
/* Useful for determining the video hardware capabilities */ |
typedef struct { |
Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */ |
Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */ |
Uint32 UnusedBits1 :6; |
Uint32 UnusedBits2 :1; |
Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */ |
Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */ |
Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */ |
Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */ |
Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */ |
Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */ |
Uint32 blit_fill :1; /* Flag: Accelerated color fill */ |
Uint32 UnusedBits3 :16; |
Uint32 video_mem; /* The total amount of video memory (in K) */ |
SDL_PixelFormat *vfmt; /* Value: The format of the video surface */ |
} SDL_VideoInfo; |
/* The most common video overlay formats. |
For an explanation of these pixel formats, see: |
http://www.webartz.com/fourcc/indexyuv.htm |
For information on the relationship between color spaces, see: |
http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html |
*/ |
#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */ |
#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */ |
#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ |
#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ |
#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ |
/* The YUV hardware video overlay */ |
typedef struct SDL_Overlay { |
Uint32 format; /* Read-only */ |
int w, h; /* Read-only */ |
int planes; /* Read-only */ |
Uint16 *pitches; /* Read-only */ |
Uint8 **pixels; /* Read-write */ |
/* Hardware-specific surface info */ |
struct private_yuvhwfuncs *hwfuncs; |
struct private_yuvhwdata *hwdata; |
/* Special flags */ |
Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */ |
Uint32 UnusedBits :31; |
} SDL_Overlay; |
/* Public enumeration for setting the OpenGL window attributes. */ |
typedef enum { |
SDL_GL_RED_SIZE, |
SDL_GL_GREEN_SIZE, |
SDL_GL_BLUE_SIZE, |
SDL_GL_ALPHA_SIZE, |
SDL_GL_BUFFER_SIZE, |
SDL_GL_DOUBLEBUFFER, |
SDL_GL_DEPTH_SIZE, |
SDL_GL_STENCIL_SIZE, |
SDL_GL_ACCUM_RED_SIZE, |
SDL_GL_ACCUM_GREEN_SIZE, |
SDL_GL_ACCUM_BLUE_SIZE, |
SDL_GL_ACCUM_ALPHA_SIZE |
} SDL_GLattr; |
/* flags for SDL_SetPalette() */ |
#define SDL_LOGPAL 0x01 |
#define SDL_PHYSPAL 0x02 |
/* Function prototypes */ |
/* These functions are used internally, and should not be used unless you |
* have a specific need to specify the video driver you want to use. |
* You should normally use SDL_Init() or SDL_InitSubSystem(). |
* |
* SDL_VideoInit() initializes the video subsystem -- sets up a connection |
* to the window manager, etc, and determines the current video mode and |
* pixel format, but does not initialize a window or graphics mode. |
* Note that event handling is activated by this routine. |
* |
* If you use both sound and video in your application, you need to call |
* SDL_Init() before opening the sound device, otherwise under Win32 DirectX, |
* you won't be able to set full-screen display modes. |
*/ |
extern DECLSPEC int SDL_VideoInit(const char *driver_name, Uint32 flags); |
extern DECLSPEC void SDL_VideoQuit(void); |
/* This function fills the given character buffer with the name of the |
* video driver, and returns a pointer to it if the video driver has |
* been initialized. It returns NULL if no driver has been initialized. |
*/ |
extern DECLSPEC char *SDL_VideoDriverName(char *namebuf, int maxlen); |
/* |
* This function returns a pointer to the current display surface. |
* If SDL is doing format conversion on the display surface, this |
* function returns the publicly visible surface, not the real video |
* surface. |
*/ |
extern DECLSPEC SDL_Surface * SDL_GetVideoSurface(void); |
/* |
* This function returns a read-only pointer to information about the |
* video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' |
* member of the returned structure will contain the pixel format of the |
* "best" video mode. |
*/ |
extern DECLSPEC const SDL_VideoInfo * SDL_GetVideoInfo(void); |
/* |
* Check to see if a particular video mode is supported. |
* It returns 0 if the requested mode is not supported under any bit depth, |
* or returns the bits-per-pixel of the closest available mode with the |
* given width and height. If this bits-per-pixel is different from the |
* one used when setting the video mode, SDL_SetVideoMode() will succeed, |
* but will emulate the requested bits-per-pixel with a shadow surface. |
* |
* The arguments to SDL_VideoModeOK() are the same ones you would pass to |
* SDL_SetVideoMode() |
*/ |
extern DECLSPEC int SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); |
/* |
* Return a pointer to an array of available screen dimensions for the |
* given format and video flags, sorted largest to smallest. Returns |
* NULL if there are no dimensions available for a particular format, |
* or (SDL_Rect **)-1 if any dimension is okay for the given format. |
* |
* If 'format' is NULL, the mode list will be for the format given |
* by SDL_GetVideoInfo()->vfmt |
*/ |
extern DECLSPEC SDL_Rect ** SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); |
/* |
* Set up a video mode with the specified width, height and bits-per-pixel. |
* |
* If 'bpp' is 0, it is treated as the current display bits per pixel. |
* |
* If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the |
* requested bits-per-pixel, but will return whatever video pixel format is |
* available. The default is to emulate the requested pixel format if it |
* is not natively available. |
* |
* If SDL_HWSURFACE is set in 'flags', the video surface will be placed in |
* video memory, if possible, and you may have to call SDL_LockSurface() |
* in order to access the raw framebuffer. Otherwise, the video surface |
* will be created in system memory. |
* |
* If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle |
* updates asynchronously, but you must always lock before accessing pixels. |
* SDL will wait for updates to complete before returning from the lock. |
* |
* If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee |
* that the colors set by SDL_SetColors() will be the colors you get. |
* Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all |
* of the colors exactly the way they are requested, and you should look |
* at the video surface structure to determine the actual palette. |
* If SDL cannot guarantee that the colors you request can be set, |
* i.e. if the colormap is shared, then the video surface may be created |
* under emulation in system memory, overriding the SDL_HWSURFACE flag. |
* |
* If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set |
* a fullscreen video mode. The default is to create a windowed mode |
* if the current graphics system has a window manager. |
* If the SDL library is able to set a fullscreen video mode, this flag |
* will be set in the surface that is returned. |
* |
* If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up |
* two surfaces in video memory and swap between them when you call |
* SDL_Flip(). This is usually slower than the normal single-buffering |
* scheme, but prevents "tearing" artifacts caused by modifying video |
* memory while the monitor is refreshing. It should only be used by |
* applications that redraw the entire screen on every update. |
* |
* If SDL_RESIZABLE is set in 'flags', the SDL library will allow the |
* window manager, if any, to resize the window at runtime. When this |
* occurs, SDL will send a SDL_VIDEORESIZE event to you application, |
* and you must respond to the event by re-calling SDL_SetVideoMode() |
* with the requested size (or another size that suits the application). |
* |
* If SDL_NOFRAME is set in 'flags', the SDL library will create a window |
* without any title bar or frame decoration. Fullscreen video modes have |
* this flag set automatically. |
* |
* This function returns the video framebuffer surface, or NULL if it fails. |
* |
* If you rely on functionality provided by certain video flags, check the |
* flags of the returned surface to make sure that functionality is available. |
* SDL will fall back to reduced functionality if the exact flags you wanted |
* are not available. |
*/ |
extern DECLSPEC SDL_Surface *SDL_SetVideoMode |
(int width, int height, int bpp, Uint32 flags); |
/* |
* Makes sure the given list of rectangles is updated on the given screen. |
* If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire |
* screen. |
* These functions should not be called while 'screen' is locked. |
*/ |
extern DECLSPEC void SDL_UpdateRects |
(SDL_Surface *screen, int numrects, SDL_Rect *rects); |
extern DECLSPEC void SDL_UpdateRect |
(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); |
/* |
* On hardware that supports double-buffering, this function sets up a flip |
* and returns. The hardware will wait for vertical retrace, and then swap |
* video buffers before the next video surface blit or lock will return. |
* On hardware that doesn not support double-buffering, this is equivalent |
* to calling SDL_UpdateRect(screen, 0, 0, 0, 0); |
* The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when |
* setting the video mode for this function to perform hardware flipping. |
* This function returns 0 if successful, or -1 if there was an error. |
*/ |
extern DECLSPEC int SDL_Flip(SDL_Surface *screen); |
/* |
* Set the gamma correction for each of the color channels. |
* The gamma values range (approximately) between 0.1 and 10.0 |
* |
* If this function isn't supported directly by the hardware, it will |
* be emulated using gamma ramps, if available. If successful, this |
* function returns 0, otherwise it returns -1. |
*/ |
extern DECLSPEC int SDL_SetGamma(float red, float green, float blue); |
/* |
* Set the gamma translation table for the red, green, and blue channels |
* of the video hardware. Each table is an array of 256 16-bit quantities, |
* representing a mapping between the input and output for that channel. |
* The input is the index into the array, and the output is the 16-bit |
* gamma value at that index, scaled to the output color precision. |
* |
* You may pass NULL for any of the channels to leave it unchanged. |
* If the call succeeds, it will return 0. If the display driver or |
* hardware does not support gamma translation, or otherwise fails, |
* this function will return -1. |
*/ |
extern DECLSPEC int SDL_SetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); |
/* |
* Retrieve the current values of the gamma translation tables. |
* |
* You must pass in valid pointers to arrays of 256 16-bit quantities. |
* Any of the pointers may be NULL to ignore that channel. |
* If the call succeeds, it will return 0. If the display driver or |
* hardware does not support gamma translation, or otherwise fails, |
* this function will return -1. |
*/ |
extern DECLSPEC int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); |
/* |
* Sets a portion of the colormap for the given 8-bit surface. If 'surface' |
* is not a palettized surface, this function does nothing, returning 0. |
* If all of the colors were set as passed to SDL_SetColors(), it will |
* return 1. If not all the color entries were set exactly as given, |
* it will return 0, and you should look at the surface palette to |
* determine the actual color palette. |
* |
* When 'surface' is the surface associated with the current display, the |
* display colormap will be updated with the requested colors. If |
* SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() |
* will always return 1, and the palette is guaranteed to be set the way |
* you desire, even if the window colormap has to be warped or run under |
* emulation. |
*/ |
extern DECLSPEC int SDL_SetColors(SDL_Surface *surface, |
SDL_Color *colors, int firstcolor, int ncolors); |
/* |
* Sets a portion of the colormap for a given 8-bit surface. |
* 'flags' is one or both of: |
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped |
* to/from the surface, |
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on |
* the screen |
* Only screens have physical palettes. Separate change of physical/logical |
* palettes is only possible if the screen has SDL_HWPALETTE set. |
* |
* The return value is 1 if all colours could be set as requested, and 0 |
* otherwise. |
* |
* SDL_SetColors() is equivalent to calling this function with |
* flags = (SDL_LOGPAL|SDL_PHYSPAL). |
*/ |
extern DECLSPEC int SDL_SetPalette(SDL_Surface *surface, int flags, |
SDL_Color *colors, int firstcolor, |
int ncolors); |
/* |
* Maps an RGB triple to an opaque pixel value for a given pixel format |
*/ |
extern DECLSPEC Uint32 SDL_MapRGB |
(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b); |
/* |
* Maps an RGBA quadruple to a pixel value for a given pixel format |
*/ |
extern DECLSPEC Uint32 SDL_MapRGBA(SDL_PixelFormat *format, |
Uint8 r, Uint8 g, Uint8 b, Uint8 a); |
/* |
* Maps a pixel value into the RGB components for a given pixel format |
*/ |
extern DECLSPEC void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, |
Uint8 *r, Uint8 *g, Uint8 *b); |
/* |
* Maps a pixel value into the RGBA components for a given pixel format |
*/ |
extern DECLSPEC void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, |
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); |
/* |
* Allocate and free an RGB surface (must be called after SDL_SetVideoMode) |
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface. |
* If the depth is greater than 8 bits, the pixel format is set using the |
* flags '[RGB]mask'. |
* If the function runs out of memory, it will return NULL. |
* |
* The 'flags' tell what kind of surface to create. |
* SDL_SWSURFACE means that the surface should be created in system memory. |
* SDL_HWSURFACE means that the surface should be created in video memory, |
* with the same format as the display surface. This is useful for surfaces |
* that will not change much, to take advantage of hardware acceleration |
* when being blitted to the display surface. |
* SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with |
* this surface, but you must always lock it before accessing the pixels. |
* SDL will wait for current blits to finish before returning from the lock. |
* SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. |
* If the hardware supports acceleration of colorkey blits between |
* two surfaces in video memory, SDL will try to place the surface in |
* video memory. If this isn't possible or if there is no hardware |
* acceleration available, the surface will be placed in system memory. |
* SDL_SRCALPHA means that the surface will be used for alpha blits and |
* if the hardware supports hardware acceleration of alpha blits between |
* two surfaces in video memory, to place the surface in video memory |
* if possible, otherwise it will be placed in system memory. |
* If the surface is created in video memory, blits will be _much_ faster, |
* but the surface format must be identical to the video surface format, |
* and the only way to access the pixels member of the surface is to use |
* the SDL_LockSurface() and SDL_UnlockSurface() calls. |
* If the requested surface actually resides in video memory, SDL_HWSURFACE |
* will be set in the flags member of the returned surface. If for some |
* reason the surface could not be placed in video memory, it will not have |
* the SDL_HWSURFACE flag set, and will be created in system memory instead. |
*/ |
#define SDL_AllocSurface SDL_CreateRGBSurface |
extern DECLSPEC SDL_Surface *SDL_CreateRGBSurface |
(Uint32 flags, int width, int height, int depth, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); |
extern DECLSPEC SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, |
int width, int height, int depth, int pitch, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); |
extern DECLSPEC void SDL_FreeSurface(SDL_Surface *surface); |
/* |
* SDL_LockSurface() sets up a surface for directly accessing the pixels. |
* Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write |
* to and read from 'surface->pixels', using the pixel format stored in |
* 'surface->format'. Once you are done accessing the surface, you should |
* use SDL_UnlockSurface() to release it. |
* |
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates |
* to 0, then you can read and write to the surface at any time, and the |
* pixel format of the surface will not change. In particular, if the |
* SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you |
* will not need to lock the display surface before accessing it. |
* |
* No operating system or library calls should be made between lock/unlock |
* pairs, as critical system locks may be held during this time. |
* |
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. |
*/ |
extern DECLSPEC int SDL_LockSurface(SDL_Surface *surface); |
extern DECLSPEC void SDL_UnlockSurface(SDL_Surface *surface); |
/* |
* Load a surface from a seekable SDL data source (memory or file.) |
* If 'freesrc' is non-zero, the source will be closed after being read. |
* Returns the new surface, or NULL if there was an error. |
* The new surface should be freed with SDL_FreeSurface(). |
*/ |
extern DECLSPEC SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); |
/* Convenience macro -- load a surface from a file */ |
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) |
/* |
* Save a surface to a seekable SDL data source (memory or file.) |
* If 'freedst' is non-zero, the source will be closed after being written. |
* Returns 0 if successful or -1 if there was an error. |
*/ |
extern DECLSPEC int SDL_SaveBMP_RW |
(SDL_Surface *surface, SDL_RWops *dst, int freedst); |
/* Convenience macro -- save a surface to a file */ |
#define SDL_SaveBMP(surface, file) \ |
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) |
/* |
* Sets the color key (transparent pixel) in a blittable surface. |
* If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), |
* 'key' will be the transparent pixel in the source image of a blit. |
* SDL_RLEACCEL requests RLE acceleration for the surface if present, |
* and removes RLE acceleration if absent. |
* If 'flag' is 0, this function clears any current color key. |
* This function returns 0, or -1 if there was an error. |
*/ |
extern DECLSPEC int SDL_SetColorKey |
(SDL_Surface *surface, Uint32 flag, Uint32 key); |
/* |
* This function sets the alpha value for the entire surface, as opposed to |
* using the alpha component of each pixel. This value measures the range |
* of transparency of the surface, 0 being completely transparent to 255 |
* being completely opaque. An 'alpha' value of 255 causes blits to be |
* opaque, the source pixels copied to the destination (the default). Note |
* that per-surface alpha can be combined with colorkey transparency. |
* |
* If 'flag' is 0, alpha blending is disabled for the surface. |
* If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. |
* OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the |
* surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. |
*/ |
extern DECLSPEC int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); |
/* |
* Sets the clipping rectangle for the destination surface in a blit. |
* |
* If the clip rectangle is NULL, clipping will be disabled. |
* If the clip rectangle doesn't intersect the surface, the function will |
* return SDL_FALSE and blits will be completely clipped. Otherwise the |
* function returns SDL_TRUE and blits to the surface will be clipped to |
* the intersection of the surface area and the clipping rectangle. |
* |
* Note that blits are automatically clipped to the edges of the source |
* and destination surfaces. |
*/ |
extern DECLSPEC SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect); |
/* |
* Gets the clipping rectangle for the destination surface in a blit. |
* 'rect' must be a pointer to a valid rectangle which will be filled |
* with the correct values. |
*/ |
extern DECLSPEC void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); |
/* |
* Creates a new surface of the specified format, and then copies and maps |
* the given surface to it so the blit of the converted surface will be as |
* fast as possible. If this function fails, it returns NULL. |
* |
* The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those |
* semantics. You can also pass SDL_RLEACCEL in the flags parameter and |
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting |
* surface. |
* |
* This function is used internally by SDL_DisplayFormat(). |
*/ |
extern DECLSPEC SDL_Surface *SDL_ConvertSurface |
(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); |
/* |
* This performs a fast blit from the source surface to the destination |
* surface. It assumes that the source and destination rectangles are |
* the same size. If either 'srcrect' or 'dstrect' are NULL, the entire |
* surface (src or dst) is copied. The final blit rectangles are saved |
* in 'srcrect' and 'dstrect' after all clipping is performed. |
* If the blit is successful, it returns 0, otherwise it returns -1. |
* |
* The blit function should not be called on a locked surface. |
* |
* The blit semantics for surfaces with and without alpha and colorkey |
* are defined as follows: |
* |
* RGBA->RGB: |
* SDL_SRCALPHA set: |
* alpha-blend (using alpha-channel). |
* SDL_SRCCOLORKEY ignored. |
* SDL_SRCALPHA not set: |
* copy RGB. |
* if SDL_SRCCOLORKEY set, only copy the pixels matching the |
* RGB values of the source colour key, ignoring alpha in the |
* comparison. |
* |
* RGB->RGBA: |
* SDL_SRCALPHA set: |
* alpha-blend (using the source per-surface alpha value); |
* set destination alpha to opaque. |
* SDL_SRCALPHA not set: |
* copy RGB, set destination alpha to 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. |
* |
* If either of the surfaces were in video memory, and the blit returns -2, |
* the video memory was lost, so it should be reloaded with artwork and |
* re-blitted: |
while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { |
while ( SDL_LockSurface(image) < 0 ) |
Sleep(10); |
-- Write image pixels to image->pixels -- |
SDL_UnlockSurface(image); |
} |
* This happens under DirectX 5.0 when the system switches away from your |
* fullscreen application. The lock will also fail until you have access |
* to the video memory again. |
*/ |
/* You should call SDL_BlitSurface() unless you know exactly how SDL |
blitting works internally and how to use the other blit functions. |
*/ |
#define SDL_BlitSurface SDL_UpperBlit |
/* This is the public blit function, SDL_BlitSurface(), and it performs |
rectangle validation and clipping before passing it to SDL_LowerBlit() |
*/ |
extern DECLSPEC int SDL_UpperBlit |
(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect); |
/* This is a semi-private blit function and it performs low-level surface |
blitting only. |
*/ |
extern DECLSPEC int SDL_LowerBlit |
(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect); |
/* |
* This function performs a fast fill of the given rectangle with 'color' |
* The given rectangle is clipped to the destination surface clip area |
* and the final fill rectangle is saved in the passed in pointer. |
* If 'dstrect' is NULL, the whole surface will be filled with 'color' |
* The color should be a pixel of the format used by the surface, and |
* can be generated by the SDL_MapRGB() function. |
* This function returns 0 on success, or -1 on error. |
*/ |
extern DECLSPEC int SDL_FillRect |
(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); |
/* |
* This function takes a surface and copies it to a new surface of the |
* pixel format and colors of the video framebuffer, suitable for fast |
* blitting onto the display surface. It calls SDL_ConvertSurface() |
* |
* If you want to take advantage of hardware colorkey or alpha blit |
* acceleration, you should set the colorkey and alpha value before |
* calling this function. |
* |
* If the conversion fails or runs out of memory, it returns NULL |
*/ |
extern DECLSPEC SDL_Surface * SDL_DisplayFormat(SDL_Surface *surface); |
/* |
* This function takes a surface and copies it to a new surface of the |
* pixel format and colors of the video framebuffer (if possible), |
* suitable for fast alpha blitting onto the display surface. |
* The new surface will always have an alpha channel. |
* |
* If you want to take advantage of hardware colorkey or alpha blit |
* acceleration, you should set the colorkey and alpha value before |
* calling this function. |
* |
* If the conversion fails or runs out of memory, it returns NULL |
*/ |
extern DECLSPEC SDL_Surface * SDL_DisplayFormatAlpha(SDL_Surface *surface); |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* YUV video surface overlay functions */ |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* This function creates a video output overlay |
Calling the returned surface an overlay is something of a misnomer because |
the contents of the display surface underneath the area where the overlay |
is shown is undefined - it may be overwritten with the converted YUV data. |
*/ |
extern DECLSPEC SDL_Overlay *SDL_CreateYUVOverlay(int width, int height, |
Uint32 format, SDL_Surface *display); |
/* Lock an overlay for direct access, and unlock it when you are done */ |
extern DECLSPEC int SDL_LockYUVOverlay(SDL_Overlay *overlay); |
extern DECLSPEC void SDL_UnlockYUVOverlay(SDL_Overlay *overlay); |
/* Blit a video overlay to the display surface. |
The contents of the video surface underneath the blit destination are |
not defined. |
The width and height of the destination rectangle may be different from |
that of the overlay, but currently only 2x scaling is supported. |
*/ |
extern DECLSPEC int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); |
/* Free a video overlay */ |
extern DECLSPEC void SDL_FreeYUVOverlay(SDL_Overlay *overlay); |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* OpenGL support functions. */ |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* |
* Dynamically load a GL driver, if SDL is built with dynamic GL. |
* |
* SDL links normally with the OpenGL library on your system by default, |
* but you can compile it to dynamically load the GL driver at runtime. |
* If you do this, you need to retrieve all of the GL functions used in |
* your program from the dynamic library using SDL_GL_GetProcAddress(). |
* |
* This is disabled in default builds of SDL. |
*/ |
extern DECLSPEC int SDL_GL_LoadLibrary(const char *path); |
/* |
* Get the address of a GL function (for extension functions) |
*/ |
extern DECLSPEC void *SDL_GL_GetProcAddress(const char* proc); |
/* |
* Set an attribute of the OpenGL subsystem before intialization. |
*/ |
extern DECLSPEC int SDL_GL_SetAttribute(SDL_GLattr attr, int value); |
/* |
* Get an attribute of the OpenGL subsystem from the windowing |
* interface, such as glX. This is of course different from getting |
* the values from SDL's internal OpenGL subsystem, which only |
* stores the values you request before initialization. |
* |
* Developers should track the values they pass into SDL_GL_SetAttribute |
* themselves if they want to retrieve these values. |
*/ |
extern DECLSPEC int SDL_GL_GetAttribute(SDL_GLattr attr, int* value); |
/* |
* Swap the OpenGL buffers, if double-buffering is supported. |
*/ |
extern DECLSPEC void SDL_GL_SwapBuffers(void); |
/* |
* Internal functions that should not be called unless you have read |
* and understood the source code for these functions. |
*/ |
extern DECLSPEC void SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); |
extern DECLSPEC void SDL_GL_Lock(void); |
extern DECLSPEC void SDL_GL_Unlock(void); |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* These functions allow interaction with the window manager, if any. */ |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
/* |
* Sets/Gets the title and icon text of the display window |
*/ |
extern DECLSPEC void SDL_WM_SetCaption(const char *title, const char *icon); |
extern DECLSPEC void SDL_WM_GetCaption(char **title, char **icon); |
/* |
* Sets the icon for the display window. |
* This function must be called before the first call to SDL_SetVideoMode(). |
* It takes an icon surface, and a mask in MSB format. |
* If 'mask' is NULL, the entire icon surface will be used as the icon. |
*/ |
extern DECLSPEC void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); |
/* |
* This function iconifies the window, and returns 1 if it succeeded. |
* If the function succeeds, it generates an SDL_APPACTIVE loss event. |
* This function is a noop and returns 0 in non-windowed environments. |
*/ |
extern DECLSPEC int SDL_WM_IconifyWindow(void); |
/* |
* Toggle fullscreen mode without changing the contents of the screen. |
* If the display surface does not require locking before accessing |
* the pixel information, then the memory pointers will not change. |
* |
* If this function was able to toggle fullscreen mode (change from |
* running in a window to fullscreen, or vice-versa), it will return 1. |
* If it is not implemented, or fails, it returns 0. |
* |
* The next call to SDL_SetVideoMode() will set the mode fullscreen |
* attribute based on the flags parameter - if SDL_FULLSCREEN is not |
* set, then the display will be windowed by default where supported. |
* |
* This is currently only implemented in the X11 video driver. |
*/ |
extern DECLSPEC int SDL_WM_ToggleFullScreen(SDL_Surface *surface); |
/* |
* This function allows you to set and query the input grab state of |
* the application. It returns the new input grab state. |
*/ |
typedef enum { |
SDL_GRAB_QUERY = -1, |
SDL_GRAB_OFF = 0, |
SDL_GRAB_ON = 1, |
SDL_GRAB_FULLSCREEN /* Used internally */ |
} SDL_GrabMode; |
/* |
* Grabbing means that the mouse is confined to the application window, |
* and nearly all keyboard input is passed directly to the application, |
* and not interpreted by a window manager, if any. |
*/ |
extern DECLSPEC SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode); |
/* Not in public API at the moment - do not use! */ |
extern DECLSPEC int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect); |
/* Ends C function definitions when using C++ */ |
#ifdef __cplusplus |
} |
#endif |
#include "close_code.h" |
#endif /* _SDL_video_h */ |
/contrib/sdk/sources/SDL-1.2.2/include/begin_code.h |
---|
0,0 → 1,91 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This file sets things up for C dynamic library function definitions, |
static inlined functions, and structures aligned at 4-byte alignment. |
If you don't like ugly C preprocessor code, don't look at this file. :) |
*/ |
/* This shouldn't be nested -- included it around code only. */ |
#ifdef _begin_code_h |
#error Nested inclusion of begin_code.h |
#endif |
#define _begin_code_h |
/* Some compilers use a special export keyword */ |
#ifndef DECLSPEC |
# ifdef __BEOS__ |
# if defined(__GNUC__) |
# define DECLSPEC __declspec(dllexport) |
# else |
# define DECLSPEC __declspec(export) |
# endif |
# else |
# ifdef WIN32UNDEFINED |
# define DECLSPEC __declspec(dllexport) |
# else |
# define DECLSPEC |
# endif |
# endif |
#endif |
/* Force structure packing at 4 byte alignment. |
This is necessary if the header is included in code which has structure |
packing set to an alternate value, say for loading structures from disk. |
The packing is reset to the previous value in close_code.h |
*/ |
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) |
#ifdef _MSC_VER |
#pragma warning(disable: 4103) |
#endif |
#ifdef __BORLANDC__ |
#pragma nopackwarning |
#endif |
#pragma pack(push,4) |
#endif /* Compiler needs structure packing set */ |
/* Set up compiler-specific options for inlining functions */ |
#ifndef SDL_INLINE_OKAY |
#ifdef __GNUC__ |
#define SDL_INLINE_OKAY |
#else |
/* Add any special compiler-specific cases here */ |
#if defined(_MSC_VER) |
#define __inline__ __inline |
#define SDL_INLINE_OKAY |
#else |
#if !defined(__MRC__) && !defined(_SGI_SOURCE) |
#define __inline__ inline |
#define SDL_INLINE_OKAY |
#endif /* Not a funky compiler */ |
#endif /* Visual C++ */ |
#endif /* GNU C */ |
#endif /* SDL_INLINE_OKAY */ |
/* If inlining isn't supported, remove "__inline__", turning static |
inlined functions into static functions (resulting in code bloat |
in all files which include the offending header files) |
*/ |
#ifndef SDL_INLINE_OKAY |
#define __inline__ |
#endif |
/contrib/sdk/sources/SDL-1.2.2/include/begin_code.h.BAK |
---|
0,0 → 1,91 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This file sets things up for C dynamic library function definitions, |
static inlined functions, and structures aligned at 4-byte alignment. |
If you don't like ugly C preprocessor code, don't look at this file. :) |
*/ |
/* This shouldn't be nested -- included it around code only. */ |
#ifdef _begin_code_h |
#error Nested inclusion of begin_code.h |
#endif |
#define _begin_code_h |
/* Some compilers use a special export keyword */ |
#ifndef DECLSPEC |
# ifdef __BEOS__ |
# if defined(__GNUC__) |
# define DECLSPEC __declspec(dllexport) |
# else |
# define DECLSPEC __declspec(export) |
# endif |
# else |
# ifdef WIN32 |
# define DECLSPEC __declspec(dllexport) |
# else |
# define DECLSPEC |
# endif |
# endif |
#endif |
/* Force structure packing at 4 byte alignment. |
This is necessary if the header is included in code which has structure |
packing set to an alternate value, say for loading structures from disk. |
The packing is reset to the previous value in close_code.h |
*/ |
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) |
#ifdef _MSC_VER |
#pragma warning(disable: 4103) |
#endif |
#ifdef __BORLANDC__ |
#pragma nopackwarning |
#endif |
#pragma pack(push,4) |
#endif /* Compiler needs structure packing set */ |
/* Set up compiler-specific options for inlining functions */ |
#ifndef SDL_INLINE_OKAY |
#ifdef __GNUC__ |
#define SDL_INLINE_OKAY |
#else |
/* Add any special compiler-specific cases here */ |
#if defined(_MSC_VER) |
#define __inline__ __inline |
#define SDL_INLINE_OKAY |
#else |
#if !defined(__MRC__) && !defined(_SGI_SOURCE) |
#define __inline__ inline |
#define SDL_INLINE_OKAY |
#endif /* Not a funky compiler */ |
#endif /* Visual C++ */ |
#endif /* GNU C */ |
#endif /* SDL_INLINE_OKAY */ |
/* If inlining isn't supported, remove "__inline__", turning static |
inlined functions into static functions (resulting in code bloat |
in all files which include the offending header files) |
*/ |
#ifndef SDL_INLINE_OKAY |
#define __inline__ |
#endif |
/contrib/sdk/sources/SDL-1.2.2/include/close_code.h |
---|
0,0 → 1,36 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This file reverses the effects of begin_code.h and should be included |
after you finish any function and structure declarations in your headers |
*/ |
#undef _begin_code_h |
/* Reset structure packing at previous byte alignment */ |
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) |
#ifdef __BORLANDC__ |
#pragma nopackwarning |
#endif |
#pragma pack(pop) |
#endif /* Compiler needs structure packing set */ |
/contrib/sdk/sources/SDL-1.2.2/src/Makefile |
---|
0,0 → 1,46 |
OUTFILE = ../lib/libSDL.a |
endian_OBJS = endian/SDL_endian.o |
file_OBJS = file/SDL_rwops.o |
hermes_OBJS = hermes/mmxp2_32.o hermes/mmx_main.o hermes/x86p_16.o \ |
hermes/x86p_32.o hermes/x86_main.o |
thread_OBJS = thread/SDL_syscond.o thread/SDL_sysmutex.o thread/SDL_syssem.o \ |
thread/SDL_systhread.o thread/SDL_thread.o |
timer_OBJS = timer/SDL_timer.o timer/dummy/SDL_systimer.o |
event_OBJS = events/SDL_active.o events/SDL_events.o events/SDL_expose.o \ |
events/SDL_keyboard.o events/SDL_mouse.o events/SDL_quit.o \ |
events/SDL_resize.o |
video_OBJS = video/SDL_blit_0.o video/SDL_blit_1.o video/SDL_blit_A.o \ |
video/SDL_blit.o video/SDL_blit_N.o video/SDL_bmp.o \ |
video/SDL_cursor.o video/SDL_gamma.o video/SDL_pixels.o \ |
video/SDL_RLEaccel.o video/SDL_stretch.o video/SDL_surface.o \ |
video/SDL_video.o video/SDL_yuv.o video/SDL_yuv_mmx.o \ |
video/SDL_yuv_sw.o video/menuetos/SDL_menuetevents.o \ |
video/menuetos/SDL_menuetvideo.o |
audio_OBJS = audio/SDL_kolibri_audio.o \ |
audio/klbr_sdk/src/init.o audio/klbr_sdk/src/setbuf.o \ |
audio/klbr_sdk/src/stopbuf.o audio/klbr_sdk/src/sndgetsize.o |
curr_OBJS = SDL.o SDL_error.o SDL_fatal.o SDL_getenv.o |
OBJS = $(endian_OBJS) $(file_OBJS) $(hermes_OBJS) $(thread_OBJS) \ |
$(timer_OBJS) $(event_OBJS) $(video_OBJS) $(curr_OBJS) $(audio_OBJS) |
CFLAGS = -D_REENTRANT -I../include -I. -DPACKAGE=\"SDL\" -DVERSION=\"1.2.2\" \ |
-fexpensive-optimizations -Wall -DENABLE_AUDIO -UDISABLE_AUDIO -DDISABLE_JOYSTICK \ |
-DDISABLE_CDROM -DDISABLE_THREADS -DENABLE_TIMERS \ |
-DUSE_ASMBLIT -Ihermes -Iaudio -Ivideo -Ievents \ |
-Ijoystick -Icdrom -Ithread -Itimer -Iendian -Ifile -DENABLE_MENUETOS \ |
-DNO_SIGNAL_H -DDISABLE_STDIO -DNEED_SDL_GETENV -DENABLE_FILE -UDISABLE_FILE \ |
-D__MENUETOS__ -DDEBUG_VIDEO -UWIN32 |
include $(MENUETDEV)/makefiles/Makefile_for_lib |
audio/klbr_sdk/src/init.o : audio/klbr_sdk/src/init.asm |
fasm audio/klbr_sdk/src/init.asm audio/klbr_sdk/src/init.o |
audio/klbr_sdk/src/setbuf.o : audio/klbr_sdk/src/setbuf.asm |
fasm audio/klbr_sdk/src/setbuf.asm audio/klbr_sdk/src/setbuf.o |
audio/klbr_sdk/src/stopbuf.o : audio/klbr_sdk/src/stopbuf.asm |
fasm audio/klbr_sdk/src/stopbuf.asm audio/klbr_sdk/src/stopbuf.o |
audio/klbr_sdk/src/sndgetsize.o : audio/klbr_sdk/src/sndgetsize.asm |
fasm audio/klbr_sdk/src/sndgetsize.asm audio/klbr_sdk/src/sndgetsize.o |
/contrib/sdk/sources/SDL-1.2.2/src/SDL.c |
---|
0,0 → 1,232 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL.c,v 1.3 2001/05/23 23:35:09 hercules Exp $"; |
#endif |
/* Initialization code for SDL */ |
#include <stdlib.h> /* For getenv() */ |
#include "SDL.h" |
#include "SDL_endian.h" |
#include "SDL_fatal.h" |
#ifndef DISABLE_VIDEO |
#include "SDL_leaks.h" |
#endif |
/* Initialization/Cleanup routines */ |
#ifndef DISABLE_JOYSTICK |
extern int SDL_JoystickInit(void); |
extern void SDL_JoystickQuit(void); |
#endif |
#ifndef DISABLE_CDROM |
extern int SDL_CDROMInit(void); |
extern void SDL_CDROMQuit(void); |
#endif |
#ifndef DISABLE_TIMERS |
extern void SDL_StartTicks(void); |
extern int SDL_TimerInit(void); |
extern void SDL_TimerQuit(void); |
#endif |
/* The current SDL version */ |
static SDL_version version = |
{ SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL }; |
/* The initialized subsystems */ |
static Uint32 SDL_initialized = 0; |
static Uint32 ticks_started = 0; |
#ifdef CHECK_LEAKS |
int surfaces_allocated = 0; |
#endif |
int SDL_InitSubSystem(Uint32 flags) |
{ |
#ifndef DISABLE_VIDEO |
/* Initialize the video/event subsystem */ |
if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) { |
if ( SDL_VideoInit(getenv("SDL_VIDEODRIVER"), |
(flags&SDL_INIT_EVENTTHREAD)) < 0 ) { |
return(-1); |
} |
SDL_initialized |= SDL_INIT_VIDEO; |
} |
#else |
if ( flags & SDL_INIT_VIDEO ) { |
SDL_SetError("SDL not built with video support"); |
return(-1); |
} |
#endif |
#ifndef DISABLE_AUDIO |
/* Initialize the audio subsystem */ |
if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) { |
if ( SDL_AudioInit(getenv("SDL_AUDIODRIVER")) < 0 ) { |
return(-1); |
} |
SDL_initialized |= SDL_INIT_AUDIO; |
} |
#else |
if ( flags & SDL_INIT_AUDIO ) { |
SDL_SetError("SDL not built with audio support"); |
return(-1); |
} |
#endif |
#ifndef DISABLE_TIMERS |
/* Initialize the timer subsystem */ |
if ( ! ticks_started ) { |
SDL_StartTicks(); |
ticks_started = 1; |
} |
if ( (flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER) ) { |
if ( SDL_TimerInit() < 0 ) { |
return(-1); |
} |
SDL_initialized |= SDL_INIT_TIMER; |
} |
#else |
if ( flags & SDL_INIT_TIMER ) { |
SDL_SetError("SDL not built with timer support"); |
return(-1); |
} |
#endif |
#ifndef DISABLE_JOYSTICK |
/* Initialize the joystick subsystem */ |
if ( (flags & SDL_INIT_JOYSTICK) && |
!(SDL_initialized & SDL_INIT_JOYSTICK) ) { |
if ( SDL_JoystickInit() < 0 ) { |
return(-1); |
} |
SDL_initialized |= SDL_INIT_JOYSTICK; |
} |
#else |
if ( flags & SDL_INIT_JOYSTICK ) { |
SDL_SetError("SDL not built with joystick support"); |
return(-1); |
} |
#endif |
#ifndef DISABLE_CDROM |
/* Initialize the CD-ROM subsystem */ |
if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) { |
if ( SDL_CDROMInit() < 0 ) { |
return(-1); |
} |
SDL_initialized |= SDL_INIT_CDROM; |
} |
#else |
if ( flags & SDL_INIT_CDROM ) { |
SDL_SetError("SDL not built with cdrom support"); |
return(-1); |
} |
#endif |
return(0); |
} |
int SDL_Init(Uint32 flags) |
{ |
/* Clear the error message */ |
SDL_ClearError(); |
/* Initialize the desired subsystems */ |
if ( SDL_InitSubSystem(flags) < 0 ) { |
return(-1); |
} |
/* Everything is initialized */ |
if ( !(flags & SDL_INIT_NOPARACHUTE) ) { |
SDL_InstallParachute(); |
} |
return(0); |
} |
void SDL_QuitSubSystem(Uint32 flags) |
{ |
/* Shut down requested initialized subsystems */ |
#ifndef DISABLE_CDROM |
if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) { |
SDL_CDROMQuit(); |
SDL_initialized &= ~SDL_INIT_CDROM; |
} |
#endif |
#ifndef DISABLE_JOYSTICK |
if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) { |
SDL_JoystickQuit(); |
SDL_initialized &= ~SDL_INIT_JOYSTICK; |
} |
#endif |
#ifndef DISABLE_TIMERS |
if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) { |
SDL_TimerQuit(); |
SDL_initialized &= ~SDL_INIT_TIMER; |
} |
#endif |
#ifndef DISABLE_AUDIO |
if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) { |
SDL_AudioQuit(); |
SDL_initialized &= ~SDL_INIT_AUDIO; |
} |
#endif |
#ifndef DISABLE_VIDEO |
if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) { |
SDL_VideoQuit(); |
SDL_initialized &= ~SDL_INIT_VIDEO; |
} |
#endif |
} |
Uint32 SDL_WasInit(Uint32 flags) |
{ |
if ( ! flags ) { |
flags = SDL_INIT_EVERYTHING; |
} |
return (SDL_initialized&flags); |
} |
void SDL_Quit(void) |
{ |
/* Quit all subsystems */ |
SDL_QuitSubSystem(SDL_INIT_EVERYTHING); |
#ifdef CHECK_LEAKS |
/* Print the number of surfaces not freed */ |
if ( surfaces_allocated != 0 ) { |
SDL_printf("SDL Warning: %d SDL surfaces extant\n", |
surfaces_allocated); |
} |
#endif |
/* Uninstall any parachute signal handlers */ |
SDL_UninstallParachute(); |
} |
/* Return the library version number */ |
const SDL_version * SDL_Linked_Version(void) |
{ |
return(&version); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/SDL_error.c |
---|
0,0 → 1,352 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_error.c,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Simple error handling in SDL */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdarg.h> |
#include <string.h> |
#include "SDL_types.h" |
#include "SDL_getenv.h" |
#include "SDL_error.h" |
#include "SDL_error_c.h" |
#ifndef DISABLE_THREADS |
#include "SDL_thread_c.h" |
#endif |
#ifdef DISABLE_THREADS |
/* The default (non-thread-safe) global error variable */ |
static SDL_error SDL_global_error; |
#define SDL_GetErrBuf() (&SDL_global_error) |
#endif /* DISABLE_THREADS */ |
#ifdef __CYGWIN__ |
#define DISABLE_STDIO |
#endif |
#define SDL_ERRBUFIZE 1024 |
/* Private functions */ |
static int vdprintf_help(unsigned c) |
{ |
int d0; |
if(c=='\n') |
{ |
c='\r'; |
__asm__ __volatile__("int $0x40":"=&a"(d0):"0"(63),"b"(1),"c"(c)); |
c='\n'; |
__asm__ __volatile__("int $0x40":"=&a"(d0):"0"(63),"b"(1),"c"(c)); |
return 0; |
} |
__asm__ __volatile__("int $0x40":"=&a"(d0):"0"(63),"b"(1),"c"(c)); |
return 0 ; |
} |
static void xputs(char * p) |
{ |
for(;*p;p++) vdprintf_help((*p)&0xff); |
} |
static char dbg_buf[1024]; |
void SDL_printf(const char * fmt,...) |
{ |
va_list ap; |
va_start(ap,fmt); |
vsprintf(dbg_buf,fmt,ap); |
va_end(ap); |
xputs(dbg_buf); |
} |
static void SDL_LookupString(const Uint8 *key, Uint16 *buf, int buflen) |
{ |
/* FIXME: Add code to lookup key in language string hash-table */ |
/* Key not found in language string hash-table */ |
while ( *key && (--buflen > 0) ) { |
*buf++ = *key++; |
} |
*buf = 0; /* NULL terminate string */ |
} |
/* Public functions */ |
void SDL_SetError (const char *fmt, ...) |
{ |
va_list ap; |
SDL_error *error; |
/* Copy in the key, mark error as valid */ |
error = SDL_GetErrBuf(); |
error->error = 1; |
strncpy((char *)error->key, fmt, sizeof(error->key)); |
error->key[sizeof(error->key)-1] = '\0'; |
va_start(ap, fmt); |
error->argc = 0; |
while ( *fmt ) { |
if ( *fmt++ == '%' ) { |
switch (*fmt++) { |
case 0: /* Malformed format string.. */ |
--fmt; |
break; |
#if 0 /* What is a character anyway? (UNICODE issues) */ |
case 'c': |
error->args[error->argc++].value_c = |
va_arg(ap, unsigned char); |
break; |
#endif |
case 'd': |
error->args[error->argc++].value_i = |
va_arg(ap, int); |
break; |
case 'f': |
error->args[error->argc++].value_f = |
va_arg(ap, double); |
break; |
case 'p': |
error->args[error->argc++].value_ptr = |
va_arg(ap, void *); |
break; |
case 's': |
{ |
int index = error->argc; |
strncpy((char *)error->args[index].buf, |
va_arg(ap, char *), ERR_MAX_STRLEN); |
error->args[index].buf[ERR_MAX_STRLEN-1] = 0; |
error->argc++; |
} |
break; |
default: |
break; |
} |
if ( error->argc >= ERR_MAX_ARGS ) { |
break; |
} |
} |
} |
va_end(ap); |
SDL_printf("SDL_SetError: %s\n", SDL_GetError()); |
} |
/* Print out an integer value to a UNICODE buffer */ |
static int PrintInt(Uint16 *str, unsigned int maxlen, int value) |
{ |
char tmp[128]; |
int len, i; |
sprintf(tmp, "%d", value); |
len = 0; |
if ( strlen(tmp) < maxlen ) { |
for ( i=0; tmp[i]; ++i ) { |
*str++ = tmp[i]; |
++len; |
} |
} |
return(len); |
} |
/* Print out a double value to a UNICODE buffer */ |
static int PrintDouble(Uint16 *str, unsigned int maxlen, double value) |
{ |
char tmp[128]; |
int len, i; |
sprintf(tmp, "%f", value); |
len = 0; |
if ( strlen(tmp) < maxlen ) { |
for ( i=0; tmp[i]; ++i ) { |
*str++ = tmp[i]; |
++len; |
} |
} |
return(len); |
} |
/* Print out a pointer value to a UNICODE buffer */ |
static int PrintPointer(Uint16 *str, unsigned int maxlen, void *value) |
{ |
char tmp[128]; |
int len, i; |
sprintf(tmp, "%p", value); |
len = 0; |
if ( strlen(tmp) < maxlen ) { |
for ( i=0; tmp[i]; ++i ) { |
*str++ = tmp[i]; |
++len; |
} |
} |
return(len); |
} |
/* This function has a bit more overhead than most error functions |
so that it supports internationalization and thread-safe errors. |
*/ |
Uint16 *SDL_GetErrorMsgUNICODE(Uint16 *errstr, unsigned int maxlen) |
{ |
SDL_error *error; |
/* Clear the error string */ |
*errstr = 0; --maxlen; |
/* Get the thread-safe error, and print it out */ |
error = SDL_GetErrBuf(); |
if ( error->error ) { |
Uint16 translated[ERR_MAX_STRLEN], *fmt, *msg; |
int len; |
int argi; |
/* Print out the UNICODE error message */ |
SDL_LookupString(error->key, translated, sizeof(translated)); |
msg = errstr; |
argi = 0; |
for ( fmt=translated; *fmt && (maxlen > 0); ) { |
if ( *fmt == '%' ) { |
switch (fmt[1]) { |
case 'S': /* Special SKIP operand */ |
argi += (fmt[2] - '0'); |
++fmt; |
break; |
case '%': |
*msg++ = '%'; |
maxlen -= 1; |
break; |
#if 0 /* What is a character anyway? (UNICODE issues) */ |
case 'c': |
*msg++ = (unsigned char) |
error->args[argi++].value_c; |
maxlen -= 1; |
break; |
#endif |
case 'd': |
len = PrintInt(msg, maxlen, |
error->args[argi++].value_i); |
msg += len; |
maxlen -= len; |
break; |
case 'f': |
len = PrintDouble(msg, maxlen, |
error->args[argi++].value_f); |
msg += len; |
maxlen -= len; |
break; |
case 'p': |
len = PrintPointer(msg, maxlen, |
error->args[argi++].value_ptr); |
msg += len; |
maxlen -= len; |
break; |
case 's': /* UNICODE string */ |
{ Uint16 buf[ERR_MAX_STRLEN], *str; |
SDL_LookupString(error->args[argi++].buf, buf, sizeof(buf)); |
str = buf; |
while ( *str && (maxlen > 0) ) { |
*msg++ = *str++; |
maxlen -= 1; |
} |
} |
break; |
} |
fmt += 2; |
} else { |
*msg++ = *fmt++; |
maxlen -= 1; |
} |
} |
*msg = 0; /* NULL terminate the string */ |
} |
return(errstr); |
} |
Uint8 *SDL_GetErrorMsg(Uint8 *errstr, unsigned int maxlen) |
{ |
Uint16 *errstr16; |
unsigned int i; |
/* Allocate the UNICODE buffer */ |
errstr16 = (Uint16 *)malloc(maxlen * (sizeof *errstr16)); |
if ( ! errstr16 ) { |
strncpy((char *)errstr, "Out of memory", maxlen); |
errstr[maxlen-1] = '\0'; |
return(errstr); |
} |
/* Get the error message */ |
SDL_GetErrorMsgUNICODE(errstr16, maxlen); |
/* Convert from UNICODE to Latin1 encoding */ |
for ( i=0; i<maxlen; ++i ) { |
errstr[i] = (Uint8)errstr16[i]; |
} |
/* Free UNICODE buffer (if necessary) */ |
free(errstr16); |
return(errstr); |
} |
/* Available for backwards compatibility */ |
char *SDL_GetError (void) |
{ |
static char errmsg[SDL_ERRBUFIZE]; |
return((char *)SDL_GetErrorMsg((unsigned char *)errmsg, SDL_ERRBUFIZE)); |
} |
void SDL_ClearError(void) |
{ |
SDL_error *error; |
error = SDL_GetErrBuf(); |
error->error = 0; |
} |
/* Very common errors go here */ |
void SDL_Error(SDL_errorcode code) |
{ |
switch (code) { |
case SDL_ENOMEM: |
SDL_SetError("Out of memory"); |
break; |
case SDL_EFREAD: |
SDL_SetError("Error reading from datastream"); |
break; |
case SDL_EFWRITE: |
SDL_SetError("Error writing to datastream"); |
break; |
case SDL_EFSEEK: |
SDL_SetError("Error seeking in datastream"); |
break; |
default: |
SDL_SetError("Unknown SDL error"); |
break; |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/SDL_error_c.h |
---|
0,0 → 1,62 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_error_c.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* This file defines a structure that carries language-independent |
error messages |
*/ |
#ifndef _SDL_error_c_h |
#define _SDL_error_c_h |
#define ERR_MAX_STRLEN 128 |
#define ERR_MAX_ARGS 5 |
typedef struct { |
/* This is a numeric value corresponding to the current error */ |
int error; |
/* This is a key used to index into a language hashtable containing |
internationalized versions of the SDL error messages. If the key |
is not in the hashtable, or no hashtable is available, the key is |
used directly as an error message format string. |
*/ |
unsigned char key[ERR_MAX_STRLEN]; |
/* These are the arguments for the error functions */ |
int argc; |
union { |
void *value_ptr; |
#if 0 /* What is a character anyway? (UNICODE issues) */ |
unsigned char value_c; |
#endif |
int value_i; |
double value_f; |
unsigned char buf[ERR_MAX_STRLEN]; |
} args[ERR_MAX_ARGS]; |
} SDL_error; |
#endif /* _SDL_error_c_h */ |
/contrib/sdk/sources/SDL-1.2.2/src/SDL_fatal.c |
---|
0,0 → 1,46 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <signal.h> |
#include <string.h> |
#include <stdarg.h> |
void SDL_printf_error(const char * fmt,...) |
{ |
int pid; |
va_list args; |
va_start(args,fmt); |
__libclog_vprintf(fmt,args); |
exit(-1); |
} |
void SDL_InstallParachute(void) |
{ |
return; |
} |
void SDL_UninstallParachute(void) |
{ |
return; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/SDL_fatal.h |
---|
0,0 → 1,32 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_fatal.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* General fatal signal handling code for SDL */ |
extern void SDL_InstallParachute(void); |
extern void SDL_UninstallParachute(void); |
/contrib/sdk/sources/SDL-1.2.2/src/SDL_getenv.c |
---|
0,0 → 1,171 |
/* Not all environments have a working getenv()/putenv() */ |
#ifdef TEST_MAIN |
#define NEED_SDL_GETENV |
#endif |
#include "SDL_getenv.h" |
#ifdef NEED_SDL_GETENV |
#include <stdlib.h> |
#include <string.h> |
static char **SDL_env = (char **)0; |
/* Put a variable of the form "name=value" into the environment */ |
int SDL_putenv(const char *variable) |
{ |
const char *name, *value; |
int added; |
int len, i; |
char **new_env; |
char *new_variable; |
/* A little error checking */ |
if ( ! variable ) { |
return(-1); |
} |
name = variable; |
for ( value=variable; *value && (*value != '='); ++value ) { |
/* Keep looking for '=' */ ; |
} |
if ( *value ) { |
++value; |
} else { |
return(-1); |
} |
/* Allocate memory for the variable */ |
new_variable = (char *)malloc(strlen(variable)+1); |
if ( ! new_variable ) { |
return(-1); |
} |
strcpy(new_variable, variable); |
/* Actually put it into the environment */ |
added = 0; |
i = 0; |
if ( SDL_env ) { |
/* Check to see if it's already there... */ |
len = (value - name); |
for ( ; SDL_env[i]; ++i ) { |
if ( strncmp(SDL_env[i], name, len) == 0 ) { |
break; |
} |
} |
/* If we found it, just replace the entry */ |
if ( SDL_env[i] ) { |
free(SDL_env[i]); |
SDL_env[i] = new_variable; |
added = 1; |
} |
} |
/* Didn't find it in the environment, expand and add */ |
if ( ! added ) { |
new_env = realloc(SDL_env, (i+2)*sizeof(char *)); |
if ( new_env ) { |
SDL_env = new_env; |
SDL_env[i++] = new_variable; |
SDL_env[i++] = (char *)0; |
added = 1; |
} else { |
free(new_variable); |
} |
} |
return (added ? 0 : -1); |
} |
/* Retrieve a variable named "name" from the environment */ |
char *SDL_getenv(const char *name) |
{ |
int len, i; |
char *value; |
value = (char *)0; |
if ( SDL_env ) { |
len = strlen(name); |
for ( i=0; SDL_env[i] && !value; ++i ) { |
if ( (strncmp(SDL_env[i], name, len) == 0) && |
(SDL_env[i][len] == '=') ) { |
value = &SDL_env[i][len+1]; |
} |
} |
} |
return value; |
} |
#endif /* NEED_GETENV */ |
#ifdef TEST_MAIN |
#include <stdio.h> |
int main(int argc, char *argv[]) |
{ |
char *value; |
printf("Checking for non-existent variable... "); |
fflush(stdout); |
if ( ! getenv("EXISTS") ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Setting FIRST=VALUE1 in the environment... "); |
fflush(stdout); |
if ( putenv("FIRST=VALUE1") == 0 ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Getting FIRST from the environment... "); |
fflush(stdout); |
value = getenv("FIRST"); |
if ( value && (strcmp(value, "VALUE1") == 0) ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Setting SECOND=VALUE2 in the environment... "); |
fflush(stdout); |
if ( putenv("SECOND=VALUE2") == 0 ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Getting SECOND from the environment... "); |
fflush(stdout); |
value = getenv("SECOND"); |
if ( value && (strcmp(value, "VALUE2") == 0) ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Setting FIRST=NOVALUE in the environment... "); |
fflush(stdout); |
if ( putenv("FIRST=NOVALUE") == 0 ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Getting FIRST from the environment... "); |
fflush(stdout); |
value = getenv("FIRST"); |
if ( value && (strcmp(value, "NOVALUE") == 0) ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
printf("Checking for non-existent variable... "); |
fflush(stdout); |
if ( ! getenv("EXISTS") ) { |
printf("okay\n"); |
} else { |
printf("failed\n"); |
} |
return(0); |
} |
#endif /* TEST_MAIN */ |
/contrib/sdk/sources/SDL-1.2.2/src/Tupfile.lua |
---|
0,0 → 1,32 |
if tup.getconfig("NO_GCC") ~= "" or tup.getconfig("NO_NASM") ~= "" then return end |
tup.include("../../../../../programs/use_gcc.lua") |
tup.include("../../../../../programs/use_menuetlibc.lua") |
tup.include("../../../../../programs/use_sound.lua") |
INCLUDES = INCLUDES .. " -I. -I../include -Ihermes -Iaudio -Ivideo -Ievents -Ijoystick -Icdrom -Ithread -Itimer -Iendian -Ifile" |
CFLAGS = CFLAGS .. ' -D_REENTRANT -DPACKAGE=\"SDL\" -DVERSION=\"1.2.2\"' |
CFLAGS = CFLAGS .. ' -DENABLE_AUDIO -UDISABLE_AUDIO -DDISABLE_JOYSTICK' |
CFLAGS = CFLAGS .. ' -DDISABLE_CDROM -DDISABLE_THREADS -DENABLE_TIMERS' |
CFLAGS = CFLAGS .. ' -DUSE_ASMBLIT -DENABLE_MENUETOS -DNO_SIGNAL_H -DDISABLE_STDIO -DNEED_SDL_GETENV' |
CFLAGS = CFLAGS .. ' -DENABLE_FILE -UDISABLE_FILE -D__MENUETOS__ -DDEBUG_VIDEO -UWIN32' |
FOLDERS = { |
"", |
"audio/", |
"endian/", |
"events/", |
"file/", |
"hermes/", |
"joystick/", |
"thread/", |
"timer/", |
"timer/dummy/", |
"video/", |
"video/menuetos/", |
} |
for i,v in ipairs(FOLDERS) do |
compile_gcc(v .. "*.c", v .. "%B.o") |
tup.append_table(OBJS, |
tup.foreach_rule(v .. "*.asm", "nasm -f coff -o %o %f", v .. "%B.o") |
) |
end |
tup.rule(OBJS, "kos32-ar rcs %o %f", {"../../../lib/libSDL.a", "../../../lib/<libSDL>"}) |
/contrib/sdk/sources/SDL-1.2.2/src/audio/SDL_kolibri_audio.c |
---|
0,0 → 1,297 |
#include "SDL_audio.h" |
#include <menuet/os.h> |
#include <stdlib.h> |
#include <string.h> |
#include <sound.h> |
#include <stdio.h> |
static void GetNotify(__u32* event) |
{ |
__asm__("int $0x40" :: "a"(68),"b"(14),"c"(event)); |
} |
static int CreateThread(void* fn, char* p_stack) |
{ |
int res; |
__asm__("int $0x40" : "=a"(res) : "a"(51),"b"(1),"c"(fn),"d"(p_stack)); |
return res; |
} |
static char pinfo[1024]; |
static int GetProcessInfo(int slot) |
{ |
int res; |
__asm__("int $0x40" : "=a"(res) : "a"(9),"b"(pinfo),"c"(slot)); |
return res; |
} |
static void ActivateWnd(int slot) |
{ |
__asm__("int $0x40" :: "a"(18),"b"(3),"c"(slot)); |
} |
static void Yield(void) |
{ |
__asm__("int $0x40" :: "a"(68),"b"(1)); |
} |
static int bInitialized=0; |
static SNDBUF hBuff=0; |
static char* data=NULL; |
static int audio_tid=0; |
static int main_slot; |
static __u32 main_tid; |
static char audio_thread_stack[40960]; |
static __u32 used_format=0; |
static volatile int mix_size=0; |
static void (*callback)(void* userdata, Uint8* stream, int len); |
static void* userdata; |
int SDL_AudioInit(const char* driver_name) |
{ |
if (bInitialized) |
{ |
SDL_SetError("audio already initialized"); |
return -1; |
} |
int ver; |
if (InitSound(&ver)) |
{ |
SDL_printf("Warning: cannot load drivers, sound output will be disabled\n"); |
return 0; |
} |
bInitialized = 1; |
return 0; |
} |
void SDL_AudioQuit(void) |
{ |
} |
char* SDL_AudioDriverName(char* namebuf, int maxlen) |
{ |
if (!bInitialized) |
return NULL; |
strncpy(namebuf,"KolibriAudio",maxlen); |
return namebuf; |
} |
#define AUDIO_SUSPEND 1 |
#define AUDIO_RESUME 2 |
#define AUDIO_DIE 3 |
static volatile int audio_command=0,audio_response=0,bLocked=0,bInCallback=0; |
static void audio_thread(void) |
{ |
SDL_printf("audio_thread created\n"); |
int bPaused; |
__u32 event[6]; |
// initialize |
if (CreateBuffer(used_format|PCM_RING, 0, &hBuff)) |
{ |
audio_response=1; |
__menuet__sys_exit(); |
} |
GetBufferSize(hBuff, &mix_size); |
SDL_printf("buffer created, size is %d\n",mix_size); |
mix_size >>= 1; |
data = malloc(mix_size); |
audio_response=1; |
if (!data) __menuet__sys_exit(); |
// wait for resume |
while (audio_command!=AUDIO_RESUME) |
Yield(); |
// initialize |
/* bInCallback=1; |
callback(userdata,data,mix_size); |
SetBuffer(hBuff,data,0,mix_size); |
callback(userdata,data,mix_size); |
SetBuffer(hBuff,data,mix_size,mix_size); |
bInCallback=0;*/ |
audio_command=0; |
bPaused=0; |
audio_response=1; |
PlayBuffer(hBuff,0); |
// main loop |
for (;;) |
{ |
if (audio_command==AUDIO_RESUME) |
{ |
PlayBuffer(hBuff,0); |
audio_command = 0; |
bPaused = 0; |
audio_response = 1; |
} |
else if (audio_command==AUDIO_SUSPEND) |
{ |
StopBuffer(hBuff); |
audio_command = 0; |
bPaused = 1; |
audio_response = 1; |
} |
else if (audio_command==AUDIO_DIE) |
{ |
audio_response = 1; |
StopBuffer(hBuff); |
DestroyBuffer(hBuff); |
__menuet__sys_exit(); |
} |
else |
{ |
GetProcessInfo(main_slot); |
if (pinfo[0x32]==9 || *(__u32*)(pinfo+0x1E)!=main_tid) |
{ |
audio_command = AUDIO_DIE; |
continue; |
} |
} |
if (bPaused) |
__menuet__delay100(5); |
else |
{ |
GetNotify(event); |
if (event[0] != 0xFF000001) |
continue; |
while (bLocked) |
Yield(); |
bInCallback=1; |
callback(userdata,data,mix_size); |
bInCallback=0; |
SetBuffer(hBuff,data,event[3],mix_size); |
} |
} |
} |
int SDL_OpenAudio(SDL_AudioSpec* desired, SDL_AudioSpec* obtained) |
{ |
if (!bInitialized) |
{ |
SDL_SetError("Audio device was not initialized"); |
return -1; |
} |
if (!obtained) |
{ |
SDL_SetError("Audio format: software emulation is not supported"); |
return -1; |
} |
if (used_format) |
{ |
SDL_SetError("Audio device was already opened"); |
return -1; |
} |
memcpy(obtained,desired,sizeof(SDL_AudioSpec)); |
switch (desired->freq) |
{ |
#define HANDLE_FREQ(freq,symb) \ |
case freq: \ |
switch (desired->channels) \ |
{ \ |
case 1: \ |
switch (desired->format) \ |
{ \ |
case AUDIO_U8: \ |
case AUDIO_S8: \ |
used_format = PCM_1_8_##symb; \ |
break; \ |
case AUDIO_U16SYS: \ |
case AUDIO_S16SYS: \ |
used_format = PCM_1_16_##symb; \ |
break; \ |
} \ |
break; \ |
case 2: \ |
switch (desired->format) \ |
{ \ |
case AUDIO_U8: \ |
case AUDIO_S8: \ |
used_format = PCM_2_8_##symb; \ |
break; \ |
case AUDIO_U16SYS: \ |
case AUDIO_S16SYS: \ |
used_format = PCM_2_16_##symb; \ |
break; \ |
} \ |
break; \ |
} \ |
break; |
HANDLE_FREQ(48000,48); |
HANDLE_FREQ(44100,44); |
HANDLE_FREQ(32000,32); |
HANDLE_FREQ(24000,24); |
HANDLE_FREQ(22050,22); |
HANDLE_FREQ(16000,16); |
HANDLE_FREQ(12000,12); |
HANDLE_FREQ(11025,11); |
HANDLE_FREQ(8000,8); |
} |
if (!used_format) |
{ |
SDL_SetError("Unknown audio format"); |
return -1; |
} |
callback=desired->callback; |
userdata=desired->userdata; |
GetProcessInfo(-1); |
main_tid = *(__u32*)(pinfo+0x1E); |
for (main_slot=0;;main_slot++) |
{ |
GetProcessInfo(main_slot); |
if (pinfo[0x32]!=9 && *(__u32*)(pinfo+0x1E)==main_tid) |
break; |
} |
audio_tid=CreateThread(audio_thread,audio_thread_stack+40960); |
if (audio_tid<0) |
{ |
SDL_SetError("Cannot create audio thread"); |
return -1; |
} |
ActivateWnd(main_slot); |
while (!audio_response) |
Yield(); |
if (!hBuff) |
{ |
SDL_SetError("Cannot create audio buffer"); |
return -1; |
} |
if (!data) |
{ |
SDL_SetError("Cannot allocate audio buffer"); |
return -1; |
} |
obtained->silence = (desired->format == AUDIO_U8 ? 0x80 : 0); |
obtained->size = mix_size; |
obtained->samples = obtained->size / obtained->channels; |
if (desired->format == AUDIO_U16SYS || desired->format == AUDIO_S16SYS) |
obtained->samples /= 2; |
SDL_printf("obtained size is %d, samples %d\n",obtained->size, |
obtained->samples); |
return 0; |
} |
void SDL_CloseAudio(void) |
{ |
if (!audio_tid) return; |
audio_response = 0; |
audio_command = AUDIO_DIE; |
while (!audio_response) |
Yield(); |
free(data); |
used_format = 0; |
} |
void SDL_PauseAudio(int pause_on) |
{ |
if (!audio_tid) return; |
audio_response = 0; |
audio_command = pause_on?AUDIO_SUSPEND:AUDIO_RESUME; |
while (!audio_response) |
Yield(); |
} |
void SDL_LockAudio(void) |
{ |
if (!audio_tid) return; |
bLocked = 1; |
while (bInCallback) |
Yield(); |
} |
void SDL_UnlockAudio(void) |
{ |
bLocked = 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/endian/SDL_endian.c |
---|
0,0 → 1,105 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Functions for dynamically reading and writing endian-specific values */ |
#include "SDL_endian.h" |
Uint16 SDL_ReadLE16 (SDL_RWops *src) |
{ |
Uint16 value; |
SDL_RWread(src, &value, (sizeof value), 1); |
return(SDL_SwapLE16(value)); |
} |
Uint16 SDL_ReadBE16 (SDL_RWops *src) |
{ |
Uint16 value; |
SDL_RWread(src, &value, (sizeof value), 1); |
return(SDL_SwapBE16(value)); |
} |
Uint32 SDL_ReadLE32 (SDL_RWops *src) |
{ |
Uint32 value; |
SDL_RWread(src, &value, (sizeof value), 1); |
return(SDL_SwapLE32(value)); |
} |
Uint32 SDL_ReadBE32 (SDL_RWops *src) |
{ |
Uint32 value; |
SDL_RWread(src, &value, (sizeof value), 1); |
return(SDL_SwapBE32(value)); |
} |
Uint64 SDL_ReadLE64 (SDL_RWops *src) |
{ |
Uint64 value; |
SDL_RWread(src, &value, (sizeof value), 1); |
return(SDL_SwapLE64(value)); |
} |
Uint64 SDL_ReadBE64 (SDL_RWops *src) |
{ |
Uint64 value; |
SDL_RWread(src, &value, (sizeof value), 1); |
return(SDL_SwapBE64(value)); |
} |
int SDL_WriteLE16 (SDL_RWops *dst, Uint16 value) |
{ |
value = SDL_SwapLE16(value); |
return(SDL_RWwrite(dst, &value, (sizeof value), 1)); |
} |
int SDL_WriteBE16 (SDL_RWops *dst, Uint16 value) |
{ |
value = SDL_SwapBE16(value); |
return(SDL_RWwrite(dst, &value, (sizeof value), 1)); |
} |
int SDL_WriteLE32 (SDL_RWops *dst, Uint32 value) |
{ |
value = SDL_SwapLE32(value); |
return(SDL_RWwrite(dst, &value, (sizeof value), 1)); |
} |
int SDL_WriteBE32 (SDL_RWops *dst, Uint32 value) |
{ |
value = SDL_SwapBE32(value); |
return(SDL_RWwrite(dst, &value, (sizeof value), 1)); |
} |
int SDL_WriteLE64 (SDL_RWops *dst, Uint64 value) |
{ |
value = SDL_SwapLE64(value); |
return(SDL_RWwrite(dst, &value, (sizeof value), 1)); |
} |
int SDL_WriteBE64 (SDL_RWops *dst, Uint64 value) |
{ |
value = SDL_SwapBE64(value); |
return(SDL_RWwrite(dst, &value, (sizeof value), 1)); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_active.c |
---|
0,0 → 1,91 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Application focus/iconification handling code for SDL */ |
#include <stdio.h> |
#include <string.h> |
#include "SDL_events.h" |
#include "SDL_events_c.h" |
/* These are static for our active event handling code */ |
static Uint8 SDL_appstate = 0; |
/* Public functions */ |
int SDL_AppActiveInit(void) |
{ |
/* Start completely active */ |
SDL_appstate = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS); |
/* That's it! */ |
return(0); |
} |
Uint8 SDL_GetAppState(void) |
{ |
return(SDL_appstate); |
} |
/* This is global for SDL_eventloop.c */ |
int SDL_PrivateAppActive(Uint8 gain, Uint8 state) |
{ |
int posted; |
Uint8 new_state; |
/* Modify the current state with the given mask */ |
if ( gain ) { |
new_state = (SDL_appstate | state); |
} else { |
new_state = (SDL_appstate & ~state); |
} |
/* Drop events that don't change state */ |
if ( new_state == SDL_appstate ) { |
return(0); |
} |
/* Update internal active state */ |
SDL_appstate = new_state; |
/* Post the event, if desired */ |
posted = 0; |
if ( SDL_ProcessEvents[SDL_ACTIVEEVENT] == SDL_ENABLE ) { |
SDL_Event event; |
memset(&event, 0, sizeof(event)); |
event.type = SDL_ACTIVEEVENT; |
event.active.gain = gain; |
event.active.state = state; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
/* If we lost keyboard focus, post key-up events */ |
if ( (state & SDL_APPINPUTFOCUS) && !gain ) { |
SDL_ResetKeyboard(); |
} |
return(posted); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_events.c |
---|
0,0 → 1,471 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* General event handling code for SDL */ |
#include <stdio.h> |
#include <string.h> |
#include "SDL.h" |
#include "SDL_thread.h" |
#include "SDL_mutex.h" |
#include "SDL_events.h" |
#include "SDL_events_c.h" |
#include "SDL_timer_c.h" |
#ifndef DISABLE_JOYSTICK |
#include "SDL_joystick_c.h" |
#endif |
#ifndef ENABLE_X11 |
#define DISABLE_X11 |
#endif |
#include "SDL_syswm.h" |
#include "SDL_sysevents.h" |
/* Public data -- the event filter */ |
SDL_EventFilter SDL_EventOK = NULL; |
Uint8 SDL_ProcessEvents[SDL_NUMEVENTS]; |
static Uint32 SDL_eventstate = 0; |
/* Private data -- event queue */ |
#define MAXEVENTS 128 |
static struct { |
SDL_mutex *lock; |
int active; |
int head; |
int tail; |
SDL_Event event[MAXEVENTS]; |
int wmmsg_next; |
struct SDL_SysWMmsg wmmsg[MAXEVENTS]; |
} SDL_EventQ; |
/* Private data -- event locking structure */ |
static struct { |
SDL_mutex *lock; |
int safe; |
} SDL_EventLock; |
/* Thread functions */ |
static SDL_Thread *SDL_EventThread = NULL; /* Thread handle */ |
static Uint32 event_thread; /* The event thread id */ |
void SDL_Lock_EventThread(void) |
{ |
if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) { |
/* Grab lock and spin until we're sure event thread stopped */ |
SDL_mutexP(SDL_EventLock.lock); |
while ( ! SDL_EventLock.safe ) { |
SDL_Delay(1); |
} |
} |
} |
void SDL_Unlock_EventThread(void) |
{ |
if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) { |
SDL_mutexV(SDL_EventLock.lock); |
} |
} |
static int SDL_GobbleEvents(void *unused) |
{ |
SDL_SetTimerThreaded(2); |
event_thread = SDL_ThreadID(); |
while ( SDL_EventQ.active ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* Get events from the video subsystem */ |
if ( video ) { |
video->PumpEvents(this); |
} |
/* Queue pending key-repeat events */ |
SDL_CheckKeyRepeat(); |
#ifndef DISABLE_JOYSTICK |
/* Check for joystick state change */ |
if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) { |
SDL_JoystickUpdate(); |
} |
#endif |
/* Give up the CPU for the rest of our timeslice */ |
SDL_EventLock.safe = 1; |
if( SDL_timer_running ) { |
SDL_ThreadedTimerCheck(); |
} |
SDL_Delay(1); |
/* Check for event locking. |
On the P of the lock mutex, if the lock is held, this thread |
will wait until the lock is released before continuing. The |
safe flag will be set, meaning that the other thread can go |
about it's business. The safe flag is reset before the V, |
so as soon as the mutex is free, other threads can see that |
it's not safe to interfere with the event thread. |
*/ |
SDL_mutexP(SDL_EventLock.lock); |
SDL_EventLock.safe = 0; |
SDL_mutexV(SDL_EventLock.lock); |
} |
SDL_SetTimerThreaded(0); |
event_thread = 0; |
return(0); |
} |
static int SDL_StartEventThread(Uint32 flags) |
{ |
/* Reset everything to zero */ |
SDL_EventThread = NULL; |
memset(&SDL_EventLock, 0, sizeof(SDL_EventLock)); |
/* Create the lock and set ourselves active */ |
#ifndef DISABLE_THREADS |
SDL_EventQ.lock = SDL_CreateMutex(); |
if ( SDL_EventQ.lock == NULL ) { |
#ifdef macintosh /* On MacOS 7/8, you can't multithread, so no lock needed */ |
; |
#else |
return(-1); |
#endif |
} |
#endif /* !DISABLE_THREADS */ |
SDL_EventQ.active = 1; |
if ( (flags&SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) { |
SDL_EventLock.lock = SDL_CreateMutex(); |
if ( SDL_EventLock.lock == NULL ) { |
return(-1); |
} |
SDL_EventLock.safe = 0; |
SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL); |
if ( SDL_EventThread == NULL ) { |
return(-1); |
} |
} else { |
event_thread = 0; |
} |
return(0); |
} |
static void SDL_StopEventThread(void) |
{ |
SDL_EventQ.active = 0; |
if ( SDL_EventThread ) { |
SDL_WaitThread(SDL_EventThread, NULL); |
SDL_EventThread = NULL; |
SDL_DestroyMutex(SDL_EventLock.lock); |
} |
SDL_DestroyMutex(SDL_EventQ.lock); |
} |
Uint32 SDL_EventThreadID(void) |
{ |
return(event_thread); |
} |
/* Public functions */ |
void SDL_StopEventLoop(void) |
{ |
/* Halt the event thread, if running */ |
SDL_StopEventThread(); |
/* Clean out EventQ */ |
SDL_EventQ.head = 0; |
SDL_EventQ.tail = 0; |
SDL_EventQ.wmmsg_next = 0; |
} |
/* This function (and associated calls) may be called more than once */ |
int SDL_StartEventLoop(Uint32 flags) |
{ |
int retcode; |
/* Clean out the event queue */ |
SDL_EventThread = NULL; |
SDL_EventQ.lock = NULL; |
SDL_StopEventLoop(); |
/* No filter to start with, process most event types */ |
SDL_EventOK = NULL; |
memset(SDL_ProcessEvents,SDL_ENABLE,sizeof(SDL_ProcessEvents)); |
SDL_eventstate = ~0; |
/* It's not save to call SDL_EventState() yet */ |
SDL_eventstate &= ~(0x00000001 << SDL_SYSWMEVENT); |
SDL_ProcessEvents[SDL_SYSWMEVENT] = SDL_IGNORE; |
/* Initialize event handlers */ |
retcode = 0; |
retcode += SDL_AppActiveInit(); |
retcode += SDL_KeyboardInit(); |
retcode += SDL_MouseInit(); |
retcode += SDL_QuitInit(); |
if ( retcode < 0 ) { |
/* We don't expect them to fail, but... */ |
return(-1); |
} |
/* Create the lock and event thread */ |
if ( SDL_StartEventThread(flags) < 0 ) { |
SDL_StopEventLoop(); |
return(-1); |
} |
return(0); |
} |
/* Add an event to the event queue -- called with the queue locked */ |
static int SDL_AddEvent(SDL_Event *event) |
{ |
int tail, added; |
tail = (SDL_EventQ.tail+1)%MAXEVENTS; |
if ( tail == SDL_EventQ.head ) { |
/* Overflow, drop event */ |
added = 0; |
} else { |
SDL_EventQ.event[SDL_EventQ.tail] = *event; |
if (event->type == SDL_SYSWMEVENT) { |
/* Note that it's possible to lose an event */ |
int next = SDL_EventQ.wmmsg_next; |
SDL_EventQ.wmmsg[next] = *event->syswm.msg; |
SDL_EventQ.event[SDL_EventQ.tail].syswm.msg = |
&SDL_EventQ.wmmsg[next]; |
SDL_EventQ.wmmsg_next = (next+1)%MAXEVENTS; |
} |
SDL_EventQ.tail = tail; |
added = 1; |
} |
return(added); |
} |
/* Cut an event, and return the next valid spot, or the tail */ |
/* -- called with the queue locked */ |
static int SDL_CutEvent(int spot) |
{ |
if ( spot == SDL_EventQ.head ) { |
SDL_EventQ.head = (SDL_EventQ.head+1)%MAXEVENTS; |
return(SDL_EventQ.head); |
} else |
if ( (spot+1)%MAXEVENTS == SDL_EventQ.tail ) { |
SDL_EventQ.tail = spot; |
return(SDL_EventQ.tail); |
} else |
/* We cut the middle -- shift everything over */ |
{ |
int here, next; |
/* This can probably be optimized with memcpy() -- careful! */ |
if ( --SDL_EventQ.tail < 0 ) { |
SDL_EventQ.tail = MAXEVENTS-1; |
} |
for ( here=spot; here != SDL_EventQ.tail; here = next ) { |
next = (here+1)%MAXEVENTS; |
SDL_EventQ.event[here] = SDL_EventQ.event[next]; |
} |
return(spot); |
} |
/* NOTREACHED */ |
} |
/* Lock the event queue, take a peep at it, and unlock it */ |
int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, |
Uint32 mask) |
{ |
int i, used; |
/* Don't look after we've quit */ |
if ( ! SDL_EventQ.active ) { |
return(0); |
} |
/* Lock the event queue */ |
used = 0; |
if ( SDL_mutexP(SDL_EventQ.lock) == 0 ) { |
if ( action == SDL_ADDEVENT ) { |
for ( i=0; i<numevents; ++i ) { |
used += SDL_AddEvent(&events[i]); |
} |
} else { |
SDL_Event tmpevent; |
int spot; |
/* If 'events' is NULL, just see if they exist */ |
if ( events == NULL ) { |
action = SDL_PEEKEVENT; |
numevents = 1; |
events = &tmpevent; |
} |
spot = SDL_EventQ.head; |
while ((used < numevents)&&(spot != SDL_EventQ.tail)) { |
if ( mask & SDL_EVENTMASK(SDL_EventQ.event[spot].type) ) { |
events[used++] = SDL_EventQ.event[spot]; |
if ( action == SDL_GETEVENT ) { |
spot = SDL_CutEvent(spot); |
} else { |
spot = (spot+1)%MAXEVENTS; |
} |
} else { |
spot = (spot+1)%MAXEVENTS; |
} |
} |
} |
SDL_mutexV(SDL_EventQ.lock); |
} else { |
SDL_SetError("Couldn't lock event queue"); |
used = -1; |
} |
return(used); |
} |
/* Run the system dependent event loops */ |
void SDL_PumpEvents(void) |
{ |
if ( !SDL_EventThread ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* Get events from the video subsystem */ |
if ( video ) { |
video->PumpEvents(this); |
} |
/* Queue pending key-repeat events */ |
SDL_CheckKeyRepeat(); |
#ifndef DISABLE_JOYSTICK |
/* Check for joystick state change */ |
if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) { |
SDL_JoystickUpdate(); |
} |
#endif |
} |
} |
/* Public functions */ |
int SDL_PollEvent (SDL_Event *event) |
{ |
SDL_PumpEvents(); |
return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)); |
} |
int SDL_WaitEvent (SDL_Event *event) |
{ |
while ( 1 ) { |
SDL_PumpEvents(); |
switch(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) { |
case -1: return -1; |
case 1: return 1; |
case 0: SDL_Delay(10); |
} |
} |
} |
int SDL_PushEvent(SDL_Event *event) |
{ |
return(SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0)); |
} |
void SDL_SetEventFilter (SDL_EventFilter filter) |
{ |
SDL_Event bitbucket; |
/* Set filter and discard pending events */ |
SDL_EventOK = filter; |
while ( SDL_PollEvent(&bitbucket) > 0 ) |
; |
} |
SDL_EventFilter SDL_GetEventFilter(void) |
{ |
return(SDL_EventOK); |
} |
Uint8 SDL_EventState (Uint8 type, int state) |
{ |
SDL_Event bitbucket; |
Uint8 current_state; |
/* If SDL_ALLEVENTS was specified... */ |
if ( type == 0xFF ) { |
current_state = SDL_IGNORE; |
for ( type=0; type<SDL_NUMEVENTS; ++type ) { |
if ( SDL_ProcessEvents[type] != SDL_IGNORE ) { |
current_state = SDL_ENABLE; |
} |
SDL_ProcessEvents[type] = state; |
if ( state == SDL_ENABLE ) { |
SDL_eventstate |= (0x00000001 << (type)); |
} else { |
SDL_eventstate &= ~(0x00000001 << (type)); |
} |
} |
while ( SDL_PollEvent(&bitbucket) > 0 ) |
; |
return(current_state); |
} |
/* Just set the state for one event type */ |
current_state = SDL_ProcessEvents[type]; |
switch (state) { |
case SDL_IGNORE: |
case SDL_ENABLE: |
/* Set state and discard pending events */ |
SDL_ProcessEvents[type] = state; |
if ( state == SDL_ENABLE ) { |
SDL_eventstate |= (0x00000001 << (type)); |
} else { |
SDL_eventstate &= ~(0x00000001 << (type)); |
} |
while ( SDL_PollEvent(&bitbucket) > 0 ) |
; |
break; |
default: |
/* Querying state? */ |
break; |
} |
return(current_state); |
} |
/* This is a generic event handler. |
*/ |
int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message) |
{ |
int posted; |
posted = 0; |
if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) { |
SDL_Event event; |
memset(&event, 0, sizeof(event)); |
event.type = SDL_SYSWMEVENT; |
event.syswm.msg = message; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
/* Update internal event state */ |
return(posted); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_events_c.h |
---|
0,0 → 1,78 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_events_c.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Useful functions and variables from SDL_events.c */ |
#include "SDL_events.h" |
/* Start and stop the event processing loop */ |
extern int SDL_StartEventLoop(Uint32 flags); |
extern void SDL_StopEventLoop(void); |
extern void SDL_QuitInterrupt(void); |
extern void SDL_Lock_EventThread(); |
extern void SDL_Unlock_EventThread(); |
extern Uint32 SDL_EventThreadID(void); |
/* Event handler init routines */ |
extern int SDL_AppActiveInit(void); |
extern int SDL_KeyboardInit(void); |
extern int SDL_MouseInit(void); |
extern int SDL_QuitInit(void); |
/* The event filter function */ |
extern SDL_EventFilter SDL_EventOK; |
/* The array of event processing states */ |
extern Uint8 SDL_ProcessEvents[SDL_NUMEVENTS]; |
/* Internal event queueing functions |
(from SDL_active.c, SDL_mouse.c, SDL_keyboard.c, SDL_quit.c, SDL_events.c) |
*/ |
extern int SDL_PrivateAppActive(Uint8 gain, Uint8 state); |
extern int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, |
Sint16 x, Sint16 y); |
extern int SDL_PrivateMouseButton(Uint8 state, Uint8 button,Sint16 x,Sint16 y); |
extern int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *key); |
extern int SDL_PrivateResize(int w, int h); |
extern int SDL_PrivateExpose(void); |
extern int SDL_PrivateQuit(void); |
extern int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message); |
/* Used by the activity event handler to remove mouse focus */ |
extern void SDL_MouseFocus(int focus); |
/* Used by the activity event handler to remove keyboard focus */ |
extern void SDL_ResetKeyboard(void); |
/* Used by the event loop to queue pending keyboard repeat events */ |
extern void SDL_CheckKeyRepeat(void); |
/* Used by the OS keyboard code to detect whether or not to do UNICODE */ |
#ifndef DEFAULT_UNICODE_TRANSLATION |
#define DEFAULT_UNICODE_TRANSLATION 0 /* Default off because of overhead */ |
#endif |
extern int SDL_TranslateUNICODE; |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_expose.c |
---|
0,0 → 1,51 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Refresh event handling code for SDL */ |
#include "SDL_events.h" |
#include "SDL_events_c.h" |
/* This is global for SDL_eventloop.c */ |
int SDL_PrivateExpose(void) |
{ |
int posted; |
SDL_Event events[32]; |
/* Pull out all old refresh events */ |
SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]), |
SDL_GETEVENT, SDL_VIDEOEXPOSEMASK); |
/* Post the event, if desired */ |
posted = 0; |
if ( SDL_ProcessEvents[SDL_VIDEOEXPOSE] == SDL_ENABLE ) { |
SDL_Event event; |
event.type = SDL_VIDEOEXPOSE; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
return(posted); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_keyboard.c |
---|
0,0 → 1,560 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* General keyboard handling code for SDL */ |
#include <stdio.h> |
#include <ctype.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_events.h" |
#include "SDL_timer.h" |
#include "SDL_events_c.h" |
#include "SDL_sysevents.h" |
/* Global keystate information */ |
static Uint8 SDL_KeyState[SDLK_LAST]; |
static SDLMod SDL_ModState; |
int SDL_TranslateUNICODE = 0; |
static char *keynames[SDLK_LAST]; /* Array of keycode names */ |
/* |
* jk 991215 - added |
*/ |
struct { |
int firsttime; /* if we check against the delay or repeat value */ |
int delay; /* the delay before we start repeating */ |
int interval; /* the delay between key repeat events */ |
Uint32 timestamp; /* the time the first keydown event occurred */ |
SDL_Event evt; /* the event we are supposed to repeat */ |
} SDL_KeyRepeat; |
/* Public functions */ |
int SDL_KeyboardInit(void) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
Uint16 i; |
/* Set default mode of UNICODE translation */ |
SDL_EnableUNICODE(DEFAULT_UNICODE_TRANSLATION); |
/* Initialize the tables */ |
SDL_ModState = KMOD_NONE; |
for ( i=0; i<SDL_TABLESIZE(keynames); ++i ) |
keynames[i] = NULL; |
for ( i=0; i<SDL_TABLESIZE(SDL_KeyState); ++i ) |
SDL_KeyState[i] = SDL_RELEASED; |
video->InitOSKeymap(this); |
SDL_EnableKeyRepeat(0, 0); |
/* Fill in the blanks in keynames */ |
keynames[SDLK_BACKSPACE] = "backspace"; |
keynames[SDLK_TAB] = "tab"; |
keynames[SDLK_CLEAR] = "clear"; |
keynames[SDLK_RETURN] = "return"; |
keynames[SDLK_PAUSE] = "pause"; |
keynames[SDLK_ESCAPE] = "escape"; |
keynames[SDLK_SPACE] = "space"; |
keynames[SDLK_EXCLAIM] = "!"; |
keynames[SDLK_QUOTEDBL] = "\""; |
keynames[SDLK_HASH] = "#"; |
keynames[SDLK_DOLLAR] = "$"; |
keynames[SDLK_AMPERSAND] = "&"; |
keynames[SDLK_QUOTE] = "'"; |
keynames[SDLK_LEFTPAREN] = "("; |
keynames[SDLK_RIGHTPAREN] = ")"; |
keynames[SDLK_ASTERISK] = "*"; |
keynames[SDLK_PLUS] = "+"; |
keynames[SDLK_COMMA] = ","; |
keynames[SDLK_MINUS] = "-"; |
keynames[SDLK_PERIOD] = "."; |
keynames[SDLK_SLASH] = "/"; |
keynames[SDLK_0] = "0"; |
keynames[SDLK_1] = "1"; |
keynames[SDLK_2] = "2"; |
keynames[SDLK_3] = "3"; |
keynames[SDLK_4] = "4"; |
keynames[SDLK_5] = "5"; |
keynames[SDLK_6] = "6"; |
keynames[SDLK_7] = "7"; |
keynames[SDLK_8] = "8"; |
keynames[SDLK_9] = "9"; |
keynames[SDLK_COLON] = ":"; |
keynames[SDLK_SEMICOLON] = ";"; |
keynames[SDLK_LESS] = "<"; |
keynames[SDLK_EQUALS] = "="; |
keynames[SDLK_GREATER] = ">"; |
keynames[SDLK_QUESTION] = "?"; |
keynames[SDLK_AT] = "@"; |
keynames[SDLK_LEFTBRACKET] = "["; |
keynames[SDLK_BACKSLASH] = "\\"; |
keynames[SDLK_RIGHTBRACKET] = "]"; |
keynames[SDLK_CARET] = "^"; |
keynames[SDLK_UNDERSCORE] = "_"; |
keynames[SDLK_BACKQUOTE] = "`"; |
keynames[SDLK_a] = "a"; |
keynames[SDLK_b] = "b"; |
keynames[SDLK_c] = "c"; |
keynames[SDLK_d] = "d"; |
keynames[SDLK_e] = "e"; |
keynames[SDLK_f] = "f"; |
keynames[SDLK_g] = "g"; |
keynames[SDLK_h] = "h"; |
keynames[SDLK_i] = "i"; |
keynames[SDLK_j] = "j"; |
keynames[SDLK_k] = "k"; |
keynames[SDLK_l] = "l"; |
keynames[SDLK_m] = "m"; |
keynames[SDLK_n] = "n"; |
keynames[SDLK_o] = "o"; |
keynames[SDLK_p] = "p"; |
keynames[SDLK_q] = "q"; |
keynames[SDLK_r] = "r"; |
keynames[SDLK_s] = "s"; |
keynames[SDLK_t] = "t"; |
keynames[SDLK_u] = "u"; |
keynames[SDLK_v] = "v"; |
keynames[SDLK_w] = "w"; |
keynames[SDLK_x] = "x"; |
keynames[SDLK_y] = "y"; |
keynames[SDLK_z] = "z"; |
keynames[SDLK_DELETE] = "delete"; |
keynames[SDLK_WORLD_0] = "world 0"; |
keynames[SDLK_WORLD_1] = "world 1"; |
keynames[SDLK_WORLD_2] = "world 2"; |
keynames[SDLK_WORLD_3] = "world 3"; |
keynames[SDLK_WORLD_4] = "world 4"; |
keynames[SDLK_WORLD_5] = "world 5"; |
keynames[SDLK_WORLD_6] = "world 6"; |
keynames[SDLK_WORLD_7] = "world 7"; |
keynames[SDLK_WORLD_8] = "world 8"; |
keynames[SDLK_WORLD_9] = "world 9"; |
keynames[SDLK_WORLD_10] = "world 10"; |
keynames[SDLK_WORLD_11] = "world 11"; |
keynames[SDLK_WORLD_12] = "world 12"; |
keynames[SDLK_WORLD_13] = "world 13"; |
keynames[SDLK_WORLD_14] = "world 14"; |
keynames[SDLK_WORLD_15] = "world 15"; |
keynames[SDLK_WORLD_16] = "world 16"; |
keynames[SDLK_WORLD_17] = "world 17"; |
keynames[SDLK_WORLD_18] = "world 18"; |
keynames[SDLK_WORLD_19] = "world 19"; |
keynames[SDLK_WORLD_20] = "world 20"; |
keynames[SDLK_WORLD_21] = "world 21"; |
keynames[SDLK_WORLD_22] = "world 22"; |
keynames[SDLK_WORLD_23] = "world 23"; |
keynames[SDLK_WORLD_24] = "world 24"; |
keynames[SDLK_WORLD_25] = "world 25"; |
keynames[SDLK_WORLD_26] = "world 26"; |
keynames[SDLK_WORLD_27] = "world 27"; |
keynames[SDLK_WORLD_28] = "world 28"; |
keynames[SDLK_WORLD_29] = "world 29"; |
keynames[SDLK_WORLD_30] = "world 30"; |
keynames[SDLK_WORLD_31] = "world 31"; |
keynames[SDLK_WORLD_32] = "world 32"; |
keynames[SDLK_WORLD_33] = "world 33"; |
keynames[SDLK_WORLD_34] = "world 34"; |
keynames[SDLK_WORLD_35] = "world 35"; |
keynames[SDLK_WORLD_36] = "world 36"; |
keynames[SDLK_WORLD_37] = "world 37"; |
keynames[SDLK_WORLD_38] = "world 38"; |
keynames[SDLK_WORLD_39] = "world 39"; |
keynames[SDLK_WORLD_40] = "world 40"; |
keynames[SDLK_WORLD_41] = "world 41"; |
keynames[SDLK_WORLD_42] = "world 42"; |
keynames[SDLK_WORLD_43] = "world 43"; |
keynames[SDLK_WORLD_44] = "world 44"; |
keynames[SDLK_WORLD_45] = "world 45"; |
keynames[SDLK_WORLD_46] = "world 46"; |
keynames[SDLK_WORLD_47] = "world 47"; |
keynames[SDLK_WORLD_48] = "world 48"; |
keynames[SDLK_WORLD_49] = "world 49"; |
keynames[SDLK_WORLD_50] = "world 50"; |
keynames[SDLK_WORLD_51] = "world 51"; |
keynames[SDLK_WORLD_52] = "world 52"; |
keynames[SDLK_WORLD_53] = "world 53"; |
keynames[SDLK_WORLD_54] = "world 54"; |
keynames[SDLK_WORLD_55] = "world 55"; |
keynames[SDLK_WORLD_56] = "world 56"; |
keynames[SDLK_WORLD_57] = "world 57"; |
keynames[SDLK_WORLD_58] = "world 58"; |
keynames[SDLK_WORLD_59] = "world 59"; |
keynames[SDLK_WORLD_60] = "world 60"; |
keynames[SDLK_WORLD_61] = "world 61"; |
keynames[SDLK_WORLD_62] = "world 62"; |
keynames[SDLK_WORLD_63] = "world 63"; |
keynames[SDLK_WORLD_64] = "world 64"; |
keynames[SDLK_WORLD_65] = "world 65"; |
keynames[SDLK_WORLD_66] = "world 66"; |
keynames[SDLK_WORLD_67] = "world 67"; |
keynames[SDLK_WORLD_68] = "world 68"; |
keynames[SDLK_WORLD_69] = "world 69"; |
keynames[SDLK_WORLD_70] = "world 70"; |
keynames[SDLK_WORLD_71] = "world 71"; |
keynames[SDLK_WORLD_72] = "world 72"; |
keynames[SDLK_WORLD_73] = "world 73"; |
keynames[SDLK_WORLD_74] = "world 74"; |
keynames[SDLK_WORLD_75] = "world 75"; |
keynames[SDLK_WORLD_76] = "world 76"; |
keynames[SDLK_WORLD_77] = "world 77"; |
keynames[SDLK_WORLD_78] = "world 78"; |
keynames[SDLK_WORLD_79] = "world 79"; |
keynames[SDLK_WORLD_80] = "world 80"; |
keynames[SDLK_WORLD_81] = "world 81"; |
keynames[SDLK_WORLD_82] = "world 82"; |
keynames[SDLK_WORLD_83] = "world 83"; |
keynames[SDLK_WORLD_84] = "world 84"; |
keynames[SDLK_WORLD_85] = "world 85"; |
keynames[SDLK_WORLD_86] = "world 86"; |
keynames[SDLK_WORLD_87] = "world 87"; |
keynames[SDLK_WORLD_88] = "world 88"; |
keynames[SDLK_WORLD_89] = "world 89"; |
keynames[SDLK_WORLD_90] = "world 90"; |
keynames[SDLK_WORLD_91] = "world 91"; |
keynames[SDLK_WORLD_92] = "world 92"; |
keynames[SDLK_WORLD_93] = "world 93"; |
keynames[SDLK_WORLD_94] = "world 94"; |
keynames[SDLK_WORLD_95] = "world 95"; |
keynames[SDLK_KP0] = "[0]"; |
keynames[SDLK_KP1] = "[1]"; |
keynames[SDLK_KP2] = "[2]"; |
keynames[SDLK_KP3] = "[3]"; |
keynames[SDLK_KP4] = "[4]"; |
keynames[SDLK_KP5] = "[5]"; |
keynames[SDLK_KP6] = "[6]"; |
keynames[SDLK_KP7] = "[7]"; |
keynames[SDLK_KP8] = "[8]"; |
keynames[SDLK_KP9] = "[9]"; |
keynames[SDLK_KP_PERIOD] = "[.]"; |
keynames[SDLK_KP_DIVIDE] = "[/]"; |
keynames[SDLK_KP_MULTIPLY] = "[*]"; |
keynames[SDLK_KP_MINUS] = "[-]"; |
keynames[SDLK_KP_PLUS] = "[+]"; |
keynames[SDLK_KP_ENTER] = "enter"; |
keynames[SDLK_KP_EQUALS] = "equals"; |
keynames[SDLK_UP] = "up"; |
keynames[SDLK_DOWN] = "down"; |
keynames[SDLK_RIGHT] = "right"; |
keynames[SDLK_LEFT] = "left"; |
keynames[SDLK_DOWN] = "down"; |
keynames[SDLK_INSERT] = "insert"; |
keynames[SDLK_HOME] = "home"; |
keynames[SDLK_END] = "end"; |
keynames[SDLK_PAGEUP] = "page up"; |
keynames[SDLK_PAGEDOWN] = "page down"; |
keynames[SDLK_F1] = "f1"; |
keynames[SDLK_F2] = "f2"; |
keynames[SDLK_F3] = "f3"; |
keynames[SDLK_F4] = "f4"; |
keynames[SDLK_F5] = "f5"; |
keynames[SDLK_F6] = "f6"; |
keynames[SDLK_F7] = "f7"; |
keynames[SDLK_F8] = "f8"; |
keynames[SDLK_F9] = "f9"; |
keynames[SDLK_F10] = "f10"; |
keynames[SDLK_F11] = "f11"; |
keynames[SDLK_F12] = "f12"; |
keynames[SDLK_F13] = "f13"; |
keynames[SDLK_F14] = "f14"; |
keynames[SDLK_F15] = "f15"; |
keynames[SDLK_NUMLOCK] = "numlock"; |
keynames[SDLK_CAPSLOCK] = "caps lock"; |
keynames[SDLK_SCROLLOCK] = "scroll lock"; |
keynames[SDLK_RSHIFT] = "right shift"; |
keynames[SDLK_LSHIFT] = "left shift"; |
keynames[SDLK_RCTRL] = "right ctrl"; |
keynames[SDLK_LCTRL] = "left ctrl"; |
keynames[SDLK_RALT] = "right alt"; |
keynames[SDLK_LALT] = "left alt"; |
keynames[SDLK_RMETA] = "right meta"; |
keynames[SDLK_LMETA] = "left meta"; |
keynames[SDLK_LSUPER] = "left super"; /* "Windows" keys */ |
keynames[SDLK_RSUPER] = "right super"; |
keynames[SDLK_MODE] = "alt gr"; |
keynames[SDLK_COMPOSE] = "compose"; |
keynames[SDLK_HELP] = "help"; |
keynames[SDLK_PRINT] = "print screen"; |
keynames[SDLK_SYSREQ] = "sys req"; |
keynames[SDLK_BREAK] = "break"; |
keynames[SDLK_MENU] = "menu"; |
keynames[SDLK_POWER] = "power"; |
keynames[SDLK_EURO] = "euro"; |
/* Done. Whew. */ |
return(0); |
} |
/* We lost the keyboard, so post key up messages for all pressed keys */ |
void SDL_ResetKeyboard(void) |
{ |
SDL_keysym keysym; |
SDLKey key; |
memset(&keysym, 0, (sizeof keysym)); |
for ( key=SDLK_FIRST; key<SDLK_LAST; ++key ) { |
if ( SDL_KeyState[key] == SDL_PRESSED ) { |
keysym.sym = key; |
SDL_PrivateKeyboard(SDL_RELEASED, &keysym); |
} |
} |
SDL_KeyRepeat.timestamp = 0; |
} |
int SDL_EnableUNICODE(int enable) |
{ |
int old_mode; |
old_mode = SDL_TranslateUNICODE; |
if ( enable >= 0 ) { |
SDL_TranslateUNICODE = enable; |
} |
return(old_mode); |
} |
Uint8 * SDL_GetKeyState (int *numkeys) |
{ |
if ( numkeys != (int *)0 ) |
*numkeys = SDLK_LAST; |
return(SDL_KeyState); |
} |
SDLMod SDL_GetModState (void) |
{ |
return(SDL_ModState); |
} |
void SDL_SetModState (SDLMod modstate) |
{ |
SDL_ModState = modstate; |
} |
char *SDL_GetKeyName(SDLKey key) |
{ |
char *keyname; |
keyname = NULL; |
if ( key < SDLK_LAST ) { |
keyname = keynames[key]; |
} |
if ( keyname == NULL ) { |
keyname = "unknown key"; |
} |
return(keyname); |
} |
/* These are global for SDL_eventloop.c */ |
int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *keysym) |
{ |
SDL_Event event; |
int posted, repeatable; |
Uint16 modstate; |
memset(&event, 0, sizeof(event)); |
/* Set up the keysym */ |
modstate = (Uint16)SDL_ModState; |
repeatable = 0; |
if ( state == SDL_PRESSED ) { |
keysym->mod = (SDLMod)modstate; |
switch (keysym->sym) { |
case SDLK_NUMLOCK: |
modstate ^= KMOD_NUM; |
if ( ! (modstate&KMOD_NUM) ) |
state = SDL_RELEASED; |
keysym->mod = (SDLMod)modstate; |
break; |
case SDLK_CAPSLOCK: |
modstate ^= KMOD_CAPS; |
if ( ! (modstate&KMOD_CAPS) ) |
state = SDL_RELEASED; |
keysym->mod = (SDLMod)modstate; |
break; |
case SDLK_LCTRL: |
modstate |= KMOD_LCTRL; |
break; |
case SDLK_RCTRL: |
modstate |= KMOD_RCTRL; |
break; |
case SDLK_LSHIFT: |
modstate |= KMOD_LSHIFT; |
break; |
case SDLK_RSHIFT: |
modstate |= KMOD_RSHIFT; |
break; |
case SDLK_LALT: |
modstate |= KMOD_LALT; |
break; |
case SDLK_RALT: |
modstate |= KMOD_RALT; |
break; |
case SDLK_LMETA: |
modstate |= KMOD_LMETA; |
break; |
case SDLK_RMETA: |
modstate |= KMOD_RMETA; |
break; |
case SDLK_MODE: |
modstate |= KMOD_MODE; |
break; |
default: |
repeatable = 1; |
break; |
} |
} else { |
switch (keysym->sym) { |
case SDLK_NUMLOCK: |
case SDLK_CAPSLOCK: |
/* Only send keydown events */ |
return(0); |
case SDLK_LCTRL: |
modstate &= ~KMOD_LCTRL; |
break; |
case SDLK_RCTRL: |
modstate &= ~KMOD_RCTRL; |
break; |
case SDLK_LSHIFT: |
modstate &= ~KMOD_LSHIFT; |
break; |
case SDLK_RSHIFT: |
modstate &= ~KMOD_RSHIFT; |
break; |
case SDLK_LALT: |
modstate &= ~KMOD_LALT; |
break; |
case SDLK_RALT: |
modstate &= ~KMOD_RALT; |
break; |
case SDLK_LMETA: |
modstate &= ~KMOD_LMETA; |
break; |
case SDLK_RMETA: |
modstate &= ~KMOD_RMETA; |
break; |
case SDLK_MODE: |
modstate &= ~KMOD_MODE; |
break; |
default: |
break; |
} |
keysym->mod = (SDLMod)modstate; |
} |
/* Figure out what type of event this is */ |
switch (state) { |
case SDL_PRESSED: |
event.type = SDL_KEYDOWN; |
break; |
case SDL_RELEASED: |
event.type = SDL_KEYUP; |
/* |
* jk 991215 - Added |
*/ |
if ( SDL_KeyRepeat.timestamp ) { |
SDL_KeyRepeat.timestamp = 0; |
} |
break; |
default: |
/* Invalid state -- bail */ |
return(0); |
} |
// /* Drop events that don't change state */ |
// if ( SDL_KeyState[keysym->sym] == state ) { |
// return(0); |
// } |
/* Update internal keyboard state */ |
SDL_ModState = (SDLMod)modstate; |
SDL_KeyState[keysym->sym] = state; |
/* Post the event, if desired */ |
posted = 0; |
if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { |
event.key.state = state; |
event.key.keysym = *keysym; |
if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) { |
posted = 1; |
/* |
* jk 991215 - Added |
*/ |
if (repeatable && (SDL_KeyRepeat.delay != 0)) { |
SDL_KeyRepeat.evt = event; |
SDL_KeyRepeat.firsttime = 1; |
SDL_KeyRepeat.timestamp=SDL_GetTicks(); |
} |
SDL_PushEvent(&event); |
} |
} |
return(posted); |
} |
/* |
* jk 991215 - Added |
*/ |
void SDL_CheckKeyRepeat(void) |
{ |
/* if ( SDL_KeyRepeat.timestamp ) { |
Uint32 now, interval; |
now = SDL_GetTicks(); |
interval = (now - SDL_KeyRepeat.timestamp); |
if ( SDL_KeyRepeat.firsttime ) { |
if ( interval > (Uint32)SDL_KeyRepeat.delay ) { |
SDL_KeyRepeat.timestamp = now; |
SDL_KeyRepeat.firsttime = 0; |
} |
} else { |
if ( interval > (Uint32)SDL_KeyRepeat.interval ) { |
SDL_KeyRepeat.timestamp = now; |
SDL_PushEvent(&SDL_KeyRepeat.evt); |
} |
} |
}*/ |
} |
int SDL_EnableKeyRepeat(int delay, int interval) |
{ |
if ( (delay < 0) || (interval < 0) ) { |
SDL_SetError("keyboard repeat value less than zero"); |
return(-1); |
} |
SDL_KeyRepeat.firsttime = 0; |
SDL_KeyRepeat.delay = delay; |
SDL_KeyRepeat.interval = interval; |
SDL_KeyRepeat.timestamp = 0; |
return(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_mouse.c |
---|
0,0 → 1,246 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* General mouse handling code for SDL */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_events.h" |
#include "SDL_events_c.h" |
#include "SDL_cursor_c.h" |
#include "SDL_sysvideo.h" |
/* These are static for our mouse handling code */ |
static Sint16 SDL_MouseX = 0; |
static Sint16 SDL_MouseY = 0; |
static Sint16 SDL_DeltaX = 0; |
static Sint16 SDL_DeltaY = 0; |
static Uint8 SDL_ButtonState = 0; |
/* Public functions */ |
int SDL_MouseInit(void) |
{ |
/* The mouse is at (0,0) */ |
SDL_MouseX = 0; |
SDL_MouseY = 0; |
SDL_DeltaX = 0; |
SDL_DeltaY = 0; |
SDL_ButtonState = 0; |
/* That's it! */ |
return(0); |
} |
Uint8 SDL_GetMouseState (int *x, int *y) |
{ |
if ( x ) |
*x = SDL_MouseX; |
if ( y ) |
*y = SDL_MouseY; |
return(SDL_ButtonState); |
} |
Uint8 SDL_GetRelativeMouseState (int *x, int *y) |
{ |
if ( x ) |
*x = SDL_DeltaX; |
if ( y ) |
*y = SDL_DeltaY; |
SDL_DeltaX = 0; |
SDL_DeltaY = 0; |
return(SDL_ButtonState); |
} |
static void ClipOffset(Sint16 *x, Sint16 *y) |
{ |
/* This clips absolute mouse coordinates when the apparent |
display surface is smaller than the real display surface. |
*/ |
if ( SDL_VideoSurface->offset ) { |
*y -= SDL_VideoSurface->offset/SDL_VideoSurface->pitch; |
*x -= (SDL_VideoSurface->offset%SDL_VideoSurface->pitch)/ |
SDL_VideoSurface->format->BytesPerPixel; |
} |
} |
/* These are global for SDL_eventloop.c */ |
int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y) |
{ |
int posted; |
Uint16 X, Y; |
Sint16 Xrel; |
Sint16 Yrel; |
/* Don't handle mouse motion if there's no cursor surface */ |
if ( SDL_VideoSurface == NULL ) { |
return(0); |
} |
/* Default buttonstate is the current one */ |
if ( ! buttonstate ) { |
buttonstate = SDL_ButtonState; |
} |
Xrel = x; |
Yrel = y; |
if ( relative ) { |
/* Push the cursor around */ |
x = (SDL_MouseX+x); |
y = (SDL_MouseY+y); |
} else { |
/* Do we need to clip {x,y} ? */ |
ClipOffset(&x, &y); |
} |
/* Mouse coordinates range from 0 - width-1 and 0 - height-1 */ |
if ( x < 0 ) |
X = 0; |
else |
if ( x >= SDL_VideoSurface->w ) |
X = SDL_VideoSurface->w-1; |
else |
X = (Uint16)x; |
if ( y < 0 ) |
Y = 0; |
else |
if ( y >= SDL_VideoSurface->h ) |
Y = SDL_VideoSurface->h-1; |
else |
Y = (Uint16)y; |
/* If not relative mode, generate relative motion from clamped X/Y. |
This prevents lots of extraneous large delta relative motion when |
the screen is windowed mode and the mouse is outside the window. |
*/ |
if ( ! relative ) { |
Xrel = X-SDL_MouseX; |
Yrel = Y-SDL_MouseY; |
} |
/* Update internal mouse state */ |
SDL_ButtonState = buttonstate; |
SDL_MouseX = X; |
SDL_MouseY = Y; |
SDL_DeltaX += Xrel; |
SDL_DeltaY += Yrel; |
SDL_MoveCursor(SDL_MouseX, SDL_MouseY); |
/* Post the event, if desired */ |
posted = 0; |
if ( SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE ) { |
SDL_Event event; |
memset(&event, 0, sizeof(event)); |
event.type = SDL_MOUSEMOTION; |
event.motion.state = buttonstate; |
event.motion.x = X; |
event.motion.y = Y; |
event.motion.xrel = Xrel; |
event.motion.yrel = Yrel; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
return(posted); |
} |
int SDL_PrivateMouseButton(Uint8 state, Uint8 button, Sint16 x, Sint16 y) |
{ |
SDL_Event event; |
int posted; |
int move_mouse; |
Uint8 buttonstate; |
memset(&event, 0, sizeof(event)); |
/* Check parameters */ |
if ( x || y ) { |
ClipOffset(&x, &y); |
move_mouse = 1; |
/* Mouse coordinates range from 0 - width-1 and 0 - height-1 */ |
if ( x < 0 ) |
x = 0; |
else |
if ( x >= SDL_VideoSurface->w ) |
x = SDL_VideoSurface->w-1; |
if ( y < 0 ) |
y = 0; |
else |
if ( y >= SDL_VideoSurface->h ) |
y = SDL_VideoSurface->h-1; |
} else { |
move_mouse = 0; |
} |
if ( ! x ) |
x = SDL_MouseX; |
if ( ! y ) |
y = SDL_MouseY; |
/* Figure out which event to perform */ |
buttonstate = SDL_ButtonState; |
switch ( state ) { |
case SDL_PRESSED: |
event.type = SDL_MOUSEBUTTONDOWN; |
buttonstate |= SDL_BUTTON(button); |
break; |
case SDL_RELEASED: |
event.type = SDL_MOUSEBUTTONUP; |
buttonstate &= ~SDL_BUTTON(button); |
break; |
default: |
/* Invalid state -- bail */ |
return(0); |
} |
/* Update internal mouse state */ |
SDL_ButtonState = buttonstate; |
if ( move_mouse ) { |
SDL_MouseX = x; |
SDL_MouseY = y; |
/* We don't wan't the cursor because MenuetOS doesn't allow |
hiding mouse cursor */ |
// uncommented for KolibriOS |
SDL_MoveCursor(SDL_MouseX, SDL_MouseY); |
} |
/* Post the event, if desired */ |
posted = 0; |
if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { |
event.button.state = state; |
event.button.button = button; |
event.button.x = x; |
event.button.y = y; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
return(posted); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_quit.c |
---|
0,0 → 1,79 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* General quit handling code for SDL */ |
#include <stdio.h> |
#ifndef NO_SIGNAL_H |
#include <signal.h> |
#endif |
#include "SDL_events.h" |
#include "SDL_events_c.h" |
#ifndef NO_SIGNAL_H |
static void SDL_HandleSIG(int sig) |
{ |
/* Reset the signal handler */ |
signal(sig, SDL_HandleSIG); |
/* Signal a quit interrupt */ |
SDL_PrivateQuit(); |
} |
#endif /* NO_SIGNAL_H */ |
/* Public functions */ |
int SDL_QuitInit(void) |
{ |
#ifndef NO_SIGNAL_H |
void (*ohandler)(int); |
/* Both SIGINT and SIGTERM are translated into quit interrupts */ |
ohandler = signal(SIGINT, SDL_HandleSIG); |
if ( ohandler != SIG_DFL ) |
signal(SIGINT, ohandler); |
ohandler = signal(SIGTERM, SDL_HandleSIG); |
if ( ohandler != SIG_DFL ) |
signal(SIGTERM, ohandler); |
#endif /* NO_SIGNAL_H */ |
/* That's it! */ |
return(0); |
} |
/* This function returns 1 if it's okay to close the application window */ |
int SDL_PrivateQuit(void) |
{ |
int posted; |
posted = 0; |
if ( SDL_ProcessEvents[SDL_QUIT] == SDL_ENABLE ) { |
SDL_Event event; |
event.type = SDL_QUIT; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
return(posted); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_resize.c |
---|
0,0 → 1,72 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Resize event handling code for SDL */ |
#include "SDL_events.h" |
#include "SDL_events_c.h" |
#include "SDL_sysvideo.h" |
/* Keep the last resize event so we don't post duplicates */ |
static struct { |
int w; |
int h; |
} last_resize; |
/* This is global for SDL_eventloop.c */ |
int SDL_PrivateResize(int w, int h) |
{ |
int posted; |
SDL_Event events[32]; |
/* See if this event would change the video surface */ |
if ( !w || !h || |
((last_resize.w == w) && (last_resize.h == h)) ) { |
return(0); |
} |
last_resize.w = w; |
last_resize.h = h; |
if ( ! SDL_VideoSurface || |
((w == SDL_VideoSurface->w) && (h == SDL_VideoSurface->h)) ) { |
return(0); |
} |
/* Pull out all old resize events */ |
SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]), |
SDL_GETEVENT, SDL_VIDEORESIZEMASK); |
/* Post the event, if desired */ |
posted = 0; |
if ( SDL_ProcessEvents[SDL_VIDEORESIZE] == SDL_ENABLE ) { |
SDL_Event event; |
event.type = SDL_VIDEORESIZE; |
event.resize.w = w; |
event.resize.h = h; |
if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { |
posted = 1; |
SDL_PushEvent(&event); |
} |
} |
return(posted); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_sysevents.h |
---|
0,0 → 1,46 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_sysevents.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
#include "SDL_sysvideo.h" |
/* Useful functions and variables from SDL_sysevents.c */ |
#ifdef __BEOS__ /* The Be event loop runs in a separate thread */ |
#define MUST_THREAD_EVENTS |
#endif |
#ifdef WIN32UNDEFINED /* Win32 doesn't allow a separate event thread */ |
#define CANT_THREAD_EVENTS |
#endif |
#ifdef macintosh /* MacOS 7/8 don't support preemptive multi-tasking */ |
#define CANT_THREAD_EVENTS |
#endif |
#ifdef __MENUETOS__ |
#define CANT_THREAD_EVENTS |
#endif |
/contrib/sdk/sources/SDL-1.2.2/src/events/SDL_sysevents.h.BAK |
---|
0,0 → 1,46 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_sysevents.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
#include "SDL_sysvideo.h" |
/* Useful functions and variables from SDL_sysevents.c */ |
#ifdef __BEOS__ /* The Be event loop runs in a separate thread */ |
#define MUST_THREAD_EVENTS |
#endif |
#ifdef WIN32 /* Win32 doesn't allow a separate event thread */ |
#define CANT_THREAD_EVENTS |
#endif |
#ifdef macintosh /* MacOS 7/8 don't support preemptive multi-tasking */ |
#define CANT_THREAD_EVENTS |
#endif |
#ifdef __MENUETOS__ |
#define CANT_THREAD_EVENTS |
#endif |
/contrib/sdk/sources/SDL-1.2.2/src/file/SDL_rwops.c |
---|
0,0 → 1,207 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This file provides a general interface for SDL to read and write |
data sources. It can easily be extended to files, memory, etc. |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_rwops.h" |
/* Functions to read/write stdio file pointers */ |
static int stdio_seek(SDL_RWops *context, int offset, int whence) |
{ |
if ( fseek(context->hidden.stdio.fp, offset, whence) == 0 ) |
{ |
return(ftell(context->hidden.stdio.fp)); |
} else { |
SDL_Error(SDL_EFSEEK); |
return(-1); |
} |
} |
static int stdio_read(SDL_RWops *context, void *ptr, int size, int maxnum) |
{ |
size_t nread; |
nread = fread(ptr, size, maxnum, context->hidden.stdio.fp); |
if ( nread == 0 && ferror(context->hidden.stdio.fp) ) |
{ |
SDL_Error(SDL_EFREAD); |
} |
return(nread); |
} |
static int stdio_write(SDL_RWops *context, const void *ptr, int size, int num) |
{ |
size_t nwrote; |
nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp); |
if ( nwrote == 0 && ferror(context->hidden.stdio.fp) ) |
{ |
SDL_Error(SDL_EFWRITE); |
} |
return(nwrote); |
} |
static int stdio_close(SDL_RWops *context) |
{ |
if ( context ) |
{ |
if ( context->hidden.stdio.autoclose ) |
{ |
fclose(context->hidden.stdio.fp); |
} |
free(context); |
} |
return(0); |
} |
static int mem_seek(SDL_RWops *context, int offset, int whence) |
{ |
Uint8 *newpos; |
switch (whence) |
{ |
case SEEK_SET: |
newpos = context->hidden.mem.base+offset; |
break; |
case SEEK_CUR: |
newpos = context->hidden.mem.here+offset; |
break; |
case SEEK_END: |
newpos = context->hidden.mem.stop+offset; |
break; |
default: |
SDL_SetError("Unknown value for 'whence'"); |
return(-1); |
} |
if ( newpos < context->hidden.mem.base ) |
{ |
newpos = context->hidden.mem.base; |
} |
if ( newpos > context->hidden.mem.stop ) |
{ |
newpos = context->hidden.mem.stop; |
} |
context->hidden.mem.here = newpos; |
return(context->hidden.mem.here-context->hidden.mem.base); |
} |
static int mem_read(SDL_RWops *context, void *ptr, int size, int maxnum) |
{ |
int num; |
num = maxnum; |
if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) |
{ |
num = (context->hidden.mem.stop-context->hidden.mem.here)/size; |
} |
memcpy(ptr, context->hidden.mem.here, num*size); |
context->hidden.mem.here += num*size; |
return(num); |
} |
static int mem_write(SDL_RWops *context, const void *ptr, int size, int num) |
{ |
if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) |
{ |
num = (context->hidden.mem.stop-context->hidden.mem.here)/size; |
} |
memcpy(context->hidden.mem.here, ptr, num*size); |
context->hidden.mem.here += num*size; |
return(num); |
} |
static int mem_close(SDL_RWops *context) |
{ |
if ( context ) |
{ |
free(context); |
} |
return(0); |
} |
SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) |
{ |
FILE *fp; |
SDL_RWops *rwops; |
rwops = NULL; |
fp = fopen(file, mode); |
if ( fp == NULL ) |
{ |
SDL_SetError("Couldn't open %s", file); |
} else { |
rwops = SDL_RWFromFP(fp, 1); |
} |
return(rwops); |
} |
SDL_RWops *SDL_RWFromFP(FILE *fp, int autoclose) |
{ |
SDL_RWops *rwops; |
rwops = SDL_AllocRW(); |
if ( rwops != NULL ) |
{ |
rwops->seek = stdio_seek; |
rwops->read = stdio_read; |
rwops->write = stdio_write; |
rwops->close = stdio_close; |
rwops->hidden.stdio.fp = fp; |
rwops->hidden.stdio.autoclose = autoclose; |
} |
return(rwops); |
} |
SDL_RWops *SDL_RWFromMem(void *mem, int size) |
{ |
SDL_RWops *rwops; |
rwops = SDL_AllocRW(); |
if ( rwops != NULL ) |
{ |
rwops->seek = mem_seek; |
rwops->read = mem_read; |
rwops->write = mem_write; |
rwops->close = mem_close; |
rwops->hidden.mem.base = (Uint8 *)mem; |
rwops->hidden.mem.here = rwops->hidden.mem.base; |
rwops->hidden.mem.stop = rwops->hidden.mem.base+size; |
} |
return(rwops); |
} |
SDL_RWops *SDL_AllocRW(void) |
{ |
SDL_RWops *area; |
area = (SDL_RWops *)malloc(sizeof *area); |
if ( area == NULL ) |
{ |
SDL_OutOfMemory(); |
} |
return(area); |
} |
void SDL_FreeRW(SDL_RWops *area) |
{ |
free(area); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/HeadMMX.h |
---|
0,0 → 1,101 |
/* |
Header definitions for the MMX routines for the HERMES library |
Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) |
This source code is licensed under the GNU LGPL |
Please refer to the file COPYING.LIB contained in the distribution for |
licensing conditions |
*/ |
#ifndef __HERMES_HEAD_MMX__ |
#define __HERMES_HEAD_MMX__ |
/* If you cannot stand ifdefs, then please do not look into this file, it's |
going to end your life :) */ |
#ifdef X86_ASSEMBLER |
#ifdef __cplusplus |
extern "C" { |
#endif |
void STACKCALL ConvertMMX(HermesConverterInterface *); |
void STACKCALL ClearMMX_32(HermesClearInterface *); |
void STACKCALL ClearMMX_24(HermesClearInterface *); |
void STACKCALL ClearMMX_16(HermesClearInterface *); |
void STACKCALL ClearMMX_8(HermesClearInterface *); |
void ConvertMMXpII32_24RGB888(); |
void ConvertMMXpII32_16RGB565(); |
void ConvertMMXpII32_16BGR565(); |
void ConvertMMXpII32_16RGB555(); |
void ConvertMMXpII32_16BGR565(); |
void ConvertMMXpII32_16BGR555(); |
void ConvertMMXp32_16RGB555(); |
#ifdef __cplusplus |
} |
#endif |
/* Fix the underscore business with ELF compilers */ |
#if defined(__ELF__) && defined(__GNUC__) |
#ifdef __cplusplus |
extern "C" { |
#endif |
void ConvertMMX(HermesConverterInterface *) __attribute__ ((alias ("_ConvertMMX"))); |
#if 0 |
void ClearMMX_32(HermesClearInterface *) __attribute__ ((alias ("_ClearMMX_32"))); |
void ClearMMX_24(HermesClearInterface *) __attribute__ ((alias ("_ClearMMX_24"))); |
void ClearMMX_16(HermesClearInterface *) __attribute__ ((alias ("_ClearMMX_16"))); |
void ClearMMX_8(HermesClearInterface *) __attribute__ ((alias ("_ClearMMX_8"))); |
void ConvertMMXp32_16RGB555() __attribute__ ((alias ("_ConvertMMXp32_16RGB555"))); |
#endif |
void ConvertMMXpII32_24RGB888() __attribute__ ((alias ("_ConvertMMXpII32_24RGB888"))); |
void ConvertMMXpII32_16RGB565() __attribute__ ((alias ("_ConvertMMXpII32_16RGB565"))); |
void ConvertMMXpII32_16BGR565() __attribute__ ((alias ("_ConvertMMXpII32_16BGR565"))); |
void ConvertMMXpII32_16RGB555() __attribute__ ((alias ("_ConvertMMXpII32_16RGB555"))); |
void ConvertMMXpII32_16BGR555() __attribute__ ((alias ("_ConvertMMXpII32_16BGR555"))); |
#ifdef __cplusplus |
} |
#endif |
#endif /* ELF and GNUC */ |
/* Make it work with Watcom */ |
#ifdef __WATCOMC__ |
#pragma warning 601 9 |
#pragma aux ConvertMMX "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearMMX_32 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearMMX_24 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearMMX_16 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearMMX_8 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ConvertMMXpII32_24RGB888 "_*" |
#pragma aux ConvertMMXpII32_16RGB565 "_*" |
#pragma aux ConvertMMXpII32_16BGR565 "_*" |
#pragma aux ConvertMMXpII32_16RGB555 "_*" |
#pragma aux ConvertMMXpII32_16BGR555 "_*" |
#pragma aux ConvertMMXp32_16RGB555 "_*" |
#endif /* WATCOM */ |
#endif /* X86_ASSEMBLER */ |
#endif |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/HeadX86.h |
---|
0,0 → 1,195 |
/* |
Header definitions for the x86 routines for the HERMES library |
Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) |
This source code is licensed under the GNU LGPL |
Please refer to the file COPYING.LIB contained in the distribution for |
licensing conditions |
*/ |
#ifndef __HERMES_HEAD_X86__ |
#define __HERMES_HEAD_X86__ |
#ifdef X86_ASSEMBLER |
/* If you can't stand IFDEFS, then close your eyes now, please :) */ |
/* Ok, we start with normal function definitions */ |
#ifdef __cplusplus |
extern "C" { |
#endif |
void STACKCALL ConvertX86(HermesConverterInterface *); |
void STACKCALL ClearX86_32(HermesClearInterface *); |
void STACKCALL ClearX86_24(HermesClearInterface *); |
void STACKCALL ClearX86_16(HermesClearInterface *); |
void STACKCALL ClearX86_8(HermesClearInterface *); |
int STACKCALL Hermes_X86_CPU(); |
void ConvertX86p32_32BGR888(); |
void ConvertX86p32_32RGBA888(); |
void ConvertX86p32_32BGRA888(); |
void ConvertX86p32_24RGB888(); |
void ConvertX86p32_24BGR888(); |
void ConvertX86p32_16RGB565(); |
void ConvertX86p32_16BGR565(); |
void ConvertX86p32_16RGB555(); |
void ConvertX86p32_16BGR555(); |
void ConvertX86p32_8RGB332(); |
void ConvertX86p16_32RGB888(); |
void ConvertX86p16_32BGR888(); |
void ConvertX86p16_32RGBA888(); |
void ConvertX86p16_32BGRA888(); |
void ConvertX86p16_24RGB888(); |
void ConvertX86p16_24BGR888(); |
void ConvertX86p16_16BGR565(); |
void ConvertX86p16_16RGB555(); |
void ConvertX86p16_16BGR555(); |
void ConvertX86p16_8RGB332(); |
void CopyX86p_4byte(); |
void CopyX86p_3byte(); |
void CopyX86p_2byte(); |
void CopyX86p_1byte(); |
void ConvertX86pI8_32(); |
void ConvertX86pI8_24(); |
void ConvertX86pI8_16(); |
extern int32 ConvertX86p16_32RGB888_LUT_X86[512]; |
extern int32 ConvertX86p16_32BGR888_LUT_X86[512]; |
extern int32 ConvertX86p16_32RGBA888_LUT_X86[512]; |
extern int32 ConvertX86p16_32BGRA888_LUT_X86[512]; |
#ifdef __cplusplus |
} |
#endif |
/* Now fix up the ELF underscore problem */ |
#if defined(__ELF__) && defined(__GNUC__) |
#ifdef __cplusplus |
extern "C" { |
#endif |
int Hermes_X86_CPU() __attribute__ ((alias ("_Hermes_X86_CPU"))); |
void ConvertX86(HermesConverterInterface *) __attribute__ ((alias ("_ConvertX86"))); |
#if 0 |
void ClearX86_32(HermesClearInterface *) __attribute__ ((alias ("_ClearX86_32"))); |
void ClearX86_24(HermesClearInterface *) __attribute__ ((alias ("_ClearX86_24"))); |
void ClearX86_16(HermesClearInterface *) __attribute__ ((alias ("_ClearX86_16"))); |
void ClearX86_8(HermesClearInterface *) __attribute__ ((alias ("_ClearX86_8"))); |
#endif |
void ConvertX86p32_32BGR888() __attribute__ ((alias ("_ConvertX86p32_32BGR888"))); |
void ConvertX86p32_32RGBA888() __attribute__ ((alias ("_ConvertX86p32_32RGBA888"))); |
void ConvertX86p32_32BGRA888() __attribute__ ((alias ("_ConvertX86p32_32BGRA888"))); |
void ConvertX86p32_24RGB888() __attribute__ ((alias ("_ConvertX86p32_24RGB888"))); |
void ConvertX86p32_24BGR888() __attribute__ ((alias ("_ConvertX86p32_24BGR888"))); |
void ConvertX86p32_16RGB565() __attribute__ ((alias ("_ConvertX86p32_16RGB565"))); |
void ConvertX86p32_16BGR565() __attribute__ ((alias ("_ConvertX86p32_16BGR565"))); |
void ConvertX86p32_16RGB555() __attribute__ ((alias ("_ConvertX86p32_16RGB555"))); |
void ConvertX86p32_16BGR555() __attribute__ ((alias ("_ConvertX86p32_16BGR555"))); |
void ConvertX86p32_8RGB332() __attribute__ ((alias ("_ConvertX86p32_8RGB332"))); |
#if 0 |
void ConvertX86p16_32RGB888() __attribute__ ((alias ("_ConvertX86p16_32RGB888"))); |
void ConvertX86p16_32BGR888() __attribute__ ((alias ("_ConvertX86p16_32BGR888"))); |
void ConvertX86p16_32RGBA888() __attribute__ ((alias ("_ConvertX86p16_32RGBA888"))); |
void ConvertX86p16_32BGRA888() __attribute__ ((alias ("_ConvertX86p16_32BGRA888"))); |
void ConvertX86p16_24RGB888() __attribute__ ((alias ("_ConvertX86p16_24RGB888"))); |
void ConvertX86p16_24BGR888() __attribute__ ((alias ("_ConvertX86p16_24BGR888"))); |
#endif |
void ConvertX86p16_16BGR565() __attribute__ ((alias ("_ConvertX86p16_16BGR565"))); |
void ConvertX86p16_16RGB555() __attribute__ ((alias ("_ConvertX86p16_16RGB555"))); |
void ConvertX86p16_16BGR555() __attribute__ ((alias ("_ConvertX86p16_16BGR555"))); |
void ConvertX86p16_8RGB332() __attribute__ ((alias ("_ConvertX86p16_8RGB332"))); |
#if 0 |
void CopyX86p_4byte() __attribute__ ((alias ("_CopyX86p_4byte"))); |
void CopyX86p_3byte() __attribute__ ((alias ("_CopyX86p_3byte"))); |
void CopyX86p_2byte() __attribute__ ((alias ("_CopyX86p_2byte"))); |
void CopyX86p_1byte() __attribute__ ((alias ("_CopyX86p_1byte"))); |
void ConvertX86pI8_32() __attribute__ ((alias ("_ConvertX86pI8_32"))); |
void ConvertX86pI8_24() __attribute__ ((alias ("_ConvertX86pI8_24"))); |
void ConvertX86pI8_16() __attribute__ ((alias ("_ConvertX86pI8_16"))); |
extern int32 ConvertX86p16_32RGB888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32RGB888_LUT_X86"))); |
extern int32 ConvertX86p16_32BGR888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32BGR888_LUT_X86"))); |
extern int32 ConvertX86p16_32RGBA888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32RGBA888_LUT_X86"))); |
extern int32 ConvertX86p16_32BGRA888_LUT_X86[512] __attribute__ ((alias ("_ConvertX86p16_32BGRA888_LUT_X86"))); |
#endif |
#ifdef __cplusplus |
} |
#endif |
#endif /* ELF & GNU */ |
/* Make it run with WATCOM C */ |
#ifdef __WATCOMC__ |
#pragma warning 601 9 |
#pragma aux Hermes_X86_CPU "_*" |
#pragma aux ConvertX86 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearX86_32 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearX86_24 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearX86_16 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ClearX86_8 "_*" modify [EAX EBX ECX EDX ESI EDI] |
#pragma aux ConvertX86p32_32BGR888 "_*" |
#pragma aux ConvertX86p32_32RGBA888 "_*" |
#pragma aux ConvertX86p32_32BGRA888 "_*" |
#pragma aux ConvertX86p32_24RGB888 "_*" |
#pragma aux ConvertX86p32_24BGR888 "_*" |
#pragma aux ConvertX86p32_16RGB565 "_*" |
#pragma aux ConvertX86p32_16BGR565 "_*" |
#pragma aux ConvertX86p32_16RGB555 "_*" |
#pragma aux ConvertX86p32_16BGR555 "_*" |
#pragma aux ConvertX86p32_8RGB332 "_*" |
#pragma aux ConvertX86p16_32RGB888 "_*" |
#pragma aux ConvertX86p16_32BGR888 "_*" |
#pragma aux ConvertX86p16_32RGBA888 "_*" |
#pragma aux ConvertX86p16_32BGRA888 "_*" |
#pragma aux ConvertX86p16_24RGB888 "_*" |
#pragma aux ConvertX86p16_24BGR888 "_*" |
#pragma aux ConvertX86p16_16BGR565 "_*" |
#pragma aux ConvertX86p16_16RGB555 "_*" |
#pragma aux ConvertX86p16_16BGR555 "_*" |
#pragma aux ConvertX86p16_8RGB332 "_*" |
#pragma aux CopyX86p_4byte "_*" |
#pragma aux CopyX86p_3byte "_*" |
#pragma aux CopyX86p_2byte "_*" |
#pragma aux CopyX86p_1byte "_*" |
#pragma aux ConvertX86pI8_32 "_*" |
#pragma aux ConvertX86pI8_24 "_*" |
#pragma aux ConvertX86pI8_16 "_*" |
#pragma aux ConvertX86p16_32RGB888_LUT_X86 "_*" |
#pragma aux ConvertX86p16_32BGR888_LUT_X86 "_*" |
#pragma aux ConvertX86p16_32RGBA888_LUT_X86 "_*" |
#pragma aux ConvertX86p16_32BGRA888_LUT_X86 "_*" |
#endif /* __WATCOMC__ */ |
#endif /* X86_ASSEMBLER */ |
#endif |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/mmx_main.asm |
---|
0,0 → 1,74 |
; |
; mmx format converter main loops for HERMES |
; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) |
; This source code is licensed under the GNU LGPL |
; |
; Please refer to the file COPYING.LIB contained in the distribution for |
; licensing conditions |
; |
BITS 32 |
GLOBAL _ConvertMMX |
GLOBAL _mmxreturn |
SECTION .text |
;; _ConvertMMX: |
;; [ESP+8] ConverterInfo* |
;; -------------------------------------------------------------------------- |
;; ConverterInfo (ebp+..) |
;; 0: void *s_pixels |
;; 4: int s_width |
;; 8: int s_height |
;; 12: int s_add |
;; 16: void *d_pixels |
;; 20: int d_width |
;; 24: int d_height |
;; 28: int d_add |
;; 32: void (*converter_function)() |
;; 36: int32 *lookup |
_ConvertMMX: |
push ebp |
mov ebp,esp |
; Save the registers used by the blitters, necessary for optimized code |
pusha |
mov eax,[ebp+8] |
cmp dword [eax+4],BYTE 0 |
je endconvert |
mov ebp,eax |
mov esi,[ebp+0] |
mov edi,[ebp+16] |
y_loop: |
mov ecx,[ebp+4] |
jmp [ebp+32] |
_mmxreturn: |
add esi,[ebp+12] |
add edi,[ebp+28] |
dec dword [ebp+8] |
jnz y_loop |
; Restore the registers used by the blitters, necessary for optimized code |
popa |
pop ebp |
endconvert: |
emms |
ret |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/mmxp2_32.asm |
---|
0,0 → 1,386 |
; |
; pII-optimised MMX format converters for HERMES |
; Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) |
; and (c) 1999 Jonathan Matthew (jmatthew@uq.net.au) |
; This source code is licensed under the GNU LGPL |
; |
; Please refer to the file COPYING.LIB contained in the distribution for |
; licensing conditions |
; |
; COPYRIGHT NOTICE |
; |
; This file partly contains code that is (c) Intel Corporation, specifically |
; the mode detection routine, and the converter to 15 bit (8 pixel |
; conversion routine from the mmx programming tutorial pages). |
; |
; |
; These routines aren't exactly pII optimised - it's just that as they |
; are, they're terrible on p5 MMXs, but less so on pIIs. Someone needs to |
; optimise them for p5 MMXs.. |
BITS 32 |
GLOBAL _ConvertMMXpII32_24RGB888 |
GLOBAL _ConvertMMXpII32_16RGB565 |
GLOBAL _ConvertMMXpII32_16BGR565 |
GLOBAL _ConvertMMXpII32_16RGB555 |
GLOBAL _ConvertMMXpII32_16BGR555 |
EXTERN _mmxreturn |
SECTION .data |
ALIGN 8 |
;; Constants for conversion routines |
mmx32_rgb888_mask dd 00ffffffh,00ffffffh |
mmx32_rgb565_b dd 000000f8h, 000000f8h |
mmx32_rgb565_g dd 0000fc00h, 0000fc00h |
mmx32_rgb565_r dd 00f80000h, 00f80000h |
mmx32_rgb555_rb dd 00f800f8h,00f800f8h |
mmx32_rgb555_g dd 0000f800h,0000f800h |
mmx32_rgb555_mul dd 20000008h,20000008h |
mmx32_bgr555_mul dd 00082000h,00082000h |
SECTION .text |
_ConvertMMXpII32_24RGB888: |
; set up mm6 as the mask, mm7 as zero |
movq mm6, qword [mmx32_rgb888_mask] |
pxor mm7, mm7 |
mov edx, ecx ; save ecx |
and ecx, 0fffffffch ; clear lower two bits |
jnz .L1 |
jmp .L2 |
.L1: |
movq mm0, [esi] ; A R G B a r g b |
pand mm0, mm6 ; 0 R G B 0 r g b |
movq mm1, [esi+8] ; A R G B a r g b |
pand mm1, mm6 ; 0 R G B 0 r g b |
movq mm2, mm0 ; 0 R G B 0 r g b |
punpckhdq mm2, mm7 ; 0 0 0 0 0 R G B |
punpckldq mm0, mm7 ; 0 0 0 0 0 r g b |
psllq mm2, 24 ; 0 0 R G B 0 0 0 |
por mm0, mm2 ; 0 0 R G B r g b |
movq mm3, mm1 ; 0 R G B 0 r g b |
psllq mm3, 48 ; g b 0 0 0 0 0 0 |
por mm0, mm3 ; g b R G B r g b |
movq mm4, mm1 ; 0 R G B 0 r g b |
punpckhdq mm4, mm7 ; 0 0 0 0 0 R G B |
punpckldq mm1, mm7 ; 0 0 0 0 0 r g b |
psrlq mm1, 16 ; 0 0 0 R G B 0 r |
psllq mm4, 8 ; 0 0 0 0 R G B 0 |
por mm1, mm4 ; 0 0 0 0 R G B r |
movq [edi], mm0 |
add esi, BYTE 16 |
movd [edi+8], mm1 |
add edi, BYTE 12 |
sub ecx, BYTE 4 |
jnz .L1 |
.L2: |
mov ecx, edx |
and ecx, BYTE 3 |
jz .L4 |
.L3: |
mov al, [esi] |
mov bl, [esi+1] |
mov dl, [esi+2] |
mov [edi], al |
mov [edi+1], bl |
mov [edi+2], dl |
add esi, BYTE 4 |
add edi, BYTE 3 |
dec ecx |
jnz .L3 |
.L4: |
jmp _mmxreturn |
_ConvertMMXpII32_16RGB565: |
; set up masks |
movq mm5, [mmx32_rgb565_b] |
movq mm6, [mmx32_rgb565_g] |
movq mm7, [mmx32_rgb565_r] |
mov edx, ecx |
shr ecx, 2 |
jnz .L1 |
jmp .L2 ; not necessary at the moment, but doesn't hurt (much) |
.L1: |
movq mm0, [esi] ; argb |
movq mm1, mm0 ; argb |
pand mm0, mm6 ; 00g0 |
movq mm3, mm1 ; argb |
pand mm1, mm5 ; 000b |
pand mm3, mm7 ; 0r00 |
pslld mm1, 2 ; 0 0 000000bb bbb00000 |
por mm0, mm1 ; 0 0 ggggggbb bbb00000 |
psrld mm0, 5 ; 0 0 00000ggg gggbbbbb |
movq mm4, [esi+8] ; argb |
movq mm2, mm4 ; argb |
pand mm4, mm6 ; 00g0 |
movq mm1, mm2 ; argb |
pand mm2, mm5 ; 000b |
pand mm1, mm7 ; 0r00 |
pslld mm2, 2 ; 0 0 000000bb bbb00000 |
por mm4, mm2 ; 0 0 ggggggbb bbb00000 |
psrld mm4, 5 ; 0 0 00000ggg gggbbbbb |
packuswb mm3, mm1 ; R 0 r 0 |
packssdw mm0, mm4 ; as above.. ish |
por mm0, mm3 ; done. |
movq [edi], mm0 |
add esi, 16 |
add edi, 8 |
dec ecx |
jnz .L1 |
.L2: |
mov ecx, edx |
and ecx, BYTE 3 |
jz .L4 |
.L3: |
mov al, [esi] |
mov bh, [esi+1] |
mov ah, [esi+2] |
shr al, 3 |
and eax, 0F81Fh ; BYTE? |
shr ebx, 5 |
and ebx, 07E0h ; BYTE? |
add eax, ebx |
mov [edi], al |
mov [edi+1], ah |
add esi, BYTE 4 |
add edi, BYTE 2 |
dec ecx |
jnz .L3 |
.L4: |
jmp _mmxreturn |
_ConvertMMXpII32_16BGR565: |
movq mm5, [mmx32_rgb565_r] |
movq mm6, [mmx32_rgb565_g] |
movq mm7, [mmx32_rgb565_b] |
mov edx, ecx |
shr ecx, 2 |
jnz .L1 |
jmp .L2 |
.L1: |
movq mm0, [esi] ; a r g b |
movq mm1, mm0 ; a r g b |
pand mm0, mm6 ; 0 0 g 0 |
movq mm3, mm1 ; a r g b |
pand mm1, mm5 ; 0 r 0 0 |
pand mm3, mm7 ; 0 0 0 b |
psllq mm3, 16 ; 0 b 0 0 |
psrld mm1, 14 ; 0 0 000000rr rrr00000 |
por mm0, mm1 ; 0 0 ggggggrr rrr00000 |
psrld mm0, 5 ; 0 0 00000ggg gggrrrrr |
movq mm4, [esi+8] ; a r g b |
movq mm2, mm4 ; a r g b |
pand mm4, mm6 ; 0 0 g 0 |
movq mm1, mm2 ; a r g b |
pand mm2, mm5 ; 0 r 0 0 |
pand mm1, mm7 ; 0 0 0 b |
psllq mm1, 16 ; 0 b 0 0 |
psrld mm2, 14 ; 0 0 000000rr rrr00000 |
por mm4, mm2 ; 0 0 ggggggrr rrr00000 |
psrld mm4, 5 ; 0 0 00000ggg gggrrrrr |
packuswb mm3, mm1 ; BBBBB000 00000000 bbbbb000 00000000 |
packssdw mm0, mm4 ; 00000GGG GGGRRRRR 00000GGG GGGRRRRR |
por mm0, mm3 ; BBBBBGGG GGGRRRRR bbbbbggg gggrrrrr |
movq [edi], mm0 |
add esi, BYTE 16 |
add edi, BYTE 8 |
dec ecx |
jnz .L1 |
.L2: |
and edx, BYTE 3 |
jz .L4 |
.L3: |
mov al, [esi+2] |
mov bh, [esi+1] |
mov ah, [esi] |
shr al, 3 |
and eax, 0F81Fh ; BYTE ? |
shr ebx, 5 |
and ebx, 07E0h ; BYTE ? |
add eax, ebx |
mov [edi], al |
mov [edi+1], ah |
add esi, BYTE 4 |
add edi, BYTE 2 |
dec edx |
jnz .L3 |
.L4: |
jmp _mmxreturn |
_ConvertMMXpII32_16BGR555: |
; the 16BGR555 converter is identical to the RGB555 one, |
; except it uses a different multiplier for the pmaddwd |
; instruction. cool huh. |
movq mm7, qword [mmx32_bgr555_mul] |
jmp _convert_bgr555_cheat |
; This is the same as the Intel version.. they obviously went to |
; much more trouble to expand/coil the loop than I did, so theirs |
; would almost certainly be faster, even if only a little. |
; I did rename 'mmx32_rgb555_add' to 'mmx32_rgb555_mul', which is |
; (I think) a more accurate name.. |
_ConvertMMXpII32_16RGB555: |
movq mm7,qword [mmx32_rgb555_mul] |
_convert_bgr555_cheat: |
movq mm6,qword [mmx32_rgb555_g] |
mov edx,ecx ; Save ecx |
and ecx,BYTE 0fffffff8h ; clear lower three bits |
jnz .L_OK |
jmp .L2 |
.L_OK: |
movq mm2,[esi+8] |
movq mm0,[esi] |
movq mm3,mm2 |
pand mm3,qword [mmx32_rgb555_rb] |
movq mm1,mm0 |
pand mm1,qword [mmx32_rgb555_rb] |
pmaddwd mm3,mm7 |
pmaddwd mm1,mm7 |
pand mm2,mm6 |
.L1: |
movq mm4,[esi+24] |
pand mm0,mm6 |
movq mm5,[esi+16] |
por mm3,mm2 |
psrld mm3,6 |
por mm1,mm0 |
movq mm0,mm4 |
psrld mm1,6 |
pand mm0,qword [mmx32_rgb555_rb] |
packssdw mm1,mm3 |
movq mm3,mm5 |
pmaddwd mm0,mm7 |
pand mm3,qword [mmx32_rgb555_rb] |
pand mm4,mm6 |
movq [edi],mm1 |
pmaddwd mm3,mm7 |
add esi,BYTE 32 |
por mm4,mm0 |
pand mm5,mm6 |
psrld mm4,6 |
movq mm2,[esi+8] |
por mm5,mm3 |
movq mm0,[esi] |
psrld mm5,6 |
movq mm3,mm2 |
movq mm1,mm0 |
pand mm3,qword [mmx32_rgb555_rb] |
packssdw mm5,mm4 |
pand mm1,qword [mmx32_rgb555_rb] |
pand mm2,mm6 |
movq [edi+8],mm5 |
pmaddwd mm3,mm7 |
pmaddwd mm1,mm7 |
add edi,BYTE 16 |
sub ecx,BYTE 8 |
jz .L2 |
jmp .L1 |
.L2: |
mov ecx,edx |
and ecx,BYTE 7 |
jz .L4 |
.L3: |
mov ebx,[esi] |
add esi,BYTE 4 |
mov eax,ebx |
mov edx,ebx |
shr eax,3 |
shr edx,6 |
and eax,BYTE 0000000000011111b |
and edx, 0000001111100000b |
shr ebx,9 |
or eax,edx |
and ebx, 0111110000000000b |
or eax,ebx |
mov [edi],ax |
add edi,BYTE 2 |
dec ecx |
jnz .L3 |
.L4: |
jmp _mmxreturn |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/x86_main.asm |
---|
0,0 → 1,126 |
; |
; x86 format converters for HERMES |
; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) |
; This source code is licensed under the GNU LGPL |
; |
; Please refer to the file COPYING.LIB contained in the distribution for |
; licensing conditions |
; |
; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission |
; |
BITS 32 |
GLOBAL _ConvertX86 |
GLOBAL _x86return |
GLOBAL _Hermes_X86_CPU |
SECTION .data |
cpu_flags dd 0 |
SECTION .text |
;; _ConvertX86: |
;; [ESP+8] ConverterInfo* |
;; -------------------------------------------------------------------------- |
;; ConverterInfo (ebp+..) |
;; 0: void *s_pixels |
;; 4: int s_width |
;; 8: int s_height |
;; 12: int s_add |
;; 16: void *d_pixels |
;; 20: int d_width |
;; 24: int d_height |
;; 28: int d_add |
;; 32: void (*converter_function)() |
;; 36: int32 *lookup |
_ConvertX86: |
push ebp |
mov ebp,esp |
; Save the registers used by the blitters, necessary for optimized code |
pusha |
mov eax,[ebp+8] |
cmp dword [eax+4],BYTE 0 |
je endconvert |
mov ebp,eax |
mov esi,[ebp+0] |
mov edi,[ebp+16] |
y_loop: |
mov ecx,[ebp+4] |
jmp [ebp+32] |
_x86return: |
add esi,[ebp+12] |
add edi,[ebp+28] |
dec dword [ebp+8] |
jnz y_loop |
; Restore the registers used by the blitters, necessary for optimized code |
popa |
pop ebp |
endconvert: |
ret |
;; Hermes_X86_CPU returns the CPUID flags in eax |
_Hermes_X86_CPU: |
pushfd |
pop eax |
mov ecx,eax |
xor eax,040000h |
push eax |
popfd |
pushfd |
pop eax |
xor eax,ecx |
jz .L1 ; Processor is 386 |
push ecx |
popfd |
mov eax,ecx |
xor eax,200000h |
push eax |
popfd |
pushfd |
pop eax |
xor eax,ecx |
je .L1 |
pusha |
mov eax,1 |
cpuid |
mov [cpu_flags],edx |
popa |
mov eax,[cpu_flags] |
.L1: |
xor eax,eax |
ret |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/x86p_16.asm |
---|
0,0 → 1,496 |
; |
; x86 format converters for HERMES |
; Copyright (c) 1998 Glenn Fielder (gaffer@gaffer.org) |
; This source code is licensed under the GNU LGPL |
; |
; Please refer to the file COPYING.LIB contained in the distribution for |
; licensing conditions |
; |
; Routines adjusted for Hermes by Christian Nentwich (brn@eleet.mcb.at) |
; Used with permission. |
; |
BITS 32 |
GLOBAL _ConvertX86p16_32RGB888 |
GLOBAL _ConvertX86p16_32BGR888 |
GLOBAL _ConvertX86p16_32RGBA888 |
GLOBAL _ConvertX86p16_32BGRA888 |
GLOBAL _ConvertX86p16_24RGB888 |
GLOBAL _ConvertX86p16_24BGR888 |
GLOBAL _ConvertX86p16_16BGR565 |
GLOBAL _ConvertX86p16_16RGB555 |
GLOBAL _ConvertX86p16_16BGR555 |
GLOBAL _ConvertX86p16_8RGB332 |
EXTERN _ConvertX86 |
EXTERN _x86return |
SECTION .text |
_ConvertX86p16_16BGR565: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
shr eax,11 |
and eax,BYTE 11111b |
and ebx,11111100000b |
shl edx,11 |
add eax,ebx |
add eax,edx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov eax,edi |
and eax,BYTE 11b |
jz .L4 |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
shr eax,11 |
and eax,BYTE 11111b |
and ebx,11111100000b |
shl edx,11 |
add eax,ebx |
add eax,edx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
.L4 ; save count |
push ecx |
; unroll twice |
shr ecx,1 |
; point arrays to end |
lea esi,[esi+ecx*4] |
lea edi,[edi+ecx*4] |
; negative counter |
neg ecx |
jmp SHORT .L6 |
.L5 mov [edi+ecx*4-4],eax |
.L6 mov eax,[esi+ecx*4] |
mov ebx,[esi+ecx*4] |
and eax,07E007E0h |
mov edx,[esi+ecx*4] |
and ebx,0F800F800h |
shr ebx,11 |
and edx,001F001Fh |
shl edx,11 |
add eax,ebx |
add eax,edx |
inc ecx |
jnz .L5 |
mov [edi+ecx*4-4],eax |
; tail |
pop ecx |
and ecx,BYTE 1 |
jz .L7 |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
shr eax,11 |
and eax,BYTE 11111b |
and ebx,11111100000b |
shl edx,11 |
add eax,ebx |
add eax,edx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
.L7 |
jmp _x86return |
_ConvertX86p16_16RGB555: |
; check short |
cmp ecx,BYTE 32 |
ja .L3 |
.L1 ; short loop |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
shr ebx,1 |
and ebx, 0111111111100000b |
and eax,BYTE 0000000000011111b |
add eax,ebx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov eax,edi |
and eax,BYTE 11b |
jz .L4 |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
shr ebx,1 |
and ebx, 0111111111100000b |
and eax,BYTE 0000000000011111b |
add eax,ebx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
.L4 ; save ebp |
push ebp |
; save count |
push ecx |
; unroll four times |
shr ecx,2 |
; point arrays to end |
lea esi,[esi+ecx*8] |
lea edi,[edi+ecx*8] |
; negative counter |
xor ebp,ebp |
sub ebp,ecx |
.L5 mov eax,[esi+ebp*8] ; agi? |
mov ecx,[esi+ebp*8+4] |
mov ebx,eax |
mov edx,ecx |
and eax,0FFC0FFC0h |
and ecx,0FFC0FFC0h |
shr eax,1 |
and ebx,001F001Fh |
shr ecx,1 |
and edx,001F001Fh |
add eax,ebx |
add ecx,edx |
mov [edi+ebp*8],eax |
mov [edi+ebp*8+4],ecx |
inc ebp |
jnz .L5 |
; tail |
pop ecx |
.L6 and ecx,BYTE 11b |
jz .L7 |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
shr ebx,1 |
and ebx, 0111111111100000b |
and eax,BYTE 0000000000011111b |
add eax,ebx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
jmp SHORT .L6 |
.L7 pop ebp |
jmp _x86return |
_ConvertX86p16_16BGR555: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
shr eax,11 |
and eax,BYTE 11111b |
shr ebx,1 |
and ebx,1111100000b |
shl edx,10 |
and edx,0111110000000000b |
add eax,ebx |
add eax,edx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov eax,edi |
and eax,BYTE 11b |
jz .L4 |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
shr eax,11 |
and eax,BYTE 11111b |
shr ebx,1 |
and ebx,1111100000b |
shl edx,10 |
and edx,0111110000000000b |
add eax,ebx |
add eax,edx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
dec ecx |
.L4 ; save count |
push ecx |
; unroll twice |
shr ecx,1 |
; point arrays to end |
lea esi,[esi+ecx*4] |
lea edi,[edi+ecx*4] |
; negative counter |
neg ecx |
jmp SHORT .L6 |
.L5 mov [edi+ecx*4-4],eax |
.L6 mov eax,[esi+ecx*4] |
shr eax,1 |
mov ebx,[esi+ecx*4] |
and eax,03E003E0h |
mov edx,[esi+ecx*4] |
and ebx,0F800F800h |
shr ebx,11 |
and edx,001F001Fh |
shl edx,10 |
add eax,ebx |
add eax,edx |
inc ecx |
jnz .L5 |
mov [edi+ecx*4-4],eax |
; tail |
pop ecx |
and ecx,BYTE 1 |
jz .L7 |
mov al,[esi] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
shr eax,11 |
and eax,BYTE 11111b |
shr ebx,1 |
and ebx,1111100000b |
shl edx,10 |
and edx,0111110000000000b |
add eax,ebx |
add eax,edx |
mov [edi],al |
mov [edi+1],ah |
add esi,BYTE 2 |
add edi,BYTE 2 |
.L7 |
jmp _x86return |
_ConvertX86p16_8RGB332: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov al,[esi+0] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
and eax,BYTE 11000b ; blue |
shr eax,3 |
and ebx,11100000000b ; green |
shr ebx,6 |
and edx,1110000000000000b ; red |
shr edx,8 |
add eax,ebx |
add eax,edx |
mov [edi],al |
add esi,BYTE 2 |
inc edi |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 mov eax,edi |
and eax,BYTE 11b |
jz .L4 |
mov al,[esi+0] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
and eax,BYTE 11000b ; blue |
shr eax,3 |
and ebx,11100000000b ; green |
shr ebx,6 |
and edx,1110000000000000b ; red |
shr edx,8 |
add eax,ebx |
add eax,edx |
mov [edi],al |
add esi,BYTE 2 |
inc edi |
dec ecx |
jmp SHORT .L3 |
.L4 ; save ebp |
push ebp |
; save count |
push ecx |
; unroll 4 times |
shr ecx,2 |
; prestep |
mov dl,[esi+0] |
mov bl,[esi+1] |
mov dh,[esi+2] |
.L5 shl edx,16 |
mov bh,[esi+3] |
shl ebx,16 |
mov dl,[esi+4] |
mov dh,[esi+6] |
mov bl,[esi+5] |
and edx,00011000000110000001100000011000b |
mov bh,[esi+7] |
ror edx,16+3 |
mov eax,ebx ; setup eax for reds |
and ebx,00000111000001110000011100000111b |
and eax,11100000111000001110000011100000b ; reds |
ror ebx,16-2 |
add esi,BYTE 8 |
ror eax,16 |
add edi,BYTE 4 |
add eax,ebx |
mov bl,[esi+1] ; greens |
add eax,edx |
mov dl,[esi+0] ; blues |
mov [edi-4],eax |
mov dh,[esi+2] |
dec ecx |
jnz .L5 |
; check tail |
pop ecx |
and ecx,BYTE 11b |
jz .L7 |
.L6 ; tail |
mov al,[esi+0] |
mov ah,[esi+1] |
mov ebx,eax |
mov edx,eax |
and eax,BYTE 11000b ; blue |
shr eax,3 |
and ebx,11100000000b ; green |
shr ebx,6 |
and edx,1110000000000000b ; red |
shr edx,8 |
add eax,ebx |
add eax,edx |
mov [edi],al |
add esi,BYTE 2 |
inc edi |
dec ecx |
jnz .L6 |
.L7 pop ebp |
jmp _x86return |
/contrib/sdk/sources/SDL-1.2.2/src/hermes/x86p_32.asm |
---|
0,0 → 1,1043 |
; |
; x86 format converters for HERMES |
; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) |
; This source code is licensed under the GNU LGPL |
; |
; Please refer to the file COPYING.LIB contained in the distribution for |
; licensing conditions |
; |
; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission |
; |
BITS 32 |
GLOBAL _ConvertX86p32_32BGR888 |
GLOBAL _ConvertX86p32_32RGBA888 |
GLOBAL _ConvertX86p32_32BGRA888 |
GLOBAL _ConvertX86p32_24RGB888 |
GLOBAL _ConvertX86p32_24BGR888 |
GLOBAL _ConvertX86p32_16RGB565 |
GLOBAL _ConvertX86p32_16BGR565 |
GLOBAL _ConvertX86p32_16RGB555 |
GLOBAL _ConvertX86p32_16BGR555 |
GLOBAL _ConvertX86p32_8RGB332 |
EXTERN _x86return |
SECTION .text |
;; _Convert_* |
;; Paramters: |
;; ESI = source |
;; EDI = dest |
;; ECX = amount (NOT 0!!! (the _ConvertX86 routine checks for that though)) |
;; Destroys: |
;; EAX, EBX, EDX |
_ConvertX86p32_32BGR888: |
; check short |
cmp ecx,BYTE 32 |
ja .L3 |
.L1 ; short loop |
mov edx,[esi] |
bswap edx |
ror edx,8 |
mov [edi],edx |
add esi,BYTE 4 |
add edi,BYTE 4 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; save ebp |
push ebp |
; unroll four times |
mov ebp,ecx |
shr ebp,2 |
; save count |
push ecx |
.L4 mov eax,[esi] |
mov ebx,[esi+4] |
bswap eax |
bswap ebx |
ror eax,8 |
mov ecx,[esi+8] |
ror ebx,8 |
mov edx,[esi+12] |
bswap ecx |
bswap edx |
ror ecx,8 |
mov [edi+0],eax |
ror edx,8 |
mov [edi+4],ebx |
mov [edi+8],ecx |
mov [edi+12],edx |
add esi,BYTE 16 |
add edi,BYTE 16 |
dec ebp |
jnz .L4 |
; check tail |
pop ecx |
and ecx,BYTE 11b |
jz .L6 |
.L5 ; tail loop |
mov edx,[esi] |
bswap edx |
ror edx,8 |
mov [edi],edx |
add esi,BYTE 4 |
add edi,BYTE 4 |
dec ecx |
jnz .L5 |
.L6 pop ebp |
jmp _x86return |
_ConvertX86p32_32RGBA888: |
; check short |
cmp ecx,BYTE 32 |
ja .L3 |
.L1 ; short loop |
mov edx,[esi] |
rol edx,8 |
mov [edi],edx |
add esi,BYTE 4 |
add edi,BYTE 4 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; save ebp |
push ebp |
; unroll four times |
mov ebp,ecx |
shr ebp,2 |
; save count |
push ecx |
.L4 mov eax,[esi] |
mov ebx,[esi+4] |
rol eax,8 |
mov ecx,[esi+8] |
rol ebx,8 |
mov edx,[esi+12] |
rol ecx,8 |
mov [edi+0],eax |
rol edx,8 |
mov [edi+4],ebx |
mov [edi+8],ecx |
mov [edi+12],edx |
add esi,BYTE 16 |
add edi,BYTE 16 |
dec ebp |
jnz .L4 |
; check tail |
pop ecx |
and ecx,BYTE 11b |
jz .L6 |
.L5 ; tail loop |
mov edx,[esi] |
rol edx,8 |
mov [edi],edx |
add esi,BYTE 4 |
add edi,BYTE 4 |
dec ecx |
jnz .L5 |
.L6 pop ebp |
jmp _x86return |
_ConvertX86p32_32BGRA888: |
; check short |
cmp ecx,BYTE 32 |
ja .L3 |
.L1 ; short loop |
mov edx,[esi] |
bswap edx |
mov [edi],edx |
add esi,BYTE 4 |
add edi,BYTE 4 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; save ebp |
push ebp |
; unroll four times |
mov ebp,ecx |
shr ebp,2 |
; save count |
push ecx |
.L4 mov eax,[esi] |
mov ebx,[esi+4] |
mov ecx,[esi+8] |
mov edx,[esi+12] |
bswap eax |
bswap ebx |
bswap ecx |
bswap edx |
mov [edi+0],eax |
mov [edi+4],ebx |
mov [edi+8],ecx |
mov [edi+12],edx |
add esi,BYTE 16 |
add edi,BYTE 16 |
dec ebp |
jnz .L4 |
; check tail |
pop ecx |
and ecx,BYTE 11b |
jz .L6 |
.L5 ; tail loop |
mov edx,[esi] |
bswap edx |
mov [edi],edx |
add esi,BYTE 4 |
add edi,BYTE 4 |
dec ecx |
jnz .L5 |
.L6 pop ebp |
jmp _x86return |
;; 32 bit RGB 888 to 24 BIT RGB 888 |
_ConvertX86p32_24RGB888: |
; check short |
cmp ecx,BYTE 32 |
ja .L3 |
.L1 ; short loop |
mov al,[esi] |
mov bl,[esi+1] |
mov dl,[esi+2] |
mov [edi],al |
mov [edi+1],bl |
mov [edi+2],dl |
add esi,BYTE 4 |
add edi,BYTE 3 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov edx,edi |
and edx,BYTE 11b |
jz .L4 |
mov al,[esi] |
mov bl,[esi+1] |
mov dl,[esi+2] |
mov [edi],al |
mov [edi+1],bl |
mov [edi+2],dl |
add esi,BYTE 4 |
add edi,BYTE 3 |
dec ecx |
jmp SHORT .L3 |
.L4 ; unroll 4 times |
push ebp |
mov ebp,ecx |
shr ebp,2 |
; save count |
push ecx |
.L5 mov eax,[esi] ; first dword eax = [A][R][G][B] |
mov ebx,[esi+4] ; second dword ebx = [a][r][g][b] |
shl eax,8 ; eax = [R][G][B][.] |
mov ecx,[esi+12] ; third dword ecx = [a][r][g][b] |
shl ebx,8 ; ebx = [r][g][b][.] |
mov al,[esi+4] ; eax = [R][G][B][b] |
ror eax,8 ; eax = [b][R][G][B] (done) |
mov bh,[esi+8+1] ; ebx = [r][g][G][.] |
mov [edi],eax |
add edi,BYTE 3*4 |
shl ecx,8 ; ecx = [r][g][b][.] |
mov bl,[esi+8+0] ; ebx = [r][g][G][B] |
rol ebx,16 ; ebx = [G][B][r][g] (done) |
mov cl,[esi+8+2] ; ecx = [r][g][b][R] (done) |
mov [edi+4-3*4],ebx |
add esi,BYTE 4*4 |
mov [edi+8-3*4],ecx |
dec ebp |
jnz .L5 |
; check tail |
pop ecx |
and ecx,BYTE 11b |
jz .L7 |
.L6 ; tail loop |
mov al,[esi] |
mov bl,[esi+1] |
mov dl,[esi+2] |
mov [edi],al |
mov [edi+1],bl |
mov [edi+2],dl |
add esi,BYTE 4 |
add edi,BYTE 3 |
dec ecx |
jnz .L6 |
.L7 pop ebp |
jmp _x86return |
;; 32 bit RGB 888 to 24 bit BGR 888 |
_ConvertX86p32_24BGR888: |
; check short |
cmp ecx,BYTE 32 |
ja .L3 |
.L1 ; short loop |
mov dl,[esi] |
mov bl,[esi+1] |
mov al,[esi+2] |
mov [edi],al |
mov [edi+1],bl |
mov [edi+2],dl |
add esi,BYTE 4 |
add edi,BYTE 3 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov edx,edi |
and edx,BYTE 11b |
jz .L4 |
mov dl,[esi] |
mov bl,[esi+1] |
mov al,[esi+2] |
mov [edi],al |
mov [edi+1],bl |
mov [edi+2],dl |
add esi,BYTE 4 |
add edi,BYTE 3 |
dec ecx |
jmp SHORT .L3 |
.L4 ; unroll 4 times |
push ebp |
mov ebp,ecx |
shr ebp,2 |
; save count |
push ecx |
.L5 |
mov eax,[esi] ; first dword eax = [A][R][G][B] |
mov ebx,[esi+4] ; second dword ebx = [a][r][g][b] |
bswap eax ; eax = [B][G][R][A] |
bswap ebx ; ebx = [b][g][r][a] |
mov al,[esi+4+2] ; eax = [B][G][R][r] |
mov bh,[esi+4+4+1] ; ebx = [b][g][G][a] |
ror eax,8 ; eax = [r][B][G][R] (done) |
mov bl,[esi+4+4+2] ; ebx = [b][g][G][R] |
ror ebx,16 ; ebx = [G][R][b][g] (done) |
mov [edi],eax |
mov [edi+4],ebx |
mov ecx,[esi+12] ; third dword ecx = [a][r][g][b] |
bswap ecx ; ecx = [b][g][r][a] |
mov cl,[esi+8] ; ecx = [b][g][r][B] (done) |
add esi,BYTE 4*4 |
mov [edi+8],ecx |
add edi,BYTE 3*4 |
dec ebp |
jnz .L5 |
; check tail |
pop ecx |
and ecx,BYTE 11b |
jz .L7 |
.L6 ; tail loop |
mov dl,[esi] |
mov bl,[esi+1] |
mov al,[esi+2] |
mov [edi],al |
mov [edi+1],bl |
mov [edi+2],dl |
add esi,BYTE 4 |
add edi,BYTE 3 |
dec ecx |
jnz .L6 |
.L7 |
pop ebp |
jmp _x86return |
;; 32 bit RGB 888 to 16 BIT RGB 565 |
_ConvertX86p32_16RGB565: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov bl,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov ah,[esi+2] ; red |
shr ah,3 |
and al,11111100b |
shl eax,3 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2: ; End of short loop |
jmp _x86return |
.L3 ; head |
mov ebx,edi |
and ebx,BYTE 11b |
jz .L4 |
mov bl,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov ah,[esi+2] ; red |
shr ah,3 |
and al,11111100b |
shl eax,3 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
.L4: |
; save count |
push ecx |
; unroll twice |
shr ecx,1 |
; point arrays to end |
lea esi,[esi+ecx*8] |
lea edi,[edi+ecx*4] |
; negative counter |
neg ecx |
jmp SHORT .L6 |
.L5: |
mov [edi+ecx*4-4],eax |
.L6: |
mov eax,[esi+ecx*8] |
shr ah,2 |
mov ebx,[esi+ecx*8+4] |
shr eax,3 |
mov edx,[esi+ecx*8+4] |
shr bh,2 |
mov dl,[esi+ecx*8+2] |
shl ebx,13 |
and eax,000007FFh |
shl edx,8 |
and ebx,07FF0000h |
and edx,0F800F800h |
add eax,ebx |
add eax,edx |
inc ecx |
jnz .L5 |
mov [edi+ecx*4-4],eax |
; tail |
pop ecx |
test cl,1 |
jz .L7 |
mov bl,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov ah,[esi+2] ; red |
shr ah,3 |
and al,11111100b |
shl eax,3 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
.L7: |
jmp _x86return |
;; 32 bit RGB 888 to 16 BIT BGR 565 |
_ConvertX86p32_16BGR565: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov ah,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov bl,[esi+2] ; red |
shr ah,3 |
and al,11111100b |
shl eax,3 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov ebx,edi |
and ebx,BYTE 11b |
jz .L4 |
mov ah,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov bl,[esi+2] ; red |
shr ah,3 |
and al,11111100b |
shl eax,3 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
.L4 ; save count |
push ecx |
; unroll twice |
shr ecx,1 |
; point arrays to end |
lea esi,[esi+ecx*8] |
lea edi,[edi+ecx*4] |
; negative count |
neg ecx |
jmp SHORT .L6 |
.L5 |
mov [edi+ecx*4-4],eax |
.L6 |
mov edx,[esi+ecx*8+4] |
mov bh,[esi+ecx*8+4] |
mov ah,[esi+ecx*8] |
shr bh,3 |
mov al,[esi+ecx*8+1] |
shr ah,3 |
mov bl,[esi+ecx*8+5] |
shl eax,3 |
mov dl,[esi+ecx*8+2] |
shl ebx,19 |
and eax,0000FFE0h |
shr edx,3 |
and ebx,0FFE00000h |
and edx,001F001Fh |
add eax,ebx |
add eax,edx |
inc ecx |
jnz .L5 |
mov [edi+ecx*4-4],eax |
; tail |
pop ecx |
and ecx,BYTE 1 |
jz .L7 |
mov ah,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov bl,[esi+2] ; red |
shr ah,3 |
and al,11111100b |
shl eax,3 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
.L7 |
jmp _x86return |
;; 32 BIT RGB TO 16 BIT RGB 555 |
_ConvertX86p32_16RGB555: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov bl,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov ah,[esi+2] ; red |
shr ah,3 |
and al,11111000b |
shl eax,2 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov ebx,edi |
and ebx,BYTE 11b |
jz .L4 |
mov bl,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov ah,[esi+2] ; red |
shr ah,3 |
and al,11111000b |
shl eax,2 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
.L4 ; save count |
push ecx |
; unroll twice |
shr ecx,1 |
; point arrays to end |
lea esi,[esi+ecx*8] |
lea edi,[edi+ecx*4] |
; negative counter |
neg ecx |
jmp SHORT .L6 |
.L5 |
mov [edi+ecx*4-4],eax |
.L6 |
mov eax,[esi+ecx*8] |
shr ah,3 |
mov ebx,[esi+ecx*8+4] |
shr eax,3 |
mov edx,[esi+ecx*8+4] |
shr bh,3 |
mov dl,[esi+ecx*8+2] |
shl ebx,13 |
and eax,000007FFh |
shl edx,7 |
and ebx,07FF0000h |
and edx,07C007C00h |
add eax,ebx |
add eax,edx |
inc ecx |
jnz .L5 |
mov [edi+ecx*4-4],eax |
; tail |
pop ecx |
and ecx,BYTE 1 |
jz .L7 |
mov bl,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov ah,[esi+2] ; red |
shr ah,3 |
and al,11111000b |
shl eax,2 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
.L7 |
jmp _x86return |
;; 32 BIT RGB TO 16 BIT BGR 555 |
_ConvertX86p32_16BGR555: |
; check short |
cmp ecx,BYTE 16 |
ja .L3 |
.L1 ; short loop |
mov ah,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov bl,[esi+2] ; red |
shr ah,3 |
and al,11111000b |
shl eax,2 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
jnz .L1 |
.L2 |
jmp _x86return |
.L3 ; head |
mov ebx,edi |
and ebx,BYTE 11b |
jz .L4 |
mov ah,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov bl,[esi+2] ; red |
shr ah,3 |
and al,11111000b |
shl eax,2 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
dec ecx |
.L4 ; save count |
push ecx |
; unroll twice |
shr ecx,1 |
; point arrays to end |
lea esi,[esi+ecx*8] |
lea edi,[edi+ecx*4] |
; negative counter |
neg ecx |
jmp SHORT .L6 |
.L5 |
mov [edi+ecx*4-4],eax |
.L6 |
mov edx,[esi+ecx*8+4] |
mov bh,[esi+ecx*8+4] |
mov ah,[esi+ecx*8] |
shr bh,3 |
mov al,[esi+ecx*8+1] |
shr ah,3 |
mov bl,[esi+ecx*8+5] |
shl eax,2 |
mov dl,[esi+ecx*8+2] |
shl ebx,18 |
and eax,00007FE0h |
shr edx,3 |
and ebx,07FE00000h |
and edx,001F001Fh |
add eax,ebx |
add eax,edx |
inc ecx |
jnz .L5 |
mov [edi+ecx*4-4],eax |
; tail |
pop ecx |
and ecx,BYTE 1 |
jz .L7 |
mov ah,[esi+0] ; blue |
mov al,[esi+1] ; green |
mov bl,[esi+2] ; red |
shr ah,3 |
and al,11111000b |
shl eax,2 |
shr bl,3 |
add al,bl |
mov [edi+0],al |
mov [edi+1],ah |
add esi,BYTE 4 |
add edi,BYTE 2 |
.L7 |
jmp _x86return |
;; FROM 32 BIT RGB to 8 BIT RGB (rrrgggbbb) |
;; This routine writes FOUR pixels at once (dword) and then, if they exist |
;; the trailing three pixels |
_ConvertX86p32_8RGB332: |
.L_ALIGNED |
push ecx |
shr ecx,2 ; We will draw 4 pixels at once |
jnz .L1 |
jmp .L2 ; short jump out of range :( |
.L1: |
mov eax,[esi] ; first pair of pixels |
mov edx,[esi+4] |
shr dl,6 |
mov ebx,eax |
shr al,6 |
and ah,0e0h |
shr ebx,16 |
and dh,0e0h |
shr ah,3 |
and bl,0e0h |
shr dh,3 |
or al,bl |
mov ebx,edx |
or al,ah |
shr ebx,16 |
or dl,dh |
and bl,0e0h |
or dl,bl |
mov ah,dl |
mov ebx,[esi+8] ; second pair of pixels |
mov edx,ebx |
and bh,0e0h |
shr bl,6 |
and edx,0e00000h |
shr edx,16 |
shr bh,3 |
ror eax,16 |
or bl,dl |
mov edx,[esi+12] |
or bl,bh |
mov al,bl |
mov ebx,edx |
and dh,0e0h |
shr dl,6 |
and ebx,0e00000h |
shr dh,3 |
mov ah,dl |
shr ebx,16 |
or ah,dh |
or ah,bl |
rol eax,16 |
add esi,BYTE 16 |
mov [edi],eax |
add edi,BYTE 4 |
dec ecx |
jz .L2 ; L1 out of range for short jump :( |
jmp .L1 |
.L2: |
pop ecx |
and ecx,BYTE 3 ; mask out number of pixels to draw |
jz .L4 ; Nothing to do anymore |
.L3: |
mov eax,[esi] ; single pixel conversion for trailing pixels |
mov ebx,eax |
shr al,6 |
and ah,0e0h |
shr ebx,16 |
shr ah,3 |
and bl,0e0h |
or al,ah |
or al,bl |
mov [edi],al |
inc edi |
add esi,BYTE 4 |
dec ecx |
jnz .L3 |
.L4: |
jmp _x86return |
/contrib/sdk/sources/SDL-1.2.2/src/joystick/SDL_joystick_c.h |
---|
0,0 → 1,42 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_joystick_c.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* Useful functions and variables from SDL_joystick.c */ |
#include "SDL_joystick.h" |
/* The number of available joysticks on the system */ |
extern Uint8 SDL_numjoysticks; |
/* Internal event queueing functions */ |
extern int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, |
Uint8 axis, Sint16 value); |
extern int SDL_PrivateJoystickBall(SDL_Joystick *joystick, |
Uint8 ball, Sint16 xrel, Sint16 yrel); |
extern int SDL_PrivateJoystickHat(SDL_Joystick *joystick, |
Uint8 hat, Uint8 value); |
extern int SDL_PrivateJoystickButton(SDL_Joystick *joystick, |
Uint8 button, Uint8 state); |
/contrib/sdk/sources/SDL-1.2.2/src/joystick/SDL_sysjoystick.h |
---|
0,0 → 1,86 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_sysjoystick.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* This is the system specific header for the SDL joystick API */ |
#include "SDL_joystick.h" |
/* The SDL joystick structure */ |
struct _SDL_Joystick { |
Uint8 index; /* Device index */ |
const char *name; /* Joystick name - system dependent */ |
int naxes; /* Number of axis controls on the joystick */ |
Sint16 *axes; /* Current axis states */ |
int nhats; /* Number of hats on the joystick */ |
Uint8 *hats; /* Current hat states */ |
int nballs; /* Number of trackballs on the joystick */ |
struct balldelta { |
int dx; |
int dy; |
} *balls; /* Current ball motion deltas */ |
int nbuttons; /* Number of buttons on the joystick */ |
Uint8 *buttons; /* Current button states */ |
struct joystick_hwdata *hwdata; /* Driver dependent information */ |
int ref_count; /* Reference count for multiple opens */ |
}; |
/* Function to scan the system for joysticks. |
* Joystick 0 should be the system default joystick. |
* This function should return the number of available joysticks, or -1 |
* on an unrecoverable fatal error. |
*/ |
extern int SDL_SYS_JoystickInit(void); |
/* Function to get the device-dependent name of a joystick */ |
extern const char *SDL_SYS_JoystickName(int index); |
/* Function to open a joystick for use. |
The joystick to open is specified by the index field of the joystick. |
This should fill the nbuttons and naxes fields of the joystick structure. |
It returns 0, or -1 if there is an error. |
*/ |
extern int SDL_SYS_JoystickOpen(SDL_Joystick *joystick); |
/* Function to update the state of a joystick - called as a device poll. |
* This function shouldn't update the joystick structure directly, |
* but instead should call SDL_PrivateJoystick*() to deliver events |
* and update joystick device state. |
*/ |
extern void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick); |
/* Function to close a joystick after use */ |
extern void SDL_SYS_JoystickClose(SDL_Joystick *joystick); |
/* Function to perform any system-specific joystick related cleanup */ |
extern void SDL_SYS_JoystickQuit(void); |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_syscond.c |
---|
0,0 → 1,222 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_syscond.c |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* An implementation of condition variables using semaphores and mutexes */ |
/* |
This implementation borrows heavily from the BeOS condition variable |
implementation, written by Christopher Tate and Owen Smith. Thanks! |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include "SDL_error.h" |
#include "SDL_thread.h" |
struct SDL_cond |
{ |
SDL_mutex *lock; |
int waiting; |
int signals; |
SDL_sem *wait_sem; |
SDL_sem *wait_done; |
}; |
/* Create a condition variable */ |
SDL_cond * SDL_CreateCond(void) |
{ |
SDL_cond *cond; |
cond = (SDL_cond *) malloc(sizeof(SDL_cond)); |
if ( cond ) { |
cond->lock = SDL_CreateMutex(); |
cond->wait_sem = SDL_CreateSemaphore(0); |
cond->wait_done = SDL_CreateSemaphore(0); |
cond->waiting = cond->signals = 0; |
if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) { |
SDL_DestroyCond(cond); |
cond = NULL; |
} |
} else { |
SDL_OutOfMemory(); |
} |
return(cond); |
} |
/* Destroy a condition variable */ |
void SDL_DestroyCond(SDL_cond *cond) |
{ |
if ( cond ) { |
if ( cond->wait_sem ) { |
SDL_DestroySemaphore(cond->wait_sem); |
} |
if ( cond->wait_done ) { |
SDL_DestroySemaphore(cond->wait_done); |
} |
if ( cond->lock ) { |
SDL_DestroyMutex(cond->lock); |
} |
free(cond); |
} |
} |
/* Restart one of the threads that are waiting on the condition variable */ |
int SDL_CondSignal(SDL_cond *cond) |
{ |
if ( ! cond ) { |
SDL_SetError("Passed a NULL condition variable"); |
return -1; |
} |
/* If there are waiting threads not already signalled, then |
signal the condition and wait for the thread to respond. |
*/ |
SDL_LockMutex(cond->lock); |
if ( cond->waiting > cond->signals ) { |
++cond->signals; |
SDL_SemPost(cond->wait_sem); |
SDL_UnlockMutex(cond->lock); |
SDL_SemWait(cond->wait_done); |
} else { |
SDL_UnlockMutex(cond->lock); |
} |
return 0; |
} |
/* Restart all threads that are waiting on the condition variable */ |
int SDL_CondBroadcast(SDL_cond *cond) |
{ |
if ( ! cond ) { |
SDL_SetError("Passed a NULL condition variable"); |
return -1; |
} |
/* If there are waiting threads not already signalled, then |
signal the condition and wait for the thread to respond. |
*/ |
SDL_LockMutex(cond->lock); |
if ( cond->waiting > cond->signals ) { |
int i, num_waiting; |
num_waiting = (cond->waiting - cond->signals); |
cond->signals = cond->waiting; |
for ( i=0; i<num_waiting; ++i ) { |
SDL_SemPost(cond->wait_sem); |
} |
/* Now all released threads are blocked here, waiting for us. |
Collect them all (and win fabulous prizes!) :-) |
*/ |
SDL_UnlockMutex(cond->lock); |
for ( i=0; i<num_waiting; ++i ) { |
SDL_SemWait(cond->wait_done); |
} |
} else { |
SDL_UnlockMutex(cond->lock); |
} |
return 0; |
} |
/* Wait on the condition variable for at most 'ms' milliseconds. |
The mutex must be locked before entering this function! |
The mutex is unlocked during the wait, and locked again after the wait. |
Typical use: |
Thread A: |
SDL_LockMutex(lock); |
while ( ! condition ) { |
SDL_CondWait(cond); |
} |
SDL_UnlockMutex(lock); |
Thread B: |
SDL_LockMutex(lock); |
... |
condition = true; |
... |
SDL_UnlockMutex(lock); |
*/ |
int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) |
{ |
int retval; |
if ( ! cond ) { |
SDL_SetError("Passed a NULL condition variable"); |
return -1; |
} |
/* Obtain the protection mutex, and increment the number of waiters. |
This allows the signal mechanism to only perform a signal if there |
are waiting threads. |
*/ |
SDL_LockMutex(cond->lock); |
++cond->waiting; |
SDL_UnlockMutex(cond->lock); |
/* Unlock the mutex, as is required by condition variable semantics */ |
SDL_UnlockMutex(mutex); |
/* Wait for a signal */ |
if ( ms == SDL_MUTEX_MAXWAIT ) { |
retval = SDL_SemWait(cond->wait_sem); |
} else { |
retval = SDL_SemWaitTimeout(cond->wait_sem, ms); |
} |
/* Let the signaler know we have completed the wait, otherwise |
the signaler can race ahead and get the condition semaphore |
if we are stopped between the mutex unlock and semaphore wait, |
giving a deadlock. See the following URL for details: |
http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html |
*/ |
SDL_LockMutex(cond->lock); |
if ( cond->signals > 0 ) { |
/* If we timed out, we need to eat a condition signal */ |
if ( retval > 0 ) { |
SDL_SemWait(cond->wait_sem); |
} |
/* We always notify the signal thread that we are done */ |
SDL_SemPost(cond->wait_done); |
/* Signal handshake complete */ |
--cond->signals; |
} |
--cond->waiting; |
SDL_UnlockMutex(cond->lock); |
/* Lock the mutex, as is required by condition variable semantics */ |
SDL_LockMutex(mutex); |
return retval; |
} |
/* Wait on the condition variable forever */ |
int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) |
{ |
return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_syscond_c.h |
---|
0,0 → 1,25 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_syscond_c.h |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_sysmutex.c |
---|
0,0 → 1,136 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_sysmutex.c |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* An implementation of mutexes using semaphores */ |
#include <stdio.h> |
#include <stdlib.h> |
#include "SDL_error.h" |
#include "SDL_thread.h" |
#include "SDL_systhread_c.h" |
struct SDL_mutex { |
int recursive; |
Uint32 owner; |
SDL_sem *sem; |
}; |
/* Create a mutex */ |
SDL_mutex *SDL_CreateMutex(void) |
{ |
SDL_mutex *mutex; |
/* Allocate mutex memory */ |
mutex = (SDL_mutex *)malloc(sizeof(*mutex)); |
if ( mutex ) { |
/* Create the mutex semaphore, with initial value 1 */ |
mutex->sem = SDL_CreateSemaphore(1); |
mutex->recursive = 0; |
mutex->owner = 0; |
if ( ! mutex->sem ) { |
free(mutex); |
mutex = NULL; |
} |
} else { |
SDL_OutOfMemory(); |
} |
return mutex; |
} |
/* Free the mutex */ |
void SDL_DestroyMutex(SDL_mutex *mutex) |
{ |
if ( mutex ) { |
if ( mutex->sem ) { |
SDL_DestroySemaphore(mutex->sem); |
} |
free(mutex); |
} |
} |
/* Lock the semaphore */ |
int SDL_mutexP(SDL_mutex *mutex) |
{ |
#ifdef DISABLE_THREADS |
return 0; |
#else |
Uint32 this_thread; |
if ( mutex == NULL ) { |
SDL_SetError("Passed a NULL mutex"); |
return -1; |
} |
this_thread = SDL_ThreadID(); |
if ( mutex->owner == this_thread ) { |
++mutex->recursive; |
} else { |
/* The order of operations is important. |
We set the locking thread id after we obtain the lock |
so unlocks from other threads will fail. |
*/ |
SDL_SemWait(mutex->sem); |
mutex->owner = this_thread; |
mutex->recursive = 0; |
} |
return 0; |
#endif /* DISABLE_THREADS */ |
} |
/* Unlock the mutex */ |
int SDL_mutexV(SDL_mutex *mutex) |
{ |
#ifdef DISABLE_THREADS |
return 0; |
#else |
if ( mutex == NULL ) { |
SDL_SetError("Passed a NULL mutex"); |
return -1; |
} |
/* If we don't own the mutex, we can't unlock it */ |
if ( SDL_ThreadID() != mutex->owner ) { |
SDL_SetError("mutex not owned by this thread"); |
return -1; |
} |
if ( mutex->recursive ) { |
--mutex->recursive; |
} else { |
/* The order of operations is important. |
First reset the owner so another thread doesn't lock |
the mutex and set the ownership before we reset it, |
then release the lock semaphore. |
*/ |
mutex->owner = 0; |
SDL_SemPost(mutex->sem); |
} |
return 0; |
#endif /* DISABLE_THREADS */ |
} |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_sysmutex_c.h |
---|
0,0 → 1,25 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_sysmutex_c.h |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_syssem.c |
---|
0,0 → 1,213 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_syssem.c |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* An implementation of semaphores using mutexes and condition variables */ |
#include <stdlib.h> |
#include "SDL_error.h" |
#include "SDL_timer.h" |
#include "SDL_thread.h" |
#include "SDL_systhread_c.h" |
#ifdef DISABLE_THREADS |
SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) |
{ |
SDL_SetError("SDL not configured with thread support"); |
return (SDL_sem *)0; |
} |
void SDL_DestroySemaphore(SDL_sem *sem) |
{ |
return; |
} |
int SDL_SemTryWait(SDL_sem *sem) |
{ |
SDL_SetError("SDL not configured with thread support"); |
return -1; |
} |
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) |
{ |
SDL_SetError("SDL not configured with thread support"); |
return -1; |
} |
int SDL_SemWait(SDL_sem *sem) |
{ |
SDL_SetError("SDL not configured with thread support"); |
return -1; |
} |
Uint32 SDL_SemValue(SDL_sem *sem) |
{ |
return 0; |
} |
int SDL_SemPost(SDL_sem *sem) |
{ |
SDL_SetError("SDL not configured with thread support"); |
return -1; |
} |
#else |
struct SDL_semaphore |
{ |
Uint32 count; |
Uint32 waiters_count; |
SDL_mutex *count_lock; |
SDL_cond *count_nonzero; |
}; |
SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) |
{ |
SDL_sem *sem; |
sem = (SDL_sem *)malloc(sizeof(*sem)); |
if ( ! sem ) { |
SDL_OutOfMemory(); |
return(0); |
} |
sem->count = initial_value; |
sem->waiters_count = 0; |
sem->count_lock = SDL_CreateMutex(); |
sem->count_nonzero = SDL_CreateCond(); |
if ( ! sem->count_lock || ! sem->count_nonzero ) { |
SDL_DestroySemaphore(sem); |
return(0); |
} |
return(sem); |
} |
/* WARNING: |
You cannot call this function when another thread is using the semaphore. |
*/ |
void SDL_DestroySemaphore(SDL_sem *sem) |
{ |
if ( sem ) { |
sem->count = 0xFFFFFFFF; |
while ( sem->waiters_count > 0) { |
SDL_CondSignal(sem->count_nonzero); |
SDL_Delay(10); |
} |
SDL_DestroyCond(sem->count_nonzero); |
SDL_mutexP(sem->count_lock); |
SDL_mutexV(sem->count_lock); |
SDL_DestroyMutex(sem->count_lock); |
free(sem); |
} |
} |
int SDL_SemTryWait(SDL_sem *sem) |
{ |
int retval; |
if ( ! sem ) { |
SDL_SetError("Passed a NULL semaphore"); |
return -1; |
} |
retval = SDL_MUTEX_TIMEDOUT; |
SDL_LockMutex(sem->count_lock); |
if ( sem->count > 0 ) { |
--sem->count; |
retval = 0; |
} |
SDL_UnlockMutex(sem->count_lock); |
return retval; |
} |
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) |
{ |
int retval; |
if ( ! sem ) { |
SDL_SetError("Passed a NULL semaphore"); |
return -1; |
} |
/* A timeout of 0 is an easy case */ |
if ( timeout == 0 ) { |
return SDL_SemTryWait(sem); |
} |
SDL_LockMutex(sem->count_lock); |
++sem->waiters_count; |
retval = 0; |
while ( (sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT) ) { |
retval = SDL_CondWaitTimeout(sem->count_nonzero, |
sem->count_lock, timeout); |
} |
--sem->waiters_count; |
--sem->count; |
SDL_UnlockMutex(sem->count_lock); |
return retval; |
} |
int SDL_SemWait(SDL_sem *sem) |
{ |
return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); |
} |
Uint32 SDL_SemValue(SDL_sem *sem) |
{ |
Uint32 value; |
value = 0; |
if ( sem ) { |
SDL_LockMutex(sem->count_lock); |
value = sem->count; |
SDL_UnlockMutex(sem->count_lock); |
} |
return value; |
} |
int SDL_SemPost(SDL_sem *sem) |
{ |
if ( ! sem ) { |
SDL_SetError("Passed a NULL semaphore"); |
return -1; |
} |
SDL_LockMutex(sem->count_lock); |
if ( sem->waiters_count > 0 ) { |
SDL_CondSignal(sem->count_nonzero); |
} |
++sem->count; |
SDL_UnlockMutex(sem->count_lock); |
return 0; |
} |
#endif /* DISABLE_THREADS */ |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_syssem_c.h |
---|
0,0 → 1,25 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_syssem_c.h |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_systhread.c |
---|
0,0 → 1,58 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_systhread.c |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Thread management routines for SDL */ |
#include "SDL_error.h" |
#include "SDL_thread.h" |
#include "SDL_systhread.h" |
int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) |
{ |
SDL_SetError("Threads are not supported on this platform"); |
return(-1); |
} |
void SDL_SYS_SetupThread(void) |
{ |
return; |
} |
Uint32 SDL_ThreadID(void) |
{ |
return(0); |
} |
void SDL_SYS_WaitThread(SDL_Thread *thread) |
{ |
return; |
} |
void SDL_SYS_KillThread(SDL_Thread *thread) |
{ |
return; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_systhread.h |
---|
0,0 → 1,48 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_systhread.h,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
#endif |
/* These are functions that need to be implemented by a port of SDL */ |
#include "SDL_thread_c.h" |
/* This function creates a thread, passing args to SDL_RunThread(), |
saves a system-dependent thread id in thread->id, and returns 0 |
on success. |
*/ |
extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args); |
/* This function does any necessary setup in the child thread */ |
extern void SDL_SYS_SetupThread(void); |
/* This function waits for the thread to finish and frees any data |
allocated by SDL_SYS_CreateThread() |
*/ |
extern void SDL_SYS_WaitThread(SDL_Thread *thread); |
/* This function kills the thread and returns */ |
extern void SDL_SYS_KillThread(SDL_Thread *thread); |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_systhread_c.h |
---|
0,0 → 1,29 |
/* WARNING: This file was automatically generated! |
* Original: ./src/thread/generic/SDL_systhread_c.h |
*/ |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Stub until we implement threads on this platform */ |
typedef int SYS_ThreadHandle; |
#define DISABLE_THREADS |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_thread.c |
---|
0,0 → 1,296 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* System independent thread management routines for SDL */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_mutex.h" |
#include "SDL_thread.h" |
#include "SDL_thread_c.h" |
#include "SDL_systhread.h" |
#define ARRAY_CHUNKSIZE 32 |
/* The array of threads currently active in the application |
(except the main thread) |
The manipulation of an array here is safer than using a linked list. |
*/ |
static int SDL_maxthreads = 0; |
static int SDL_numthreads = 0; |
static SDL_Thread **SDL_Threads = NULL; |
static SDL_mutex *thread_lock = NULL; |
int _creating_thread_lock = 0; |
int SDL_ThreadsInit(void) |
{ |
int retval; |
retval = 0; |
/* Set the thread lock creation flag so that we can reuse an |
existing lock on the system - since this mutex never gets |
destroyed (see SDL_ThreadsQuit()), we want to reuse it. |
*/ |
_creating_thread_lock = 1; |
thread_lock = SDL_CreateMutex(); |
_creating_thread_lock = 0; |
if ( thread_lock == NULL ) { |
retval = -1; |
} |
return(retval); |
} |
/* This should never be called... |
If this is called by SDL_Quit(), we don't know whether or not we should |
clean up threads here. If any threads are still running after this call, |
they will no longer have access to any per-thread data. |
*/ |
void SDL_ThreadsQuit() |
{ |
SDL_mutex *mutex; |
mutex = thread_lock; |
thread_lock = NULL; |
if ( mutex != NULL ) { |
SDL_DestroyMutex(mutex); |
} |
} |
/* Routines for manipulating the thread list */ |
static void SDL_AddThread(SDL_Thread *thread) |
{ |
SDL_Thread **threads; |
/* WARNING: |
If the very first threads are created simultaneously, then |
there could be a race condition causing memory corruption. |
In practice, this isn't a problem because by definition there |
is only one thread running the first time this is called. |
*/ |
if ( thread_lock == NULL ) { |
if ( SDL_ThreadsInit() < 0 ) { |
return; |
} |
} |
SDL_mutexP(thread_lock); |
/* Expand the list of threads, if necessary */ |
#ifdef DEBUG_THREADS |
printf("Adding thread (%d already - %d max)\n", |
SDL_numthreads, SDL_maxthreads); |
#endif |
if ( SDL_numthreads == SDL_maxthreads ) { |
threads=(SDL_Thread **)malloc((SDL_maxthreads+ARRAY_CHUNKSIZE)* |
(sizeof *threads)); |
if ( threads == NULL ) { |
SDL_OutOfMemory(); |
goto done; |
} |
memcpy(threads, SDL_Threads, SDL_numthreads*(sizeof *threads)); |
SDL_maxthreads += ARRAY_CHUNKSIZE; |
if ( SDL_Threads ) { |
free(SDL_Threads); |
} |
SDL_Threads = threads; |
} |
SDL_Threads[SDL_numthreads++] = thread; |
done: |
SDL_mutexV(thread_lock); |
} |
static void SDL_DelThread(SDL_Thread *thread) |
{ |
int i; |
if ( thread_lock ) { |
SDL_mutexP(thread_lock); |
for ( i=0; i<SDL_numthreads; ++i ) { |
if ( thread == SDL_Threads[i] ) { |
break; |
} |
} |
if ( i < SDL_numthreads ) { |
--SDL_numthreads; |
while ( i < SDL_numthreads ) { |
SDL_Threads[i] = SDL_Threads[i+1]; |
++i; |
} |
#ifdef DEBUG_THREADS |
printf("Deleting thread (%d left - %d max)\n", |
SDL_numthreads, SDL_maxthreads); |
#endif |
} |
SDL_mutexV(thread_lock); |
} |
} |
/* The default (non-thread-safe) global error variable */ |
static SDL_error SDL_global_error; |
/* Routine to get the thread-specific error variable */ |
SDL_error *SDL_GetErrBuf(void) |
{ |
SDL_error *errbuf; |
errbuf = &SDL_global_error; |
if ( SDL_Threads ) { |
int i; |
Uint32 this_thread; |
this_thread = SDL_ThreadID(); |
SDL_mutexP(thread_lock); |
for ( i=0; i<SDL_numthreads; ++i ) { |
if ( this_thread == SDL_Threads[i]->threadid ) { |
errbuf = &SDL_Threads[i]->errbuf; |
break; |
} |
} |
SDL_mutexV(thread_lock); |
} |
return(errbuf); |
} |
/* Arguments and callback to setup and run the user thread function */ |
typedef struct { |
int (*func)(void *); |
void *data; |
SDL_Thread *info; |
SDL_sem *wait; |
} thread_args; |
void SDL_RunThread(void *data) |
{ |
thread_args *args; |
int (*userfunc)(void *); |
void *userdata; |
int *statusloc; |
/* Perform any system-dependent setup |
- this function cannot fail, and cannot use SDL_SetError() |
*/ |
SDL_SYS_SetupThread(); |
/* Get the thread id */ |
args = (thread_args *)data; |
args->info->threadid = SDL_ThreadID(); |
/* Figure out what function to run */ |
userfunc = args->func; |
userdata = args->data; |
statusloc = &args->info->status; |
/* Wake up the parent thread */ |
SDL_SemPost(args->wait); |
/* Run the function */ |
*statusloc = userfunc(userdata); |
} |
SDL_Thread *SDL_CreateThread(int (*fn)(void *), void *data) |
{ |
SDL_Thread *thread; |
thread_args *args; |
int ret; |
/* Allocate memory for the thread info structure */ |
thread = (SDL_Thread *)malloc(sizeof(*thread)); |
if ( thread == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
memset(thread, 0, (sizeof *thread)); |
thread->status = -1; |
/* Set up the arguments for the thread */ |
args = (thread_args *)malloc(sizeof(*args)); |
if ( args == NULL ) { |
SDL_OutOfMemory(); |
free(thread); |
return(NULL); |
} |
args->func = fn; |
args->data = data; |
args->info = thread; |
args->wait = SDL_CreateSemaphore(0); |
if ( args->wait == NULL ) { |
free(thread); |
free(args); |
return(NULL); |
} |
/* Add the thread to the list of available threads */ |
SDL_AddThread(thread); |
/* Create the thread and go! */ |
ret = SDL_SYS_CreateThread(thread, args); |
if ( ret >= 0 ) { |
/* Wait for the thread function to use arguments */ |
SDL_SemWait(args->wait); |
} else { |
/* Oops, failed. Gotta free everything */ |
SDL_DelThread(thread); |
free(thread); |
thread = NULL; |
} |
SDL_DestroySemaphore(args->wait); |
free(args); |
/* Everything is running now */ |
return(thread); |
} |
void SDL_WaitThread(SDL_Thread *thread, int *status) |
{ |
if ( thread ) { |
SDL_SYS_WaitThread(thread); |
if ( status ) { |
*status = thread->status; |
} |
SDL_DelThread(thread); |
free(thread); |
} |
} |
Uint32 SDL_GetThreadID(SDL_Thread *thread) |
{ |
Uint32 id; |
if ( thread ) { |
id = thread->threadid; |
} else { |
id = SDL_ThreadID(); |
} |
return(id); |
} |
void SDL_KillThread(SDL_Thread *thread) |
{ |
if ( thread ) { |
SDL_SYS_KillThread(thread); |
SDL_WaitThread(thread, NULL); |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/thread/SDL_thread_c.h |
---|
0,0 → 1,44 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifndef _SDL_thread_c_h |
#define _SDL_thread_c_h |
#include "SDL_error_c.h" |
#include "SDL_systhread_c.h" |
/* This is the system-independent thread info structure */ |
struct SDL_Thread { |
Uint32 threadid; |
SYS_ThreadHandle handle; |
int status; |
SDL_error errbuf; |
void *data; |
}; |
/* This is the function called to run a thread */ |
extern void SDL_RunThread(void *data); |
/* Routine to get the thread-specific error variable */ |
extern SDL_error *SDL_GetErrBuf(void); |
#endif /* _SDL_thread_c_h */ |
/contrib/sdk/sources/SDL-1.2.2/src/timer/SDL_systimer.h |
---|
0,0 → 1,46 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_systimer.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* The system dependent timer handling functions */ |
#include "SDL_timer.h" |
#include "SDL_timer_c.h" |
/* Initialize the system dependent timer subsystem */ |
extern int SDL_SYS_TimerInit(void); |
/* Quit the system dependent timer subsystem */ |
extern void SDL_SYS_TimerQuit(void); |
/* Start a timer set up by SDL_SetTimer() */ |
extern int SDL_SYS_StartTimer(void); |
/* Stop a previously started timer */ |
extern void SDL_SYS_StopTimer(void); |
/contrib/sdk/sources/SDL-1.2.2/src/timer/SDL_timer.c |
---|
0,0 → 1,281 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
#include <stdlib.h> |
#include <stdio.h> /* For the definition of NULL */ |
#include "SDL_error.h" |
#include "SDL_timer.h" |
#include "SDL_timer_c.h" |
#include "SDL_mutex.h" |
#include "SDL_systimer.h" |
/* #define DEBUG_TIMERS */ |
int SDL_timer_started = 0; |
int SDL_timer_running = 0; |
/* Data to handle a single periodic alarm */ |
Uint32 SDL_alarm_interval = 0; |
SDL_TimerCallback SDL_alarm_callback; |
static SDL_bool list_changed = SDL_FALSE; |
/* Data used for a thread-based timer */ |
static int SDL_timer_threaded = 0; |
struct _SDL_TimerID { |
Uint32 interval; |
SDL_NewTimerCallback cb; |
void *param; |
Uint32 last_alarm; |
struct _SDL_TimerID *next; |
}; |
static SDL_TimerID SDL_timers = NULL; |
static Uint32 num_timers = 0; |
static SDL_mutex *SDL_timer_mutex; |
/* Set whether or not the timer should use a thread. |
This should not be called while the timer subsystem is running. |
*/ |
int SDL_SetTimerThreaded(int value) |
{ |
int retval; |
if ( SDL_timer_started ) { |
SDL_SetError("Timer already initialized"); |
retval = -1; |
} else { |
retval = 0; |
SDL_timer_threaded = value; |
} |
return retval; |
} |
int SDL_TimerInit(void) |
{ |
int retval; |
SDL_timer_running = 0; |
SDL_SetTimer(0, NULL); |
retval = 0; |
if ( ! SDL_timer_threaded ) { |
retval = SDL_SYS_TimerInit(); |
} |
if ( SDL_timer_threaded ) { |
SDL_timer_mutex = SDL_CreateMutex(); |
} |
SDL_timer_started = 1; |
return(retval); |
} |
void SDL_TimerQuit(void) |
{ |
SDL_SetTimer(0, NULL); |
if ( SDL_timer_threaded < 2 ) { |
SDL_SYS_TimerQuit(); |
} |
if ( SDL_timer_threaded ) { |
SDL_DestroyMutex(SDL_timer_mutex); |
} |
SDL_timer_started = 0; |
SDL_timer_threaded = 0; |
} |
void SDL_ThreadedTimerCheck(void) |
{ |
Uint32 now, ms; |
SDL_TimerID t, prev, next; |
int removed; |
now = SDL_GetTicks(); |
SDL_mutexP(SDL_timer_mutex); |
for ( prev = NULL, t = SDL_timers; t; t = next ) { |
removed = 0; |
ms = t->interval - SDL_TIMESLICE; |
next = t->next; |
if ( (t->last_alarm < now) && ((now - t->last_alarm) > ms) ) { |
if ( (now - t->last_alarm) < t->interval ) { |
t->last_alarm += t->interval; |
} else { |
t->last_alarm = now; |
} |
list_changed = SDL_FALSE; |
#ifdef DEBUG_TIMERS |
printf("Executing timer %p (thread = %d)\n", |
t, SDL_ThreadID()); |
#endif |
SDL_mutexV(SDL_timer_mutex); |
ms = t->cb(t->interval, t->param); |
SDL_mutexP(SDL_timer_mutex); |
if ( list_changed ) { |
/* Abort, list of timers has been modified */ |
break; |
} |
if ( ms != t->interval ) { |
if ( ms ) { |
t->interval = ROUND_RESOLUTION(ms); |
} else { /* Remove the timer from the linked list */ |
#ifdef DEBUG_TIMERS |
printf("SDL: Removing timer %p\n", t); |
#endif |
if ( prev ) { |
prev->next = next; |
} else { |
SDL_timers = next; |
} |
free(t); |
-- num_timers; |
removed = 1; |
} |
} |
} |
/* Don't update prev if the timer has disappeared */ |
if ( ! removed ) { |
prev = t; |
} |
} |
SDL_mutexV(SDL_timer_mutex); |
} |
SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param) |
{ |
SDL_TimerID t; |
if ( ! SDL_timer_mutex ) { |
if ( SDL_timer_started ) { |
SDL_SetError("This platform doesn't support multiple timers"); |
} else { |
SDL_SetError("You must call SDL_Init(SDL_INIT_TIMER) first"); |
} |
return NULL; |
} |
if ( ! SDL_timer_threaded ) { |
SDL_SetError("Multiple timers require threaded events!"); |
return NULL; |
} |
SDL_mutexP(SDL_timer_mutex); |
t = (SDL_TimerID) malloc(sizeof(struct _SDL_TimerID)); |
if ( t ) { |
t->interval = ROUND_RESOLUTION(interval); |
t->cb = callback; |
t->param = param; |
t->last_alarm = SDL_GetTicks(); |
t->next = SDL_timers; |
SDL_timers = t; |
++ num_timers; |
list_changed = SDL_TRUE; |
SDL_timer_running = 1; |
} |
#ifdef DEBUG_TIMERS |
printf("SDL_AddTimer(%d) = %08x num_timers = %d\n", interval, (Uint32)t, num_timers); |
#endif |
SDL_mutexV(SDL_timer_mutex); |
return t; |
} |
SDL_bool SDL_RemoveTimer(SDL_TimerID id) |
{ |
SDL_TimerID t, prev = NULL; |
SDL_bool removed; |
removed = SDL_FALSE; |
SDL_mutexP(SDL_timer_mutex); |
/* Look for id in the linked list of timers */ |
for (t = SDL_timers; t; prev=t, t = t->next ) { |
if ( t == id ) { |
if(prev) { |
prev->next = t->next; |
} else { |
SDL_timers = t->next; |
} |
free(t); |
-- num_timers; |
removed = SDL_TRUE; |
list_changed = SDL_TRUE; |
break; |
} |
} |
#ifdef DEBUG_TIMERS |
printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %d\n", (Uint32)id, removed, num_timers, SDL_ThreadID()); |
#endif |
SDL_mutexV(SDL_timer_mutex); |
return removed; |
} |
static void SDL_RemoveAllTimers(SDL_TimerID t) |
{ |
SDL_TimerID freeme; |
/* Changed to non-recursive implementation. |
The recursive implementation is elegant, but subject to |
stack overflow if there are lots and lots of timers. |
*/ |
while ( t ) { |
freeme = t; |
t = t->next; |
free(freeme); |
} |
} |
/* Old style callback functions are wrapped through this */ |
static Uint32 callback_wrapper(Uint32 ms, void *param) |
{ |
SDL_TimerCallback func = (SDL_TimerCallback) param; |
return (*func)(ms); |
} |
int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback) |
{ |
int retval; |
#ifdef DEBUG_TIMERS |
printf("SDL_SetTimer(%d)\n", ms); |
#endif |
retval = 0; |
if ( SDL_timer_running ) { /* Stop any currently running timer */ |
SDL_timer_running = 0; |
if ( SDL_timer_threaded ) { |
SDL_mutexP(SDL_timer_mutex); |
SDL_RemoveAllTimers(SDL_timers); |
SDL_timers = NULL; |
SDL_mutexV(SDL_timer_mutex); |
} else { |
SDL_SYS_StopTimer(); |
} |
} |
if ( ms ) { |
if ( SDL_timer_threaded ) { |
retval = (SDL_AddTimer(ms, callback_wrapper, |
(void *)callback) != NULL); |
} else { |
SDL_timer_running = 1; |
SDL_alarm_interval = ms; |
SDL_alarm_callback = callback; |
retval = SDL_SYS_StartTimer(); |
} |
} |
return retval; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/timer/SDL_timer_c.h |
---|
0,0 → 1,52 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
5635-34 Springhouse Dr. |
Pleasanton, CA 94588 (USA) |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_timer_c.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Useful functions and variables from SDL_timer.c */ |
#include "SDL_timer.h" |
#define ROUND_RESOLUTION(X) \ |
(((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) |
extern int SDL_timer_started; |
extern int SDL_timer_running; |
/* Data to handle a single periodic alarm */ |
extern Uint32 SDL_alarm_interval; |
extern SDL_TimerCallback SDL_alarm_callback; |
/* Set whether or not the timer should use a thread. |
This should be called while the timer subsystem is running. |
*/ |
extern int SDL_SetTimerThreaded(int value); |
extern int SDL_TimerInit(void); |
extern void SDL_TimerQuit(void); |
/* This function is called from the SDL event thread if it is available */ |
extern void SDL_ThreadedTimerCheck(void); |
/contrib/sdk/sources/SDL-1.2.2/src/timer/dummy/SDL_systimer.c |
---|
0,0 → 1,114 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_systimer.c,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
#include <stdio.h> |
#include <sys/time.h> |
#include <signal.h> |
#include <unistd.h> |
#include <string.h> |
#include <errno.h> |
#include "SDL_error.h" |
#include "SDL_timer.h" |
#include "SDL_timer_c.h" |
#if _POSIX_THREAD_SYSCALL_SOFT |
#include <pthread.h> |
#endif |
#if defined(DISABLE_THREADS) || defined(FORK_HACK) |
#define USE_ITIMER |
#endif |
/* The first ticks value of the application */ |
//static struct timeval start; |
//static unsigned startlo,starthi; |
//static unsigned clockrate; |
static unsigned starttime; |
void SDL_StartTicks(void) |
{ |
// gettimeofday(&start, NULL); |
// __asm__ ("int $0x40" : "=a"(clockrate) : "a"(18),"b"(5)); |
// __asm__ ("rdtsc" : "=a"(startlo),"=d"(starthi)); |
__asm__ ("int $0x40" : "=a"(starttime) : "a"(26),"b"(9)); |
} |
Uint32 SDL_GetTicks (void) |
{ |
/* struct timeval now; |
Uint32 ticks; |
gettimeofday(&now, NULL); |
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000; |
return(ticks);*/ |
/*int res; |
__asm__ ("rdtsc\n\t" |
"sub (_startlo),%%eax\n\t" |
"sbb (_starthi),%%edx\n\t" |
"push %%eax\n\t" |
"mov %%edx,%%eax\n\t" |
"mov $1000,%%ecx\n\t" |
"mul %%ecx\n\t" |
"xchg (%%esp),%%eax\n\t" |
"mul %%ecx\n\t" |
"add %%edx,(%%esp)\n\t" |
"pop %%edx\n\t" |
"divl (_clockrate)\n\t" : "=a"(res)); |
return res;*/ |
unsigned curtime; |
__asm__ ("int $0x40" : "=a"(curtime) : "a"(26),"b"(9)); |
return (curtime-starttime)*10; |
} |
void SDL_Delay (Uint32 ms) |
{ |
__menuet__delay100(ms); |
/* Uint32 start = SDL_GetTicks(); |
do |
__asm__("int $0x40" :: "a"(68),"b"(1)); |
while (SDL_GetTicks()-start < ms);*/ |
} |
int SDL_SYS_TimerInit(void) |
{ |
return(0); |
} |
void SDL_SYS_TimerQuit(void) |
{ |
} |
int SDL_SYS_StartTimer(void) |
{ |
return(0); |
} |
void SDL_SYS_StopTimer(void) |
{ |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_RLEaccel.c |
---|
0,0 → 1,1552 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* |
* RLE encoding for software colorkey and alpha-channel acceleration |
* |
* Original version by Sam Lantinga |
* |
* Mattias Engdegård (Yorick): Rewrite. New encoding format, encoder and |
* decoder. Added per-surface alpha blitter. Added per-pixel alpha |
* format, encoder and blitter. |
* |
* Many thanks to Xark and johns for hints, benchmarks and useful comments |
* leading to this code. |
* |
* Welcome to Macro Mayhem. |
*/ |
/* |
* The encoding translates the image data to a stream of segments of the form |
* |
* <skip> <run> <data> |
* |
* where <skip> is the number of transparent pixels to skip, |
* <run> is the number of opaque pixels to blit, |
* and <data> are the pixels themselves. |
* |
* This basic structure is used both for colorkeyed surfaces, used for simple |
* binary transparency and for per-surface alpha blending, and for surfaces |
* with per-pixel alpha. The details differ, however: |
* |
* Encoding of colorkeyed surfaces: |
* |
* Encoded pixels always have the same format as the target surface. |
* <skip> and <run> are unsigned 8 bit integers, except for 32 bit depth |
* where they are 16 bit. This makes the pixel data aligned at all times. |
* Segments never wrap around from one scan line to the next. |
* |
* The end of the sequence is marked by a zero <skip>,<run> pair at the * |
* beginning of a line. |
* |
* Encoding of surfaces with per-pixel alpha: |
* |
* The sequence begins with a struct RLEDestFormat describing the target |
* pixel format, to provide reliable un-encoding. |
* |
* Each scan line is encoded twice: First all completely opaque pixels, |
* encoded in the target format as described above, and then all |
* partially transparent (translucent) pixels (where 1 <= alpha <= 254), |
* in the following 32-bit format: |
* |
* For 32-bit targets, each pixel has the target RGB format but with |
* the alpha value occupying the highest 8 bits. The <skip> and <run> |
* counts are 16 bit. |
* |
* For 16-bit targets, each pixel has the target RGB format, but with |
* the middle component (usually green) shifted 16 steps to the left, |
* and the hole filled with the 5 most significant bits of the alpha value. |
* i.e. if the target has the format rrrrrggggggbbbbb, |
* the encoded pixel will be 00000gggggg00000rrrrr0aaaaabbbbb. |
* The <skip> and <run> counts are 8 bit for the opaque lines, 16 bit |
* for the translucent lines. Two padding bytes may be inserted |
* before each translucent line to keep them 32-bit aligned. |
* |
* The end of the sequence is marked by a zero <skip>,<run> pair at the |
* beginning of an opaque line. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_types.h" |
#include "SDL_video.h" |
#include "SDL_error.h" |
#include "SDL_sysvideo.h" |
#include "SDL_blit.h" |
#include "SDL_memops.h" |
#include "SDL_RLEaccel_c.h" |
#ifndef MAX |
#define MAX(a, b) ((a) > (b) ? (a) : (b)) |
#endif |
#ifndef MIN |
#define MIN(a, b) ((a) < (b) ? (a) : (b)) |
#endif |
#define PIXEL_COPY(to, from, len, bpp) \ |
do { \ |
if(bpp == 4) { \ |
SDL_memcpy4(to, from, (unsigned)(len)); \ |
} else { \ |
SDL_memcpy(to, from, (unsigned)(len) * (bpp)); \ |
} \ |
} while(0) |
/* |
* Various colorkey blit methods, for opaque and per-surface alpha |
*/ |
#define OPAQUE_BLIT(to, from, length, bpp, alpha) \ |
PIXEL_COPY(to, from, length, bpp) |
/* |
* For 32bpp pixels on the form 0x00rrggbb: |
* If we treat the middle component separately, we can process the two |
* remaining in parallel. This is safe to do because of the gap to the left |
* of each component, so the bits from the multiplication don't collide. |
* This can be used for any RGB permutation of course. |
*/ |
#define ALPHA_BLIT32_888(to, from, length, bpp, alpha) \ |
do { \ |
int i; \ |
Uint32 *src = (Uint32 *)(from); \ |
Uint32 *dst = (Uint32 *)(to); \ |
for(i = 0; i < (int)(length); i++) { \ |
Uint32 s = *src++; \ |
Uint32 d = *dst; \ |
Uint32 s1 = s & 0xff00ff; \ |
Uint32 d1 = d & 0xff00ff; \ |
d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ |
s &= 0xff00; \ |
d &= 0xff00; \ |
d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ |
*dst++ = d1 | d; \ |
} \ |
} while(0) |
/* |
* For 16bpp pixels we can go a step further: put the middle component |
* in the high 16 bits of a 32 bit word, and process all three RGB |
* components at the same time. Since the smallest gap is here just |
* 5 bits, we have to scale alpha down to 5 bits as well. |
*/ |
#define ALPHA_BLIT16_565(to, from, length, bpp, alpha) \ |
do { \ |
int i; \ |
Uint16 *src = (Uint16 *)(from); \ |
Uint16 *dst = (Uint16 *)(to); \ |
for(i = 0; i < (int)(length); i++) { \ |
Uint32 s = *src++; \ |
Uint32 d = *dst; \ |
s = (s | s << 16) & 0x07e0f81f; \ |
d = (d | d << 16) & 0x07e0f81f; \ |
d += (s - d) * alpha >> 5; \ |
d &= 0x07e0f81f; \ |
*dst++ = d | d >> 16; \ |
} \ |
} while(0) |
#define ALPHA_BLIT16_555(to, from, length, bpp, alpha) \ |
do { \ |
int i; \ |
Uint16 *src = (Uint16 *)(from); \ |
Uint16 *dst = (Uint16 *)(to); \ |
for(i = 0; i < (int)(length); i++) { \ |
Uint32 s = *src++; \ |
Uint32 d = *dst; \ |
s = (s | s << 16) & 0x03e07c1f; \ |
d = (d | d << 16) & 0x03e07c1f; \ |
d += (s - d) * alpha >> 5; \ |
d &= 0x03e07c1f; \ |
*dst++ = d | d >> 16; \ |
} \ |
} while(0) |
/* |
* The general slow catch-all function, for remaining depths and formats |
*/ |
#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \ |
do { \ |
int i; \ |
Uint8 *src = from; \ |
Uint8 *dst = to; \ |
for(i = 0; i < (int)(length); i++) { \ |
Uint32 s, d; \ |
unsigned rs, gs, bs, rd, gd, bd; \ |
switch(bpp) { \ |
case 2: \ |
s = *(Uint16 *)src; \ |
d = *(Uint16 *)dst; \ |
break; \ |
case 3: \ |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
s = (src[0] << 16) | (src[1] << 8) | src[2]; \ |
d = (dst[0] << 16) | (dst[1] << 8) | dst[2]; \ |
} else { \ |
s = (src[2] << 16) | (src[1] << 8) | src[0]; \ |
d = (dst[2] << 16) | (dst[1] << 8) | dst[0]; \ |
} \ |
break; \ |
case 4: \ |
s = *(Uint32 *)src; \ |
d = *(Uint32 *)dst; \ |
break; \ |
} \ |
RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \ |
RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \ |
rd += (rs - rd) * alpha >> 8; \ |
gd += (gs - gd) * alpha >> 8; \ |
bd += (bs - bd) * alpha >> 8; \ |
PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \ |
switch(bpp) { \ |
case 2: \ |
*(Uint16 *)dst = d; \ |
break; \ |
case 3: \ |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ |
dst[0] = d >> 16; \ |
dst[1] = d >> 8; \ |
dst[2] = d; \ |
} else { \ |
dst[0] = d; \ |
dst[1] = d >> 8; \ |
dst[2] = d >> 16; \ |
} \ |
break; \ |
case 4: \ |
*(Uint32 *)dst = d; \ |
break; \ |
} \ |
src += bpp; \ |
dst += bpp; \ |
} \ |
} while(0) |
/* |
* Special case: 50% alpha (alpha=128) |
* This is treated specially because it can be optimized very well, and |
* since it is good for many cases of semi-translucency. |
* The theory is to do all three components at the same time: |
* First zero the lowest bit of each component, which gives us room to |
* add them. Then shift right and add the sum of the lowest bits. |
*/ |
#define ALPHA_BLIT32_888_50(to, from, length, bpp, alpha) \ |
do { \ |
int i; \ |
Uint32 *src = (Uint32 *)(from); \ |
Uint32 *dst = (Uint32 *)(to); \ |
for(i = 0; i < (int)(length); i++) { \ |
Uint32 s = *src++; \ |
Uint32 d = *dst; \ |
*dst++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \ |
+ (s & d & 0x00010101); \ |
} \ |
} while(0) |
/* |
* For 16bpp, we can actually blend two pixels in parallel, if we take |
* care to shift before we add, not after. |
*/ |
/* helper: blend a single 16 bit pixel at 50% */ |
#define BLEND16_50(dst, src, mask) \ |
do { \ |
Uint32 s = *src++; \ |
Uint32 d = *dst; \ |
*dst++ = (((s & mask) + (d & mask)) >> 1) \ |
+ (s & d & (~mask & 0xffff)); \ |
} while(0) |
/* basic 16bpp blender. mask is the pixels to keep when adding. */ |
#define ALPHA_BLIT16_50(to, from, length, bpp, alpha, mask) \ |
do { \ |
unsigned n = (length); \ |
Uint16 *src = (Uint16 *)(from); \ |
Uint16 *dst = (Uint16 *)(to); \ |
if(((unsigned long)src ^ (unsigned long)dst) & 3) { \ |
/* source and destination not in phase, blit one by one */ \ |
while(n--) \ |
BLEND16_50(dst, src, mask); \ |
} else { \ |
if((unsigned long)src & 3) { \ |
/* first odd pixel */ \ |
BLEND16_50(dst, src, mask); \ |
n--; \ |
} \ |
for(; n > 1; n -= 2) { \ |
Uint32 s = *(Uint32 *)src; \ |
Uint32 d = *(Uint32 *)dst; \ |
*(Uint32 *)dst = ((s & (mask | mask << 16)) >> 1) \ |
+ ((d & (mask | mask << 16)) >> 1) \ |
+ (s & d & (~(mask | mask << 16))); \ |
src += 2; \ |
dst += 2; \ |
} \ |
if(n) \ |
BLEND16_50(dst, src, mask); /* last odd pixel */ \ |
} \ |
} while(0) |
#define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha) \ |
ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de) |
#define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \ |
ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde) |
#define CHOOSE_BLIT(blitter, alpha, fmt) \ |
do { \ |
if(alpha == 255) { \ |
switch(fmt->BytesPerPixel) { \ |
case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \ |
case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \ |
case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \ |
case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \ |
} \ |
} else { \ |
switch(fmt->BytesPerPixel) { \ |
case 1: \ |
/* No 8bpp alpha blitting */ \ |
break; \ |
\ |
case 2: \ |
switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \ |
case 0xffff: \ |
if(fmt->Gmask == 0x07e0 \ |
|| fmt->Rmask == 0x07e0 \ |
|| fmt->Bmask == 0x07e0) { \ |
if(alpha == 128) \ |
blitter(2, Uint8, ALPHA_BLIT16_565_50); \ |
else { \ |
alpha >>= 3; /* use 5 bit alpha */ \ |
blitter(2, Uint8, ALPHA_BLIT16_565); \ |
} \ |
} else \ |
goto general16; \ |
break; \ |
\ |
case 0x7fff: \ |
if(fmt->Gmask == 0x03e0 \ |
|| fmt->Rmask == 0x03e0 \ |
|| fmt->Bmask == 0x03e0) { \ |
if(alpha == 128) \ |
blitter(2, Uint8, ALPHA_BLIT16_555_50); \ |
else { \ |
alpha >>= 3; /* use 5 bit alpha */ \ |
blitter(2, Uint8, ALPHA_BLIT16_555); \ |
} \ |
break; \ |
} \ |
/* fallthrough */ \ |
\ |
default: \ |
general16: \ |
blitter(2, Uint8, ALPHA_BLIT_ANY); \ |
} \ |
break; \ |
\ |
case 3: \ |
blitter(3, Uint8, ALPHA_BLIT_ANY); \ |
break; \ |
\ |
case 4: \ |
if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ |
&& (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ |
|| fmt->Bmask == 0xff00)) { \ |
if(alpha == 128) \ |
blitter(4, Uint16, ALPHA_BLIT32_888_50); \ |
else \ |
blitter(4, Uint16, ALPHA_BLIT32_888); \ |
} else \ |
blitter(4, Uint16, ALPHA_BLIT_ANY); \ |
break; \ |
} \ |
} \ |
} while(0) |
/* |
* This takes care of the case when the surface is clipped on the left and/or |
* right. Top clipping has already been taken care of. |
*/ |
static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst, |
Uint8 *dstbuf, SDL_Rect *srcrect, unsigned alpha) |
{ |
SDL_PixelFormat *fmt = dst->format; |
#define RLECLIPBLIT(bpp, Type, do_blit) \ |
do { \ |
int linecount = srcrect->h; \ |
int ofs = 0; \ |
int left = srcrect->x; \ |
int right = left + srcrect->w; \ |
dstbuf -= left * bpp; \ |
for(;;) { \ |
int run; \ |
ofs += *(Type *)srcbuf; \ |
run = ((Type *)srcbuf)[1]; \ |
srcbuf += 2 * sizeof(Type); \ |
if(run) { \ |
/* clip to left and right borders */ \ |
if(ofs < right) { \ |
int start = 0; \ |
int len = run; \ |
int startcol; \ |
if(left - ofs > 0) { \ |
start = left - ofs; \ |
len -= start; \ |
if(len <= 0) \ |
goto nocopy ## bpp ## do_blit; \ |
} \ |
startcol = ofs + start; \ |
if(len > right - startcol) \ |
len = right - startcol; \ |
do_blit(dstbuf + startcol * bpp, srcbuf + start * bpp, \ |
len, bpp, alpha); \ |
} \ |
nocopy ## bpp ## do_blit: \ |
srcbuf += run * bpp; \ |
ofs += run; \ |
} else if(!ofs) \ |
break; \ |
if(ofs == w) { \ |
ofs = 0; \ |
dstbuf += dst->pitch; \ |
if(!--linecount) \ |
break; \ |
} \ |
} \ |
} while(0) |
CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt); |
#undef RLECLIPBLIT |
} |
/* blit a colorkeyed RLE surface */ |
int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
Uint8 *dstbuf; |
Uint8 *srcbuf; |
int x, y; |
int w = src->w; |
unsigned alpha; |
/* Lock the destination if necessary */ |
if ( dst->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video->LockHWSurface(this, dst) < 0 ) { |
return(-1); |
} |
} |
/* Set up the source and destination pointers */ |
x = dstrect->x; |
y = dstrect->y; |
dstbuf = (Uint8 *)dst->pixels + dst->offset |
+ y * dst->pitch + x * src->format->BytesPerPixel; |
srcbuf = (Uint8 *)src->map->sw_data->aux_data; |
{ |
/* skip lines at the top if neccessary */ |
int vskip = srcrect->y; |
int ofs = 0; |
if(vskip) { |
#define RLESKIP(bpp, Type) \ |
for(;;) { \ |
int run; \ |
ofs += *(Type *)srcbuf; \ |
run = ((Type *)srcbuf)[1]; \ |
srcbuf += sizeof(Type) * 2; \ |
if(run) { \ |
srcbuf += run * bpp; \ |
ofs += run; \ |
} else if(!ofs) \ |
goto done; \ |
if(ofs == w) { \ |
ofs = 0; \ |
if(!--vskip) \ |
break; \ |
} \ |
} |
switch(src->format->BytesPerPixel) { |
case 1: RLESKIP(1, Uint8); break; |
case 2: RLESKIP(2, Uint8); break; |
case 3: RLESKIP(3, Uint8); break; |
case 4: RLESKIP(4, Uint16); break; |
} |
#undef RLESKIP |
} |
} |
alpha = (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA |
? src->format->alpha : 255; |
/* if left or right edge clipping needed, call clip blit */ |
if ( srcrect->x || srcrect->w != src->w ) { |
RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha); |
} else { |
SDL_PixelFormat *fmt = src->format; |
#define RLEBLIT(bpp, Type, do_blit) \ |
do { \ |
int linecount = srcrect->h; \ |
int ofs = 0; \ |
for(;;) { \ |
unsigned run; \ |
ofs += *(Type *)srcbuf; \ |
run = ((Type *)srcbuf)[1]; \ |
srcbuf += 2 * sizeof(Type); \ |
if(run) { \ |
do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \ |
srcbuf += run * bpp; \ |
ofs += run; \ |
} else if(!ofs) \ |
break; \ |
if(ofs == w) { \ |
ofs = 0; \ |
dstbuf += dst->pitch; \ |
if(!--linecount) \ |
break; \ |
} \ |
} \ |
} while(0) |
CHOOSE_BLIT(RLEBLIT, alpha, fmt); |
#undef RLEBLIT |
} |
done: |
/* Unlock the destination if necessary */ |
if ( dst->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->UnlockHWSurface(this, dst); |
} |
return(0); |
} |
#undef OPAQUE_BLIT |
/* |
* Per-pixel blitting macros for translucent pixels: |
* These use the same techniques as the per-surface blitting macros |
*/ |
/* |
* For 32bpp pixels, we have made sure the alpha is stored in the top |
* 8 bits, so proceed as usual |
*/ |
#define BLIT_TRANSL_888(src, dst) \ |
do { \ |
Uint32 s = src; \ |
Uint32 d = dst; \ |
unsigned alpha = s >> 24; \ |
Uint32 s1 = s & 0xff00ff; \ |
Uint32 d1 = d & 0xff00ff; \ |
d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ |
s &= 0xff00; \ |
d &= 0xff00; \ |
d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ |
dst = d1 | d; \ |
} while(0) |
/* |
* For 16bpp pixels, we have stored the 5 most significant alpha bits in |
* bits 5-10. As before, we can process all 3 RGB components at the same time. |
*/ |
#define BLIT_TRANSL_565(src, dst) \ |
do { \ |
Uint32 s = src; \ |
Uint32 d = dst; \ |
unsigned alpha = (s & 0x3e0) >> 5; \ |
s &= 0x07e0f81f; \ |
d = (d | d << 16) & 0x07e0f81f; \ |
d += (s - d) * alpha >> 5; \ |
d &= 0x07e0f81f; \ |
dst = d | d >> 16; \ |
} while(0) |
#define BLIT_TRANSL_555(src, dst) \ |
do { \ |
Uint32 s = src; \ |
Uint32 d = dst; \ |
unsigned alpha = (s & 0x3e0) >> 5; \ |
s &= 0x03e07c1f; \ |
d = (d | d << 16) & 0x03e07c1f; \ |
d += (s - d) * alpha >> 5; \ |
d &= 0x03e07c1f; \ |
dst = d | d >> 16; \ |
} while(0) |
/* used to save the destination format in the encoding. Designed to be |
macro-compatible with SDL_PixelFormat but without the unneeded fields */ |
typedef struct { |
Uint8 BytesPerPixel; |
Uint8 Rloss; |
Uint8 Gloss; |
Uint8 Bloss; |
Uint8 Rshift; |
Uint8 Gshift; |
Uint8 Bshift; |
Uint8 Ashift; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
Uint32 Amask; |
} RLEDestFormat; |
/* blit a pixel-alpha RLE surface clipped at the right and/or left edges */ |
static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst, |
Uint8 *dstbuf, SDL_Rect *srcrect) |
{ |
SDL_PixelFormat *df = dst->format; |
/* |
* clipped blitter: Ptype is the destination pixel type, |
* Ctype the translucent count type, and do_blend the macro |
* to blend one pixel. |
*/ |
#define RLEALPHACLIPBLIT(Ptype, Ctype, do_blend) \ |
do { \ |
int linecount = srcrect->h; \ |
int left = srcrect->x; \ |
int right = left + srcrect->w; \ |
dstbuf -= left * sizeof(Ptype); \ |
do { \ |
int ofs = 0; \ |
/* blit opaque pixels on one line */ \ |
do { \ |
unsigned run; \ |
ofs += ((Ctype *)srcbuf)[0]; \ |
run = ((Ctype *)srcbuf)[1]; \ |
srcbuf += 2 * sizeof(Ctype); \ |
if(run) { \ |
/* clip to left and right borders */ \ |
int cofs = ofs; \ |
int crun = run; \ |
if(left - cofs > 0) { \ |
crun -= left - cofs; \ |
cofs = left; \ |
} \ |
if(crun > right - cofs) \ |
crun = right - cofs; \ |
if(crun > 0) \ |
PIXEL_COPY(dstbuf + cofs * sizeof(Ptype), \ |
srcbuf + (cofs - ofs) * sizeof(Ptype), \ |
(unsigned)crun, sizeof(Ptype)); \ |
srcbuf += run * sizeof(Ptype); \ |
ofs += run; \ |
} else if(!ofs) \ |
return; \ |
} while(ofs < w); \ |
/* skip padding if necessary */ \ |
if(sizeof(Ptype) == 2) \ |
srcbuf += (unsigned long)srcbuf & 2; \ |
/* blit translucent pixels on the same line */ \ |
ofs = 0; \ |
do { \ |
unsigned run; \ |
ofs += ((Uint16 *)srcbuf)[0]; \ |
run = ((Uint16 *)srcbuf)[1]; \ |
srcbuf += 4; \ |
if(run) { \ |
/* clip to left and right borders */ \ |
int cofs = ofs; \ |
int crun = run; \ |
if(left - cofs > 0) { \ |
crun -= left - cofs; \ |
cofs = left; \ |
} \ |
if(crun > right - cofs) \ |
crun = right - cofs; \ |
if(crun > 0) { \ |
Ptype *dst = (Ptype *)dstbuf + cofs; \ |
Uint32 *src = (Uint32 *)srcbuf + (cofs - ofs); \ |
int i; \ |
for(i = 0; i < crun; i++) \ |
do_blend(src[i], dst[i]); \ |
} \ |
srcbuf += run * 4; \ |
ofs += run; \ |
} \ |
} while(ofs < w); \ |
dstbuf += dst->pitch; \ |
} while(--linecount); \ |
} while(0) |
switch(df->BytesPerPixel) { |
case 2: |
if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0 |
|| df->Bmask == 0x07e0) |
RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565); |
else |
RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555); |
break; |
case 4: |
RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888); |
break; |
} |
} |
/* blit a pixel-alpha RLE surface */ |
int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
int x, y; |
int w = src->w; |
Uint8 *srcbuf, *dstbuf; |
SDL_PixelFormat *df = dst->format; |
/* Lock the destination if necessary */ |
if(dst->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT)) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if(video->LockHWSurface(this, dst) < 0) { |
return -1; |
} |
} |
x = dstrect->x; |
y = dstrect->y; |
dstbuf = (Uint8 *)dst->pixels + dst->offset |
+ y * dst->pitch + x * df->BytesPerPixel; |
srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat); |
{ |
/* skip lines at the top if necessary */ |
int vskip = srcrect->y; |
if(vskip) { |
int ofs; |
if(df->BytesPerPixel == 2) { |
/* the 16/32 interleaved format */ |
do { |
/* skip opaque line */ |
ofs = 0; |
do { |
int run; |
ofs += srcbuf[0]; |
run = srcbuf[1]; |
srcbuf += 2; |
if(run) { |
srcbuf += 2 * run; |
ofs += run; |
} else if(!ofs) |
goto done; |
} while(ofs < w); |
/* skip padding */ |
srcbuf += (unsigned long)srcbuf & 2; |
/* skip translucent line */ |
ofs = 0; |
do { |
int run; |
ofs += ((Uint16 *)srcbuf)[0]; |
run = ((Uint16 *)srcbuf)[1]; |
srcbuf += 4 * (run + 1); |
ofs += run; |
} while(ofs < w); |
} while(--vskip); |
} else { |
/* the 32/32 interleaved format */ |
vskip <<= 1; /* opaque and translucent have same format */ |
do { |
ofs = 0; |
do { |
int run; |
ofs += ((Uint16 *)srcbuf)[0]; |
run = ((Uint16 *)srcbuf)[1]; |
srcbuf += 4; |
if(run) { |
srcbuf += 4 * run; |
ofs += run; |
} else if(!ofs) |
goto done; |
} while(ofs < w); |
} while(--vskip); |
} |
} |
} |
/* if left or right edge clipping needed, call clip blit */ |
if(srcrect->x || srcrect->w != src->w) { |
RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect); |
} else { |
/* |
* non-clipped blitter. Ptype is the destination pixel type, |
* Ctype the translucent count type, and do_blend the |
* macro to blend one pixel. |
*/ |
#define RLEALPHABLIT(Ptype, Ctype, do_blend) \ |
do { \ |
int linecount = srcrect->h; \ |
do { \ |
int ofs = 0; \ |
/* blit opaque pixels on one line */ \ |
do { \ |
unsigned run; \ |
ofs += ((Ctype *)srcbuf)[0]; \ |
run = ((Ctype *)srcbuf)[1]; \ |
srcbuf += 2 * sizeof(Ctype); \ |
if(run) { \ |
PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \ |
run, sizeof(Ptype)); \ |
srcbuf += run * sizeof(Ptype); \ |
ofs += run; \ |
} else if(!ofs) \ |
goto done; \ |
} while(ofs < w); \ |
/* skip padding if necessary */ \ |
if(sizeof(Ptype) == 2) \ |
srcbuf += (unsigned long)srcbuf & 2; \ |
/* blit translucent pixels on the same line */ \ |
ofs = 0; \ |
do { \ |
unsigned run; \ |
ofs += ((Uint16 *)srcbuf)[0]; \ |
run = ((Uint16 *)srcbuf)[1]; \ |
srcbuf += 4; \ |
if(run) { \ |
Ptype *dst = (Ptype *)dstbuf + ofs; \ |
unsigned i; \ |
for(i = 0; i < run; i++) { \ |
Uint32 src = *(Uint32 *)srcbuf; \ |
do_blend(src, *dst); \ |
srcbuf += 4; \ |
dst++; \ |
} \ |
ofs += run; \ |
} \ |
} while(ofs < w); \ |
dstbuf += dst->pitch; \ |
} while(--linecount); \ |
} while(0) |
switch(df->BytesPerPixel) { |
case 2: |
if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0 |
|| df->Bmask == 0x07e0) |
RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565); |
else |
RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555); |
break; |
case 4: |
RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888); |
break; |
} |
} |
done: |
/* Unlock the destination if necessary */ |
if(dst->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT)) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->UnlockHWSurface(this, dst); |
} |
return 0; |
} |
/* |
* Auxiliary functions: |
* The encoding functions take 32bpp rgb + a, and |
* return the number of bytes copied to the destination. |
* The decoding functions copy to 32bpp rgb + a, and |
* return the number of bytes copied from the source. |
* These are only used in the encoder and un-RLE code and are therefore not |
* highly optimised. |
*/ |
/* encode 32bpp rgb + a into 16bpp rgb, losing alpha */ |
static int copy_opaque_16(void *dst, Uint32 *src, int n, |
SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint16 *d = dst; |
for(i = 0; i < n; i++) { |
unsigned r, g, b; |
RGB_FROM_PIXEL(*src, sfmt, r, g, b); |
PIXEL_FROM_RGB(*d, dfmt, r, g, b); |
src++; |
d++; |
} |
return n * 2; |
} |
/* decode opaque pixels from 16bpp to 32bpp rgb + a */ |
static int uncopy_opaque_16(Uint32 *dst, void *src, int n, |
RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint16 *s = src; |
unsigned alpha = dfmt->Amask ? 255 : 0; |
for(i = 0; i < n; i++) { |
unsigned r, g, b; |
RGB_FROM_PIXEL(*s, sfmt, r, g, b); |
PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, alpha); |
s++; |
dst++; |
} |
return n * 2; |
} |
/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */ |
static int copy_transl_565(void *dst, Uint32 *src, int n, |
SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint32 *d = dst; |
for(i = 0; i < n; i++) { |
unsigned r, g, b, a; |
Uint16 pix; |
RGBA_FROM_8888(*src, sfmt, r, g, b, a); |
PIXEL_FROM_RGB(pix, dfmt, r, g, b); |
*d = ((pix & 0x7e0) << 16) | (pix & 0xf81f) | ((a << 2) & 0x7e0); |
src++; |
d++; |
} |
return n * 4; |
} |
/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */ |
static int copy_transl_555(void *dst, Uint32 *src, int n, |
SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint32 *d = dst; |
for(i = 0; i < n; i++) { |
unsigned r, g, b, a; |
Uint16 pix; |
RGBA_FROM_8888(*src, sfmt, r, g, b, a); |
PIXEL_FROM_RGB(pix, dfmt, r, g, b); |
*d = ((pix & 0x3e0) << 16) | (pix & 0xfc1f) | ((a << 2) & 0x3e0); |
src++; |
d++; |
} |
return n * 4; |
} |
/* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */ |
static int uncopy_transl_16(Uint32 *dst, void *src, int n, |
RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint32 *s = src; |
for(i = 0; i < n; i++) { |
unsigned r, g, b, a; |
Uint32 pix = *s++; |
a = (pix & 0x3e0) >> 2; |
pix = (pix & ~0x3e0) | pix >> 16; |
RGB_FROM_PIXEL(pix, sfmt, r, g, b); |
PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a); |
dst++; |
} |
return n * 4; |
} |
/* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ |
static int copy_32(void *dst, Uint32 *src, int n, |
SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint32 *d = dst; |
for(i = 0; i < n; i++) { |
unsigned r, g, b, a; |
Uint32 pixel; |
RGBA_FROM_8888(*src, sfmt, r, g, b, a); |
PIXEL_FROM_RGB(pixel, dfmt, r, g, b); |
*d++ = pixel | a << 24; |
src++; |
} |
return n * 4; |
} |
/* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ |
static int uncopy_32(Uint32 *dst, void *src, int n, |
RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) |
{ |
int i; |
Uint32 *s = src; |
for(i = 0; i < n; i++) { |
unsigned r, g, b, a; |
Uint32 pixel = *s++; |
RGB_FROM_PIXEL(pixel, sfmt, r, g, b); |
a = pixel >> 24; |
PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a); |
dst++; |
} |
return n * 4; |
} |
#define ISOPAQUE(pixel, fmt) ((((pixel) & fmt->Amask) >> fmt->Ashift) == 255) |
#define ISTRANSL(pixel, fmt) \ |
((unsigned)((((pixel) & fmt->Amask) >> fmt->Ashift) - 1U) < 254U) |
/* convert surface to be quickly alpha-blittable onto dest, if possible */ |
static int RLEAlphaSurface(SDL_Surface *surface) |
{ |
SDL_Surface *dest; |
SDL_PixelFormat *df; |
int maxsize = 0; |
int max_opaque_run; |
int max_transl_run = 65535; |
unsigned masksum; |
Uint8 *rlebuf, *dst; |
int (*copy_opaque)(void *, Uint32 *, int, |
SDL_PixelFormat *, SDL_PixelFormat *); |
int (*copy_transl)(void *, Uint32 *, int, |
SDL_PixelFormat *, SDL_PixelFormat *); |
dest = surface->map->dst; |
if(!dest) |
return -1; |
df = dest->format; |
if(surface->format->BitsPerPixel != 32) |
return -1; /* only 32bpp source supported */ |
/* find out whether the destination is one we support, |
and determine the max size of the encoded result */ |
masksum = df->Rmask | df->Gmask | df->Bmask; |
switch(df->BytesPerPixel) { |
case 2: |
/* 16bpp: only support 565 and 555 formats */ |
switch(masksum) { |
case 0xffff: |
if(df->Gmask == 0x07e0 |
|| df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { |
copy_opaque = copy_opaque_16; |
copy_transl = copy_transl_565; |
} else |
return -1; |
break; |
case 0x7fff: |
if(df->Gmask == 0x03e0 |
|| df->Rmask == 0x03e0 || df->Bmask == 0x03e0) { |
copy_opaque = copy_opaque_16; |
copy_transl = copy_transl_555; |
} else |
return -1; |
break; |
default: |
return -1; |
} |
max_opaque_run = 255; /* runs stored as bytes */ |
/* worst case is alternating opaque and translucent pixels, |
with room for alignment padding between lines */ |
maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2; |
break; |
case 4: |
if(masksum != 0x00ffffff) |
return -1; /* requires unused high byte */ |
copy_opaque = copy_32; |
copy_transl = copy_32; |
max_opaque_run = 255; /* runs stored as short ints */ |
/* worst case is alternating opaque and translucent pixels */ |
maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4; |
break; |
default: |
return -1; /* anything else unsupported right now */ |
} |
maxsize += sizeof(RLEDestFormat); |
rlebuf = (Uint8 *)malloc(maxsize); |
if(!rlebuf) { |
SDL_OutOfMemory(); |
return -1; |
} |
{ |
/* save the destination format so we can undo the encoding later */ |
RLEDestFormat *r = (RLEDestFormat *)rlebuf; |
r->BytesPerPixel = df->BytesPerPixel; |
r->Rloss = df->Rloss; |
r->Gloss = df->Gloss; |
r->Bloss = df->Bloss; |
r->Rshift = df->Rshift; |
r->Gshift = df->Gshift; |
r->Bshift = df->Bshift; |
r->Ashift = df->Ashift; |
r->Rmask = df->Rmask; |
r->Gmask = df->Gmask; |
r->Bmask = df->Bmask; |
r->Amask = df->Amask; |
} |
dst = rlebuf + sizeof(RLEDestFormat); |
/* Do the actual encoding */ |
{ |
int x, y; |
int h = surface->h, w = surface->w; |
SDL_PixelFormat *sf = surface->format; |
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels + surface->offset); |
Uint8 *lastline = dst; /* end of last non-blank line */ |
/* opaque counts are 8 or 16 bits, depending on target depth */ |
#define ADD_OPAQUE_COUNTS(n, m) \ |
if(df->BytesPerPixel == 4) { \ |
((Uint16 *)dst)[0] = n; \ |
((Uint16 *)dst)[1] = m; \ |
dst += 4; \ |
} else { \ |
dst[0] = n; \ |
dst[1] = m; \ |
dst += 2; \ |
} |
/* translucent counts are always 16 bit */ |
#define ADD_TRANSL_COUNTS(n, m) \ |
(((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4) |
for(y = 0; y < h; y++) { |
int runstart, skipstart; |
int blankline = 0; |
/* First encode all opaque pixels of a scan line */ |
x = 0; |
do { |
int run, skip, len; |
skipstart = x; |
while(x < w && !ISOPAQUE(src[x], sf)) |
x++; |
runstart = x; |
while(x < w && ISOPAQUE(src[x], sf)) |
x++; |
skip = runstart - skipstart; |
if(skip == w) |
blankline = 1; |
run = x - runstart; |
while(skip > max_opaque_run) { |
ADD_OPAQUE_COUNTS(max_opaque_run, 0); |
skip -= max_opaque_run; |
} |
len = MIN(run, max_opaque_run); |
ADD_OPAQUE_COUNTS(skip, len); |
dst += copy_opaque(dst, src + runstart, len, sf, df); |
runstart += len; |
run -= len; |
while(run) { |
len = MIN(run, max_opaque_run); |
ADD_OPAQUE_COUNTS(0, len); |
dst += copy_opaque(dst, src + runstart, len, sf, df); |
runstart += len; |
run -= len; |
} |
} while(x < w); |
/* Make sure the next output address is 32-bit aligned */ |
dst += (unsigned long)dst & 2; |
/* Next, encode all translucent pixels of the same scan line */ |
x = 0; |
do { |
int run, skip, len; |
skipstart = x; |
while(x < w && !ISTRANSL(src[x], sf)) |
x++; |
runstart = x; |
while(x < w && ISTRANSL(src[x], sf)) |
x++; |
skip = runstart - skipstart; |
blankline &= (skip == w); |
run = x - runstart; |
while(skip > max_transl_run) { |
ADD_TRANSL_COUNTS(max_transl_run, 0); |
skip -= max_transl_run; |
} |
len = MIN(run, max_transl_run); |
ADD_TRANSL_COUNTS(skip, len); |
dst += copy_transl(dst, src + runstart, len, sf, df); |
runstart += len; |
run -= len; |
while(run) { |
len = MIN(run, max_transl_run); |
ADD_TRANSL_COUNTS(0, len); |
dst += copy_transl(dst, src + runstart, len, sf, df); |
runstart += len; |
run -= len; |
} |
if(!blankline) |
lastline = dst; |
} while(x < w); |
src += surface->pitch >> 2; |
} |
dst = lastline; /* back up past trailing blank lines */ |
ADD_OPAQUE_COUNTS(0, 0); |
} |
#undef ADD_OPAQUE_COUNTS |
#undef ADD_TRANSL_COUNTS |
/* Now that we have it encoded, release the original pixels */ |
if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC |
&& (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { |
free( surface->pixels ); |
surface->pixels = NULL; |
} |
/* realloc the buffer to release unused memory */ |
{ |
Uint8 *p = realloc(rlebuf, dst - rlebuf); |
if(!p) |
p = rlebuf; |
surface->map->sw_data->aux_data = p; |
} |
return 0; |
} |
static Uint32 getpix_8(Uint8 *srcbuf) |
{ |
return *srcbuf; |
} |
static Uint32 getpix_16(Uint8 *srcbuf) |
{ |
return *(Uint16 *)srcbuf; |
} |
static Uint32 getpix_24(Uint8 *srcbuf) |
{ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) |
return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16); |
else |
return (srcbuf[0] << 16) + (srcbuf[1] << 8) + srcbuf[2]; |
} |
static Uint32 getpix_32(Uint8 *srcbuf) |
{ |
return *(Uint32 *)srcbuf; |
} |
typedef Uint32 (*getpix_func)(Uint8 *); |
static getpix_func getpixes[4] = { |
getpix_8, getpix_16, getpix_24, getpix_32 |
}; |
static int RLEColorkeySurface(SDL_Surface *surface) |
{ |
Uint8 *rlebuf, *dst; |
int maxn; |
int y; |
Uint8 *srcbuf, *curbuf, *lastline; |
int maxsize = 0; |
int skip, run; |
int bpp = surface->format->BytesPerPixel; |
getpix_func getpix; |
Uint32 ckey, rgbmask; |
int w, h; |
/* calculate the worst case size for the compressed surface */ |
switch(bpp) { |
case 1: |
/* worst case is alternating opaque and transparent pixels, |
starting with an opaque pixel */ |
maxsize = surface->h * 3 * (surface->w / 2 + 1) + 2; |
break; |
case 2: |
case 3: |
/* worst case is solid runs, at most 255 pixels wide */ |
maxsize = surface->h * (2 * (surface->w / 255 + 1) |
+ surface->w * bpp) + 2; |
break; |
case 4: |
/* worst case is solid runs, at most 65535 pixels wide */ |
maxsize = surface->h * (4 * (surface->w / 65535 + 1) |
+ surface->w * 4) + 4; |
break; |
} |
rlebuf = (Uint8 *)malloc(maxsize); |
if ( rlebuf == NULL ) { |
SDL_OutOfMemory(); |
return(-1); |
} |
/* Set up the conversion */ |
srcbuf = (Uint8 *)surface->pixels+surface->offset; |
curbuf = srcbuf; |
maxn = bpp == 4 ? 65535 : 255; |
skip = run = 0; |
dst = rlebuf; |
rgbmask = ~surface->format->Amask; |
ckey = surface->format->colorkey & rgbmask; |
lastline = dst; |
getpix = getpixes[bpp - 1]; |
w = surface->w; |
h = surface->h; |
#define ADD_COUNTS(n, m) \ |
if(bpp == 4) { \ |
((Uint16 *)dst)[0] = n; \ |
((Uint16 *)dst)[1] = m; \ |
dst += 4; \ |
} else { \ |
dst[0] = n; \ |
dst[1] = m; \ |
dst += 2; \ |
} |
for(y = 0; y < h; y++) { |
int x = 0; |
int blankline = 0; |
do { |
int run, skip, len; |
int runstart; |
int skipstart = x; |
/* find run of transparent, then opaque pixels */ |
while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey) |
x++; |
runstart = x; |
while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey) |
x++; |
skip = runstart - skipstart; |
if(skip == w) |
blankline = 1; |
run = x - runstart; |
/* encode segment */ |
while(skip > maxn) { |
ADD_COUNTS(maxn, 0); |
skip -= maxn; |
} |
len = MIN(run, maxn); |
ADD_COUNTS(skip, len); |
memcpy(dst, srcbuf + runstart * bpp, len * bpp); |
dst += len * bpp; |
run -= len; |
runstart += len; |
while(run) { |
len = MIN(run, maxn); |
ADD_COUNTS(0, len); |
memcpy(dst, srcbuf + runstart * bpp, len * bpp); |
dst += len * bpp; |
runstart += len; |
run -= len; |
} |
if(!blankline) |
lastline = dst; |
} while(x < w); |
srcbuf += surface->pitch; |
} |
dst = lastline; /* back up bast trailing blank lines */ |
ADD_COUNTS(0, 0); |
#undef ADD_COUNTS |
/* Now that we have it encoded, release the original pixels */ |
if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC |
&& (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { |
free( surface->pixels ); |
surface->pixels = NULL; |
} |
/* realloc the buffer to release unused memory */ |
{ |
/* If realloc returns NULL, the original block is left intact */ |
Uint8 *p = realloc(rlebuf, dst - rlebuf); |
if(!p) |
p = rlebuf; |
surface->map->sw_data->aux_data = p; |
} |
return(0); |
} |
int SDL_RLESurface(SDL_Surface *surface) |
{ |
int retcode; |
/* Clear any previous RLE conversion */ |
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { |
SDL_UnRLESurface(surface, 1); |
} |
/* We don't support RLE encoding of bitmaps */ |
if ( surface->format->BitsPerPixel < 8 ) { |
return(-1); |
} |
/* Lock the surface if it's in hardware */ |
if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video->LockHWSurface(this, surface) < 0 ) { |
return(-1); |
} |
} |
/* Encode */ |
if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { |
retcode = RLEColorkeySurface(surface); |
} else { |
if((surface->flags & SDL_SRCALPHA) == SDL_SRCALPHA |
&& surface->format->Amask != 0) |
retcode = RLEAlphaSurface(surface); |
else |
retcode = -1; /* no RLE for per-surface alpha sans ckey */ |
} |
/* Unlock the surface if it's in hardware */ |
if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->UnlockHWSurface(this, surface); |
} |
if(retcode < 0) |
return -1; |
/* The surface is now accelerated */ |
surface->flags |= SDL_RLEACCEL; |
return(0); |
} |
/* |
* Un-RLE a surface with pixel alpha |
* This may not give back exactly the image before RLE-encoding; all |
* completely transparent pixels will be lost, and colour and alpha depth |
* may have been reduced (when encoding for 16bpp targets). |
*/ |
static void UnRLEAlpha(SDL_Surface *surface) |
{ |
Uint8 *srcbuf; |
Uint32 *dst; |
SDL_PixelFormat *sf = surface->format; |
RLEDestFormat *df = surface->map->sw_data->aux_data; |
int (*uncopy_opaque)(Uint32 *, void *, int, |
RLEDestFormat *, SDL_PixelFormat *); |
int (*uncopy_transl)(Uint32 *, void *, int, |
RLEDestFormat *, SDL_PixelFormat *); |
int w = surface->w; |
int bpp = df->BytesPerPixel; |
if(bpp == 2) { |
uncopy_opaque = uncopy_opaque_16; |
uncopy_transl = uncopy_transl_16; |
} else { |
uncopy_opaque = uncopy_transl = uncopy_32; |
} |
surface->pixels = malloc(surface->h * surface->pitch); |
/* fill background with transparent pixels */ |
memset(surface->pixels, 0, surface->h * surface->pitch); |
dst = surface->pixels; |
srcbuf = (Uint8 *)(df + 1); |
for(;;) { |
/* copy opaque pixels */ |
int ofs = 0; |
do { |
unsigned run; |
if(bpp == 2) { |
ofs += srcbuf[0]; |
run = srcbuf[1]; |
srcbuf += 2; |
} else { |
ofs += ((Uint16 *)srcbuf)[0]; |
run = ((Uint16 *)srcbuf)[1]; |
srcbuf += 4; |
} |
if(run) { |
srcbuf += uncopy_opaque(dst + ofs, srcbuf, run, df, sf); |
ofs += run; |
} else if(!ofs) |
return; |
} while(ofs < w); |
/* skip padding if needed */ |
if(bpp == 2) |
srcbuf += (unsigned long)srcbuf & 2; |
/* copy translucent pixels */ |
ofs = 0; |
do { |
unsigned run; |
ofs += ((Uint16 *)srcbuf)[0]; |
run = ((Uint16 *)srcbuf)[1]; |
srcbuf += 4; |
if(run) { |
srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf); |
ofs += run; |
} |
} while(ofs < w); |
dst += surface->pitch >> 2; |
} |
} |
void SDL_UnRLESurface(SDL_Surface *surface, int recode) |
{ |
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { |
surface->flags &= ~SDL_RLEACCEL; |
if(recode && (surface->flags & SDL_PREALLOC) != SDL_PREALLOC |
&& (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { |
if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { |
SDL_Rect full; |
unsigned alpha_flag; |
/* re-create the original surface */ |
surface->pixels = malloc(surface->h * surface->pitch); |
/* fill it with the background colour */ |
SDL_FillRect(surface, NULL, surface->format->colorkey); |
/* now render the encoded surface */ |
full.x = full.y = 0; |
full.w = surface->w; |
full.h = surface->h; |
alpha_flag = surface->flags & SDL_SRCALPHA; |
surface->flags &= ~SDL_SRCALPHA; /* opaque blit */ |
SDL_RLEBlit(surface, &full, surface, &full); |
surface->flags |= alpha_flag; |
} else |
UnRLEAlpha(surface); |
} |
if ( surface->map && surface->map->sw_data->aux_data ) { |
free(surface->map->sw_data->aux_data); |
surface->map->sw_data->aux_data = NULL; |
} |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_RLEaccel_c.h |
---|
0,0 → 1,35 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_RLEaccel_c.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Useful functions and variables from SDL_RLEaccel.c */ |
extern int SDL_RLESurface(SDL_Surface *surface); |
extern int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect); |
extern int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect); |
extern void SDL_UnRLESurface(SDL_Surface *surface, int recode); |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit.c |
---|
0,0 → 1,289 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_sysvideo.h" |
#include "SDL_blit.h" |
#include "SDL_RLEaccel_c.h" |
#include "SDL_pixels_c.h" |
#include "SDL_memops.h" |
/* The general purpose software blit routine */ |
static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
int okay; |
int src_locked; |
int dst_locked; |
/* Everything is okay at the beginning... */ |
okay = 1; |
/* Lock the destination if it's in hardware */ |
dst_locked = 0; |
if ( dst->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video->LockHWSurface(this, dst) < 0 ) { |
okay = 0; |
} else { |
dst_locked = 1; |
} |
} |
/* Lock the source if it's in hardware */ |
src_locked = 0; |
if ( src->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video->LockHWSurface(this, src) < 0 ) { |
okay = 0; |
} else { |
src_locked = 1; |
} |
} |
/* Unencode the destination if it's RLE encoded */ |
if ( dst->flags & SDL_RLEACCEL ) { |
SDL_UnRLESurface(dst, 1); |
dst->flags |= SDL_RLEACCEL; /* save accel'd state */ |
} |
/* Set up source and destination buffer pointers, and BLIT! */ |
if ( okay && srcrect->w && srcrect->h ) { |
SDL_BlitInfo info; |
SDL_loblit RunBlit; |
/* Set up the blit information */ |
info.s_pixels = (Uint8 *)src->pixels + src->offset + |
(Uint16)srcrect->y*src->pitch + |
(Uint16)srcrect->x*src->format->BytesPerPixel; |
info.s_width = srcrect->w; |
info.s_height = srcrect->h; |
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel; |
info.d_pixels = (Uint8 *)dst->pixels + dst->offset + |
(Uint16)dstrect->y*dst->pitch + |
(Uint16)dstrect->x*dst->format->BytesPerPixel; |
info.d_width = dstrect->w; |
info.d_height = dstrect->h; |
info.d_skip=dst->pitch-info.d_width*dst->format->BytesPerPixel; |
info.aux_data = src->map->sw_data->aux_data; |
info.src = src->format; |
info.table = src->map->table; |
info.dst = dst->format; |
RunBlit = src->map->sw_data->blit; |
/* Run the actual software blit */ |
RunBlit(&info); |
} |
/* Re-encode the destination if it's RLE encoded */ |
if ( dst->flags & SDL_RLEACCEL ) { |
dst->flags &= ~SDL_RLEACCEL; /* stop lying */ |
SDL_RLESurface(dst); |
} |
/* We need to unlock the surfaces if they're locked */ |
if ( dst_locked ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->UnlockHWSurface(this, dst); |
} else |
if ( src_locked ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->UnlockHWSurface(this, src); |
} |
/* Blit is done! */ |
return(okay ? 0 : -1); |
} |
static void SDL_BlitCopy(SDL_BlitInfo *info) |
{ |
Uint8 *src, *dst; |
int w, h; |
int srcskip, dstskip; |
w = info->d_width*info->dst->BytesPerPixel; |
h = info->d_height; |
src = info->s_pixels; |
dst = info->d_pixels; |
srcskip = w+info->s_skip; |
dstskip = w+info->d_skip; |
while ( h-- ) { |
SDL_memcpy(dst, src, w); |
src += srcskip; |
dst += dstskip; |
} |
} |
static void SDL_BlitCopyOverlap(SDL_BlitInfo *info) |
{ |
Uint8 *src, *dst; |
int w, h; |
int srcskip, dstskip; |
w = info->d_width*info->dst->BytesPerPixel; |
h = info->d_height; |
src = info->s_pixels; |
dst = info->d_pixels; |
srcskip = w+info->s_skip; |
dstskip = w+info->d_skip; |
if ( dst < src ) { |
while ( h-- ) { |
SDL_memcpy(dst, src, w); |
src += srcskip; |
dst += dstskip; |
} |
} else { |
src += ((h-1) * srcskip); |
dst += ((h-1) * dstskip); |
while ( h-- ) { |
SDL_revcpy(dst, src, w); |
src -= srcskip; |
dst -= dstskip; |
} |
} |
} |
/* Figure out which of many blit routines to set up on a surface */ |
int SDL_CalculateBlit(SDL_Surface *surface) |
{ |
int blit_index; |
/* Clean everything out to start */ |
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { |
SDL_UnRLESurface(surface, 1); |
} |
surface->map->sw_blit = NULL; |
/* Figure out if an accelerated hardware blit is possible */ |
surface->flags &= ~SDL_HWACCEL; |
if ( surface->map->identity ) { |
int hw_blit_ok; |
if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { |
/* We only support accelerated blitting to hardware */ |
if ( surface->map->dst->flags & SDL_HWSURFACE ) { |
hw_blit_ok = current_video->info.blit_hw; |
} else { |
hw_blit_ok = 0; |
} |
if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) { |
hw_blit_ok = current_video->info.blit_hw_CC; |
} |
if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) { |
hw_blit_ok = current_video->info.blit_hw_A; |
} |
} else { |
/* We only support accelerated blitting to hardware */ |
if ( surface->map->dst->flags & SDL_HWSURFACE ) { |
hw_blit_ok = current_video->info.blit_sw; |
} else { |
hw_blit_ok = 0; |
} |
if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) { |
hw_blit_ok = current_video->info.blit_sw_CC; |
} |
if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) { |
hw_blit_ok = current_video->info.blit_sw_A; |
} |
} |
if ( hw_blit_ok ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->CheckHWBlit(this, surface, surface->map->dst); |
} |
} |
/* Get the blit function index, based on surface mode */ |
/* { 0 = nothing, 1 = colorkey, 2 = alpha, 3 = colorkey+alpha } */ |
blit_index = 0; |
blit_index |= (!!(surface->flags & SDL_SRCCOLORKEY)) << 0; |
if ( surface->flags & SDL_SRCALPHA |
&& (surface->format->alpha != SDL_ALPHA_OPAQUE |
|| surface->format->Amask) ) { |
blit_index |= 2; |
} |
/* Check for special "identity" case -- copy blit */ |
if ( surface->map->identity && blit_index == 0 ) { |
surface->map->sw_data->blit = SDL_BlitCopy; |
/* Handle overlapping blits on the same surface */ |
if ( surface == surface->map->dst ) { |
surface->map->sw_data->blit = SDL_BlitCopyOverlap; |
} |
} else { |
if ( surface->format->BitsPerPixel < 8 ) { |
surface->map->sw_data->blit = |
SDL_CalculateBlit0(surface, blit_index); |
} else { |
switch ( surface->format->BytesPerPixel ) { |
case 1: |
surface->map->sw_data->blit = |
SDL_CalculateBlit1(surface, blit_index); |
break; |
case 2: |
case 3: |
case 4: |
surface->map->sw_data->blit = |
SDL_CalculateBlitN(surface, blit_index); |
break; |
default: |
surface->map->sw_data->blit = NULL; |
break; |
} |
} |
} |
/* Make sure we have a blit function */ |
if ( surface->map->sw_data->blit == NULL ) { |
SDL_InvalidateMap(surface->map); |
SDL_SetError("Blit combination not supported"); |
return(-1); |
} |
/* Choose software blitting function */ |
if(surface->flags & SDL_RLEACCELOK |
&& (surface->flags & SDL_HWACCEL) != SDL_HWACCEL) { |
if(surface->map->identity |
&& (blit_index == 1 |
|| (blit_index == 3 && !surface->format->Amask))) { |
if ( SDL_RLESurface(surface) == 0 ) |
surface->map->sw_blit = SDL_RLEBlit; |
} else if(blit_index == 2 && surface->format->Amask) { |
if ( SDL_RLESurface(surface) == 0 ) |
surface->map->sw_blit = SDL_RLEAlphaBlit; |
} |
} |
if ( surface->map->sw_blit == NULL ) { |
surface->map->sw_blit = SDL_SoftBlit; |
} |
return(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit.h |
---|
0,0 → 1,437 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_blit.h,v 1.3 2001/07/07 20:20:16 hercules Exp $"; |
#endif |
#ifndef _SDL_blit_h |
#define _SDL_blit_h |
#include "SDL_endian.h" |
/* The structure passed to the low level blit functions */ |
typedef struct { |
Uint8 *s_pixels; |
int s_width; |
int s_height; |
int s_skip; |
Uint8 *d_pixels; |
int d_width; |
int d_height; |
int d_skip; |
void *aux_data; |
SDL_PixelFormat *src; |
Uint8 *table; |
SDL_PixelFormat *dst; |
} SDL_BlitInfo; |
/* The type definition for the low level blit functions */ |
typedef void (*SDL_loblit)(SDL_BlitInfo *info); |
/* This is the private info structure for software accelerated blits */ |
struct private_swaccel { |
SDL_loblit blit; |
void *aux_data; |
}; |
/* Blit mapping definition */ |
typedef struct SDL_BlitMap { |
SDL_Surface *dst; |
int identity; |
Uint8 *table; |
SDL_blit hw_blit; |
SDL_blit sw_blit; |
struct private_hwaccel *hw_data; |
struct private_swaccel *sw_data; |
/* the version count matches the destination; mismatch indicates |
an invalid mapping */ |
unsigned int format_version; |
} SDL_BlitMap; |
/* Definitions for special global blit functions */ |
#include "SDL_blit_A.h" |
/* Functions found in SDL_blit.c */ |
extern int SDL_CalculateBlit(SDL_Surface *surface); |
/* Functions found in SDL_blit_{0,1,N,A}.c */ |
extern SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int complex); |
extern SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int complex); |
extern SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int complex); |
extern SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int complex); |
/* |
* Useful macros for blitting routines |
*/ |
#define FORMAT_EQUAL(A, B) \ |
((A)->BitsPerPixel == (B)->BitsPerPixel \ |
&& ((A)->Rmask == (B)->Rmask) && ((A)->Amask == (B)->Amask)) |
/* Load pixel of the specified format from a buffer and get its R-G-B values */ |
/* FIXME: rescale values to 0..255 here? */ |
#define RGB_FROM_PIXEL(pixel, fmt, r, g, b) \ |
{ \ |
r = (((pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss); \ |
g = (((pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss); \ |
b = (((pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss); \ |
} |
#define RGB_FROM_RGB565(pixel, r, g, b) \ |
{ \ |
r = (((pixel&0xF800)>>11)<<3); \ |
g = (((pixel&0x07E0)>>5)<<2); \ |
b = ((pixel&0x001F)<<3); \ |
} |
#define RGB_FROM_RGB555(pixel, r, g, b) \ |
{ \ |
r = (((pixel&0x7C00)>>10)<<3); \ |
g = (((pixel&0x03E0)>>5)<<3); \ |
b = ((pixel&0x001F)<<3); \ |
} |
#define RGB_FROM_RGB888(pixel, r, g, b) \ |
{ \ |
r = ((pixel&0xFF0000)>>16); \ |
g = ((pixel&0xFF00)>>8); \ |
b = (pixel&0xFF); \ |
} |
#define RETRIEVE_RGB_PIXEL(buf, bpp, pixel) \ |
do { \ |
switch (bpp) { \ |
case 2: \ |
pixel = *((Uint16 *)(buf)); \ |
break; \ |
\ |
case 3: { \ |
Uint8 *B = (Uint8 *)(buf); \ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ |
pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ |
} else { \ |
pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ |
} \ |
} \ |
break; \ |
\ |
case 4: \ |
pixel = *((Uint32 *)(buf)); \ |
break; \ |
\ |
default: \ |
pixel = 0; /* appease gcc */ \ |
break; \ |
} \ |
} while(0) |
#define DISEMBLE_RGB(buf, bpp, fmt, pixel, r, g, b) \ |
do { \ |
switch (bpp) { \ |
case 2: \ |
pixel = *((Uint16 *)(buf)); \ |
break; \ |
\ |
case 3: { \ |
Uint8 *B = (Uint8 *)buf; \ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ |
pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ |
} else { \ |
pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ |
} \ |
} \ |
break; \ |
\ |
case 4: \ |
pixel = *((Uint32 *)(buf)); \ |
break; \ |
\ |
default: \ |
pixel = 0; /* prevent gcc from complaining */ \ |
break; \ |
} \ |
RGB_FROM_PIXEL(pixel, fmt, r, g, b); \ |
} while(0) |
/* Assemble R-G-B values into a specified pixel format and store them */ |
#define PIXEL_FROM_RGB(pixel, fmt, r, g, b) \ |
{ \ |
pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \ |
((g>>fmt->Gloss)<<fmt->Gshift)| \ |
((b>>fmt->Bloss)<<fmt->Bshift); \ |
} |
#define RGB565_FROM_RGB(pixel, r, g, b) \ |
{ \ |
pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \ |
} |
#define RGB555_FROM_RGB(pixel, r, g, b) \ |
{ \ |
pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \ |
} |
#define RGB888_FROM_RGB(pixel, r, g, b) \ |
{ \ |
pixel = (r<<16)|(g<<8)|b; \ |
} |
#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \ |
{ \ |
switch (bpp) { \ |
case 2: { \ |
Uint16 pixel; \ |
\ |
PIXEL_FROM_RGB(pixel, fmt, r, g, b); \ |
*((Uint16 *)(buf)) = pixel; \ |
} \ |
break; \ |
\ |
case 3: { \ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ |
*((buf)+fmt->Rshift/8) = r; \ |
*((buf)+fmt->Gshift/8) = g; \ |
*((buf)+fmt->Bshift/8) = b; \ |
} else { \ |
*((buf)+2-fmt->Rshift/8) = r; \ |
*((buf)+2-fmt->Gshift/8) = g; \ |
*((buf)+2-fmt->Bshift/8) = b; \ |
} \ |
} \ |
break; \ |
\ |
case 4: { \ |
Uint32 pixel; \ |
\ |
PIXEL_FROM_RGB(pixel, fmt, r, g, b); \ |
*((Uint32 *)(buf)) = pixel; \ |
} \ |
break; \ |
} \ |
} |
#define ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask) \ |
{ \ |
switch (bpp) { \ |
case 2: { \ |
Uint16 *bufp; \ |
Uint16 pixel; \ |
\ |
bufp = (Uint16 *)buf; \ |
PIXEL_FROM_RGB(pixel, fmt, r, g, b); \ |
*bufp = pixel | (*bufp & Amask); \ |
} \ |
break; \ |
\ |
case 3: { \ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ |
*((buf)+fmt->Rshift/8) = r; \ |
*((buf)+fmt->Gshift/8) = g; \ |
*((buf)+fmt->Bshift/8) = b; \ |
} else { \ |
*((buf)+2-fmt->Rshift/8) = r; \ |
*((buf)+2-fmt->Gshift/8) = g; \ |
*((buf)+2-fmt->Bshift/8) = b; \ |
} \ |
} \ |
break; \ |
\ |
case 4: { \ |
Uint32 *bufp; \ |
Uint32 pixel; \ |
\ |
bufp = (Uint32 *)buf; \ |
PIXEL_FROM_RGB(pixel, fmt, r, g, b); \ |
*bufp = pixel | (*bufp & Amask); \ |
} \ |
break; \ |
} \ |
} |
/* FIXME: Should we rescale alpha into 0..255 here? */ |
#define RGBA_FROM_PIXEL(pixel, fmt, r, g, b, a) \ |
{ \ |
r = ((pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss; \ |
g = ((pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss; \ |
b = ((pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss; \ |
a = ((pixel&fmt->Amask)>>fmt->Ashift)<<fmt->Aloss; \ |
} |
#define RGBA_FROM_8888(pixel, fmt, r, g, b, a) \ |
{ \ |
r = (pixel&fmt->Rmask)>>fmt->Rshift; \ |
g = (pixel&fmt->Gmask)>>fmt->Gshift; \ |
b = (pixel&fmt->Bmask)>>fmt->Bshift; \ |
a = (pixel&fmt->Amask)>>fmt->Ashift; \ |
} |
#define RGBA_FROM_RGBA8888(pixel, r, g, b, a) \ |
{ \ |
r = (pixel>>24); \ |
g = ((pixel>>16)&0xFF); \ |
b = ((pixel>>8)&0xFF); \ |
a = (pixel&0xFF); \ |
} |
#define RGBA_FROM_ARGB8888(pixel, r, g, b, a) \ |
{ \ |
r = ((pixel>>16)&0xFF); \ |
g = ((pixel>>8)&0xFF); \ |
b = (pixel&0xFF); \ |
a = (pixel>>24); \ |
} |
#define RGBA_FROM_ABGR8888(pixel, r, g, b, a) \ |
{ \ |
r = (pixel&0xFF); \ |
g = ((pixel>>8)&0xFF); \ |
b = ((pixel>>16)&0xFF); \ |
a = (pixel>>24); \ |
} |
#define DISEMBLE_RGBA(buf, bpp, fmt, pixel, r, g, b, a) \ |
do { \ |
switch (bpp) { \ |
case 2: \ |
pixel = *((Uint16 *)(buf)); \ |
break; \ |
\ |
case 3: {/* FIXME: broken code (no alpha) */ \ |
Uint8 *b = (Uint8 *)buf; \ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ |
pixel = b[0] + (b[1] << 8) + (b[2] << 16); \ |
} else { \ |
pixel = (b[0] << 16) + (b[1] << 8) + b[2]; \ |
} \ |
} \ |
break; \ |
\ |
case 4: \ |
pixel = *((Uint32 *)(buf)); \ |
break; \ |
\ |
default: \ |
pixel = 0; /* stop gcc complaints */ \ |
break; \ |
} \ |
RGBA_FROM_PIXEL(pixel, fmt, r, g, b, a); \ |
pixel &= ~fmt->Amask; \ |
} while(0) |
/* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ |
#define PIXEL_FROM_RGBA(pixel, fmt, r, g, b, a) \ |
{ \ |
pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \ |
((g>>fmt->Gloss)<<fmt->Gshift)| \ |
((b>>fmt->Bloss)<<fmt->Bshift)| \ |
((a<<fmt->Aloss)<<fmt->Ashift); \ |
} |
#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ |
{ \ |
switch (bpp) { \ |
case 2: { \ |
Uint16 pixel; \ |
\ |
PIXEL_FROM_RGBA(pixel, fmt, r, g, b, a); \ |
*((Uint16 *)(buf)) = pixel; \ |
} \ |
break; \ |
\ |
case 3: { /* FIXME: broken code (no alpha) */ \ |
if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ |
*((buf)+fmt->Rshift/8) = r; \ |
*((buf)+fmt->Gshift/8) = g; \ |
*((buf)+fmt->Bshift/8) = b; \ |
} else { \ |
*((buf)+2-fmt->Rshift/8) = r; \ |
*((buf)+2-fmt->Gshift/8) = g; \ |
*((buf)+2-fmt->Bshift/8) = b; \ |
} \ |
} \ |
break; \ |
\ |
case 4: { \ |
Uint32 pixel; \ |
\ |
PIXEL_FROM_RGBA(pixel, fmt, r, g, b, a); \ |
*((Uint32 *)(buf)) = pixel; \ |
} \ |
break; \ |
} \ |
} |
/* Blend the RGB values of two pixels based on a source alpha value */ |
#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \ |
do { \ |
dR = (((sR-dR)*(A))>>8)+dR; \ |
dG = (((sG-dG)*(A))>>8)+dG; \ |
dB = (((sB-dB)*(A))>>8)+dB; \ |
} while(0) |
/* This is a very useful loop for optimizing blitters */ |
#define USE_DUFFS_LOOP |
#ifdef USE_DUFFS_LOOP |
/* 8-times unrolled loop */ |
#define DUFFS_LOOP8(pixel_copy_increment, width) \ |
{ int n = (width+7)/8; \ |
switch (width & 7) { \ |
case 0: do { pixel_copy_increment; \ |
case 7: pixel_copy_increment; \ |
case 6: pixel_copy_increment; \ |
case 5: pixel_copy_increment; \ |
case 4: pixel_copy_increment; \ |
case 3: pixel_copy_increment; \ |
case 2: pixel_copy_increment; \ |
case 1: pixel_copy_increment; \ |
} while ( --n > 0 ); \ |
} \ |
} |
/* 4-times unrolled loop */ |
#define DUFFS_LOOP4(pixel_copy_increment, width) \ |
{ int n = (width+3)/4; \ |
switch (width & 3) { \ |
case 0: do { pixel_copy_increment; \ |
case 3: pixel_copy_increment; \ |
case 2: pixel_copy_increment; \ |
case 1: pixel_copy_increment; \ |
} while ( --n > 0 ); \ |
} \ |
} |
/* Use the 8-times version of the loop by default */ |
#define DUFFS_LOOP(pixel_copy_increment, width) \ |
DUFFS_LOOP8(pixel_copy_increment, width) |
#else |
/* Don't use Duff's device to unroll loops */ |
#define DUFFS_LOOP(pixel_copy_increment, width) \ |
{ int n; \ |
for ( n=width; n > 0; --n ) { \ |
pixel_copy_increment; \ |
} \ |
} |
#define DUFFS_LOOP8(pixel_copy_increment, width) \ |
DUFFS_LOOP(pixel_copy_increment, width) |
#define DUFFS_LOOP4(pixel_copy_increment, width) \ |
DUFFS_LOOP(pixel_copy_increment, width) |
#endif /* USE_DUFFS_LOOP */ |
/* Prevent Visual C++ 6.0 from printing out stupid warnings */ |
#if defined(_MSC_VER) && (_MSC_VER >= 600) |
#pragma warning(disable: 4550) |
#endif |
#endif /* _SDL_blit_h */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit_0.c |
---|
0,0 → 1,471 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdio.h> |
#include <string.h> |
#include "SDL_types.h" |
#include "SDL_video.h" |
#include "SDL_blit.h" |
/* Functions to blit from bitmaps to other surfaces */ |
static void BlitBto1(SDL_BlitInfo *info) |
{ |
int c; |
int width, height; |
Uint8 *src, *map, *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
srcskip += width-(width+7)/8; |
if ( map ) { |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( 1 ) { |
*dst = map[bit]; |
} |
dst++; |
byte <<= 1; |
} |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( 1 ) { |
*dst = bit; |
} |
dst++; |
byte <<= 1; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
} |
static void BlitBto2(SDL_BlitInfo *info) |
{ |
int c; |
int width, height; |
Uint8 *src; |
Uint16 *map, *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = (Uint16 *)info->d_pixels; |
dstskip = info->d_skip/2; |
map = (Uint16 *)info->table; |
srcskip += width-(width+7)/8; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( 1 ) { |
*dst = map[bit]; |
} |
byte <<= 1; |
dst++; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitBto3(SDL_BlitInfo *info) |
{ |
int c, o; |
int width, height; |
Uint8 *src, *map, *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
srcskip += width-(width+7)/8; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( 1 ) { |
o = bit * 4; |
dst[0] = map[o++]; |
dst[1] = map[o++]; |
dst[2] = map[o++]; |
} |
byte <<= 1; |
dst += 3; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitBto4(SDL_BlitInfo *info) |
{ |
int width, height; |
Uint8 *src; |
Uint32 *map, *dst; |
int srcskip, dstskip; |
int c; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = (Uint32 *)info->d_pixels; |
dstskip = info->d_skip/4; |
map = (Uint32 *)info->table; |
srcskip += width-(width+7)/8; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( 1 ) { |
*dst = map[bit]; |
} |
byte <<= 1; |
dst++; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitBto1Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
Uint8 *dst = info->d_pixels; |
int srcskip = info->s_skip; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
Uint8 *palmap = info->table; |
int c; |
/* Set up some basic variables */ |
srcskip += width-(width+7)/8; |
if ( palmap ) { |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( bit != ckey ) { |
*dst = palmap[bit]; |
} |
dst++; |
byte <<= 1; |
} |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( bit != ckey ) { |
*dst = bit; |
} |
dst++; |
byte <<= 1; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
} |
static void BlitBto2Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int srcskip = info->s_skip; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
Uint8 *palmap = info->table; |
int c; |
/* Set up some basic variables */ |
srcskip += width-(width+7)/8; |
dstskip /= 2; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( bit != ckey ) { |
*dstp=((Uint16 *)palmap)[bit]; |
} |
byte <<= 1; |
dstp++; |
} |
src += srcskip; |
dstp += dstskip; |
} |
} |
static void BlitBto3Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
Uint8 *dst = info->d_pixels; |
int srcskip = info->s_skip; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
Uint8 *palmap = info->table; |
int c; |
/* Set up some basic variables */ |
srcskip += width-(width+7)/8; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( bit != ckey ) { |
memcpy(dst, &palmap[bit*4], 3); |
} |
byte <<= 1; |
dst += 3; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitBto4Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
Uint32 *dstp = (Uint32 *)info->d_pixels; |
int srcskip = info->s_skip; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
Uint8 *palmap = info->table; |
int c; |
/* Set up some basic variables */ |
srcskip += width-(width+7)/8; |
dstskip /= 4; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( bit != ckey ) { |
*dstp=((Uint32 *)palmap)[bit]; |
} |
byte <<= 1; |
dstp++; |
} |
src += srcskip; |
dstp += dstskip; |
} |
} |
static void BlitBtoNAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
Uint8 *dst = info->d_pixels; |
int srcskip = info->s_skip; |
int dstskip = info->d_skip; |
const SDL_Color *srcpal = info->src->palette->colors; |
SDL_PixelFormat *dstfmt = info->dst; |
int dstbpp; |
int c; |
const int A = info->src->alpha; |
/* Set up some basic variables */ |
dstbpp = dstfmt->BytesPerPixel; |
srcskip += width-(width+7)/8; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( 1 ) { |
Uint32 pixel; |
unsigned sR, sG, sB; |
unsigned dR, dG, dB; |
sR = srcpal[bit].r; |
sG = srcpal[bit].g; |
sB = srcpal[bit].b; |
DISEMBLE_RGB(dst, dstbpp, dstfmt, |
pixel, dR, dG, dB); |
ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); |
ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); |
} |
byte <<= 1; |
dst += dstbpp; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitBtoNAlphaKey(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
Uint8 *dst = info->d_pixels; |
int srcskip = info->s_skip; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
const SDL_Color *srcpal = srcfmt->palette->colors; |
int dstbpp; |
int c; |
const int A = srcfmt->alpha; |
Uint32 ckey = srcfmt->colorkey; |
/* Set up some basic variables */ |
dstbpp = dstfmt->BytesPerPixel; |
srcskip += width-(width+7)/8; |
while ( height-- ) { |
Uint8 byte = 0, bit; |
for ( c=0; c<width; ++c ) { |
if ( (c&7) == 0 ) { |
byte = *src++; |
} |
bit = (byte&0x80)>>7; |
if ( bit != ckey ) { |
int sR, sG, sB; |
int dR, dG, dB; |
Uint32 pixel; |
sR = srcpal[bit].r; |
sG = srcpal[bit].g; |
sB = srcpal[bit].b; |
DISEMBLE_RGB(dst, dstbpp, dstfmt, |
pixel, dR, dG, dB); |
ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); |
ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); |
} |
byte <<= 1; |
dst += dstbpp; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static SDL_loblit bitmap_blit[] = { |
NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4 |
}; |
static SDL_loblit colorkey_blit[] = { |
NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key |
}; |
SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int blit_index) |
{ |
int which; |
if ( surface->map->dst->format->BitsPerPixel < 8 ) { |
which = 0; |
} else { |
which = surface->map->dst->format->BytesPerPixel; |
} |
switch(blit_index) { |
case 0: /* copy */ |
return bitmap_blit[which]; |
case 1: /* colorkey */ |
return colorkey_blit[which]; |
case 2: /* alpha */ |
return which >= 2 ? BlitBtoNAlpha : NULL; |
case 4: /* alpha + colorkey */ |
return which >= 2 ? BlitBtoNAlphaKey : NULL; |
} |
return NULL; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit_1.c |
---|
0,0 → 1,526 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdio.h> |
#include "SDL_types.h" |
#include "SDL_video.h" |
#include "SDL_blit.h" |
#include "SDL_sysvideo.h" |
#include "SDL_endian.h" |
/* Functions to blit from 8-bit surfaces to other surfaces */ |
static void Blit1to1(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint8 *src, *map, *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
{ |
*dst = map[*src]; |
} |
dst++; |
src++; |
, width); |
#else |
for ( c=width; c; --c ) { |
*dst = map[*src]; |
dst++; |
src++; |
} |
#endif |
src += srcskip; |
dst += dstskip; |
} |
} |
/* This is now endian dependent */ |
#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) |
#define HI 1 |
#define LO 0 |
#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */ |
#define HI 0 |
#define LO 1 |
#endif |
static void Blit1to2(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint8 *src, *dst; |
Uint16 *map; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = (Uint16 *)info->table; |
#ifdef USE_DUFFS_LOOP |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
*(Uint16 *)dst = map[*src++]; |
dst += 2; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
#else |
/* Memory align at 4-byte boundary, if necessary */ |
if ( (long)dst & 0x03 ) { |
/* Don't do anything if width is 0 */ |
if ( width == 0 ) { |
return; |
} |
--width; |
while ( height-- ) { |
/* Perform copy alignment */ |
*(Uint16 *)dst = map[*src++]; |
dst += 2; |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
*(Uint32 *)dst = |
(map[src[HI]]<<16)|(map[src[LO]]); |
src += 2; |
dst += 4; |
*(Uint32 *)dst = |
(map[src[HI]]<<16)|(map[src[LO]]); |
src += 2; |
dst += 4; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
*(Uint16 *)dst = map[*src++]; |
dst += 2; |
case 2: |
*(Uint32 *)dst = |
(map[src[HI]]<<16)|(map[src[LO]]); |
src += 2; |
dst += 4; |
break; |
case 1: |
*(Uint16 *)dst = map[*src++]; |
dst += 2; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
*(Uint32 *)dst = |
(map[src[HI]]<<16)|(map[src[LO]]); |
src += 2; |
dst += 4; |
*(Uint32 *)dst = |
(map[src[HI]]<<16)|(map[src[LO]]); |
src += 2; |
dst += 4; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
*(Uint16 *)dst = map[*src++]; |
dst += 2; |
case 2: |
*(Uint32 *)dst = |
(map[src[HI]]<<16)|(map[src[LO]]); |
src += 2; |
dst += 4; |
break; |
case 1: |
*(Uint16 *)dst = map[*src++]; |
dst += 2; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
#endif /* USE_DUFFS_LOOP */ |
} |
static void Blit1to3(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int o; |
int width, height; |
Uint8 *src, *map, *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
{ |
o = *src * 4; |
dst[0] = map[o++]; |
dst[1] = map[o++]; |
dst[2] = map[o++]; |
} |
src++; |
dst += 3; |
, width); |
#else |
for ( c=width; c; --c ) { |
o = *src * 4; |
dst[0] = map[o++]; |
dst[1] = map[o++]; |
dst[2] = map[o++]; |
src++; |
dst += 3; |
} |
#endif /* USE_DUFFS_LOOP */ |
src += srcskip; |
dst += dstskip; |
} |
} |
static void Blit1to4(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint8 *src; |
Uint32 *map, *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = (Uint32 *)info->d_pixels; |
dstskip = info->d_skip/4; |
map = (Uint32 *)info->table; |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
*dst++ = map[*src++]; |
, width); |
#else |
for ( c=width/4; c; --c ) { |
*dst++ = map[*src++]; |
*dst++ = map[*src++]; |
*dst++ = map[*src++]; |
*dst++ = map[*src++]; |
} |
switch ( width & 3 ) { |
case 3: |
*dst++ = map[*src++]; |
case 2: |
*dst++ = map[*src++]; |
case 1: |
*dst++ = map[*src++]; |
} |
#endif /* USE_DUFFS_LOOP */ |
src += srcskip; |
dst += dstskip; |
} |
} |
static void Blit1to1Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint8 *palmap = info->table; |
Uint32 ckey = info->src->colorkey; |
if ( palmap ) { |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
if ( *src != ckey ) { |
*dst = palmap[*src]; |
} |
dst++; |
src++; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
if ( *src != ckey ) { |
*dst = *src; |
} |
dst++; |
src++; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
} |
static void Blit1to2Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip; |
Uint16 *palmap = (Uint16 *)info->table; |
Uint32 ckey = info->src->colorkey; |
/* Set up some basic variables */ |
dstskip /= 2; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
if ( *src != ckey ) { |
*dstp=palmap[*src]; |
} |
src++; |
dstp++; |
}, |
width); |
src += srcskip; |
dstp += dstskip; |
} |
} |
static void Blit1to3Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint8 *palmap = info->table; |
Uint32 ckey = info->src->colorkey; |
int o; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
if ( *src != ckey ) { |
o = *src * 4; |
dst[0] = palmap[o++]; |
dst[1] = palmap[o++]; |
dst[2] = palmap[o++]; |
} |
src++; |
dst += 3; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
static void Blit1to4Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint32 *dstp = (Uint32 *)info->d_pixels; |
int dstskip = info->d_skip; |
Uint32 *palmap = (Uint32 *)info->table; |
Uint32 ckey = info->src->colorkey; |
/* Set up some basic variables */ |
dstskip /= 4; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
if ( *src != ckey ) { |
*dstp = palmap[*src]; |
} |
src++; |
dstp++; |
}, |
width); |
src += srcskip; |
dstp += dstskip; |
} |
} |
static void Blit1toNAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *dstfmt = info->dst; |
const SDL_Color *srcpal = info->src->palette->colors; |
int dstbpp; |
const int A = info->src->alpha; |
/* Set up some basic variables */ |
dstbpp = dstfmt->BytesPerPixel; |
while ( height-- ) { |
int sR, sG, sB; |
int dR, dG, dB; |
DUFFS_LOOP4( |
{ |
Uint32 pixel; |
sR = srcpal[*src].r; |
sG = srcpal[*src].g; |
sB = srcpal[*src].b; |
DISEMBLE_RGB(dst, dstbpp, dstfmt, |
pixel, dR, dG, dB); |
ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); |
ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); |
src++; |
dst += dstbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
static void Blit1toNAlphaKey(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
const SDL_Color *srcpal = info->src->palette->colors; |
Uint32 ckey = srcfmt->colorkey; |
int dstbpp; |
const int A = srcfmt->alpha; |
/* Set up some basic variables */ |
dstbpp = dstfmt->BytesPerPixel; |
while ( height-- ) { |
int sR, sG, sB; |
int dR, dG, dB; |
DUFFS_LOOP( |
{ |
if ( *src != ckey ) { |
Uint32 pixel; |
sR = srcpal[*src].r; |
sG = srcpal[*src].g; |
sB = srcpal[*src].b; |
DISEMBLE_RGB(dst, dstbpp, dstfmt, |
pixel, dR, dG, dB); |
ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); |
ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); |
} |
src++; |
dst += dstbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
static SDL_loblit one_blit[] = { |
NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4 |
}; |
static SDL_loblit one_blitkey[] = { |
NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key |
}; |
SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int blit_index) |
{ |
int which; |
SDL_PixelFormat *dstfmt; |
dstfmt = surface->map->dst->format; |
if ( dstfmt->BitsPerPixel < 8 ) { |
which = 0; |
} else { |
which = dstfmt->BytesPerPixel; |
} |
switch(blit_index) { |
case 0: /* copy */ |
return one_blit[which]; |
case 1: /* colorkey */ |
return one_blitkey[which]; |
case 2: /* alpha */ |
/* Supporting 8bpp->8bpp alpha is doable but requires lots of |
tables which consume space and takes time to precompute, |
so is better left to the user */ |
return which >= 2 ? Blit1toNAlpha : NULL; |
case 3: /* alpha + colorkey */ |
return which >= 2 ? Blit1toNAlphaKey : NULL; |
} |
return NULL; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit_A.c |
---|
0,0 → 1,772 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdio.h> |
#include "SDL_types.h" |
#include "SDL_video.h" |
#include "SDL_blit.h" |
/* Functions to perform alpha blended blitting */ |
/* N->1 blending with per-surface alpha */ |
static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint8 *palmap = info->table; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
int srcbpp = srcfmt->BytesPerPixel; |
const unsigned A = srcfmt->alpha; |
while ( height-- ) { |
DUFFS_LOOP4( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
unsigned dR; |
unsigned dG; |
unsigned dB; |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, sR, sG, sB); |
dR = dstfmt->palette->colors[*dst].r; |
dG = dstfmt->palette->colors[*dst].g; |
dB = dstfmt->palette->colors[*dst].b; |
ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); |
dR &= 0xff; |
dG &= 0xff; |
dB &= 0xff; |
/* Pack RGB into 8bit pixel */ |
if ( palmap == NULL ) { |
*dst =((dR>>5)<<(3+2))| |
((dG>>5)<<(2))| |
((dB>>6)<<(0)); |
} else { |
*dst = palmap[((dR>>5)<<(3+2))| |
((dG>>5)<<(2)) | |
((dB>>6)<<(0))]; |
} |
dst++; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
/* N->1 blending with pixel alpha */ |
static void BlitNto1PixelAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint8 *palmap = info->table; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
int srcbpp = srcfmt->BytesPerPixel; |
/* FIXME: fix alpha bit field expansion here too? */ |
while ( height-- ) { |
DUFFS_LOOP4( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
unsigned sA; |
unsigned dR; |
unsigned dG; |
unsigned dB; |
DISEMBLE_RGBA(src,srcbpp,srcfmt,pixel,sR,sG,sB,sA); |
dR = dstfmt->palette->colors[*dst].r; |
dG = dstfmt->palette->colors[*dst].g; |
dB = dstfmt->palette->colors[*dst].b; |
ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); |
dR &= 0xff; |
dG &= 0xff; |
dB &= 0xff; |
/* Pack RGB into 8bit pixel */ |
if ( palmap == NULL ) { |
*dst =((dR>>5)<<(3+2))| |
((dG>>5)<<(2))| |
((dB>>6)<<(0)); |
} else { |
*dst = palmap[((dR>>5)<<(3+2))| |
((dG>>5)<<(2)) | |
((dB>>6)<<(0)) ]; |
} |
dst++; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
/* colorkeyed N->1 blending with per-surface alpha */ |
static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint8 *palmap = info->table; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
int srcbpp = srcfmt->BytesPerPixel; |
Uint32 ckey = srcfmt->colorkey; |
const int A = srcfmt->alpha; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
unsigned dR; |
unsigned dG; |
unsigned dB; |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, sR, sG, sB); |
if ( pixel != ckey ) { |
dR = dstfmt->palette->colors[*dst].r; |
dG = dstfmt->palette->colors[*dst].g; |
dB = dstfmt->palette->colors[*dst].b; |
ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); |
dR &= 0xff; |
dG &= 0xff; |
dB &= 0xff; |
/* Pack RGB into 8bit pixel */ |
if ( palmap == NULL ) { |
*dst =((dR>>5)<<(3+2))| |
((dG>>5)<<(2)) | |
((dB>>6)<<(0)); |
} else { |
*dst = palmap[((dR>>5)<<(3+2))| |
((dG>>5)<<(2)) | |
((dB>>6)<<(0)) ]; |
} |
} |
dst++; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ |
static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint32 *srcp = (Uint32 *)info->s_pixels; |
int srcskip = info->s_skip >> 2; |
Uint32 *dstp = (Uint32 *)info->d_pixels; |
int dstskip = info->d_skip >> 2; |
while(height--) { |
DUFFS_LOOP4({ |
Uint32 s = *srcp++; |
Uint32 d = *dstp; |
*dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) |
+ (s & d & 0x00010101)) | 0xff000000; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
/* fast RGB888->(A)RGB888 blending with surface alpha */ |
static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) |
{ |
unsigned alpha = info->src->alpha; |
if(alpha == 128) { |
BlitRGBtoRGBSurfaceAlpha128(info); |
} else { |
int width = info->d_width; |
int height = info->d_height; |
Uint32 *srcp = (Uint32 *)info->s_pixels; |
int srcskip = info->s_skip >> 2; |
Uint32 *dstp = (Uint32 *)info->d_pixels; |
int dstskip = info->d_skip >> 2; |
while(height--) { |
DUFFS_LOOP4({ |
Uint32 s; |
Uint32 d; |
Uint32 s1; |
Uint32 d1; |
s = *srcp; |
d = *dstp; |
s1 = s & 0xff00ff; |
d1 = d & 0xff00ff; |
d1 = (d1 + ((s1 - d1) * alpha >> 8)) |
& 0xff00ff; |
s &= 0xff00; |
d &= 0xff00; |
d = (d + ((s - d) * alpha >> 8)) & 0xff00; |
*dstp = d1 | d | 0xff000000; |
++srcp; |
++dstp; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
} |
/* fast ARGB888->(A)RGB888 blending with pixel alpha */ |
static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint32 *srcp = (Uint32 *)info->s_pixels; |
int srcskip = info->s_skip >> 2; |
Uint32 *dstp = (Uint32 *)info->d_pixels; |
int dstskip = info->d_skip >> 2; |
while(height--) { |
DUFFS_LOOP4({ |
Uint32 dalpha; |
Uint32 d; |
Uint32 s1; |
Uint32 d1; |
Uint32 s = *srcp; |
Uint32 alpha = s >> 24; |
/* FIXME: Here we special-case opaque alpha since the |
compositioning used (>>8 instead of /255) doesn't handle |
it correctly. Also special-case alpha=0 for speed? |
Benchmark this! */ |
if(alpha == SDL_ALPHA_OPAQUE) { |
*dstp = (s & 0x00ffffff) | (*dstp & 0xff000000); |
} else { |
/* |
* take out the middle component (green), and process |
* the other two in parallel. One multiply less. |
*/ |
d = *dstp; |
dalpha = d & 0xff000000; |
s1 = s & 0xff00ff; |
d1 = d & 0xff00ff; |
d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; |
s &= 0xff00; |
d &= 0xff00; |
d = (d + ((s - d) * alpha >> 8)) & 0xff00; |
*dstp = d1 | d | dalpha; |
} |
++srcp; |
++dstp; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
/* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */ |
/* blend a single 16 bit pixel at 50% */ |
#define BLEND16_50(d, s, mask) \ |
((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff))) |
/* blend two 16 bit pixels at 50% */ |
#define BLEND2x16_50(d, s, mask) \ |
(((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \ |
+ (s & d & (~(mask | mask << 16)))) |
static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint16 *srcp = (Uint16 *)info->s_pixels; |
int srcskip = info->s_skip >> 1; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip >> 1; |
while(height--) { |
if(((unsigned long)srcp ^ (unsigned long)dstp) & 2) { |
/* |
* Source and destination not aligned, pipeline it. |
* This is mostly a win for big blits but no loss for |
* small ones |
*/ |
Uint32 prev_sw; |
int w = width; |
/* handle odd destination */ |
if((unsigned long)dstp & 2) { |
Uint16 d = *dstp, s = *srcp; |
*dstp = BLEND16_50(d, s, mask); |
dstp++; |
srcp++; |
w--; |
} |
srcp++; /* srcp is now 32-bit aligned */ |
/* bootstrap pipeline with first halfword */ |
prev_sw = ((Uint32 *)srcp)[-1]; |
while(w > 1) { |
Uint32 sw, dw, s; |
sw = *(Uint32 *)srcp; |
dw = *(Uint32 *)dstp; |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) |
s = (prev_sw << 16) + (sw >> 16); |
else |
s = (prev_sw >> 16) + (sw << 16); |
prev_sw = sw; |
*(Uint32 *)dstp = BLEND2x16_50(dw, s, mask); |
dstp += 2; |
srcp += 2; |
w -= 2; |
} |
/* final pixel if any */ |
if(w) { |
Uint16 d = *dstp, s; |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) |
s = prev_sw; |
else |
s = prev_sw >> 16; |
*dstp = BLEND16_50(d, s, mask); |
srcp++; |
dstp++; |
} |
srcp += srcskip - 1; |
dstp += dstskip; |
} else { |
/* source and destination are aligned */ |
int w = width; |
/* first odd pixel? */ |
if((unsigned long)srcp & 2) { |
Uint16 d = *dstp, s = *srcp; |
*dstp = BLEND16_50(d, s, mask); |
srcp++; |
dstp++; |
w--; |
} |
/* srcp and dstp are now 32-bit aligned */ |
while(w > 1) { |
Uint32 sw = *(Uint32 *)srcp; |
Uint32 dw = *(Uint32 *)dstp; |
*(Uint32 *)dstp = BLEND2x16_50(dw, sw, mask); |
srcp += 2; |
dstp += 2; |
w -= 2; |
} |
/* last odd pixel? */ |
if(w) { |
Uint16 d = *dstp, s = *srcp; |
*dstp = BLEND16_50(d, s, mask); |
srcp++; |
dstp++; |
} |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
} |
/* fast RGB565->RGB565 blending with surface alpha */ |
static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info) |
{ |
unsigned alpha = info->src->alpha; |
if(alpha == 128) { |
Blit16to16SurfaceAlpha128(info, 0xf7de); |
} else { |
int width = info->d_width; |
int height = info->d_height; |
Uint16 *srcp = (Uint16 *)info->s_pixels; |
int srcskip = info->s_skip >> 1; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip >> 1; |
alpha >>= 3; /* downscale alpha to 5 bits */ |
while(height--) { |
DUFFS_LOOP4({ |
Uint32 s = *srcp++; |
Uint32 d = *dstp; |
/* |
* shift out the middle component (green) to |
* the high 16 bits, and process all three RGB |
* components at the same time. |
*/ |
s = (s | s << 16) & 0x07e0f81f; |
d = (d | d << 16) & 0x07e0f81f; |
d += (s - d) * alpha >> 5; |
d &= 0x07e0f81f; |
*dstp++ = d | d >> 16; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
} |
/* fast RGB555->RGB555 blending with surface alpha */ |
static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) |
{ |
unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */ |
if(alpha == 128) { |
Blit16to16SurfaceAlpha128(info, 0xfbde); |
} else { |
int width = info->d_width; |
int height = info->d_height; |
Uint16 *srcp = (Uint16 *)info->s_pixels; |
int srcskip = info->s_skip >> 1; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip >> 1; |
alpha >>= 3; /* downscale alpha to 5 bits */ |
while(height--) { |
DUFFS_LOOP4({ |
Uint32 s = *srcp++; |
Uint32 d = *dstp; |
/* |
* shift out the middle component (green) to |
* the high 16 bits, and process all three RGB |
* components at the same time. |
*/ |
s = (s | s << 16) & 0x03e07c1f; |
d = (d | d << 16) & 0x03e07c1f; |
d += (s - d) * alpha >> 5; |
d &= 0x03e07c1f; |
*dstp++ = d | d >> 16; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
} |
/* fast ARGB8888->RGB565 blending with pixel alpha */ |
static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint32 *srcp = (Uint32 *)info->s_pixels; |
int srcskip = info->s_skip >> 2; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip >> 1; |
while(height--) { |
DUFFS_LOOP4({ |
Uint32 s = *srcp; |
unsigned alpha = s >> 27; /* downscale alpha to 5 bits */ |
/* FIXME: Here we special-case opaque alpha since the |
compositioning used (>>8 instead of /255) doesn't handle |
it correctly. Also special-case alpha=0 for speed? |
Benchmark this! */ |
if(alpha == (SDL_ALPHA_OPAQUE >> 3)) { |
*dstp = (s >> 8 & 0xf800) + (s >> 5 & 0x7e0) |
+ (s >> 3 & 0x1f); |
} else { |
Uint32 d = *dstp; |
/* |
* convert source and destination to G0RAB65565 |
* and blend all components at the same time |
*/ |
s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800) |
+ (s >> 3 & 0x1f); |
d = (d | d << 16) & 0x07e0f81f; |
d += (s - d) * alpha >> 5; |
d &= 0x07e0f81f; |
*dstp = d | d >> 16; |
} |
srcp++; |
dstp++; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
/* fast ARGB8888->RGB555 blending with pixel alpha */ |
static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint32 *srcp = (Uint32 *)info->s_pixels; |
int srcskip = info->s_skip >> 2; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip >> 1; |
while(height--) { |
DUFFS_LOOP4({ |
unsigned alpha; |
Uint32 s = *srcp; |
alpha = s >> 27; /* downscale alpha to 5 bits */ |
/* FIXME: Here we special-case opaque alpha since the |
compositioning used (>>8 instead of /255) doesn't handle |
it correctly. Also special-case alpha=0 for speed? |
Benchmark this! */ |
if(alpha == (SDL_ALPHA_OPAQUE >> 3)) { |
*dstp = (s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) |
+ (s >> 3 & 0x1f); |
} else { |
Uint32 d = *dstp; |
/* |
* convert source and destination to G0RAB65565 |
* and blend all components at the same time |
*/ |
s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00) |
+ (s >> 3 & 0x1f); |
d = (d | d << 16) & 0x03e07c1f; |
d += (s - d) * alpha >> 5; |
d &= 0x03e07c1f; |
*dstp = d | d >> 16; |
} |
srcp++; |
dstp++; |
}, width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
/* General (slow) N->N blending with per-surface alpha */ |
static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
int srcbpp = srcfmt->BytesPerPixel; |
int dstbpp = dstfmt->BytesPerPixel; |
unsigned sA = srcfmt->alpha; |
unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; |
while ( height-- ) { |
DUFFS_LOOP4( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
unsigned dR; |
unsigned dG; |
unsigned dB; |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, sR, sG, sB); |
DISEMBLE_RGB(dst, dstbpp, dstfmt, pixel, dR, dG, dB); |
ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); |
src += srcbpp; |
dst += dstbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
/* General (slow) colorkeyed N->N blending with per-surface alpha */ |
static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
Uint32 ckey = srcfmt->colorkey; |
int srcbpp = srcfmt->BytesPerPixel; |
int dstbpp = dstfmt->BytesPerPixel; |
unsigned sA = srcfmt->alpha; |
unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; |
while ( height-- ) { |
DUFFS_LOOP4( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
unsigned dR; |
unsigned dG; |
unsigned dB; |
RETRIEVE_RGB_PIXEL(src, srcbpp, pixel); |
if(pixel != ckey) { |
RGB_FROM_PIXEL(pixel, srcfmt, sR, sG, sB); |
DISEMBLE_RGB(dst, dstbpp, dstfmt, pixel, dR, dG, dB); |
ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); |
} |
src += srcbpp; |
dst += dstbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
/* General (slow) N->N blending with pixel alpha */ |
static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
int srcbpp; |
int dstbpp; |
/* Set up some basic variables */ |
srcbpp = srcfmt->BytesPerPixel; |
dstbpp = dstfmt->BytesPerPixel; |
/* FIXME: for 8bpp source alpha, this doesn't get opaque values |
quite right. for <8bpp source alpha, it gets them very wrong |
(check all macros!) |
It is unclear whether there is a good general solution that doesn't |
need a branch (or a divide). */ |
while ( height-- ) { |
DUFFS_LOOP4( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
unsigned dR; |
unsigned dG; |
unsigned dB; |
unsigned sA; |
unsigned dA; |
DISEMBLE_RGBA(src, srcbpp, srcfmt, pixel, sR, sG, sB, sA); |
DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); |
ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); |
src += srcbpp; |
dst += dstbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) |
{ |
SDL_PixelFormat *sf = surface->format; |
SDL_PixelFormat *df = surface->map->dst->format; |
if(sf->Amask == 0) { |
if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { |
if(df->BytesPerPixel == 1) |
return BlitNto1SurfaceAlphaKey; |
else |
return BlitNtoNSurfaceAlphaKey; |
} else { |
/* Per-surface alpha blits */ |
switch(df->BytesPerPixel) { |
case 1: |
return BlitNto1SurfaceAlpha; |
case 2: |
if(surface->map->identity) { |
if(df->Gmask == 0x7e0) |
return Blit565to565SurfaceAlpha; |
else if(df->Gmask == 0x3e0) |
return Blit555to555SurfaceAlpha; |
} |
return BlitNtoNSurfaceAlpha; |
case 4: |
if(sf->Rmask == df->Rmask |
&& sf->Gmask == df->Gmask |
&& sf->Bmask == df->Bmask |
&& (sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff |
&& sf->BytesPerPixel == 4) |
return BlitRGBtoRGBSurfaceAlpha; |
else |
return BlitNtoNSurfaceAlpha; |
case 3: |
default: |
return BlitNtoNSurfaceAlpha; |
} |
} |
} else { |
/* Per-pixel alpha blits */ |
switch(df->BytesPerPixel) { |
case 1: |
return BlitNto1PixelAlpha; |
case 2: |
if(sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 |
&& sf->Gmask == 0xff00 |
&& ((sf->Rmask == 0xff && df->Rmask == 0x1f) |
|| (sf->Bmask == 0xff && df->Bmask == 0x1f))) { |
if(df->Gmask == 0x7e0) |
return BlitARGBto565PixelAlpha; |
else if(df->Gmask == 0x3e0) |
return BlitARGBto555PixelAlpha; |
} |
return BlitNtoNPixelAlpha; |
case 4: |
if(sf->Amask == 0xff000000 |
&& sf->Rmask == df->Rmask |
&& sf->Gmask == df->Gmask |
&& sf->Bmask == df->Bmask |
&& sf->BytesPerPixel == 4) |
return BlitRGBtoRGBPixelAlpha; |
return BlitNtoNPixelAlpha; |
case 3: |
default: |
return BlitNtoNPixelAlpha; |
} |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit_A.h |
---|
0,0 → 1,30 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_blit_A.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Functions from SDL_blitalpha.c */ |
extern void SDL_BlitAlpha(SDL_BlitInfo *info); |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_blit_N.c |
---|
0,0 → 1,1607 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdio.h> |
#include "SDL_types.h" |
#include "SDL_video.h" |
#include "SDL_blit.h" |
#include "SDL_byteorder.h" |
/* Function to check the CPU flags */ |
#define MMX_CPU 0x800000 |
#ifdef USE_ASMBLIT |
#define CPU_Flags() Hermes_X86_CPU() |
#else |
#define CPU_Flags() 0L |
#endif |
/* Functions to blit from N-bit surfaces to other surfaces */ |
#ifdef USE_ASMBLIT |
/* Heheheh, we coerce Hermes into using SDL blit information */ |
#define X86_ASSEMBLER |
#define HermesConverterInterface SDL_BlitInfo |
#define HermesClearInterface void |
#define STACKCALL |
typedef Uint32 int32; |
#include "HeadMMX.h" |
#include "HeadX86.h" |
#else |
/* This is now endian dependent */ |
#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) |
#define HI 1 |
#define LO 0 |
#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */ |
#define HI 0 |
#define LO 1 |
#endif |
/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ |
#define RGB888_RGB332(dst, src) { \ |
dst = (((src)&0x00E00000)>>16)| \ |
(((src)&0x0000E000)>>11)| \ |
(((src)&0x000000C0)>>6); \ |
} |
static void Blit_RGB888_index8(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint32 *src; |
const Uint8 *map; |
Uint8 *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = (Uint32 *)info->s_pixels; |
srcskip = info->s_skip/4; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
if ( map == NULL ) { |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
RGB888_RGB332(*dst++, *src); |
, width); |
#else |
for ( c=width/4; c; --c ) { |
/* Pack RGB into 8bit pixel */ |
++src; |
RGB888_RGB332(*dst++, *src); |
++src; |
RGB888_RGB332(*dst++, *src); |
++src; |
RGB888_RGB332(*dst++, *src); |
++src; |
} |
switch ( width & 3 ) { |
case 3: |
RGB888_RGB332(*dst++, *src); |
++src; |
case 2: |
RGB888_RGB332(*dst++, *src); |
++src; |
case 1: |
RGB888_RGB332(*dst++, *src); |
++src; |
} |
#endif /* USE_DUFFS_LOOP */ |
src += srcskip; |
dst += dstskip; |
} |
} else { |
int pixel; |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
, width); |
#else |
for ( c=width/4; c; --c ) { |
/* Pack RGB into 8bit pixel */ |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
} |
switch ( width & 3 ) { |
case 3: |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
case 2: |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
case 1: |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
} |
#endif /* USE_DUFFS_LOOP */ |
src += srcskip; |
dst += dstskip; |
} |
} |
} |
/* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */ |
#define RGB888_RGB555(dst, src) { \ |
*(Uint16 *)(dst) = (((*src)&0x00F80000)>>9)| \ |
(((*src)&0x0000F800)>>6)| \ |
(((*src)&0x000000F8)>>3); \ |
} |
#define RGB888_RGB555_TWO(dst, src) { \ |
*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \ |
(((src[HI])&0x0000F800)>>6)| \ |
(((src[HI])&0x000000F8)>>3))<<16)| \ |
(((src[LO])&0x00F80000)>>9)| \ |
(((src[LO])&0x0000F800)>>6)| \ |
(((src[LO])&0x000000F8)>>3); \ |
} |
static void Blit_RGB888_RGB555(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint32 *src; |
Uint16 *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = (Uint32 *)info->s_pixels; |
srcskip = info->s_skip/4; |
dst = (Uint16 *)info->d_pixels; |
dstskip = info->d_skip/2; |
#ifdef USE_DUFFS_LOOP |
while ( height-- ) { |
DUFFS_LOOP( |
RGB888_RGB555(dst, src); |
++src; |
++dst; |
, width); |
src += srcskip; |
dst += dstskip; |
} |
#else |
/* Memory align at 4-byte boundary, if necessary */ |
if ( (long)dst & 0x03 ) { |
/* Don't do anything if width is 0 */ |
if ( width == 0 ) { |
return; |
} |
--width; |
while ( height-- ) { |
/* Perform copy alignment */ |
RGB888_RGB555(dst, src); |
++src; |
++dst; |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
RGB888_RGB555_TWO(dst, src); |
src += 2; |
dst += 2; |
RGB888_RGB555_TWO(dst, src); |
src += 2; |
dst += 2; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
RGB888_RGB555(dst, src); |
++src; |
++dst; |
case 2: |
RGB888_RGB555_TWO(dst, src); |
src += 2; |
dst += 2; |
break; |
case 1: |
RGB888_RGB555(dst, src); |
++src; |
++dst; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
RGB888_RGB555_TWO(dst, src); |
src += 2; |
dst += 2; |
RGB888_RGB555_TWO(dst, src); |
src += 2; |
dst += 2; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
RGB888_RGB555(dst, src); |
++src; |
++dst; |
case 2: |
RGB888_RGB555_TWO(dst, src); |
src += 2; |
dst += 2; |
break; |
case 1: |
RGB888_RGB555(dst, src); |
++src; |
++dst; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
#endif /* USE_DUFFS_LOOP */ |
} |
/* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */ |
#define RGB888_RGB565(dst, src) { \ |
*(Uint16 *)(dst) = (((*src)&0x00F80000)>>8)| \ |
(((*src)&0x0000FC00)>>5)| \ |
(((*src)&0x000000F8)>>3); \ |
} |
#define RGB888_RGB565_TWO(dst, src) { \ |
*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \ |
(((src[HI])&0x0000FC00)>>5)| \ |
(((src[HI])&0x000000F8)>>3))<<16)| \ |
(((src[LO])&0x00F80000)>>8)| \ |
(((src[LO])&0x0000FC00)>>5)| \ |
(((src[LO])&0x000000F8)>>3); \ |
} |
static void Blit_RGB888_RGB565(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint32 *src; |
Uint16 *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = (Uint32 *)info->s_pixels; |
srcskip = info->s_skip/4; |
dst = (Uint16 *)info->d_pixels; |
dstskip = info->d_skip/2; |
#ifdef USE_DUFFS_LOOP |
while ( height-- ) { |
DUFFS_LOOP( |
RGB888_RGB565(dst, src); |
++src; |
++dst; |
, width); |
src += srcskip; |
dst += dstskip; |
} |
#else |
/* Memory align at 4-byte boundary, if necessary */ |
if ( (long)dst & 0x03 ) { |
/* Don't do anything if width is 0 */ |
if ( width == 0 ) { |
return; |
} |
--width; |
while ( height-- ) { |
/* Perform copy alignment */ |
RGB888_RGB565(dst, src); |
++src; |
++dst; |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
RGB888_RGB565_TWO(dst, src); |
src += 2; |
dst += 2; |
RGB888_RGB565_TWO(dst, src); |
src += 2; |
dst += 2; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
RGB888_RGB565(dst, src); |
++src; |
++dst; |
case 2: |
RGB888_RGB565_TWO(dst, src); |
src += 2; |
dst += 2; |
break; |
case 1: |
RGB888_RGB565(dst, src); |
++src; |
++dst; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
RGB888_RGB565_TWO(dst, src); |
src += 2; |
dst += 2; |
RGB888_RGB565_TWO(dst, src); |
src += 2; |
dst += 2; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
RGB888_RGB565(dst, src); |
++src; |
++dst; |
case 2: |
RGB888_RGB565_TWO(dst, src); |
src += 2; |
dst += 2; |
break; |
case 1: |
RGB888_RGB565(dst, src); |
++src; |
++dst; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
#endif /* USE_DUFFS_LOOP */ |
} |
#endif /* USE_ASMBLIT */ |
/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */ |
#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) |
#define RGB565_32(dst, src, map) (map[src[0]*2] + map[src[1]*2+1]) |
#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */ |
#define RGB565_32(dst, src, map) (map[src[1]*2] + map[src[0]*2+1]) |
#endif |
static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint8 *src; |
Uint32 *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = (Uint8 *)info->s_pixels; |
srcskip = info->s_skip; |
dst = (Uint32 *)info->d_pixels; |
dstskip = info->d_skip/4; |
#ifdef USE_DUFFS_LOOP |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
#else |
while ( height-- ) { |
/* Copy in 4 pixel chunks */ |
for ( c=width/4; c; --c ) { |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
} |
/* Get any leftovers */ |
switch (width & 3) { |
case 3: |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
case 2: |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
case 1: |
*dst++ = RGB565_32(dst, src, map); |
src += 2; |
break; |
} |
src += srcskip; |
dst += dstskip; |
} |
#endif /* USE_DUFFS_LOOP */ |
} |
/* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */ |
static const Uint32 RGB565_ARGB8888_LUT[512] = { |
0x00000000, 0xff000000, 0x00000008, 0xff002000, |
0x00000010, 0xff004000, 0x00000018, 0xff006100, |
0x00000020, 0xff008100, 0x00000029, 0xff00a100, |
0x00000031, 0xff00c200, 0x00000039, 0xff00e200, |
0x00000041, 0xff080000, 0x0000004a, 0xff082000, |
0x00000052, 0xff084000, 0x0000005a, 0xff086100, |
0x00000062, 0xff088100, 0x0000006a, 0xff08a100, |
0x00000073, 0xff08c200, 0x0000007b, 0xff08e200, |
0x00000083, 0xff100000, 0x0000008b, 0xff102000, |
0x00000094, 0xff104000, 0x0000009c, 0xff106100, |
0x000000a4, 0xff108100, 0x000000ac, 0xff10a100, |
0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200, |
0x000000c5, 0xff180000, 0x000000cd, 0xff182000, |
0x000000d5, 0xff184000, 0x000000de, 0xff186100, |
0x000000e6, 0xff188100, 0x000000ee, 0xff18a100, |
0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200, |
0x00000400, 0xff200000, 0x00000408, 0xff202000, |
0x00000410, 0xff204000, 0x00000418, 0xff206100, |
0x00000420, 0xff208100, 0x00000429, 0xff20a100, |
0x00000431, 0xff20c200, 0x00000439, 0xff20e200, |
0x00000441, 0xff290000, 0x0000044a, 0xff292000, |
0x00000452, 0xff294000, 0x0000045a, 0xff296100, |
0x00000462, 0xff298100, 0x0000046a, 0xff29a100, |
0x00000473, 0xff29c200, 0x0000047b, 0xff29e200, |
0x00000483, 0xff310000, 0x0000048b, 0xff312000, |
0x00000494, 0xff314000, 0x0000049c, 0xff316100, |
0x000004a4, 0xff318100, 0x000004ac, 0xff31a100, |
0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200, |
0x000004c5, 0xff390000, 0x000004cd, 0xff392000, |
0x000004d5, 0xff394000, 0x000004de, 0xff396100, |
0x000004e6, 0xff398100, 0x000004ee, 0xff39a100, |
0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200, |
0x00000800, 0xff410000, 0x00000808, 0xff412000, |
0x00000810, 0xff414000, 0x00000818, 0xff416100, |
0x00000820, 0xff418100, 0x00000829, 0xff41a100, |
0x00000831, 0xff41c200, 0x00000839, 0xff41e200, |
0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000, |
0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100, |
0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100, |
0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200, |
0x00000883, 0xff520000, 0x0000088b, 0xff522000, |
0x00000894, 0xff524000, 0x0000089c, 0xff526100, |
0x000008a4, 0xff528100, 0x000008ac, 0xff52a100, |
0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200, |
0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000, |
0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100, |
0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100, |
0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200, |
0x00000c00, 0xff620000, 0x00000c08, 0xff622000, |
0x00000c10, 0xff624000, 0x00000c18, 0xff626100, |
0x00000c20, 0xff628100, 0x00000c29, 0xff62a100, |
0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200, |
0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000, |
0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100, |
0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100, |
0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200, |
0x00000c83, 0xff730000, 0x00000c8b, 0xff732000, |
0x00000c94, 0xff734000, 0x00000c9c, 0xff736100, |
0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100, |
0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200, |
0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000, |
0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100, |
0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100, |
0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200, |
0x00001000, 0xff830000, 0x00001008, 0xff832000, |
0x00001010, 0xff834000, 0x00001018, 0xff836100, |
0x00001020, 0xff838100, 0x00001029, 0xff83a100, |
0x00001031, 0xff83c200, 0x00001039, 0xff83e200, |
0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000, |
0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100, |
0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100, |
0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200, |
0x00001083, 0xff940000, 0x0000108b, 0xff942000, |
0x00001094, 0xff944000, 0x0000109c, 0xff946100, |
0x000010a4, 0xff948100, 0x000010ac, 0xff94a100, |
0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200, |
0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000, |
0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100, |
0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100, |
0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200, |
0x00001400, 0xffa40000, 0x00001408, 0xffa42000, |
0x00001410, 0xffa44000, 0x00001418, 0xffa46100, |
0x00001420, 0xffa48100, 0x00001429, 0xffa4a100, |
0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200, |
0x00001441, 0xffac0000, 0x0000144a, 0xffac2000, |
0x00001452, 0xffac4000, 0x0000145a, 0xffac6100, |
0x00001462, 0xffac8100, 0x0000146a, 0xffaca100, |
0x00001473, 0xffacc200, 0x0000147b, 0xfface200, |
0x00001483, 0xffb40000, 0x0000148b, 0xffb42000, |
0x00001494, 0xffb44000, 0x0000149c, 0xffb46100, |
0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100, |
0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200, |
0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000, |
0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100, |
0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100, |
0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200, |
0x00001800, 0xffc50000, 0x00001808, 0xffc52000, |
0x00001810, 0xffc54000, 0x00001818, 0xffc56100, |
0x00001820, 0xffc58100, 0x00001829, 0xffc5a100, |
0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200, |
0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000, |
0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100, |
0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100, |
0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200, |
0x00001883, 0xffd50000, 0x0000188b, 0xffd52000, |
0x00001894, 0xffd54000, 0x0000189c, 0xffd56100, |
0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100, |
0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200, |
0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000, |
0x000018d5, 0xffde4000, 0x000018de, 0xffde6100, |
0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100, |
0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200, |
0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000, |
0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100, |
0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100, |
0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200, |
0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000, |
0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100, |
0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100, |
0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200, |
0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000, |
0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100, |
0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100, |
0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200, |
0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000, |
0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100, |
0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100, |
0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200 |
}; |
static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info) |
{ |
Blit_RGB565_32(info, RGB565_ARGB8888_LUT); |
} |
/* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */ |
static const Uint32 RGB565_ABGR8888_LUT[512] = { |
0xff000000, 0x00000000, 0xff080000, 0x00002000, |
0xff100000, 0x00004000, 0xff180000, 0x00006100, |
0xff200000, 0x00008100, 0xff290000, 0x0000a100, |
0xff310000, 0x0000c200, 0xff390000, 0x0000e200, |
0xff410000, 0x00000008, 0xff4a0000, 0x00002008, |
0xff520000, 0x00004008, 0xff5a0000, 0x00006108, |
0xff620000, 0x00008108, 0xff6a0000, 0x0000a108, |
0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208, |
0xff830000, 0x00000010, 0xff8b0000, 0x00002010, |
0xff940000, 0x00004010, 0xff9c0000, 0x00006110, |
0xffa40000, 0x00008110, 0xffac0000, 0x0000a110, |
0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210, |
0xffc50000, 0x00000018, 0xffcd0000, 0x00002018, |
0xffd50000, 0x00004018, 0xffde0000, 0x00006118, |
0xffe60000, 0x00008118, 0xffee0000, 0x0000a118, |
0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218, |
0xff000400, 0x00000020, 0xff080400, 0x00002020, |
0xff100400, 0x00004020, 0xff180400, 0x00006120, |
0xff200400, 0x00008120, 0xff290400, 0x0000a120, |
0xff310400, 0x0000c220, 0xff390400, 0x0000e220, |
0xff410400, 0x00000029, 0xff4a0400, 0x00002029, |
0xff520400, 0x00004029, 0xff5a0400, 0x00006129, |
0xff620400, 0x00008129, 0xff6a0400, 0x0000a129, |
0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229, |
0xff830400, 0x00000031, 0xff8b0400, 0x00002031, |
0xff940400, 0x00004031, 0xff9c0400, 0x00006131, |
0xffa40400, 0x00008131, 0xffac0400, 0x0000a131, |
0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231, |
0xffc50400, 0x00000039, 0xffcd0400, 0x00002039, |
0xffd50400, 0x00004039, 0xffde0400, 0x00006139, |
0xffe60400, 0x00008139, 0xffee0400, 0x0000a139, |
0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239, |
0xff000800, 0x00000041, 0xff080800, 0x00002041, |
0xff100800, 0x00004041, 0xff180800, 0x00006141, |
0xff200800, 0x00008141, 0xff290800, 0x0000a141, |
0xff310800, 0x0000c241, 0xff390800, 0x0000e241, |
0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a, |
0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a, |
0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a, |
0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a, |
0xff830800, 0x00000052, 0xff8b0800, 0x00002052, |
0xff940800, 0x00004052, 0xff9c0800, 0x00006152, |
0xffa40800, 0x00008152, 0xffac0800, 0x0000a152, |
0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252, |
0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a, |
0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a, |
0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a, |
0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a, |
0xff000c00, 0x00000062, 0xff080c00, 0x00002062, |
0xff100c00, 0x00004062, 0xff180c00, 0x00006162, |
0xff200c00, 0x00008162, 0xff290c00, 0x0000a162, |
0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262, |
0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a, |
0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a, |
0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a, |
0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a, |
0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073, |
0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173, |
0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173, |
0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273, |
0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b, |
0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b, |
0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b, |
0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b, |
0xff001000, 0x00000083, 0xff081000, 0x00002083, |
0xff101000, 0x00004083, 0xff181000, 0x00006183, |
0xff201000, 0x00008183, 0xff291000, 0x0000a183, |
0xff311000, 0x0000c283, 0xff391000, 0x0000e283, |
0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b, |
0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b, |
0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b, |
0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b, |
0xff831000, 0x00000094, 0xff8b1000, 0x00002094, |
0xff941000, 0x00004094, 0xff9c1000, 0x00006194, |
0xffa41000, 0x00008194, 0xffac1000, 0x0000a194, |
0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294, |
0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c, |
0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c, |
0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c, |
0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c, |
0xff001400, 0x000000a4, 0xff081400, 0x000020a4, |
0xff101400, 0x000040a4, 0xff181400, 0x000061a4, |
0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4, |
0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4, |
0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac, |
0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac, |
0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac, |
0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac, |
0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4, |
0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4, |
0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4, |
0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4, |
0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd, |
0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd, |
0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd, |
0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd, |
0xff001800, 0x000000c5, 0xff081800, 0x000020c5, |
0xff101800, 0x000040c5, 0xff181800, 0x000061c5, |
0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5, |
0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5, |
0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd, |
0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd, |
0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd, |
0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd, |
0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5, |
0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5, |
0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5, |
0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5, |
0xffc51800, 0x000000de, 0xffcd1800, 0x000020de, |
0xffd51800, 0x000040de, 0xffde1800, 0x000061de, |
0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de, |
0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de, |
0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6, |
0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6, |
0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6, |
0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6, |
0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee, |
0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee, |
0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee, |
0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee, |
0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6, |
0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6, |
0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6, |
0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6, |
0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff, |
0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff, |
0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff, |
0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff |
}; |
static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info) |
{ |
Blit_RGB565_32(info, RGB565_ABGR8888_LUT); |
} |
/* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */ |
static const Uint32 RGB565_RGBA8888_LUT[512] = { |
0x000000ff, 0x00000000, 0x000008ff, 0x00200000, |
0x000010ff, 0x00400000, 0x000018ff, 0x00610000, |
0x000020ff, 0x00810000, 0x000029ff, 0x00a10000, |
0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000, |
0x000041ff, 0x08000000, 0x00004aff, 0x08200000, |
0x000052ff, 0x08400000, 0x00005aff, 0x08610000, |
0x000062ff, 0x08810000, 0x00006aff, 0x08a10000, |
0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000, |
0x000083ff, 0x10000000, 0x00008bff, 0x10200000, |
0x000094ff, 0x10400000, 0x00009cff, 0x10610000, |
0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000, |
0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000, |
0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000, |
0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000, |
0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000, |
0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000, |
0x000400ff, 0x20000000, 0x000408ff, 0x20200000, |
0x000410ff, 0x20400000, 0x000418ff, 0x20610000, |
0x000420ff, 0x20810000, 0x000429ff, 0x20a10000, |
0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000, |
0x000441ff, 0x29000000, 0x00044aff, 0x29200000, |
0x000452ff, 0x29400000, 0x00045aff, 0x29610000, |
0x000462ff, 0x29810000, 0x00046aff, 0x29a10000, |
0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000, |
0x000483ff, 0x31000000, 0x00048bff, 0x31200000, |
0x000494ff, 0x31400000, 0x00049cff, 0x31610000, |
0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000, |
0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000, |
0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000, |
0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000, |
0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000, |
0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000, |
0x000800ff, 0x41000000, 0x000808ff, 0x41200000, |
0x000810ff, 0x41400000, 0x000818ff, 0x41610000, |
0x000820ff, 0x41810000, 0x000829ff, 0x41a10000, |
0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000, |
0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000, |
0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000, |
0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000, |
0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000, |
0x000883ff, 0x52000000, 0x00088bff, 0x52200000, |
0x000894ff, 0x52400000, 0x00089cff, 0x52610000, |
0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000, |
0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000, |
0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000, |
0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000, |
0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000, |
0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000, |
0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000, |
0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000, |
0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000, |
0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000, |
0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000, |
0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000, |
0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000, |
0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000, |
0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000, |
0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000, |
0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000, |
0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000, |
0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000, |
0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000, |
0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000, |
0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000, |
0x001000ff, 0x83000000, 0x001008ff, 0x83200000, |
0x001010ff, 0x83400000, 0x001018ff, 0x83610000, |
0x001020ff, 0x83810000, 0x001029ff, 0x83a10000, |
0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000, |
0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000, |
0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000, |
0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000, |
0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000, |
0x001083ff, 0x94000000, 0x00108bff, 0x94200000, |
0x001094ff, 0x94400000, 0x00109cff, 0x94610000, |
0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000, |
0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000, |
0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000, |
0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000, |
0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000, |
0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000, |
0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000, |
0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000, |
0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000, |
0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000, |
0x001441ff, 0xac000000, 0x00144aff, 0xac200000, |
0x001452ff, 0xac400000, 0x00145aff, 0xac610000, |
0x001462ff, 0xac810000, 0x00146aff, 0xaca10000, |
0x001473ff, 0xacc20000, 0x00147bff, 0xace20000, |
0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000, |
0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000, |
0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000, |
0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000, |
0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000, |
0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000, |
0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000, |
0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000, |
0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000, |
0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000, |
0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000, |
0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000, |
0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000, |
0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000, |
0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000, |
0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000, |
0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000, |
0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000, |
0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000, |
0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000, |
0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000, |
0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000, |
0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000, |
0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000, |
0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000, |
0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000, |
0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000, |
0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000, |
0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000, |
0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000, |
0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000, |
0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000, |
0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000, |
0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000, |
0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000, |
0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000, |
0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000, |
0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000, |
0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000, |
0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000, |
}; |
static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info) |
{ |
Blit_RGB565_32(info, RGB565_RGBA8888_LUT); |
} |
/* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */ |
static const Uint32 RGB565_BGRA8888_LUT[512] = { |
0x00000000, 0x000000ff, 0x08000000, 0x002000ff, |
0x10000000, 0x004000ff, 0x18000000, 0x006100ff, |
0x20000000, 0x008100ff, 0x29000000, 0x00a100ff, |
0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff, |
0x41000000, 0x000008ff, 0x4a000000, 0x002008ff, |
0x52000000, 0x004008ff, 0x5a000000, 0x006108ff, |
0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff, |
0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff, |
0x83000000, 0x000010ff, 0x8b000000, 0x002010ff, |
0x94000000, 0x004010ff, 0x9c000000, 0x006110ff, |
0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff, |
0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff, |
0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff, |
0xd5000000, 0x004018ff, 0xde000000, 0x006118ff, |
0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff, |
0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff, |
0x00040000, 0x000020ff, 0x08040000, 0x002020ff, |
0x10040000, 0x004020ff, 0x18040000, 0x006120ff, |
0x20040000, 0x008120ff, 0x29040000, 0x00a120ff, |
0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff, |
0x41040000, 0x000029ff, 0x4a040000, 0x002029ff, |
0x52040000, 0x004029ff, 0x5a040000, 0x006129ff, |
0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff, |
0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff, |
0x83040000, 0x000031ff, 0x8b040000, 0x002031ff, |
0x94040000, 0x004031ff, 0x9c040000, 0x006131ff, |
0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff, |
0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff, |
0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff, |
0xd5040000, 0x004039ff, 0xde040000, 0x006139ff, |
0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff, |
0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff, |
0x00080000, 0x000041ff, 0x08080000, 0x002041ff, |
0x10080000, 0x004041ff, 0x18080000, 0x006141ff, |
0x20080000, 0x008141ff, 0x29080000, 0x00a141ff, |
0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff, |
0x41080000, 0x00004aff, 0x4a080000, 0x00204aff, |
0x52080000, 0x00404aff, 0x5a080000, 0x00614aff, |
0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff, |
0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff, |
0x83080000, 0x000052ff, 0x8b080000, 0x002052ff, |
0x94080000, 0x004052ff, 0x9c080000, 0x006152ff, |
0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff, |
0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff, |
0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff, |
0xd5080000, 0x00405aff, 0xde080000, 0x00615aff, |
0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff, |
0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff, |
0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff, |
0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff, |
0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff, |
0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff, |
0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff, |
0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff, |
0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff, |
0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff, |
0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff, |
0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff, |
0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff, |
0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff, |
0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff, |
0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff, |
0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff, |
0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff, |
0x00100000, 0x000083ff, 0x08100000, 0x002083ff, |
0x10100000, 0x004083ff, 0x18100000, 0x006183ff, |
0x20100000, 0x008183ff, 0x29100000, 0x00a183ff, |
0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff, |
0x41100000, 0x00008bff, 0x4a100000, 0x00208bff, |
0x52100000, 0x00408bff, 0x5a100000, 0x00618bff, |
0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff, |
0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff, |
0x83100000, 0x000094ff, 0x8b100000, 0x002094ff, |
0x94100000, 0x004094ff, 0x9c100000, 0x006194ff, |
0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff, |
0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff, |
0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff, |
0xd5100000, 0x00409cff, 0xde100000, 0x00619cff, |
0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff, |
0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff, |
0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff, |
0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff, |
0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff, |
0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff, |
0x41140000, 0x0000acff, 0x4a140000, 0x0020acff, |
0x52140000, 0x0040acff, 0x5a140000, 0x0061acff, |
0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff, |
0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff, |
0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff, |
0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff, |
0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff, |
0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff, |
0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff, |
0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff, |
0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff, |
0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff, |
0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff, |
0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff, |
0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff, |
0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff, |
0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff, |
0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff, |
0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff, |
0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff, |
0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff, |
0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff, |
0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff, |
0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff, |
0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff, |
0xd5180000, 0x0040deff, 0xde180000, 0x0061deff, |
0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff, |
0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff, |
0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff, |
0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff, |
0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff, |
0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff, |
0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff, |
0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff, |
0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff, |
0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff, |
0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff, |
0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff, |
0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff, |
0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff, |
0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff, |
0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff, |
0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff, |
0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff |
}; |
static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info) |
{ |
Blit_RGB565_32(info, RGB565_BGRA8888_LUT); |
} |
/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ |
#ifndef RGB888_RGB332 |
#define RGB888_RGB332(dst, src) { \ |
dst = (((src)&0x00E00000)>>16)| \ |
(((src)&0x0000E000)>>11)| \ |
(((src)&0x000000C0)>>6); \ |
} |
#endif |
static void Blit_RGB888_index8_map(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int pixel; |
int width, height; |
Uint32 *src; |
const Uint8 *map; |
Uint8 *dst; |
int srcskip, dstskip; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = (Uint32 *)info->s_pixels; |
srcskip = info->s_skip/4; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
#ifdef USE_DUFFS_LOOP |
while ( height-- ) { |
DUFFS_LOOP( |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
, width); |
src += srcskip; |
dst += dstskip; |
} |
#else |
while ( height-- ) { |
for ( c=width/4; c; --c ) { |
/* Pack RGB into 8bit pixel */ |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
} |
switch ( width & 3 ) { |
case 3: |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
case 2: |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
case 1: |
RGB888_RGB332(pixel, *src); |
*dst++ = map[pixel]; |
++src; |
} |
src += srcskip; |
dst += dstskip; |
} |
#endif /* USE_DUFFS_LOOP */ |
} |
static void BlitNto1(SDL_BlitInfo *info) |
{ |
#ifndef USE_DUFFS_LOOP |
int c; |
#endif |
int width, height; |
Uint8 *src; |
const Uint8 *map; |
Uint8 *dst; |
int srcskip, dstskip; |
int srcbpp; |
Uint32 pixel; |
int sR, sG, sB; |
SDL_PixelFormat *srcfmt; |
/* Set up some basic variables */ |
width = info->d_width; |
height = info->d_height; |
src = info->s_pixels; |
srcskip = info->s_skip; |
dst = info->d_pixels; |
dstskip = info->d_skip; |
map = info->table; |
srcfmt = info->src; |
srcbpp = srcfmt->BytesPerPixel; |
if ( map == NULL ) { |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, |
sR, sG, sB); |
if ( 1 ) { |
/* Pack RGB into 8bit pixel */ |
*dst = ((sR>>5)<<(3+2))| |
((sG>>5)<<(2)) | |
((sB>>6)<<(0)) ; |
} |
dst++; |
src += srcbpp; |
, width); |
#else |
for ( c=width; c; --c ) { |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, |
sR, sG, sB); |
if ( 1 ) { |
/* Pack RGB into 8bit pixel */ |
*dst = ((sR>>5)<<(3+2))| |
((sG>>5)<<(2)) | |
((sB>>6)<<(0)) ; |
} |
dst++; |
src += srcbpp; |
} |
#endif |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
#ifdef USE_DUFFS_LOOP |
DUFFS_LOOP( |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, |
sR, sG, sB); |
if ( 1 ) { |
/* Pack RGB into 8bit pixel */ |
*dst = map[((sR>>5)<<(3+2))| |
((sG>>5)<<(2)) | |
((sB>>6)<<(0)) ]; |
} |
dst++; |
src += srcbpp; |
, width); |
#else |
for ( c=width; c; --c ) { |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, |
sR, sG, sB); |
if ( 1 ) { |
/* Pack RGB into 8bit pixel */ |
*dst = map[((sR>>5)<<(3+2))| |
((sG>>5)<<(2)) | |
((sB>>6)<<(0)) ]; |
} |
dst++; |
src += srcbpp; |
} |
#endif /* USE_DUFFS_LOOP */ |
src += srcskip; |
dst += dstskip; |
} |
} |
} |
static void BlitNtoN(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
int srcbpp = srcfmt->BytesPerPixel; |
SDL_PixelFormat *dstfmt = info->dst; |
int dstbpp = dstfmt->BytesPerPixel; |
unsigned alpha = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, sR, sG, sB); |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha); |
dst += dstbpp; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitNtoNCopyAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
int srcbpp = srcfmt->BytesPerPixel; |
SDL_PixelFormat *dstfmt = info->dst; |
int dstbpp = dstfmt->BytesPerPixel; |
int c; |
/* FIXME: should map alpha to [0..255] correctly! */ |
while ( height-- ) { |
for ( c=width; c; --c ) { |
Uint32 pixel; |
unsigned sR, sG, sB, sA; |
DISEMBLE_RGBA(src, srcbpp, srcfmt, pixel, |
sR, sG, sB, sA); |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, |
sR, sG, sB, sA); |
dst += dstbpp; |
src += srcbpp; |
} |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitNto1Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
SDL_PixelFormat *srcfmt = info->src; |
const Uint8 *palmap = info->table; |
Uint32 ckey = srcfmt->colorkey; |
Uint32 rgbmask = ~srcfmt->Amask; |
int srcbpp; |
Uint32 pixel; |
Uint8 sR, sG, sB; |
/* Set up some basic variables */ |
srcbpp = srcfmt->BytesPerPixel; |
ckey &= rgbmask; |
if ( palmap == NULL ) { |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, |
sR, sG, sB); |
if ( (pixel & rgbmask) != ckey ) { |
/* Pack RGB into 8bit pixel */ |
*dst = ((sR>>5)<<(3+2))| |
((sG>>5)<<(2)) | |
((sB>>6)<<(0)) ; |
} |
dst++; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} else { |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, |
sR, sG, sB); |
if ( (pixel & rgbmask) != ckey ) { |
/* Pack RGB into 8bit pixel */ |
*dst = palmap[((sR>>5)<<(3+2))| |
((sG>>5)<<(2)) | |
((sB>>6)<<(0)) ]; |
} |
dst++; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
} |
static void Blit2to2Key(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint16 *srcp = (Uint16 *)info->s_pixels; |
int srcskip = info->s_skip; |
Uint16 *dstp = (Uint16 *)info->d_pixels; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
Uint32 rgbmask = ~info->src->Amask; |
/* Set up some basic variables */ |
srcskip /= 2; |
dstskip /= 2; |
ckey &= rgbmask; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
if ( (*srcp & rgbmask) != ckey ) { |
*dstp = *srcp; |
} |
dstp++; |
srcp++; |
}, |
width); |
srcp += srcskip; |
dstp += dstskip; |
} |
} |
static void BlitNtoNKey(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
int srcbpp = srcfmt->BytesPerPixel; |
int dstbpp = dstfmt->BytesPerPixel; |
unsigned alpha = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
Uint32 pixel; |
unsigned sR; |
unsigned sG; |
unsigned sB; |
RETRIEVE_RGB_PIXEL(src, srcbpp, pixel); |
if ( pixel != ckey ) { |
RGB_FROM_PIXEL(pixel, srcfmt, sR, sG, sB); |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, |
sR, sG, sB, alpha); |
} |
dst += dstbpp; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info) |
{ |
int width = info->d_width; |
int height = info->d_height; |
Uint8 *src = info->s_pixels; |
int srcskip = info->s_skip; |
Uint8 *dst = info->d_pixels; |
int dstskip = info->d_skip; |
Uint32 ckey = info->src->colorkey; |
SDL_PixelFormat *srcfmt = info->src; |
SDL_PixelFormat *dstfmt = info->dst; |
Uint32 rgbmask = ~srcfmt->Amask; |
Uint8 srcbpp; |
Uint8 dstbpp; |
Uint32 pixel; |
Uint8 sR, sG, sB, sA; |
/* Set up some basic variables */ |
srcbpp = srcfmt->BytesPerPixel; |
dstbpp = dstfmt->BytesPerPixel; |
ckey &= rgbmask; |
/* FIXME: should map alpha to [0..255] correctly! */ |
while ( height-- ) { |
DUFFS_LOOP( |
{ |
DISEMBLE_RGBA(src, srcbpp, srcfmt, pixel, |
sR, sG, sB, sA); |
if ( (pixel & rgbmask) != ckey ) { |
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, |
sR, sG, sB, sA); |
} |
dst += dstbpp; |
src += srcbpp; |
}, |
width); |
src += srcskip; |
dst += dstskip; |
} |
} |
/* Normal N to N optimized blitters */ |
struct blit_table { |
Uint32 srcR, srcG, srcB; |
int dstbpp; |
Uint32 dstR, dstG, dstB; |
Uint32 cpu_flags; |
void *aux_data; |
SDL_loblit blitfunc; |
enum { NO_ALPHA, SET_ALPHA, COPY_ALPHA } alpha; |
}; |
static const struct blit_table normal_blit_1[] = { |
/* Default for 8-bit RGB source, an invalid combination */ |
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL }, |
}; |
static const struct blit_table normal_blit_2[] = { |
#ifdef USE_ASMBLIT |
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800, |
0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA }, |
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F, |
0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA }, |
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00, |
0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA }, |
#endif |
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF, |
0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA }, |
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000, |
0, NULL, Blit_RGB565_ABGR8888, SET_ALPHA }, |
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0xFF000000,0x00FF0000,0x0000FF00, |
0, NULL, Blit_RGB565_RGBA8888, SET_ALPHA }, |
{ 0x0000F800,0x000007E0,0x0000001F, 4, 0x0000FF00,0x00FF0000,0xFF000000, |
0, NULL, Blit_RGB565_BGRA8888, SET_ALPHA }, |
/* Default for 16-bit RGB source, used if no other blitter matches */ |
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } |
}; |
static const struct blit_table normal_blit_3[] = { |
/* Default for 24-bit RGB source, never optimized */ |
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } |
}; |
static const struct blit_table normal_blit_4[] = { |
#ifdef USE_ASMBLIT |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, |
MMX_CPU, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, |
0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800, |
MMX_CPU, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800, |
0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F, |
MMX_CPU, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F, |
0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00, |
MMX_CPU, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00, |
0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF, |
0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000, |
0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000, |
0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00, |
0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000, |
0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA }, |
#else |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, |
0, NULL, Blit_RGB888_RGB565, NO_ALPHA }, |
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F, |
0, NULL, Blit_RGB888_RGB555, NO_ALPHA }, |
#endif |
/* Default for 32-bit RGB source, used if no other blitter matches */ |
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } |
}; |
static const struct blit_table *normal_blit[] = { |
normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4 |
}; |
SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index) |
{ |
struct private_swaccel *sdata; |
SDL_PixelFormat *srcfmt; |
SDL_PixelFormat *dstfmt; |
const struct blit_table *table; |
int which; |
SDL_loblit blitfun; |
/* Set up data for choosing the blit */ |
sdata = surface->map->sw_data; |
srcfmt = surface->format; |
dstfmt = surface->map->dst->format; |
if ( blit_index & 2 ) { |
/* alpha or alpha+colorkey */ |
return SDL_CalculateAlphaBlit(surface, blit_index); |
} |
/* We don't support destinations less than 8-bits */ |
if ( dstfmt->BitsPerPixel < 8 ) { |
return(NULL); |
} |
if(blit_index == 1) { |
/* colorkey blit: Here we don't have too many options, mostly |
because RLE is the preferred fast way to deal with this. |
If a particular case turns out to be useful we'll add it. */ |
if(srcfmt->BytesPerPixel == 2 |
&& surface->map->identity) |
return Blit2to2Key; |
else if(dstfmt->BytesPerPixel == 1) |
return BlitNto1Key; |
else { |
if(srcfmt->Amask && dstfmt->Amask) |
return BlitNtoNKeyCopyAlpha; |
else |
return BlitNtoNKey; |
} |
} |
blitfun = NULL; |
if ( dstfmt->BitsPerPixel == 8 ) { |
/* We assume 8-bit destinations are palettized */ |
if ( (srcfmt->BytesPerPixel == 4) && |
(srcfmt->Rmask == 0x00FF0000) && |
(srcfmt->Gmask == 0x0000FF00) && |
(srcfmt->Bmask == 0x000000FF) ) { |
if ( surface->map->table ) { |
blitfun = Blit_RGB888_index8_map; |
} else { |
#ifdef USE_ASMBLIT |
sdata->aux_data = ConvertX86p32_8RGB332; |
blitfun = ConvertX86; |
#else |
blitfun = Blit_RGB888_index8; |
#endif |
} |
} else { |
blitfun = BlitNto1; |
} |
} else { |
/* Now the meat, choose the blitter we want */ |
int a_need = 0; |
if(dstfmt->Amask) |
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA; |
table = normal_blit[srcfmt->BytesPerPixel-1]; |
for ( which=0; table[which].srcR; ++which ) { |
if ( srcfmt->Rmask == table[which].srcR && |
srcfmt->Gmask == table[which].srcG && |
srcfmt->Bmask == table[which].srcB && |
dstfmt->BytesPerPixel == table[which].dstbpp && |
dstfmt->Rmask == table[which].dstR && |
dstfmt->Gmask == table[which].dstG && |
dstfmt->Bmask == table[which].dstB && |
(a_need & table[which].alpha) == a_need && |
(CPU_Flags()&table[which].cpu_flags) == |
table[which].cpu_flags ) |
break; |
} |
sdata->aux_data = table[which].aux_data; |
blitfun = table[which].blitfunc; |
if(a_need == COPY_ALPHA && blitfun == BlitNtoN) |
blitfun = BlitNtoNCopyAlpha; |
} |
#ifdef DEBUG_ASM |
#ifdef USE_ASMBLIT |
if ( blitfun == ConvertMMX ) |
SDL_printf("Using mmx blit\n"); |
else |
if ( blitfun == ConvertX86 ) |
SDL_printf("Using asm blit\n"); |
else |
#endif |
if ( (blitfun == SDL_BlitNtoN) || (blitfun == SDL_BlitNto1) ) |
fprintf(stderr, "Using C blit\n"); |
else |
fprintf(stderr, "Using optimized C blit\n"); |
#endif /* DEBUG_ASM */ |
return(blitfun); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_bmp.c |
---|
0,0 → 1,523 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifndef DISABLE_FILE |
/* |
Code to load and save surfaces in Windows BMP format. |
Why support BMP format? Well, it's a native format for Windows, and |
most image processing programs can read and write it. It would be nice |
to be able to have at least one image format that we can natively load |
and save, and since PNG is so complex that it would bloat the library, |
BMP is a good alternative. |
This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp. |
*/ |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_endian.h" |
/* Compression encodings for BMP files */ |
#ifndef BI_RGB |
#define BI_RGB 0 |
#define BI_RLE8 1 |
#define BI_RLE4 2 |
#define BI_BITFIELDS 3 |
#endif |
SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) |
{ |
int was_error; |
long fp_offset; |
int bmpPitch; |
int i, pad; |
SDL_Surface *surface; |
Uint32 Rmask; |
Uint32 Gmask; |
Uint32 Bmask; |
SDL_Palette *palette; |
Uint8 *bits; |
int ExpandBMP; |
/* The Win32 BMP file header (14 bytes) */ |
char magic[2]; |
Uint32 bfSize; |
Uint16 bfReserved1; |
Uint16 bfReserved2; |
Uint32 bfOffBits; |
/* The Win32 BITMAPINFOHEADER struct (40 bytes) */ |
Uint32 biSize; |
Sint32 biWidth; |
Sint32 biHeight; |
Uint16 biPlanes; |
Uint16 biBitCount; |
Uint32 biCompression; |
Uint32 biSizeImage; |
Sint32 biXPelsPerMeter; |
Sint32 biYPelsPerMeter; |
Uint32 biClrUsed; |
Uint32 biClrImportant; |
/* Make sure we are passed a valid data source */ |
surface = NULL; |
was_error = 0; |
if ( src == NULL ) { |
was_error = 1; |
goto done; |
} |
/* Read in the BMP file header */ |
fp_offset = SDL_RWtell(src); |
SDL_ClearError(); |
if ( SDL_RWread(src, magic, 1, 2) != 2 ) { |
SDL_Error(SDL_EFREAD); |
was_error = 1; |
goto done; |
} |
if ( strncmp(magic, "BM", 2) != 0 ) { |
SDL_SetError("File is not a Windows BMP file"); |
was_error = 1; |
goto done; |
} |
bfSize = SDL_ReadLE32(src); |
bfReserved1 = SDL_ReadLE16(src); |
bfReserved2 = SDL_ReadLE16(src); |
bfOffBits = SDL_ReadLE32(src); |
/* Read the Win32 BITMAPINFOHEADER */ |
biSize = SDL_ReadLE32(src); |
if ( biSize == 12 ) { |
biWidth = (Uint32)SDL_ReadLE16(src); |
biHeight = (Uint32)SDL_ReadLE16(src); |
biPlanes = SDL_ReadLE16(src); |
biBitCount = SDL_ReadLE16(src); |
biCompression = BI_RGB; |
biSizeImage = 0; |
biXPelsPerMeter = 0; |
biYPelsPerMeter = 0; |
biClrUsed = 0; |
biClrImportant = 0; |
} else { |
biWidth = SDL_ReadLE32(src); |
biHeight = SDL_ReadLE32(src); |
biPlanes = SDL_ReadLE16(src); |
biBitCount = SDL_ReadLE16(src); |
biCompression = SDL_ReadLE32(src); |
biSizeImage = SDL_ReadLE32(src); |
biXPelsPerMeter = SDL_ReadLE32(src); |
biYPelsPerMeter = SDL_ReadLE32(src); |
biClrUsed = SDL_ReadLE32(src); |
biClrImportant = SDL_ReadLE32(src); |
} |
/* Check for read error */ |
if ( strcmp(SDL_GetError(), "") != 0 ) { |
was_error = 1; |
goto done; |
} |
/* Expand 1 and 4 bit bitmaps to 8 bits per pixel */ |
switch (biBitCount) { |
case 1: |
case 4: |
ExpandBMP = biBitCount; |
biBitCount = 8; |
break; |
default: |
ExpandBMP = 0; |
break; |
} |
/* We don't support any BMP compression right now */ |
Rmask = Gmask = Bmask = 0; |
switch (biCompression) { |
case BI_RGB: |
/* If there are no masks, use the defaults */ |
if ( bfOffBits == (14+biSize) ) { |
/* Default values for the BMP format */ |
switch (biBitCount) { |
case 15: |
case 16: |
Rmask = 0x7C00; |
Gmask = 0x03E0; |
Bmask = 0x001F; |
break; |
case 24: |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
Rmask = 0x000000FF; |
Gmask = 0x0000FF00; |
Bmask = 0x00FF0000; |
break; |
#endif |
case 32: |
Rmask = 0x00FF0000; |
Gmask = 0x0000FF00; |
Bmask = 0x000000FF; |
break; |
default: |
break; |
} |
break; |
} |
/* Fall through -- read the RGB masks */ |
case BI_BITFIELDS: |
switch (biBitCount) { |
case 15: |
case 16: |
case 32: |
Rmask = SDL_ReadLE32(src); |
Gmask = SDL_ReadLE32(src); |
Bmask = SDL_ReadLE32(src); |
break; |
default: |
break; |
} |
break; |
default: |
SDL_SetError("Compressed BMP files not supported"); |
was_error = 1; |
goto done; |
} |
/* Create a compatible surface, note that the colors are RGB ordered */ |
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, |
biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, 0); |
if ( surface == NULL ) { |
was_error = 1; |
goto done; |
} |
/* Load the palette, if any */ |
palette = (surface->format)->palette; |
if ( palette ) { |
if ( biClrUsed == 0 ) { |
biClrUsed = 1 << biBitCount; |
} |
if ( biSize == 12 ) { |
for ( i = 0; i < (int)biClrUsed; ++i ) { |
SDL_RWread(src, &palette->colors[i].b, 1, 1); |
SDL_RWread(src, &palette->colors[i].g, 1, 1); |
SDL_RWread(src, &palette->colors[i].r, 1, 1); |
palette->colors[i].unused = 0; |
} |
} else { |
for ( i = 0; i < (int)biClrUsed; ++i ) { |
SDL_RWread(src, &palette->colors[i].b, 1, 1); |
SDL_RWread(src, &palette->colors[i].g, 1, 1); |
SDL_RWread(src, &palette->colors[i].r, 1, 1); |
SDL_RWread(src, &palette->colors[i].unused, 1, 1); |
} |
} |
palette->ncolors = biClrUsed; |
} |
/* Read the surface pixels. Note that the bmp image is upside down */ |
if ( SDL_RWseek(src, fp_offset+bfOffBits, SEEK_SET) < 0 ) { |
SDL_Error(SDL_EFSEEK); |
was_error = 1; |
goto done; |
} |
bits = (Uint8 *)surface->pixels+(surface->h*surface->pitch); |
switch (ExpandBMP) { |
case 1: |
bmpPitch = (biWidth + 7) >> 3; |
pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0); |
break; |
case 4: |
bmpPitch = (biWidth + 1) >> 1; |
pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0); |
break; |
default: |
pad = ((surface->pitch%4) ? |
(4-(surface->pitch%4)) : 0); |
break; |
} |
while ( bits > (Uint8 *)surface->pixels ) { |
bits -= surface->pitch; |
switch (ExpandBMP) { |
case 1: |
case 4: { |
Uint8 pixel = 0; |
int shift = (8-ExpandBMP); |
for ( i=0; i<surface->w; ++i ) { |
if ( i%(8/ExpandBMP) == 0 ) { |
if ( !SDL_RWread(src, &pixel, 1, 1) ) { |
SDL_SetError( |
"Error reading from BMP"); |
was_error = 1; |
goto done; |
} |
} |
*(bits+i) = (pixel>>shift); |
pixel <<= ExpandBMP; |
} } |
break; |
default: |
if ( SDL_RWread(src, bits, 1, surface->pitch) |
!= surface->pitch ) { |
SDL_Error(SDL_EFREAD); |
was_error = 1; |
goto done; |
} |
#if SDL_BYTEORDER == SDL_BIG_ENDIAN |
/* Byte-swap the pixels if needed. Note that the 24bpp |
case has already been taken care of above. */ |
switch(biBitCount) { |
case 15: |
case 16: { |
Uint16 *pix = (Uint16 *)bits; |
for(i = 0; i < surface->w; i++) |
pix[i] = SDL_Swap16(pix[i]); |
break; |
} |
case 32: { |
Uint32 *pix = (Uint32 *)bits; |
for(i = 0; i < surface->w; i++) |
pix[i] = SDL_Swap32(pix[i]); |
break; |
} |
} |
#endif |
break; |
} |
/* Skip padding bytes, ugh */ |
if ( pad ) { |
Uint8 padbyte; |
for ( i=0; i<pad; ++i ) { |
SDL_RWread(src, &padbyte, 1, 1); |
} |
} |
} |
done: |
if ( was_error ) { |
if ( surface ) { |
SDL_FreeSurface(surface); |
} |
surface = NULL; |
} |
if ( freesrc && src ) { |
SDL_RWclose(src); |
} |
return(surface); |
} |
int SDL_SaveBMP_RW (SDL_Surface *saveme, SDL_RWops *dst, int freedst) |
{ |
long fp_offset; |
int i, pad; |
SDL_Surface *surface; |
Uint8 *bits; |
/* The Win32 BMP file header (14 bytes) */ |
char magic[2] = { 'B', 'M' }; |
Uint32 bfSize; |
Uint16 bfReserved1; |
Uint16 bfReserved2; |
Uint32 bfOffBits; |
/* The Win32 BITMAPINFOHEADER struct (40 bytes) */ |
Uint32 biSize; |
Sint32 biWidth; |
Sint32 biHeight; |
Uint16 biPlanes; |
Uint16 biBitCount; |
Uint32 biCompression; |
Uint32 biSizeImage; |
Sint32 biXPelsPerMeter; |
Sint32 biYPelsPerMeter; |
Uint32 biClrUsed; |
Uint32 biClrImportant; |
/* Make sure we have somewhere to save */ |
surface = NULL; |
if ( dst ) { |
if ( saveme->format->palette ) { |
if ( saveme->format->BitsPerPixel == 8 ) { |
surface = saveme; |
} else { |
SDL_SetError("%d bpp BMP files not supported", |
saveme->format->BitsPerPixel); |
} |
} |
else if ( (saveme->format->BitsPerPixel == 24) && |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
(saveme->format->Rmask == 0x00FF0000) && |
(saveme->format->Gmask == 0x0000FF00) && |
(saveme->format->Bmask == 0x000000FF) |
#else |
(saveme->format->Rmask == 0x000000FF) && |
(saveme->format->Gmask == 0x0000FF00) && |
(saveme->format->Bmask == 0x00FF0000) |
#endif |
) { |
surface = saveme; |
} else { |
SDL_Rect bounds; |
/* Convert to 24 bits per pixel */ |
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, |
saveme->w, saveme->h, 24, |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
0x00FF0000, 0x0000FF00, 0x000000FF, |
#else |
0x000000FF, 0x0000FF00, 0x00FF0000, |
#endif |
0); |
if ( surface != NULL ) { |
bounds.x = 0; |
bounds.y = 0; |
bounds.w = saveme->w; |
bounds.h = saveme->h; |
if ( SDL_LowerBlit(saveme, &bounds, surface, |
&bounds) < 0 ) { |
SDL_FreeSurface(surface); |
SDL_SetError( |
"Couldn't convert image to 24 bpp"); |
surface = NULL; |
} |
} |
} |
} |
if ( surface && (SDL_LockSurface(surface) == 0) ) { |
/* Set the BMP file header values */ |
bfSize = 0; /* We'll write this when we're done */ |
bfReserved1 = 0; |
bfReserved2 = 0; |
bfOffBits = 0; /* We'll write this when we're done */ |
/* Write the BMP file header values */ |
fp_offset = SDL_RWtell(dst); |
SDL_ClearError(); |
SDL_RWwrite(dst, magic, 2, 1); |
SDL_WriteLE32(dst, bfSize); |
SDL_WriteLE16(dst, bfReserved1); |
SDL_WriteLE16(dst, bfReserved2); |
SDL_WriteLE32(dst, bfOffBits); |
/* Set the BMP info values */ |
biSize = 40; |
biWidth = surface->w; |
biHeight = surface->h; |
biPlanes = 1; |
biBitCount = surface->format->BitsPerPixel; |
biCompression = BI_RGB; |
biSizeImage = surface->h*surface->pitch; |
biXPelsPerMeter = 0; |
biYPelsPerMeter = 0; |
if ( surface->format->palette ) { |
biClrUsed = surface->format->palette->ncolors; |
} else { |
biClrUsed = 0; |
} |
biClrImportant = 0; |
/* Write the BMP info values */ |
SDL_WriteLE32(dst, biSize); |
SDL_WriteLE32(dst, biWidth); |
SDL_WriteLE32(dst, biHeight); |
SDL_WriteLE16(dst, biPlanes); |
SDL_WriteLE16(dst, biBitCount); |
SDL_WriteLE32(dst, biCompression); |
SDL_WriteLE32(dst, biSizeImage); |
SDL_WriteLE32(dst, biXPelsPerMeter); |
SDL_WriteLE32(dst, biYPelsPerMeter); |
SDL_WriteLE32(dst, biClrUsed); |
SDL_WriteLE32(dst, biClrImportant); |
/* Write the palette (in BGR color order) */ |
if ( surface->format->palette ) { |
SDL_Color *colors; |
int ncolors; |
colors = surface->format->palette->colors; |
ncolors = surface->format->palette->ncolors; |
for ( i=0; i<ncolors; ++i ) { |
SDL_RWwrite(dst, &colors[i].b, 1, 1); |
SDL_RWwrite(dst, &colors[i].g, 1, 1); |
SDL_RWwrite(dst, &colors[i].r, 1, 1); |
SDL_RWwrite(dst, &colors[i].unused, 1, 1); |
} |
} |
/* Write the bitmap offset */ |
bfOffBits = SDL_RWtell(dst)-fp_offset; |
if ( SDL_RWseek(dst, fp_offset+10, SEEK_SET) < 0 ) { |
SDL_Error(SDL_EFSEEK); |
} |
SDL_WriteLE32(dst, bfOffBits); |
if ( SDL_RWseek(dst, fp_offset+bfOffBits, SEEK_SET) < 0 ) { |
SDL_Error(SDL_EFSEEK); |
} |
/* Write the bitmap image upside down */ |
bits = (Uint8 *)surface->pixels+(surface->h*surface->pitch); |
pad = ((surface->pitch%4) ? (4-(surface->pitch%4)) : 0); |
while ( bits > (Uint8 *)surface->pixels ) { |
bits -= surface->pitch; |
if ( SDL_RWwrite(dst, bits, 1, surface->pitch) |
!= surface->pitch) { |
SDL_Error(SDL_EFWRITE); |
break; |
} |
if ( pad ) { |
const Uint8 padbyte = 0; |
for ( i=0; i<pad; ++i ) { |
SDL_RWwrite(dst, &padbyte, 1, 1); |
} |
} |
} |
/* Write the BMP file size */ |
bfSize = SDL_RWtell(dst)-fp_offset; |
if ( SDL_RWseek(dst, fp_offset+2, SEEK_SET) < 0 ) { |
SDL_Error(SDL_EFSEEK); |
} |
SDL_WriteLE32(dst, bfSize); |
if ( SDL_RWseek(dst, fp_offset+bfSize, SEEK_SET) < 0 ) { |
SDL_Error(SDL_EFSEEK); |
} |
/* Close it up.. */ |
SDL_UnlockSurface(surface); |
if ( surface != saveme ) { |
SDL_FreeSurface(surface); |
} |
} |
if ( freedst && dst ) { |
SDL_RWclose(dst); |
} |
return((strcmp(SDL_GetError(), "") == 0) ? 0 : -1); |
} |
#endif /* ENABLE_FILE */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_cursor.c |
---|
0,0 → 1,742 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* General cursor handling code for SDL */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_mutex.h" |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_mouse.h" |
#include "SDL_blit.h" |
#include "SDL_events_c.h" |
#include "SDL_sysvideo.h" |
#include "SDL_sysevents.h" |
#include "SDL_cursor_c.h" |
#include "SDL_pixels_c.h" |
#include "default_cursor.h" |
/* These are static for our cursor handling code */ |
volatile int SDL_cursorstate = 0; |
SDL_Cursor *SDL_cursor = NULL; |
static SDL_Cursor *SDL_defcursor = NULL; |
SDL_mutex *SDL_cursorlock = NULL; |
/* Public functions */ |
void SDL_CursorQuit(void) |
{ |
if ( SDL_cursor != NULL ) { |
SDL_Cursor *cursor; |
SDL_cursorstate &= ~CURSOR_VISIBLE; |
if ( SDL_cursor != SDL_defcursor ) { |
SDL_FreeCursor(SDL_cursor); |
} |
SDL_cursor = NULL; |
if ( SDL_defcursor != NULL ) { |
cursor = SDL_defcursor; |
SDL_defcursor = NULL; |
SDL_FreeCursor(cursor); |
} |
} |
if ( SDL_cursorlock != NULL ) { |
SDL_DestroyMutex(SDL_cursorlock); |
SDL_cursorlock = NULL; |
} |
} |
int SDL_CursorInit(Uint32 multithreaded) |
{ |
/* We don't have mouse focus, and the cursor isn't drawn yet */ |
SDL_cursorstate = CURSOR_VISIBLE; |
/* Create the default cursor */ |
if ( SDL_defcursor == NULL ) { |
SDL_defcursor = SDL_CreateCursor(default_cdata, default_cmask, |
DEFAULT_CWIDTH, DEFAULT_CHEIGHT, |
DEFAULT_CHOTX, DEFAULT_CHOTY); |
SDL_SetCursor(SDL_defcursor); |
} |
/* Create a lock if necessary */ |
if ( multithreaded ) { |
SDL_cursorlock = SDL_CreateMutex(); |
} |
/* That's it! */ |
return(0); |
} |
/* Multi-thread support for cursors */ |
#ifndef SDL_LockCursor |
void SDL_LockCursor(void) |
{ |
if ( SDL_cursorlock ) { |
SDL_mutexP(SDL_cursorlock); |
} |
} |
#endif |
#ifndef SDL_UnlockCursor |
void SDL_UnlockCursor(void) |
{ |
if ( SDL_cursorlock ) { |
SDL_mutexV(SDL_cursorlock); |
} |
} |
#endif |
/* Software cursor drawing support */ |
SDL_Cursor * SDL_CreateCursor (Uint8 *data, Uint8 *mask, |
int w, int h, int hot_x, int hot_y) |
{ |
SDL_VideoDevice *video = current_video; |
int savelen; |
int i; |
SDL_Cursor *cursor; |
/* Make sure the width is a multiple of 8 */ |
w = ((w+7)&~7); |
/* Sanity check the hot spot */ |
if ( (hot_x < 0) || (hot_y < 0) || (hot_x >= w) || (hot_y >= h) ) { |
SDL_SetError("Cursor hot spot doesn't lie within cursor"); |
return(NULL); |
} |
/* Allocate memory for the cursor */ |
cursor = (SDL_Cursor *)malloc(sizeof *cursor); |
if ( cursor == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
savelen = (w*4)*h; |
cursor->area.x = 0; |
cursor->area.y = 0; |
cursor->area.w = w; |
cursor->area.h = h; |
cursor->hot_x = hot_x; |
cursor->hot_y = hot_y; |
cursor->data = (Uint8 *)malloc((w/8)*h*2); |
cursor->mask = cursor->data+((w/8)*h); |
cursor->save[0] = (Uint8 *)malloc(savelen*2); |
cursor->save[1] = cursor->save[0] + savelen; |
cursor->wm_cursor = NULL; |
if ( ! cursor->data || ! cursor->save[0] ) { |
SDL_FreeCursor(cursor); |
SDL_OutOfMemory(); |
return(NULL); |
} |
for ( i=((w/8)*h)-1; i>=0; --i ) { |
cursor->data[i] = data[i]; |
cursor->mask[i] = mask[i] | data[i]; |
} |
memset(cursor->save[0], 0, savelen*2); |
/* If the window manager gives us a good cursor, we're done! */ |
if ( video->CreateWMCursor ) { |
cursor->wm_cursor = video->CreateWMCursor(video, data, mask, |
w, h, hot_x, hot_y); |
} else { |
cursor->wm_cursor = NULL; |
} |
return(cursor); |
} |
/* SDL_SetCursor(NULL) can be used to force the cursor redraw, |
if this is desired for any reason. This is used when setting |
the video mode and when the SDL window gains the mouse focus. |
*/ |
void SDL_SetCursor (SDL_Cursor *cursor) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* Make sure that the video subsystem has been initialized */ |
if ( ! video ) { |
return; |
} |
/* Prevent the event thread from moving the mouse */ |
SDL_LockCursor(); |
/* Set the new cursor */ |
if ( cursor && (cursor != SDL_cursor) ) { |
/* Erase the current mouse position */ |
if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { |
SDL_EraseCursor(SDL_VideoSurface); |
} else if ( video->MoveWMCursor ) { |
/* If the video driver is moving the cursor directly, |
it needs to hide the old cursor before (possibly) |
showing the new one. (But don't erase NULL cursor) |
*/ |
if ( SDL_cursor ) { |
video->ShowWMCursor(this, NULL); |
} |
} |
SDL_cursor = cursor; |
} |
/* Draw the new mouse cursor */ |
if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) { |
/* Use window manager cursor if possible */ |
if ( SDL_cursor->wm_cursor && |
video->ShowWMCursor(this, SDL_cursor->wm_cursor) ) |
SDL_cursorstate &= ~CURSOR_USINGSW; |
else { |
SDL_cursorstate |= CURSOR_USINGSW; |
if ( video->ShowWMCursor ) { |
video->ShowWMCursor(this, NULL); |
} |
{ int x, y; |
SDL_GetMouseState(&x, &y); |
SDL_cursor->area.x = (x - SDL_cursor->hot_x); |
SDL_cursor->area.y = (y - SDL_cursor->hot_y); |
} |
SDL_DrawCursor(SDL_VideoSurface); |
} |
} else { |
/* Erase window manager mouse (cursor not visible) */ |
if ( SDL_cursor && (SDL_cursorstate & CURSOR_USINGSW) ) { |
SDL_EraseCursor(SDL_VideoSurface); |
} else { |
if ( video ) { |
video->ShowWMCursor(this, NULL); |
} |
} |
} |
SDL_UnlockCursor(); |
} |
SDL_Cursor * SDL_GetCursor (void) |
{ |
return(SDL_cursor); |
} |
void SDL_FreeCursor (SDL_Cursor *cursor) |
{ |
if ( cursor ) { |
if ( cursor == SDL_cursor ) { |
SDL_SetCursor(SDL_defcursor); |
} |
if ( cursor != SDL_defcursor ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( cursor->data ) { |
free(cursor->data); |
} |
if ( cursor->save[0] ) { |
free(cursor->save[0]); |
} |
if ( video && cursor->wm_cursor ) { |
video->FreeWMCursor(this, cursor->wm_cursor); |
} |
free(cursor); |
} |
} |
} |
int SDL_ShowCursor (int toggle) |
{ |
int showing; |
showing = (SDL_cursorstate & CURSOR_VISIBLE); |
if ( toggle >= 0 ) { |
SDL_LockCursor(); |
if ( toggle ) { |
SDL_cursorstate |= CURSOR_VISIBLE; |
} else { |
SDL_cursorstate &= ~CURSOR_VISIBLE; |
} |
SDL_UnlockCursor(); |
if ( (SDL_cursorstate & CURSOR_VISIBLE) != showing ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
SDL_SetCursor(NULL); |
if ( video && video->CheckMouseMode ) { |
video->CheckMouseMode(this); |
} |
} |
} else { |
/* Query current state */ ; |
} |
return(showing ? 1 : 0); |
} |
void SDL_WarpMouse (Uint16 x, Uint16 y) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* This generates a mouse motion event */ |
if ( video->WarpWMCursor ) { |
video->WarpWMCursor(this, x, y); |
} else { |
x += (this->screen->offset % this->screen->pitch) / |
this->screen->format->BytesPerPixel; |
y += (this->screen->offset / this->screen->pitch); |
SDL_PrivateMouseMotion(0, 0, x, y); |
} |
} |
void SDL_MoveCursor(int x, int y) |
{ |
SDL_VideoDevice *video = current_video; |
/* Erase and update the current mouse position */ |
if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { |
/* Erase and redraw mouse cursor in new position */ |
SDL_LockCursor(); |
SDL_EraseCursor(SDL_VideoSurface); |
SDL_cursor->area.x = (x - SDL_cursor->hot_x); |
SDL_cursor->area.y = (y - SDL_cursor->hot_y); |
SDL_DrawCursor(SDL_VideoSurface); |
SDL_UnlockCursor(); |
} else if ( video->MoveWMCursor ) { |
video->MoveWMCursor(video, x, y); |
} |
} |
/* Keep track of the current cursor colors */ |
static int palette_changed = 1; |
static Uint32 pixels8[2]; |
void SDL_CursorPaletteChanged(void) |
{ |
palette_changed = 1; |
} |
void SDL_MouseRect(SDL_Rect *area) |
{ |
int clip_diff; |
*area = SDL_cursor->area; |
if ( area->x < 0 ) { |
area->w += area->x; |
area->x = 0; |
} |
if ( area->y < 0 ) { |
area->h += area->y; |
area->y = 0; |
} |
clip_diff = (area->x+area->w)-SDL_VideoSurface->w; |
if ( clip_diff > 0 ) { |
area->w = area->w < clip_diff ? 0 : area->w-clip_diff; |
} |
clip_diff = (area->y+area->h)-SDL_VideoSurface->h; |
if ( clip_diff > 0 ) { |
area->h = area->h < clip_diff ? 0 : area->h-clip_diff; |
} |
} |
static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) |
{ |
const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 }; |
int i, w, h; |
Uint8 *data, datab; |
Uint8 *mask, maskb; |
data = SDL_cursor->data + area->y * SDL_cursor->area.w/8; |
mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8; |
switch (screen->format->BytesPerPixel) { |
case 1: { |
Uint8 *dst; |
int dstskip; |
if ( palette_changed ) { |
pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255); |
pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0); |
palette_changed = 0; |
} |
dst = (Uint8 *)screen->pixels + |
(SDL_cursor->area.y+area->y)*screen->pitch + |
SDL_cursor->area.x; |
dstskip = screen->pitch-area->w; |
for ( h=area->h; h; h-- ) { |
for ( w=area->w/8; w; w-- ) { |
maskb = *mask++; |
datab = *data++; |
for ( i=0; i<8; ++i ) { |
if ( maskb & 0x80 ) { |
*dst = pixels8[datab>>7]; |
} |
maskb <<= 1; |
datab <<= 1; |
dst++; |
} |
} |
dst += dstskip; |
} |
} |
break; |
case 2: { |
Uint16 *dst; |
int dstskip; |
dst = (Uint16 *)screen->pixels + |
(SDL_cursor->area.y+area->y)*screen->pitch/2 + |
SDL_cursor->area.x; |
dstskip = (screen->pitch/2)-area->w; |
for ( h=area->h; h; h-- ) { |
for ( w=area->w/8; w; w-- ) { |
maskb = *mask++; |
datab = *data++; |
for ( i=0; i<8; ++i ) { |
if ( maskb & 0x80 ) { |
*dst = pixels[datab>>7]; |
} |
maskb <<= 1; |
datab <<= 1; |
dst++; |
} |
} |
dst += dstskip; |
} |
} |
break; |
case 3: { |
Uint8 *dst; |
int dstskip; |
dst = (Uint8 *)screen->pixels + |
(SDL_cursor->area.y+area->y)*screen->pitch + |
SDL_cursor->area.x*3; |
dstskip = screen->pitch-area->w*3; |
for ( h=area->h; h; h-- ) { |
for ( w=area->w/8; w; w-- ) { |
maskb = *mask++; |
datab = *data++; |
for ( i=0; i<8; ++i ) { |
if ( maskb & 0x80 ) { |
memset(dst,pixels[datab>>7],3); |
} |
maskb <<= 1; |
datab <<= 1; |
dst += 3; |
} |
} |
dst += dstskip; |
} |
} |
break; |
case 4: { |
Uint32 *dst; |
int dstskip; |
dst = (Uint32 *)screen->pixels + |
(SDL_cursor->area.y+area->y)*screen->pitch/4 + |
SDL_cursor->area.x; |
dstskip = (screen->pitch/4)-area->w; |
for ( h=area->h; h; h-- ) { |
for ( w=area->w/8; w; w-- ) { |
maskb = *mask++; |
datab = *data++; |
for ( i=0; i<8; ++i ) { |
if ( maskb & 0x80 ) { |
*dst = pixels[datab>>7]; |
} |
maskb <<= 1; |
datab <<= 1; |
dst++; |
} |
} |
dst += dstskip; |
} |
} |
break; |
} |
} |
static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area) |
{ |
const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 }; |
int h; |
int x, minx, maxx; |
Uint8 *data, datab = 0; |
Uint8 *mask, maskb = 0; |
Uint8 *dst; |
int dstbpp, dstskip; |
data = SDL_cursor->data + area->y * SDL_cursor->area.w/8; |
mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8; |
dstbpp = screen->format->BytesPerPixel; |
dst = (Uint8 *)screen->pixels + |
(SDL_cursor->area.y+area->y)*screen->pitch + |
SDL_cursor->area.x*dstbpp; |
dstskip = screen->pitch-SDL_cursor->area.w*dstbpp; |
minx = area->x; |
maxx = area->x+area->w; |
if ( screen->format->BytesPerPixel == 1 ) { |
if ( palette_changed ) { |
pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255); |
pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0); |
palette_changed = 0; |
} |
for ( h=area->h; h; h-- ) { |
for ( x=0; x<SDL_cursor->area.w; ++x ) { |
if ( (x%8) == 0 ) { |
maskb = *mask++; |
datab = *data++; |
} |
if ( (x >= minx) && (x < maxx) ) { |
if ( maskb & 0x80 ) { |
memset(dst, pixels8[datab>>7], dstbpp); |
} |
} |
maskb <<= 1; |
datab <<= 1; |
dst += dstbpp; |
} |
dst += dstskip; |
} |
} else { |
for ( h=area->h; h; h-- ) { |
for ( x=0; x<SDL_cursor->area.w; ++x ) { |
if ( (x%8) == 0 ) { |
maskb = *mask++; |
datab = *data++; |
} |
if ( (x >= minx) && (x < maxx) ) { |
if ( maskb & 0x80 ) { |
memset(dst, pixels[datab>>7], dstbpp); |
} |
} |
maskb <<= 1; |
datab <<= 1; |
dst += dstbpp; |
} |
dst += dstskip; |
} |
} |
} |
/* This handles the ugly work of converting the saved cursor background from |
the pixel format of the shadow surface to that of the video surface. |
This is only necessary when blitting from a shadow surface of a different |
pixel format than the video surface, and using a software rendered cursor. |
*/ |
static void SDL_ConvertCursorSave(SDL_Surface *screen, int w, int h) |
{ |
SDL_BlitInfo info; |
SDL_loblit RunBlit; |
/* Make sure we can steal the blit mapping */ |
if ( screen->map->dst != SDL_VideoSurface ) { |
return; |
} |
/* Set up the blit information */ |
info.s_pixels = SDL_cursor->save[1]; |
info.s_width = w; |
info.s_height = h; |
info.s_skip = 0; |
info.d_pixels = SDL_cursor->save[0]; |
info.d_width = w; |
info.d_height = h; |
info.d_skip = 0; |
info.aux_data = screen->map->sw_data->aux_data; |
info.src = screen->format; |
info.table = screen->map->table; |
info.dst = SDL_VideoSurface->format; |
RunBlit = screen->map->sw_data->blit; |
/* Run the actual software blit */ |
RunBlit(&info); |
} |
void SDL_DrawCursorNoLock(SDL_Surface *screen) |
{ |
SDL_Rect area; |
/* Get the mouse rectangle, clipped to the screen */ |
SDL_MouseRect(&area); |
if ( (area.w == 0) || (area.h == 0) ) { |
return; |
} |
/* Copy mouse background */ |
{ int w, h, screenbpp; |
Uint8 *src, *dst; |
/* Set up the copy pointers */ |
screenbpp = screen->format->BytesPerPixel; |
if ( (screen == SDL_VideoSurface) || |
FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) { |
dst = SDL_cursor->save[0]; |
} else { |
dst = SDL_cursor->save[1]; |
} |
src = (Uint8 *)screen->pixels + area.y * screen->pitch + |
area.x * screenbpp; |
/* Perform the copy */ |
w = area.w*screenbpp; |
h = area.h; |
while ( h-- ) { |
memcpy(dst, src, w); |
dst += w; |
src += screen->pitch; |
} |
} |
/* Draw the mouse cursor */ |
area.x -= SDL_cursor->area.x; |
area.y -= SDL_cursor->area.y; |
if ( (area.x == 0) && (area.w == SDL_cursor->area.w) ) { |
SDL_DrawCursorFast(screen, &area); |
} else { |
SDL_DrawCursorSlow(screen, &area); |
} |
} |
void SDL_DrawCursor(SDL_Surface *screen) |
{ |
/* Lock the screen if necessary */ |
if ( screen == NULL ) { |
return; |
} |
if ( SDL_MUSTLOCK(screen) ) { |
if ( SDL_LockSurface(screen) < 0 ) { |
return; |
} |
} |
SDL_DrawCursorNoLock(screen); |
/* Unlock the screen and update if necessary */ |
if ( SDL_MUSTLOCK(screen) ) { |
SDL_UnlockSurface(screen); |
} |
if ( (screen == SDL_VideoSurface) && |
((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
SDL_Rect area; |
SDL_MouseRect(&area); |
/* This can be called before a video mode is set */ |
if ( video->UpdateRects ) { |
video->UpdateRects(this, 1, &area); |
} |
} |
} |
void SDL_EraseCursorNoLock(SDL_Surface *screen) |
{ |
SDL_Rect area; |
/* Get the mouse rectangle, clipped to the screen */ |
SDL_MouseRect(&area); |
if ( (area.w == 0) || (area.h == 0) ) { |
return; |
} |
/* Copy mouse background */ |
{ int w, h, screenbpp; |
Uint8 *src, *dst; |
/* Set up the copy pointers */ |
screenbpp = screen->format->BytesPerPixel; |
if ( (screen == SDL_VideoSurface) || |
FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) { |
src = SDL_cursor->save[0]; |
} else { |
src = SDL_cursor->save[1]; |
} |
dst = (Uint8 *)screen->pixels + area.y * screen->pitch + |
area.x * screenbpp; |
/* Perform the copy */ |
w = area.w*screenbpp; |
h = area.h; |
while ( h-- ) { |
memcpy(dst, src, w); |
src += w; |
dst += screen->pitch; |
} |
/* Perform pixel conversion on cursor background */ |
if ( src > SDL_cursor->save[1] ) { |
SDL_ConvertCursorSave(screen, area.w, area.h); |
} |
} |
} |
void SDL_EraseCursor(SDL_Surface *screen) |
{ |
/* Lock the screen if necessary */ |
if ( screen == NULL ) { |
return; |
} |
if ( SDL_MUSTLOCK(screen) ) { |
if ( SDL_LockSurface(screen) < 0 ) { |
return; |
} |
} |
SDL_EraseCursorNoLock(screen); |
/* Unlock the screen and update if necessary */ |
if ( SDL_MUSTLOCK(screen) ) { |
SDL_UnlockSurface(screen); |
} |
if ( (screen == SDL_VideoSurface) && |
((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
SDL_Rect area; |
SDL_MouseRect(&area); |
if ( video->UpdateRects ) { |
video->UpdateRects(this, 1, &area); |
} |
} |
} |
/* Reset the cursor on video mode change |
FIXME: Keep track of all cursors, and reset them all. |
*/ |
void SDL_ResetCursor(void) |
{ |
int savelen; |
if ( SDL_cursor ) { |
savelen = SDL_cursor->area.w*4*SDL_cursor->area.h; |
SDL_cursor->area.x = 0; |
SDL_cursor->area.y = 0; |
memset(SDL_cursor->save[0], 0, savelen); |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_cursor_c.h |
---|
0,0 → 1,77 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_cursor_c.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Useful variables and functions from SDL_cursor.c */ |
#include "SDL_mouse.h" |
extern int SDL_CursorInit(Uint32 flags); |
extern void SDL_CursorPaletteChanged(void); |
extern void SDL_DrawCursor(SDL_Surface *screen); |
extern void SDL_DrawCursorNoLock(SDL_Surface *screen); |
extern void SDL_EraseCursor(SDL_Surface *screen); |
extern void SDL_EraseCursorNoLock(SDL_Surface *screen); |
extern void SDL_UpdateCursor(SDL_Surface *screen); |
extern void SDL_ResetCursor(void); |
extern void SDL_MoveCursor(int x, int y); |
extern void SDL_CursorQuit(void); |
#define INLINE_MOUSELOCK |
#ifdef INLINE_MOUSELOCK |
/* Inline (macro) versions of the mouse lock functions */ |
#include "SDL_mutex.h" |
extern SDL_mutex *SDL_cursorlock; |
#define SDL_LockCursor() \ |
do { \ |
if ( SDL_cursorlock ) { \ |
SDL_mutexP(SDL_cursorlock); \ |
} \ |
} while ( 0 ) |
#define SDL_UnlockCursor() \ |
do { \ |
if ( SDL_cursorlock ) { \ |
SDL_mutexV(SDL_cursorlock); \ |
} \ |
} while ( 0 ) |
#else |
extern void SDL_LockCursor(void); |
extern void SDL_UnlockCursor(void); |
#endif /* INLINE_MOUSELOCK */ |
/* Only for low-level mouse cursor drawing */ |
extern SDL_Cursor *SDL_cursor; |
extern void SDL_MouseRect(SDL_Rect *area); |
/* State definitions for the SDL cursor */ |
#define CURSOR_VISIBLE 0x01 |
#define CURSOR_USINGSW 0x10 |
#define SHOULD_DRAWCURSOR(X) \ |
(((X)&(CURSOR_VISIBLE|CURSOR_USINGSW)) == \ |
(CURSOR_VISIBLE|CURSOR_USINGSW)) |
extern volatile int SDL_cursorstate; |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_gamma.c |
---|
0,0 → 1,238 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* Gamma correction support */ |
#define USE_MATH_H /* Used for calculating gamma ramps */ |
#ifdef USE_MATH_H |
#include <math.h> |
#endif |
#include <stdlib.h> |
#include "SDL_error.h" |
#include "SDL_sysvideo.h" |
#ifdef USE_MATH_H |
static void CalculateGammaRamp(float gamma, Uint16 *ramp) |
{ |
int i; |
/* 0.0 gamma is all black */ |
if ( gamma <= 0.0 ) { |
for ( i=0; i<256; ++i ) { |
ramp[i] = 0; |
} |
return; |
} else |
/* 1.0 gamma is identity */ |
if ( gamma == 1.0 ) { |
for ( i=0; i<256; ++i ) { |
ramp[i] = (i << 8) | i; |
} |
return; |
} else |
/* Calculate a real gamma ramp */ |
{ int value; |
gamma = 1.0f / gamma; |
for ( i=0; i<256; ++i ) { |
value = (int)(pow((double)i/256.0, gamma)*65535.0+0.5); |
if ( value > 65535 ) { |
value = 65535; |
} |
ramp[i] = (Uint16)value; |
} |
} |
} |
static void CalculateGammaFromRamp(float *gamma, Uint16 *ramp) |
{ |
/* The following is adapted from a post by Garrett Bass on OpenGL |
Gamedev list, March 4, 2000. |
*/ |
float sum = 0.0; |
int i, count = 0; |
*gamma = 1.0; |
for ( i = 1; i < 256; ++i ) { |
if ( (ramp[i] != 0) && (ramp[i] != 65535) ) { |
double B = (double)i / 256.0; |
double A = ramp[i] / 65535.0; |
sum += (float) ( log(A) / log(B) ); |
count++; |
} |
} |
if ( count && sum ) { |
*gamma = 1.0f / (sum / count); |
} |
} |
#endif /* USE_MATH_H */ |
int SDL_SetGamma(float red, float green, float blue) |
{ |
int succeeded; |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
succeeded = -1; |
#ifdef USE_MATH_H |
/* Prefer using SetGammaRamp(), as it's more flexible */ |
{ |
Uint16 ramp[3][256]; |
CalculateGammaRamp(red, ramp[0]); |
CalculateGammaRamp(green, ramp[1]); |
CalculateGammaRamp(blue, ramp[2]); |
succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]); |
} |
#else |
SDL_SetError("Gamma correction not supported"); |
#endif |
if ( (succeeded < 0) && video->SetGamma ) { |
SDL_ClearError(); |
succeeded = video->SetGamma(this, red, green, blue); |
} |
return succeeded; |
} |
/* Calculating the gamma by integrating the gamma ramps isn't exact, |
so this function isn't officially supported. |
*/ |
int SDL_GetGamma(float *red, float *green, float *blue) |
{ |
int succeeded; |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
succeeded = -1; |
#ifdef USE_MATH_H |
/* Prefer using GetGammaRamp(), as it's more flexible */ |
{ |
Uint16 ramp[3][256]; |
succeeded = SDL_GetGammaRamp(ramp[0], ramp[1], ramp[2]); |
if ( succeeded >= 0 ) { |
CalculateGammaFromRamp(red, ramp[0]); |
CalculateGammaFromRamp(green, ramp[1]); |
CalculateGammaFromRamp(blue, ramp[2]); |
} |
} |
#else |
SDL_SetError("Gamma correction not supported"); |
#endif |
if ( (succeeded < 0) && video->GetGamma ) { |
SDL_ClearError(); |
succeeded = video->GetGamma(this, red, green, blue); |
} |
return succeeded; |
} |
int SDL_SetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue) |
{ |
int succeeded; |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
SDL_Surface *screen = SDL_PublicSurface; |
/* Verify the screen parameter */ |
if ( !screen ) { |
SDL_SetError("No video mode has been set"); |
return -1; |
} |
/* Lazily allocate the gamma tables */ |
if ( ! video->gamma ) { |
SDL_GetGammaRamp(0, 0, 0); |
} |
/* Fill the gamma table with the new values */ |
if ( red ) { |
memcpy(&video->gamma[0*256], red, 256*sizeof(*video->gamma)); |
} |
if ( green ) { |
memcpy(&video->gamma[1*256], green, 256*sizeof(*video->gamma)); |
} |
if ( blue ) { |
memcpy(&video->gamma[2*256], blue, 256*sizeof(*video->gamma)); |
} |
/* Gamma correction always possible on split palettes */ |
if ( (screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) { |
SDL_Palette *pal = screen->format->palette; |
/* If physical palette has been set independently, use it */ |
if(video->physpal) |
pal = video->physpal; |
SDL_SetPalette(screen, SDL_PHYSPAL, |
pal->colors, 0, pal->ncolors); |
return 0; |
} |
/* Try to set the gamma ramp in the driver */ |
succeeded = -1; |
if ( video->SetGammaRamp ) { |
succeeded = video->SetGammaRamp(this, video->gamma); |
} else { |
SDL_SetError("Gamma ramp manipulation not supported"); |
} |
return succeeded; |
} |
int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* Lazily allocate the gamma table */ |
if ( ! video->gamma ) { |
video->gamma = malloc(3*256*sizeof(*video->gamma)); |
if ( ! video->gamma ) { |
SDL_OutOfMemory(); |
return -1; |
} |
if ( video->GetGammaRamp ) { |
/* Get the real hardware gamma */ |
video->GetGammaRamp(this, video->gamma); |
} else { |
/* Assume an identity gamma */ |
int i; |
for ( i=0; i<256; ++i ) { |
video->gamma[0*256+i] = (i << 8) | i; |
video->gamma[1*256+i] = (i << 8) | i; |
video->gamma[2*256+i] = (i << 8) | i; |
} |
} |
} |
/* Just copy from our internal table */ |
if ( red ) { |
memcpy(red, &video->gamma[0*256], 256*sizeof(*red)); |
} |
if ( green ) { |
memcpy(green, &video->gamma[1*256], 256*sizeof(*green)); |
} |
if ( blue ) { |
memcpy(blue, &video->gamma[2*256], 256*sizeof(*blue)); |
} |
return 0; |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_glfuncs.h |
---|
0,0 → 1,341 |
/* list of OpenGL functions sorted alphabetically |
If you need to use a GL function from the SDL video subsystem, |
change it's entry from SDL_PROC_UNUSED to SDL_PROC and rebuild. |
*/ |
#define SDL_PROC_UNUSED(ret,func,params) |
SDL_PROC_UNUSED(void,glAccum,(GLenum,GLfloat)) |
SDL_PROC_UNUSED(void,glAlphaFunc,(GLenum,GLclampf)) |
SDL_PROC_UNUSED(GLboolean,glAreTexturesResident,(GLsizei,const GLuint*,GLboolean*)) |
SDL_PROC_UNUSED(void,glArrayElement,(GLint)) |
SDL_PROC(void,glBegin,(GLenum)) |
SDL_PROC(void,glBindTexture,(GLenum,GLuint)) |
SDL_PROC_UNUSED(void,glBitmap,(GLsizei,GLsizei,GLfloat,GLfloat,GLfloat,GLfloat,const GLubyte*)) |
SDL_PROC(void,glBlendFunc,(GLenum,GLenum)) |
SDL_PROC_UNUSED(void,glCallList,(GLuint)) |
SDL_PROC_UNUSED(void,glCallLists,(GLsizei,GLenum,const GLvoid*)) |
SDL_PROC_UNUSED(void,glClear,(GLbitfield)) |
SDL_PROC_UNUSED(void,glClearAccum,(GLfloat,GLfloat,GLfloat,GLfloat)) |
SDL_PROC_UNUSED(void,glClearColor,(GLclampf,GLclampf,GLclampf,GLclampf)) |
SDL_PROC_UNUSED(void,glClearDepth,(GLclampd)) |
SDL_PROC_UNUSED(void,glClearIndex,(GLfloat)) |
SDL_PROC_UNUSED(void,glClearStencil,(GLint)) |
SDL_PROC_UNUSED(void,glClipPlane,(GLenum,const GLdouble*)) |
SDL_PROC_UNUSED(void,glColor3b,(GLbyte,GLbyte,GLbyte)) |
SDL_PROC_UNUSED(void,glColor3bv,(const GLbyte*)) |
SDL_PROC_UNUSED(void,glColor3d,(GLdouble,GLdouble,GLdouble)) |
SDL_PROC_UNUSED(void,glColor3dv,(const GLdouble*)) |
SDL_PROC_UNUSED(void,glColor3f,(GLfloat,GLfloat,GLfloat)) |
SDL_PROC_UNUSED(void,glColor3fv,(const GLfloat*)) |
SDL_PROC_UNUSED(void,glColor3i,(GLint,GLint,GLint)) |
SDL_PROC_UNUSED(void,glColor3iv,(const GLint*)) |
SDL_PROC_UNUSED(void,glColor3s,(GLshort,GLshort,GLshort)) |
SDL_PROC_UNUSED(void,glColor3sv,(const GLshort*)) |
SDL_PROC_UNUSED(void,glColor3ub,(GLubyte,GLubyte,GLubyte)) |
SDL_PROC_UNUSED(void,glColor3ubv,(const GLubyte*)) |
SDL_PROC_UNUSED(void,glColor3ui,(GLuint,GLuint,GLuint)) |
SDL_PROC_UNUSED(void,glColor3uiv,(const GLuint*)) |
SDL_PROC_UNUSED(void,glColor3us,(GLushort,GLushort,GLushort)) |
SDL_PROC_UNUSED(void,glColor3usv,(const GLushort*)) |
SDL_PROC_UNUSED(void,glColor4b,(GLbyte,GLbyte,GLbyte,GLbyte)) |
SDL_PROC_UNUSED(void,glColor4bv,(const GLbyte*)) |
SDL_PROC_UNUSED(void,glColor4d,(GLdouble,GLdouble,GLdouble,GLdouble)) |
SDL_PROC_UNUSED(void,glColor4dv,(const GLdouble*)) |
SDL_PROC(void,glColor4f,(GLfloat,GLfloat,GLfloat,GLfloat)) |
SDL_PROC_UNUSED(void,glColor4fv,(const GLfloat*)) |
SDL_PROC_UNUSED(void,glColor4i,(GLint,GLint,GLint,GLint)) |
SDL_PROC_UNUSED(void,glColor4iv,(const GLint*)) |
SDL_PROC_UNUSED(void,glColor4s,(GLshort,GLshort,GLshort,GLshort)) |
SDL_PROC_UNUSED(void,glColor4sv,(const GLshort*)) |
SDL_PROC_UNUSED(void,glColor4ub,(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) |
SDL_PROC_UNUSED(void,glColor4ubv,(const GLubyte *v)) |
SDL_PROC_UNUSED(void,glColor4ui,(GLuint red, GLuint green, GLuint blue, GLuint alpha)) |
SDL_PROC_UNUSED(void,glColor4uiv,(const GLuint *v)) |
SDL_PROC_UNUSED(void,glColor4us,(GLushort red, GLushort green, GLushort blue, GLushort alpha)) |
SDL_PROC_UNUSED(void,glColor4usv,(const GLushort *v)) |
SDL_PROC_UNUSED(void,glColorMask,(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) |
SDL_PROC_UNUSED(void,glColorMaterial,(GLenum face, GLenum mode)) |
SDL_PROC_UNUSED(void,glColorPointer,(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) |
SDL_PROC_UNUSED(void,glCopyPixels,(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)) |
SDL_PROC(void,glCopyTexImage1D,(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border)) |
SDL_PROC_UNUSED(void,glCopyTexImage2D,(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) |
SDL_PROC_UNUSED(void,glCopyTexSubImage1D,(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) |
SDL_PROC_UNUSED(void,glCopyTexSubImage2D,(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) |
SDL_PROC_UNUSED(void,glCullFace,(GLenum mode)) |
SDL_PROC_UNUSED(void,glDeleteLists,(GLuint list, GLsizei range)) |
SDL_PROC_UNUSED(void,glDeleteTextures,(GLsizei n, const GLuint *textures)) |
SDL_PROC_UNUSED(void,glDepthFunc,(GLenum func)) |
SDL_PROC_UNUSED(void,glDepthMask,(GLboolean flag)) |
SDL_PROC_UNUSED(void,glDepthRange,(GLclampd zNear, GLclampd zFar)) |
SDL_PROC(void,glDisable,(GLenum cap)) |
SDL_PROC_UNUSED(void,glDisableClientState,(GLenum array)) |
SDL_PROC_UNUSED(void,glDrawArrays,(GLenum mode, GLint first, GLsizei count)) |
SDL_PROC_UNUSED(void,glDrawBuffer,(GLenum mode)) |
SDL_PROC_UNUSED(void,glDrawElements,(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)) |
SDL_PROC_UNUSED(void,glDrawPixels,(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) |
SDL_PROC_UNUSED(void,glEdgeFlag,(GLboolean flag)) |
SDL_PROC_UNUSED(void,glEdgeFlagPointer,(GLsizei stride, const GLvoid *pointer)) |
SDL_PROC_UNUSED(void,glEdgeFlagv,(const GLboolean *flag)) |
SDL_PROC(void,glEnable,(GLenum cap)) |
SDL_PROC_UNUSED(void,glEnableClientState,(GLenum array)) |
SDL_PROC(void,glEnd,(void)) |
SDL_PROC_UNUSED(void,glEndList,(void)) |
SDL_PROC_UNUSED(void,glEvalCoord1d,(GLdouble u)) |
SDL_PROC_UNUSED(void,glEvalCoord1dv,(const GLdouble *u)) |
SDL_PROC_UNUSED(void,glEvalCoord1f,(GLfloat u)) |
SDL_PROC_UNUSED(void,glEvalCoord1fv,(const GLfloat *u)) |
SDL_PROC_UNUSED(void,glEvalCoord2d,(GLdouble u, GLdouble v)) |
SDL_PROC_UNUSED(void,glEvalCoord2dv,(const GLdouble *u)) |
SDL_PROC_UNUSED(void,glEvalCoord2f,(GLfloat u, GLfloat v)) |
SDL_PROC_UNUSED(void,glEvalCoord2fv,(const GLfloat *u)) |
SDL_PROC_UNUSED(void,glEvalMesh1,(GLenum mode, GLint i1, GLint i2)) |
SDL_PROC_UNUSED(void,glEvalMesh2,(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)) |
SDL_PROC_UNUSED(void,glEvalPoint1,(GLint i)) |
SDL_PROC_UNUSED(void,glEvalPoint2,(GLint i, GLint j)) |
SDL_PROC_UNUSED(void,glFeedbackBuffer,(GLsizei size, GLenum type, GLfloat *buffer)) |
SDL_PROC_UNUSED(void,glFinish,(void)) |
SDL_PROC(void,glFlush,(void)) |
SDL_PROC_UNUSED(void,glFogf,(GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glFogfv,(GLenum pname, const GLfloat *params)) |
SDL_PROC_UNUSED(void,glFogi,(GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glFogiv,(GLenum pname, const GLint *params)) |
SDL_PROC_UNUSED(void,glFrontFace,(GLenum mode)) |
SDL_PROC_UNUSED(void,glFrustum,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) |
SDL_PROC_UNUSED(GLuint,glGenLists,(GLsizei range)) |
SDL_PROC(void,glGenTextures,(GLsizei n, GLuint *textures)) |
SDL_PROC_UNUSED(void,glGetBooleanv,(GLenum pname, GLboolean *params)) |
SDL_PROC_UNUSED(void,glGetClipPlane,(GLenum plane, GLdouble *equation)) |
SDL_PROC_UNUSED(void,glGetDoublev,(GLenum pname, GLdouble *params)) |
SDL_PROC_UNUSED(GLenum,glGetError,(void)) |
SDL_PROC_UNUSED(void,glGetFloatv,(GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetIntegerv,(GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glGetLightfv,(GLenum light, GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetLightiv,(GLenum light, GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glGetMapdv,(GLenum target, GLenum query, GLdouble *v)) |
SDL_PROC_UNUSED(void,glGetMapfv,(GLenum target, GLenum query, GLfloat *v)) |
SDL_PROC_UNUSED(void,glGetMapiv,(GLenum target, GLenum query, GLint *v)) |
SDL_PROC_UNUSED(void,glGetMaterialfv,(GLenum face, GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetMaterialiv,(GLenum face, GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glGetPixelMapfv,(GLenum map, GLfloat *values)) |
SDL_PROC_UNUSED(void,glGetPixelMapuiv,(GLenum map, GLuint *values)) |
SDL_PROC_UNUSED(void,glGetPixelMapusv,(GLenum map, GLushort *values)) |
SDL_PROC_UNUSED(void,glGetPointerv,(GLenum pname, GLvoid* *params)) |
SDL_PROC_UNUSED(void,glGetPolygonStipple,(GLubyte *mask)) |
SDL_PROC(const GLubyte *,glGetString,(GLenum name)) |
SDL_PROC_UNUSED(void,glGetTexEnvfv,(GLenum target, GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetTexEnviv,(GLenum target, GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glGetTexGendv,(GLenum coord, GLenum pname, GLdouble *params)) |
SDL_PROC_UNUSED(void,glGetTexGenfv,(GLenum coord, GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetTexGeniv,(GLenum coord, GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glGetTexImage,(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)) |
SDL_PROC_UNUSED(void,glGetTexLevelParameterfv,(GLenum target, GLint level, GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetTexLevelParameteriv,(GLenum target, GLint level, GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glGetTexParameterfv,(GLenum target, GLenum pname, GLfloat *params)) |
SDL_PROC_UNUSED(void,glGetTexParameteriv,(GLenum target, GLenum pname, GLint *params)) |
SDL_PROC_UNUSED(void,glHint,(GLenum target, GLenum mode)) |
SDL_PROC_UNUSED(void,glIndexMask,(GLuint mask)) |
SDL_PROC_UNUSED(void,glIndexPointer,(GLenum type, GLsizei stride, const GLvoid *pointer)) |
SDL_PROC_UNUSED(void,glIndexd,(GLdouble c)) |
SDL_PROC_UNUSED(void,glIndexdv,(const GLdouble *c)) |
SDL_PROC_UNUSED(void,glIndexf,(GLfloat c)) |
SDL_PROC_UNUSED(void,glIndexfv,(const GLfloat *c)) |
SDL_PROC_UNUSED(void,glIndexi,(GLint c)) |
SDL_PROC_UNUSED(void,glIndexiv,(const GLint *c)) |
SDL_PROC_UNUSED(void,glIndexs,(GLshort c)) |
SDL_PROC_UNUSED(void,glIndexsv,(const GLshort *c)) |
SDL_PROC_UNUSED(void,glIndexub,(GLubyte c)) |
SDL_PROC_UNUSED(void,glIndexubv,(const GLubyte *c)) |
SDL_PROC_UNUSED(void,glInitNames,(void)) |
SDL_PROC_UNUSED(void,glInterleavedArrays,(GLenum format, GLsizei stride, const GLvoid *pointer)) |
SDL_PROC_UNUSED(GLboolean,glIsEnabled,(GLenum cap)) |
SDL_PROC_UNUSED(GLboolean,glIsList,(GLuint list)) |
SDL_PROC_UNUSED(GLboolean,glIsTexture,(GLuint texture)) |
SDL_PROC_UNUSED(void,glLightModelf,(GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glLightModelfv,(GLenum pname, const GLfloat *params)) |
SDL_PROC_UNUSED(void,glLightModeli,(GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glLightModeliv,(GLenum pname, const GLint *params)) |
SDL_PROC_UNUSED(void,glLightf,(GLenum light, GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glLightfv,(GLenum light, GLenum pname, const GLfloat *params)) |
SDL_PROC_UNUSED(void,glLighti,(GLenum light, GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glLightiv,(GLenum light, GLenum pname, const GLint *params)) |
SDL_PROC_UNUSED(void,glLineStipple,(GLint factor, GLushort pattern)) |
SDL_PROC_UNUSED(void,glLineWidth,(GLfloat width)) |
SDL_PROC_UNUSED(void,glListBase,(GLuint base)) |
SDL_PROC(void,glLoadIdentity,(void)) |
SDL_PROC_UNUSED(void,glLoadMatrixd,(const GLdouble *m)) |
SDL_PROC_UNUSED(void,glLoadMatrixf,(const GLfloat *m)) |
SDL_PROC_UNUSED(void,glLoadName,(GLuint name)) |
SDL_PROC_UNUSED(void,glLogicOp,(GLenum opcode)) |
SDL_PROC_UNUSED(void,glMap1d,(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)) |
SDL_PROC_UNUSED(void,glMap1f,(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)) |
SDL_PROC_UNUSED(void,glMap2d,(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)) |
SDL_PROC_UNUSED(void,glMap2f,(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)) |
SDL_PROC_UNUSED(void,glMapGrid1d,(GLint un, GLdouble u1, GLdouble u2)) |
SDL_PROC_UNUSED(void,glMapGrid1f,(GLint un, GLfloat u1, GLfloat u2)) |
SDL_PROC_UNUSED(void,glMapGrid2d,(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)) |
SDL_PROC_UNUSED(void,glMapGrid2f,(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)) |
SDL_PROC_UNUSED(void,glMaterialf,(GLenum face, GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glMaterialfv,(GLenum face, GLenum pname, const GLfloat *params)) |
SDL_PROC_UNUSED(void,glMateriali,(GLenum face, GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glMaterialiv,(GLenum face, GLenum pname, const GLint *params)) |
SDL_PROC(void,glMatrixMode,(GLenum mode)) |
SDL_PROC_UNUSED(void,glMultMatrixd,(const GLdouble *m)) |
SDL_PROC_UNUSED(void,glMultMatrixf,(const GLfloat *m)) |
SDL_PROC_UNUSED(void,glNewList,(GLuint list, GLenum mode)) |
SDL_PROC_UNUSED(void,glNormal3b,(GLbyte nx, GLbyte ny, GLbyte nz)) |
SDL_PROC_UNUSED(void,glNormal3bv,(const GLbyte *v)) |
SDL_PROC_UNUSED(void,glNormal3d,(GLdouble nx, GLdouble ny, GLdouble nz)) |
SDL_PROC_UNUSED(void,glNormal3dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glNormal3f,(GLfloat nx, GLfloat ny, GLfloat nz)) |
SDL_PROC_UNUSED(void,glNormal3fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glNormal3i,(GLint nx, GLint ny, GLint nz)) |
SDL_PROC_UNUSED(void,glNormal3iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glNormal3s,(GLshort nx, GLshort ny, GLshort nz)) |
SDL_PROC_UNUSED(void,glNormal3sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glNormalPointer,(GLenum type, GLsizei stride, const GLvoid *pointer)) |
SDL_PROC(void,glOrtho,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) |
SDL_PROC_UNUSED(void,glPassThrough,(GLfloat token)) |
SDL_PROC_UNUSED(void,glPixelMapfv,(GLenum map, GLsizei mapsize, const GLfloat *values)) |
SDL_PROC_UNUSED(void,glPixelMapuiv,(GLenum map, GLsizei mapsize, const GLuint *values)) |
SDL_PROC_UNUSED(void,glPixelMapusv,(GLenum map, GLsizei mapsize, const GLushort *values)) |
SDL_PROC_UNUSED(void,glPixelStoref,(GLenum pname, GLfloat param)) |
SDL_PROC(void,glPixelStorei,(GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glPixelTransferf,(GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glPixelTransferi,(GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glPixelZoom,(GLfloat xfactor, GLfloat yfactor)) |
SDL_PROC_UNUSED(void,glPointSize,(GLfloat size)) |
SDL_PROC_UNUSED(void,glPolygonMode,(GLenum face, GLenum mode)) |
SDL_PROC_UNUSED(void,glPolygonOffset,(GLfloat factor, GLfloat units)) |
SDL_PROC_UNUSED(void,glPolygonStipple,(const GLubyte *mask)) |
SDL_PROC(void,glPopAttrib,(void)) |
SDL_PROC(void,glPopClientAttrib,(void)) |
SDL_PROC(void,glPopMatrix,(void)) |
SDL_PROC_UNUSED(void,glPopName,(void)) |
SDL_PROC_UNUSED(void,glPrioritizeTextures,(GLsizei n, const GLuint *textures, const GLclampf *priorities)) |
SDL_PROC(void,glPushAttrib,(GLbitfield mask)) |
SDL_PROC(void,glPushClientAttrib,(GLbitfield mask)) |
SDL_PROC(void,glPushMatrix,(void)) |
SDL_PROC_UNUSED(void,glPushName,(GLuint name)) |
SDL_PROC_UNUSED(void,glRasterPos2d,(GLdouble x, GLdouble y)) |
SDL_PROC_UNUSED(void,glRasterPos2dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glRasterPos2f,(GLfloat x, GLfloat y)) |
SDL_PROC_UNUSED(void,glRasterPos2fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glRasterPos2i,(GLint x, GLint y)) |
SDL_PROC_UNUSED(void,glRasterPos2iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glRasterPos2s,(GLshort x, GLshort y)) |
SDL_PROC_UNUSED(void,glRasterPos2sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glRasterPos3d,(GLdouble x, GLdouble y, GLdouble z)) |
SDL_PROC_UNUSED(void,glRasterPos3dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glRasterPos3f,(GLfloat x, GLfloat y, GLfloat z)) |
SDL_PROC_UNUSED(void,glRasterPos3fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glRasterPos3i,(GLint x, GLint y, GLint z)) |
SDL_PROC_UNUSED(void,glRasterPos3iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glRasterPos3s,(GLshort x, GLshort y, GLshort z)) |
SDL_PROC_UNUSED(void,glRasterPos3sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glRasterPos4d,(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) |
SDL_PROC_UNUSED(void,glRasterPos4dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glRasterPos4f,(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) |
SDL_PROC_UNUSED(void,glRasterPos4fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glRasterPos4i,(GLint x, GLint y, GLint z, GLint w)) |
SDL_PROC_UNUSED(void,glRasterPos4iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glRasterPos4s,(GLshort x, GLshort y, GLshort z, GLshort w)) |
SDL_PROC_UNUSED(void,glRasterPos4sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glReadBuffer,(GLenum mode)) |
SDL_PROC_UNUSED(void,glReadPixels,(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)) |
SDL_PROC_UNUSED(void,glRectd,(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)) |
SDL_PROC_UNUSED(void,glRectdv,(const GLdouble *v1, const GLdouble *v2)) |
SDL_PROC_UNUSED(void,glRectf,(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) |
SDL_PROC_UNUSED(void,glRectfv,(const GLfloat *v1, const GLfloat *v2)) |
SDL_PROC_UNUSED(void,glRecti,(GLint x1, GLint y1, GLint x2, GLint y2)) |
SDL_PROC_UNUSED(void,glRectiv,(const GLint *v1, const GLint *v2)) |
SDL_PROC_UNUSED(void,glRects,(GLshort x1, GLshort y1, GLshort x2, GLshort y2)) |
SDL_PROC_UNUSED(void,glRectsv,(const GLshort *v1, const GLshort *v2)) |
SDL_PROC_UNUSED(GLint,glRenderMode,(GLenum mode)) |
SDL_PROC_UNUSED(void,glRotated,(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)) |
SDL_PROC_UNUSED(void,glRotatef,(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) |
SDL_PROC_UNUSED(void,glScaled,(GLdouble x, GLdouble y, GLdouble z)) |
SDL_PROC_UNUSED(void,glScalef,(GLfloat x, GLfloat y, GLfloat z)) |
SDL_PROC_UNUSED(void,glScissor,(GLint x, GLint y, GLsizei width, GLsizei height)) |
SDL_PROC_UNUSED(void,glSelectBuffer,(GLsizei size, GLuint *buffer)) |
SDL_PROC_UNUSED(void,glShadeModel,(GLenum mode)) |
SDL_PROC_UNUSED(void,glStencilFunc,(GLenum func, GLint ref, GLuint mask)) |
SDL_PROC_UNUSED(void,glStencilMask,(GLuint mask)) |
SDL_PROC_UNUSED(void,glStencilOp,(GLenum fail, GLenum zfail, GLenum zpass)) |
SDL_PROC_UNUSED(void,glTexCoord1d,(GLdouble s)) |
SDL_PROC_UNUSED(void,glTexCoord1dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glTexCoord1f,(GLfloat s)) |
SDL_PROC_UNUSED(void,glTexCoord1fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glTexCoord1i,(GLint s)) |
SDL_PROC_UNUSED(void,glTexCoord1iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glTexCoord1s,(GLshort s)) |
SDL_PROC_UNUSED(void,glTexCoord1sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glTexCoord2d,(GLdouble s, GLdouble t)) |
SDL_PROC_UNUSED(void,glTexCoord2dv,(const GLdouble *v)) |
SDL_PROC(void,glTexCoord2f,(GLfloat s, GLfloat t)) |
SDL_PROC_UNUSED(void,glTexCoord2fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glTexCoord2i,(GLint s, GLint t)) |
SDL_PROC_UNUSED(void,glTexCoord2iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glTexCoord2s,(GLshort s, GLshort t)) |
SDL_PROC_UNUSED(void,glTexCoord2sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glTexCoord3d,(GLdouble s, GLdouble t, GLdouble r)) |
SDL_PROC_UNUSED(void,glTexCoord3dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glTexCoord3f,(GLfloat s, GLfloat t, GLfloat r)) |
SDL_PROC_UNUSED(void,glTexCoord3fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glTexCoord3i,(GLint s, GLint t, GLint r)) |
SDL_PROC_UNUSED(void,glTexCoord3iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glTexCoord3s,(GLshort s, GLshort t, GLshort r)) |
SDL_PROC_UNUSED(void,glTexCoord3sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glTexCoord4d,(GLdouble s, GLdouble t, GLdouble r, GLdouble q)) |
SDL_PROC_UNUSED(void,glTexCoord4dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glTexCoord4f,(GLfloat s, GLfloat t, GLfloat r, GLfloat q)) |
SDL_PROC_UNUSED(void,glTexCoord4fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glTexCoord4i,(GLint s, GLint t, GLint r, GLint q)) |
SDL_PROC_UNUSED(void,glTexCoord4iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glTexCoord4s,(GLshort s, GLshort t, GLshort r, GLshort q)) |
SDL_PROC_UNUSED(void,glTexCoord4sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glTexCoordPointer,(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) |
SDL_PROC(void,glTexEnvf,(GLenum target, GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glTexEnvfv,(GLenum target, GLenum pname, const GLfloat *params)) |
SDL_PROC_UNUSED(void,glTexEnvi,(GLenum target, GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glTexEnviv,(GLenum target, GLenum pname, const GLint *params)) |
SDL_PROC_UNUSED(void,glTexGend,(GLenum coord, GLenum pname, GLdouble param)) |
SDL_PROC_UNUSED(void,glTexGendv,(GLenum coord, GLenum pname, const GLdouble *params)) |
SDL_PROC_UNUSED(void,glTexGenf,(GLenum coord, GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glTexGenfv,(GLenum coord, GLenum pname, const GLfloat *params)) |
SDL_PROC_UNUSED(void,glTexGeni,(GLenum coord, GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glTexGeniv,(GLenum coord, GLenum pname, const GLint *params)) |
SDL_PROC_UNUSED(void,glTexImage1D,(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) |
SDL_PROC(void,glTexImage2D,(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) |
SDL_PROC_UNUSED(void,glTexParameterf,(GLenum target, GLenum pname, GLfloat param)) |
SDL_PROC_UNUSED(void,glTexParameterfv,(GLenum target, GLenum pname, const GLfloat *params)) |
SDL_PROC(void,glTexParameteri,(GLenum target, GLenum pname, GLint param)) |
SDL_PROC_UNUSED(void,glTexParameteriv,(GLenum target, GLenum pname, const GLint *params)) |
SDL_PROC_UNUSED(void,glTexSubImage1D,(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) |
SDL_PROC(void,glTexSubImage2D,(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) |
SDL_PROC_UNUSED(void,glTranslated,(GLdouble x, GLdouble y, GLdouble z)) |
SDL_PROC_UNUSED(void,glTranslatef,(GLfloat x, GLfloat y, GLfloat z)) |
SDL_PROC_UNUSED(void,glVertex2d,(GLdouble x, GLdouble y)) |
SDL_PROC_UNUSED(void,glVertex2dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glVertex2f,(GLfloat x, GLfloat y)) |
SDL_PROC_UNUSED(void,glVertex2fv,(const GLfloat *v)) |
SDL_PROC(void,glVertex2i,(GLint x, GLint y)) |
SDL_PROC_UNUSED(void,glVertex2iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glVertex2s,(GLshort x, GLshort y)) |
SDL_PROC_UNUSED(void,glVertex2sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glVertex3d,(GLdouble x, GLdouble y, GLdouble z)) |
SDL_PROC_UNUSED(void,glVertex3dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glVertex3f,(GLfloat x, GLfloat y, GLfloat z)) |
SDL_PROC_UNUSED(void,glVertex3fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glVertex3i,(GLint x, GLint y, GLint z)) |
SDL_PROC_UNUSED(void,glVertex3iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glVertex3s,(GLshort x, GLshort y, GLshort z)) |
SDL_PROC_UNUSED(void,glVertex3sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glVertex4d,(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) |
SDL_PROC_UNUSED(void,glVertex4dv,(const GLdouble *v)) |
SDL_PROC_UNUSED(void,glVertex4f,(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) |
SDL_PROC_UNUSED(void,glVertex4fv,(const GLfloat *v)) |
SDL_PROC_UNUSED(void,glVertex4i,(GLint x, GLint y, GLint z, GLint w)) |
SDL_PROC_UNUSED(void,glVertex4iv,(const GLint *v)) |
SDL_PROC_UNUSED(void,glVertex4s,(GLshort x, GLshort y, GLshort z, GLshort w)) |
SDL_PROC_UNUSED(void,glVertex4sv,(const GLshort *v)) |
SDL_PROC_UNUSED(void,glVertexPointer,(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) |
SDL_PROC(void,glViewport,(GLint x, GLint y, GLsizei width, GLsizei height)) |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_leaks.h |
---|
0,0 → 1,35 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_leaks.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Define this if you want surface leak detection code enabled */ |
/*#define CHECK_LEAKS*/ |
/* Global variables used to check leaks in code using SDL */ |
#ifdef CHECK_LEAKS |
extern int surfaces_allocated; |
#endif |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_memops.h |
---|
0,0 → 1,144 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_memops.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
#ifndef _SDL_memops_h |
#define _SDL_memops_h |
/* System dependent optimized memory manipulation routines: |
*/ |
#include <string.h> |
#if defined(__GNUC__) && defined(i386) |
/* Thanks to Brennan "Bas" Underwood, for the inspiration. :) |
*/ |
#define SDL_memcpy(dst, src, len) \ |
do { \ |
int u0, u1, u2; \ |
__asm__ __volatile__ ( \ |
"cld\n\t" \ |
"rep ; movsl\n\t" \ |
"testb $2,%b4\n\t" \ |
"je 1f\n\t" \ |
"movsw\n" \ |
"1:\ttestb $1,%b4\n\t" \ |
"je 2f\n\t" \ |
"movsb\n" \ |
"2:" \ |
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \ |
: "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \ |
: "memory" ); \ |
} while(0) |
#define SDL_memcpy4(dst, src, len) \ |
do { \ |
int ecx, edi, esi; \ |
__asm__ __volatile__ ( \ |
"cld\n\t" \ |
"rep ; movsl" \ |
: "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ |
: "0" ((unsigned)(len)), "1" (dst), "2" (src) \ |
: "memory" ); \ |
} while(0) |
#define SDL_revcpy(dst, src, len) \ |
do { \ |
int u0, u1, u2; \ |
char *dstp = (char *)(dst); \ |
char *srcp = (char *)(src); \ |
int n = (len); \ |
if ( n >= 4 ) { \ |
__asm__ __volatile__ ( \ |
"std\n\t" \ |
"rep ; movsl\n\t" \ |
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \ |
: "0" (n >> 2), \ |
"1" (dstp+(n-4)), "2" (srcp+(n-4)) \ |
: "memory" ); \ |
} \ |
switch (n & 3) { \ |
case 3: dstp[2] = srcp[2]; \ |
case 2: dstp[1] = srcp[1]; \ |
case 1: dstp[0] = srcp[0]; \ |
break; \ |
default: \ |
break; \ |
} \ |
} while(0) |
#define SDL_memmove(dst, src, len) \ |
do { \ |
if ( (dst) < (src) ) { \ |
SDL_memcpy((dst), (src), (len)); \ |
} else { \ |
SDL_revcpy((dst), (src), (len)); \ |
} \ |
} while(0) |
#define SDL_memset4(dst, val, len) \ |
do { \ |
int u0, u1, u2; \ |
__asm__ __volatile__ ( \ |
"cld\n\t" \ |
"rep ; stosl\n\t" \ |
: "=&D" (u0), "=&a" (u1), "=&c" (u2) \ |
: "0" (dst), "1" (val), "2" ((Uint32)(len)) \ |
: "memory" ); \ |
} while(0) |
#endif /* GNU C and x86 */ |
/* If there are no optimized versions, define the normal versions */ |
#ifndef SDL_memcpy |
#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) |
#endif |
#ifndef SDL_memcpy4 |
#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len) << 2) |
#endif |
#ifndef SDL_revcpy |
#define SDL_revcpy(dst, src, len) memmove(dst, src, len) |
#endif |
#ifndef SDL_memset4 |
#define SDL_memset4(dst, val, len) \ |
do { \ |
unsigned _count = (len); \ |
unsigned _n = (_count + 3) / 4; \ |
Uint32 *_p = (Uint32 *)(dst); \ |
Uint32 _val = (val); \ |
switch (_count % 4) { \ |
case 0: do { *_p++ = _val; \ |
case 3: *_p++ = _val; \ |
case 2: *_p++ = _val; \ |
case 1: *_p++ = _val; \ |
} while ( --_n ); \ |
} \ |
} while(0) |
#endif |
#endif /* _SDL_memops_h */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_pixels.c |
---|
0,0 → 1,615 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* General (mostly internal) pixel/color manipulation routines for SDL */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_endian.h" |
#include "SDL_video.h" |
#include "SDL_sysvideo.h" |
#include "SDL_blit.h" |
#include "SDL_pixels_c.h" |
#include "SDL_RLEaccel_c.h" |
/* Helper functions */ |
/* |
* Allocate a pixel format structure and fill it according to the given info. |
*/ |
SDL_PixelFormat *SDL_AllocFormat(int bpp, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) |
{ |
SDL_PixelFormat *format; |
Uint32 mask; |
/* Allocate an empty pixel format structure */ |
format = malloc(sizeof(*format)); |
if ( format == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
memset(format, 0, sizeof(*format)); |
format->alpha = SDL_ALPHA_OPAQUE; |
/* Set up the format */ |
format->BitsPerPixel = bpp; |
format->BytesPerPixel = (bpp+7)/8; |
switch (bpp) { |
case 1: |
/* Create the 2 color black-white palette */ |
format->palette = (SDL_Palette *)malloc( |
sizeof(SDL_Palette)); |
if ( format->palette == NULL ) { |
SDL_FreeFormat(format); |
SDL_OutOfMemory(); |
return(NULL); |
} |
(format->palette)->ncolors = 2; |
(format->palette)->colors = (SDL_Color *)malloc( |
(format->palette)->ncolors*sizeof(SDL_Color)); |
if ( (format->palette)->colors == NULL ) { |
SDL_FreeFormat(format); |
SDL_OutOfMemory(); |
return(NULL); |
} |
format->palette->colors[0].r = 0xFF; |
format->palette->colors[0].g = 0xFF; |
format->palette->colors[0].b = 0xFF; |
format->palette->colors[1].r = 0x00; |
format->palette->colors[1].g = 0x00; |
format->palette->colors[1].b = 0x00; |
format->Rloss = 8; |
format->Gloss = 8; |
format->Bloss = 8; |
format->Aloss = 8; |
format->Rshift = 0; |
format->Gshift = 0; |
format->Bshift = 0; |
format->Ashift = 0; |
format->Rmask = 0; |
format->Gmask = 0; |
format->Bmask = 0; |
format->Amask = 0; |
break; |
case 4: |
/* Create the 16 color VGA palette */ |
format->palette = (SDL_Palette *)malloc( |
sizeof(SDL_Palette)); |
if ( format->palette == NULL ) { |
SDL_FreeFormat(format); |
SDL_OutOfMemory(); |
return(NULL); |
} |
(format->palette)->ncolors = 16; |
(format->palette)->colors = (SDL_Color *)malloc( |
(format->palette)->ncolors*sizeof(SDL_Color)); |
if ( (format->palette)->colors == NULL ) { |
SDL_FreeFormat(format); |
SDL_OutOfMemory(); |
return(NULL); |
} |
/* Punt for now, will this ever be used? */ |
memset((format->palette)->colors, 0, |
(format->palette)->ncolors*sizeof(SDL_Color)); |
/* Palettized formats have no mask info */ |
format->Rloss = 8; |
format->Gloss = 8; |
format->Bloss = 8; |
format->Aloss = 8; |
format->Rshift = 0; |
format->Gshift = 0; |
format->Bshift = 0; |
format->Ashift = 0; |
format->Rmask = 0; |
format->Gmask = 0; |
format->Bmask = 0; |
format->Amask = 0; |
break; |
case 8: |
/* Create an empty 256 color palette */ |
format->palette = (SDL_Palette *)malloc( |
sizeof(SDL_Palette)); |
if ( format->palette == NULL ) { |
SDL_FreeFormat(format); |
SDL_OutOfMemory(); |
return(NULL); |
} |
(format->palette)->ncolors = 256; |
(format->palette)->colors = (SDL_Color *)malloc( |
(format->palette)->ncolors*sizeof(SDL_Color)); |
if ( (format->palette)->colors == NULL ) { |
SDL_FreeFormat(format); |
SDL_OutOfMemory(); |
return(NULL); |
} |
memset((format->palette)->colors, 0, |
(format->palette)->ncolors*sizeof(SDL_Color)); |
/* Palettized formats have no mask info */ |
format->Rloss = 8; |
format->Gloss = 8; |
format->Bloss = 8; |
format->Aloss = 8; |
format->Rshift = 0; |
format->Gshift = 0; |
format->Bshift = 0; |
format->Ashift = 0; |
format->Rmask = 0; |
format->Gmask = 0; |
format->Bmask = 0; |
format->Amask = 0; |
break; |
default: |
/* No palette, just packed pixel info */ |
format->palette = NULL; |
format->Rshift = 0; |
format->Rloss = 8; |
if ( Rmask ) { |
for ( mask = Rmask; !(mask&0x01); mask >>= 1 ) |
++format->Rshift; |
for ( ; (mask&0x01); mask >>= 1 ) |
--format->Rloss; |
} |
format->Gshift = 0; |
format->Gloss = 8; |
if ( Gmask ) { |
for ( mask = Gmask; !(mask&0x01); mask >>= 1 ) |
++format->Gshift; |
for ( ; (mask&0x01); mask >>= 1 ) |
--format->Gloss; |
} |
format->Bshift = 0; |
format->Bloss = 8; |
if ( Bmask ) { |
for ( mask = Bmask; !(mask&0x01); mask >>= 1 ) |
++format->Bshift; |
for ( ; (mask&0x01); mask >>= 1 ) |
--format->Bloss; |
} |
format->Ashift = 0; |
format->Aloss = 8; |
if ( Amask ) { |
for ( mask = Amask; !(mask&0x01); mask >>= 1 ) |
++format->Ashift; |
for ( ; (mask&0x01); mask >>= 1 ) |
--format->Aloss; |
} |
format->Rmask = Rmask; |
format->Gmask = Gmask; |
format->Bmask = Bmask; |
format->Amask = Amask; |
break; |
} |
/* Calculate some standard bitmasks, if necessary |
* Note: This could conflict with an alpha mask, if given. |
*/ |
if ( (bpp > 8) && !format->Rmask && !format->Gmask && !format->Bmask ) { |
/* R-G-B */ |
if ( bpp > 24 ) |
bpp = 24; |
format->Rloss = 8-(bpp/3); |
format->Gloss = 8-(bpp/3)-(bpp%3); |
format->Bloss = 8-(bpp/3); |
format->Rshift = ((bpp/3)+(bpp%3))+(bpp/3); |
format->Gshift = (bpp/3); |
format->Bshift = 0; |
format->Rmask = ((0xFF>>format->Rloss)<<format->Rshift); |
format->Gmask = ((0xFF>>format->Gloss)<<format->Gshift); |
format->Bmask = ((0xFF>>format->Bloss)<<format->Bshift); |
} |
return(format); |
} |
SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) |
{ |
if ( surface->format ) { |
SDL_FreeFormat(surface->format); |
SDL_FormatChanged(surface); |
} |
surface->format = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask); |
return surface->format; |
} |
/* |
* Change any previous mappings from/to the new surface format |
*/ |
void SDL_FormatChanged(SDL_Surface *surface) |
{ |
surface->format_version++; |
SDL_InvalidateMap(surface->map); |
} |
/* |
* Free a previously allocated format structure |
*/ |
void SDL_FreeFormat(SDL_PixelFormat *format) |
{ |
if ( format ) { |
if ( format->palette ) { |
if ( format->palette->colors ) { |
free(format->palette->colors); |
} |
free(format->palette); |
} |
free(format); |
} |
} |
/* |
* Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors |
*/ |
void SDL_DitherColors(SDL_Color *colors, int bpp) |
{ |
int i; |
if(bpp != 8) |
return; /* only 8bpp supported right now */ |
for(i = 0; i < 256; i++) { |
int r, g, b; |
/* map each bit field to the full [0, 255] interval, |
so 0 is mapped to (0, 0, 0) and 255 to (255, 255, 255) */ |
r = i & 0xe0; |
r |= r >> 3 | r >> 6; |
colors[i].r = r; |
g = (i << 3) & 0xe0; |
g |= g >> 3 | g >> 6; |
colors[i].g = g; |
b = i & 0x3; |
b |= b << 2; |
b |= b << 4; |
colors[i].b = b; |
} |
} |
/* |
* Calculate the pad-aligned scanline width of a surface |
*/ |
Uint16 SDL_CalculatePitch(SDL_Surface *surface) |
{ |
Uint16 pitch; |
/* Surface should be 4-byte aligned for speed */ |
pitch = surface->w*surface->format->BytesPerPixel; |
switch (surface->format->BitsPerPixel) { |
case 1: |
pitch = (pitch+7)/8; |
break; |
case 4: |
pitch = (pitch+1)/2; |
break; |
default: |
break; |
} |
pitch = (pitch + 3) & ~3; /* 4-byte aligning */ |
return(pitch); |
} |
/* |
* Match an RGB value to a particular palette index |
*/ |
Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b) |
{ |
/* Do colorspace distance matching */ |
unsigned int smallest; |
unsigned int distance; |
int rd, gd, bd; |
int i; |
Uint8 pixel=0; |
smallest = ~0; |
for ( i=0; i<pal->ncolors; ++i ) { |
rd = pal->colors[i].r - r; |
gd = pal->colors[i].g - g; |
bd = pal->colors[i].b - b; |
distance = (rd*rd)+(gd*gd)+(bd*bd); |
if ( distance < smallest ) { |
pixel = i; |
if ( distance == 0 ) { /* Perfect match! */ |
break; |
} |
smallest = distance; |
} |
} |
return(pixel); |
} |
/* Find the opaque pixel value corresponding to an RGB triple */ |
Uint32 SDL_MapRGB(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) |
{ |
if ( format->palette == NULL ) { |
return (r >> format->Rloss) << format->Rshift |
| (g >> format->Gloss) << format->Gshift |
| (b >> format->Bloss) << format->Bshift |
| format->Amask; |
} else { |
return SDL_FindColor(format->palette, r, g, b); |
} |
} |
/* Find the pixel value corresponding to an RGBA quadruple */ |
Uint32 SDL_MapRGBA(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
{ |
if ( format->palette == NULL ) { |
return (r >> format->Rloss) << format->Rshift |
| (g >> format->Gloss) << format->Gshift |
| (b >> format->Bloss) << format->Bshift |
| ((a >> format->Aloss) << format->Ashift & format->Amask); |
} else { |
return SDL_FindColor(format->palette, r, g, b); |
} |
} |
void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, |
Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
{ |
if ( fmt->palette == NULL ) { |
/* |
* This makes sure that the result is mapped to the |
* interval [0..255], and the maximum value for each |
* component is 255. This is important to make sure |
* that white is indeed reported as (255, 255, 255), |
* and that opaque alpha is 255. |
* This only works for RGB bit fields at least 4 bit |
* wide, which is almost always the case. |
*/ |
unsigned rv, gv, bv, av; |
rv = (pixel & fmt->Rmask) >> fmt->Rshift; |
*r = (rv << fmt->Rloss) + (rv >> (8 - fmt->Rloss)); |
gv = (pixel & fmt->Gmask) >> fmt->Gshift; |
*g = (gv << fmt->Gloss) + (gv >> (8 - fmt->Gloss)); |
bv = (pixel & fmt->Bmask) >> fmt->Bshift; |
*b = (bv << fmt->Bloss) + (bv >> (8 - fmt->Bloss)); |
if(fmt->Amask) { |
av = (pixel & fmt->Amask) >> fmt->Ashift; |
*a = (av << fmt->Aloss) + (av >> (8 - fmt->Aloss)); |
} else |
*a = SDL_ALPHA_OPAQUE; |
} else { |
*r = fmt->palette->colors[pixel].r; |
*g = fmt->palette->colors[pixel].g; |
*b = fmt->palette->colors[pixel].b; |
*a = SDL_ALPHA_OPAQUE; |
} |
} |
void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r,Uint8 *g,Uint8 *b) |
{ |
if ( fmt->palette == NULL ) { |
/* the note for SDL_GetRGBA above applies here too */ |
unsigned rv, gv, bv; |
rv = (pixel & fmt->Rmask) >> fmt->Rshift; |
*r = (rv << fmt->Rloss) + (rv >> (8 - fmt->Rloss)); |
gv = (pixel & fmt->Gmask) >> fmt->Gshift; |
*g = (gv << fmt->Gloss) + (gv >> (8 - fmt->Gloss)); |
bv = (pixel & fmt->Bmask) >> fmt->Bshift; |
*b = (bv << fmt->Bloss) + (bv >> (8 - fmt->Bloss)); |
} else { |
*r = fmt->palette->colors[pixel].r; |
*g = fmt->palette->colors[pixel].g; |
*b = fmt->palette->colors[pixel].b; |
} |
} |
/* Apply gamma to a set of colors - this is easy. :) */ |
void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output, |
int ncolors) |
{ |
int i; |
for ( i=0; i<ncolors; ++i ) { |
output[i].r = gamma[0*256 + colors[i].r] >> 8; |
output[i].g = gamma[1*256 + colors[i].g] >> 8; |
output[i].b = gamma[2*256 + colors[i].b] >> 8; |
} |
} |
/* Map from Palette to Palette */ |
static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical) |
{ |
Uint8 *map; |
int i; |
if ( identical ) { |
if ( src->ncolors <= dst->ncolors ) { |
/* If an identical palette, no need to map */ |
if ( memcmp(src->colors, dst->colors, src->ncolors* |
sizeof(SDL_Color)) == 0 ) { |
*identical = 1; |
return(NULL); |
} |
} |
*identical = 0; |
} |
map = (Uint8 *)malloc(src->ncolors); |
if ( map == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
for ( i=0; i<src->ncolors; ++i ) { |
map[i] = SDL_FindColor(dst, |
src->colors[i].r, src->colors[i].g, src->colors[i].b); |
} |
return(map); |
} |
/* Map from Palette to BitField */ |
static Uint8 *Map1toN(SDL_Palette *src, SDL_PixelFormat *dst) |
{ |
Uint8 *map; |
int i; |
int bpp; |
unsigned alpha; |
bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); |
map = (Uint8 *)malloc(src->ncolors*bpp); |
if ( map == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
alpha = dst->Amask ? SDL_ALPHA_OPAQUE : 0; |
/* We memory copy to the pixel map so the endianness is preserved */ |
for ( i=0; i<src->ncolors; ++i ) { |
ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst, |
src->colors[i].r, src->colors[i].g, |
src->colors[i].b, alpha); |
} |
return(map); |
} |
/* Map from BitField to Dithered-Palette to Palette */ |
static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_Palette *dst, int *identical) |
{ |
/* Generate a 256 color dither palette */ |
SDL_Palette dithered; |
SDL_Color colors[256]; |
dithered.ncolors = 256; |
SDL_DitherColors(colors, 8); |
dithered.colors = colors; |
return(Map1to1(&dithered, dst, identical)); |
} |
SDL_BlitMap *SDL_AllocBlitMap(void) |
{ |
SDL_BlitMap *map; |
/* Allocate the empty map */ |
map = (SDL_BlitMap *)malloc(sizeof(*map)); |
if ( map == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
memset(map, 0, sizeof(*map)); |
/* Allocate the software blit data */ |
map->sw_data = (struct private_swaccel *)malloc(sizeof(*map->sw_data)); |
if ( map->sw_data == NULL ) { |
SDL_FreeBlitMap(map); |
SDL_OutOfMemory(); |
return(NULL); |
} |
memset(map->sw_data, 0, sizeof(*map->sw_data)); |
/* It's ready to go */ |
return(map); |
} |
void SDL_InvalidateMap(SDL_BlitMap *map) |
{ |
if ( ! map ) { |
return; |
} |
map->dst = NULL; |
map->format_version = (unsigned int)-1; |
if ( map->table ) { |
free(map->table); |
map->table = NULL; |
} |
} |
int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst) |
{ |
SDL_PixelFormat *srcfmt; |
SDL_PixelFormat *dstfmt; |
SDL_BlitMap *map; |
/* Clear out any previous mapping */ |
map = src->map; |
if ( (src->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { |
SDL_UnRLESurface(src, 1); |
} |
SDL_InvalidateMap(map); |
/* Figure out what kind of mapping we're doing */ |
map->identity = 0; |
srcfmt = src->format; |
dstfmt = dst->format; |
switch (srcfmt->BytesPerPixel) { |
case 1: |
switch (dstfmt->BytesPerPixel) { |
case 1: |
/* Palette --> Palette */ |
/* If both SDL_HWSURFACE, assume have same palette */ |
if ( ((src->flags & SDL_HWSURFACE) == SDL_HWSURFACE) && |
((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) ) { |
map->identity = 1; |
} else { |
map->table = Map1to1(srcfmt->palette, |
dstfmt->palette, &map->identity); |
} |
if ( ! map->identity ) { |
if ( map->table == NULL ) { |
return(-1); |
} |
} |
if (srcfmt->BitsPerPixel!=dstfmt->BitsPerPixel) |
map->identity = 0; |
break; |
default: |
/* Palette --> BitField */ |
map->table = Map1toN(srcfmt->palette, dstfmt); |
if ( map->table == NULL ) { |
return(-1); |
} |
break; |
} |
break; |
default: |
switch (dstfmt->BytesPerPixel) { |
case 1: |
/* BitField --> Palette */ |
map->table = MapNto1(srcfmt, |
dstfmt->palette, &map->identity); |
if ( ! map->identity ) { |
if ( map->table == NULL ) { |
return(-1); |
} |
} |
map->identity = 0; /* Don't optimize to copy */ |
break; |
default: |
/* BitField --> BitField */ |
if ( FORMAT_EQUAL(srcfmt, dstfmt) ) |
map->identity = 1; |
break; |
} |
break; |
} |
map->dst = dst; |
map->format_version = dst->format_version; |
/* Choose your blitters wisely */ |
return(SDL_CalculateBlit(src)); |
} |
void SDL_FreeBlitMap(SDL_BlitMap *map) |
{ |
if ( map ) { |
SDL_InvalidateMap(map); |
if ( map->sw_data != NULL ) { |
free(map->sw_data); |
} |
free(map); |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_pixels_c.h |
---|
0,0 → 1,50 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_pixels_c.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Useful functions and variables from SDL_pixel.c */ |
#include "SDL_blit.h" |
/* Pixel format functions */ |
extern SDL_PixelFormat *SDL_AllocFormat(int bpp, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); |
extern SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); |
extern void SDL_FormatChanged(SDL_Surface *surface); |
extern void SDL_FreeFormat(SDL_PixelFormat *format); |
/* Blit mapping functions */ |
extern SDL_BlitMap *SDL_AllocBlitMap(void); |
extern void SDL_InvalidateMap(SDL_BlitMap *map); |
extern int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst); |
extern void SDL_FreeBlitMap(SDL_BlitMap *map); |
/* Miscellaneous functions */ |
extern Uint16 SDL_CalculatePitch(SDL_Surface *surface); |
extern void SDL_DitherColors(SDL_Color *colors, int bpp); |
extern Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b); |
extern void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output, int ncolors); |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_stretch.c |
---|
0,0 → 1,305 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This a stretch blit implementation based on ideas given to me by |
Tomasz Cejner - thanks! :) |
April 27, 2000 - Sam Lantinga |
*/ |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_blit.h" |
/* This isn't ready for general consumption yet - it should be folded |
into the general blitting mechanism. |
*/ |
#if (defined(WIN32UNDEFINED) && !defined(_M_ALPHA) && !defined(_WIN32_WCE)) || \ |
defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) |
#define USE_ASM_STRETCH |
#endif |
#ifdef USE_ASM_STRETCH |
#if defined(WIN32UNDEFINED) || defined(i386) |
#define PREFIX16 0x66 |
#define STORE_BYTE 0xAA |
#define STORE_WORD 0xAB |
#define LOAD_BYTE 0xAC |
#define LOAD_WORD 0xAD |
#define RETURN 0xC3 |
#else |
#error Need assembly opcodes for this architecture |
#endif |
#if defined(__ELF__) && defined(__GNUC__) |
extern unsigned char _copy_row[4096] __attribute__ ((alias ("copy_row"))); |
#endif |
static unsigned char copy_row[4096]; |
static int generate_rowbytes(int src_w, int dst_w, int bpp) |
{ |
static struct { |
int bpp; |
int src_w; |
int dst_w; |
} last; |
int i; |
int pos, inc; |
unsigned char *eip; |
unsigned char load, store; |
/* See if we need to regenerate the copy buffer */ |
if ( (src_w == last.src_w) && |
(dst_w == last.src_w) && (bpp == last.bpp) ) { |
return(0); |
} |
last.bpp = bpp; |
last.src_w = src_w; |
last.dst_w = dst_w; |
switch (bpp) { |
case 1: |
load = LOAD_BYTE; |
store = STORE_BYTE; |
break; |
case 2: |
case 4: |
load = LOAD_WORD; |
store = STORE_WORD; |
break; |
default: |
SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp); |
return(-1); |
} |
pos = 0x10000; |
inc = (src_w << 16) / dst_w; |
eip = copy_row; |
for ( i=0; i<dst_w; ++i ) { |
while ( pos >= 0x10000L ) { |
if ( bpp == 2 ) { |
*eip++ = PREFIX16; |
} |
*eip++ = load; |
pos -= 0x10000L; |
} |
if ( bpp == 2 ) { |
*eip++ = PREFIX16; |
} |
*eip++ = store; |
pos += inc; |
} |
*eip++ = RETURN; |
/* Verify that we didn't overflow (too late) */ |
if ( eip > (copy_row+sizeof(copy_row)) ) { |
SDL_SetError("Copy buffer overflow"); |
return(-1); |
} |
return(0); |
} |
#else |
#define DEFINE_COPY_ROW(name, type) \ |
void name(type *src, int src_w, type *dst, int dst_w) \ |
{ \ |
int i; \ |
int pos, inc; \ |
type pixel = 0; \ |
\ |
pos = 0x10000; \ |
inc = (src_w << 16) / dst_w; \ |
for ( i=dst_w; i>0; --i ) { \ |
while ( pos >= 0x10000L ) { \ |
pixel = *src++; \ |
pos -= 0x10000L; \ |
} \ |
*dst++ = pixel; \ |
pos += inc; \ |
} \ |
} |
DEFINE_COPY_ROW(copy_row1, Uint8) |
DEFINE_COPY_ROW(copy_row2, Uint16) |
DEFINE_COPY_ROW(copy_row4, Uint32) |
#endif /* USE_ASM_STRETCH */ |
/* The ASM code doesn't handle 24-bpp stretch blits */ |
void copy_row3(Uint8 *src, int src_w, Uint8 *dst, int dst_w) |
{ |
int i; |
int pos, inc; |
Uint8 pixel[3]; |
pos = 0x10000; |
inc = (src_w << 16) / dst_w; |
for ( i=dst_w; i>0; --i ) { |
while ( pos >= 0x10000L ) { |
pixel[0] = *src++; |
pixel[1] = *src++; |
pixel[2] = *src++; |
pos -= 0x10000L; |
} |
*dst++ = pixel[0]; |
*dst++ = pixel[1]; |
*dst++ = pixel[2]; |
pos += inc; |
} |
} |
/* Perform a stretch blit between two surfaces of the same format. |
NOTE: This function is not safe to call from multiple threads! |
*/ |
int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
int pos, inc; |
int dst_width; |
int dst_maxrow; |
int src_row, dst_row; |
Uint8 *srcp = NULL; |
Uint8 *dstp; |
SDL_Rect full_src; |
SDL_Rect full_dst; |
#if defined(USE_ASM_STRETCH) && defined(__GNUC__) |
int u1, u2; |
#endif |
const int bpp = dst->format->BytesPerPixel; |
if ( src->format->BitsPerPixel != dst->format->BitsPerPixel ) { |
SDL_SetError("Only works with same format surfaces"); |
return(-1); |
} |
/* Verify the blit rectangles */ |
if ( srcrect ) { |
if ( (srcrect->x < 0) || (srcrect->y < 0) || |
((srcrect->x+srcrect->w) > src->w) || |
((srcrect->y+srcrect->h) > src->h) ) { |
SDL_SetError("Invalid source blit rectangle"); |
return(-1); |
} |
} else { |
full_src.x = 0; |
full_src.y = 0; |
full_src.w = src->w; |
full_src.h = src->h; |
srcrect = &full_src; |
} |
if ( dstrect ) { |
if ( (dstrect->x < 0) || (dstrect->y < 0) || |
((dstrect->x+dstrect->w) > dst->w) || |
((dstrect->y+dstrect->h) > dst->h) ) { |
SDL_SetError("Invalid destination blit rectangle"); |
return(-1); |
} |
} else { |
full_dst.x = 0; |
full_dst.y = 0; |
full_dst.w = dst->w; |
full_dst.h = dst->h; |
dstrect = &full_dst; |
} |
/* Set up the data... */ |
pos = 0x10000; |
inc = (srcrect->h << 16) / dstrect->h; |
src_row = srcrect->y; |
dst_row = dstrect->y; |
dst_width = dstrect->w*bpp; |
#ifdef USE_ASM_STRETCH |
/* Write the opcodes for this stretch */ |
if ( (bpp != 3) && |
(generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0) ) { |
return(-1); |
} |
#endif |
/* Perform the stretch blit */ |
for ( dst_maxrow = dst_row+dstrect->h; dst_row<dst_maxrow; ++dst_row ) { |
dstp = (Uint8 *)dst->pixels + (dst_row*dst->pitch) |
+ (dstrect->x*bpp); |
while ( pos >= 0x10000L ) { |
srcp = (Uint8 *)src->pixels + (src_row*src->pitch) |
+ (srcrect->x*bpp); |
++src_row; |
pos -= 0x10000L; |
} |
#ifdef USE_ASM_STRETCH |
switch (bpp) { |
case 3: |
copy_row3(srcp, srcrect->w, dstp, dstrect->w); |
break; |
default: |
#ifdef __GNUC__ |
__asm__ __volatile__ ("call _copy_row" |
: "=&D" (u1), "=&S" (u2) |
: "0" (dstp), "1" (srcp) |
: "memory" ); |
#else |
#ifdef WIN32UNDEFINED |
{ void *code = ©_row; |
__asm { |
push edi |
push esi |
mov edi, dstp |
mov esi, srcp |
call dword ptr code |
pop esi |
pop edi |
} |
} |
#else |
#error Need inline assembly for this compiler |
#endif |
#endif /* __GNUC__ */ |
break; |
} |
#else |
switch (bpp) { |
case 1: |
copy_row1(srcp, srcrect->w, dstp, dstrect->w); |
break; |
case 2: |
copy_row2((Uint16 *)srcp, srcrect->w, |
(Uint16 *)dstp, dstrect->w); |
break; |
case 3: |
copy_row3(srcp, srcrect->w, dstp, dstrect->w); |
break; |
case 4: |
copy_row4((Uint32 *)srcp, srcrect->w, |
(Uint32 *)dstp, dstrect->w); |
break; |
} |
#endif |
pos += inc; |
} |
return(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_stretch.c.BAK |
---|
0,0 → 1,305 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This a stretch blit implementation based on ideas given to me by |
Tomasz Cejner - thanks! :) |
April 27, 2000 - Sam Lantinga |
*/ |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_blit.h" |
/* This isn't ready for general consumption yet - it should be folded |
into the general blitting mechanism. |
*/ |
#if (defined(WIN32) && !defined(_M_ALPHA) && !defined(_WIN32_WCE)) || \ |
defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) |
#define USE_ASM_STRETCH |
#endif |
#ifdef USE_ASM_STRETCH |
#if defined(WIN32) || defined(i386) |
#define PREFIX16 0x66 |
#define STORE_BYTE 0xAA |
#define STORE_WORD 0xAB |
#define LOAD_BYTE 0xAC |
#define LOAD_WORD 0xAD |
#define RETURN 0xC3 |
#else |
#error Need assembly opcodes for this architecture |
#endif |
#if defined(__ELF__) && defined(__GNUC__) |
extern unsigned char _copy_row[4096] __attribute__ ((alias ("copy_row"))); |
#endif |
static unsigned char copy_row[4096]; |
static int generate_rowbytes(int src_w, int dst_w, int bpp) |
{ |
static struct { |
int bpp; |
int src_w; |
int dst_w; |
} last; |
int i; |
int pos, inc; |
unsigned char *eip; |
unsigned char load, store; |
/* See if we need to regenerate the copy buffer */ |
if ( (src_w == last.src_w) && |
(dst_w == last.src_w) && (bpp == last.bpp) ) { |
return(0); |
} |
last.bpp = bpp; |
last.src_w = src_w; |
last.dst_w = dst_w; |
switch (bpp) { |
case 1: |
load = LOAD_BYTE; |
store = STORE_BYTE; |
break; |
case 2: |
case 4: |
load = LOAD_WORD; |
store = STORE_WORD; |
break; |
default: |
SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp); |
return(-1); |
} |
pos = 0x10000; |
inc = (src_w << 16) / dst_w; |
eip = copy_row; |
for ( i=0; i<dst_w; ++i ) { |
while ( pos >= 0x10000L ) { |
if ( bpp == 2 ) { |
*eip++ = PREFIX16; |
} |
*eip++ = load; |
pos -= 0x10000L; |
} |
if ( bpp == 2 ) { |
*eip++ = PREFIX16; |
} |
*eip++ = store; |
pos += inc; |
} |
*eip++ = RETURN; |
/* Verify that we didn't overflow (too late) */ |
if ( eip > (copy_row+sizeof(copy_row)) ) { |
SDL_SetError("Copy buffer overflow"); |
return(-1); |
} |
return(0); |
} |
#else |
#define DEFINE_COPY_ROW(name, type) \ |
void name(type *src, int src_w, type *dst, int dst_w) \ |
{ \ |
int i; \ |
int pos, inc; \ |
type pixel = 0; \ |
\ |
pos = 0x10000; \ |
inc = (src_w << 16) / dst_w; \ |
for ( i=dst_w; i>0; --i ) { \ |
while ( pos >= 0x10000L ) { \ |
pixel = *src++; \ |
pos -= 0x10000L; \ |
} \ |
*dst++ = pixel; \ |
pos += inc; \ |
} \ |
} |
DEFINE_COPY_ROW(copy_row1, Uint8) |
DEFINE_COPY_ROW(copy_row2, Uint16) |
DEFINE_COPY_ROW(copy_row4, Uint32) |
#endif /* USE_ASM_STRETCH */ |
/* The ASM code doesn't handle 24-bpp stretch blits */ |
void copy_row3(Uint8 *src, int src_w, Uint8 *dst, int dst_w) |
{ |
int i; |
int pos, inc; |
Uint8 pixel[3]; |
pos = 0x10000; |
inc = (src_w << 16) / dst_w; |
for ( i=dst_w; i>0; --i ) { |
while ( pos >= 0x10000L ) { |
pixel[0] = *src++; |
pixel[1] = *src++; |
pixel[2] = *src++; |
pos -= 0x10000L; |
} |
*dst++ = pixel[0]; |
*dst++ = pixel[1]; |
*dst++ = pixel[2]; |
pos += inc; |
} |
} |
/* Perform a stretch blit between two surfaces of the same format. |
NOTE: This function is not safe to call from multiple threads! |
*/ |
int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
int pos, inc; |
int dst_width; |
int dst_maxrow; |
int src_row, dst_row; |
Uint8 *srcp = NULL; |
Uint8 *dstp; |
SDL_Rect full_src; |
SDL_Rect full_dst; |
#if defined(USE_ASM_STRETCH) && defined(__GNUC__) |
int u1, u2; |
#endif |
const int bpp = dst->format->BytesPerPixel; |
if ( src->format->BitsPerPixel != dst->format->BitsPerPixel ) { |
SDL_SetError("Only works with same format surfaces"); |
return(-1); |
} |
/* Verify the blit rectangles */ |
if ( srcrect ) { |
if ( (srcrect->x < 0) || (srcrect->y < 0) || |
((srcrect->x+srcrect->w) > src->w) || |
((srcrect->y+srcrect->h) > src->h) ) { |
SDL_SetError("Invalid source blit rectangle"); |
return(-1); |
} |
} else { |
full_src.x = 0; |
full_src.y = 0; |
full_src.w = src->w; |
full_src.h = src->h; |
srcrect = &full_src; |
} |
if ( dstrect ) { |
if ( (dstrect->x < 0) || (dstrect->y < 0) || |
((dstrect->x+dstrect->w) > dst->w) || |
((dstrect->y+dstrect->h) > dst->h) ) { |
SDL_SetError("Invalid destination blit rectangle"); |
return(-1); |
} |
} else { |
full_dst.x = 0; |
full_dst.y = 0; |
full_dst.w = dst->w; |
full_dst.h = dst->h; |
dstrect = &full_dst; |
} |
/* Set up the data... */ |
pos = 0x10000; |
inc = (srcrect->h << 16) / dstrect->h; |
src_row = srcrect->y; |
dst_row = dstrect->y; |
dst_width = dstrect->w*bpp; |
#ifdef USE_ASM_STRETCH |
/* Write the opcodes for this stretch */ |
if ( (bpp != 3) && |
(generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0) ) { |
return(-1); |
} |
#endif |
/* Perform the stretch blit */ |
for ( dst_maxrow = dst_row+dstrect->h; dst_row<dst_maxrow; ++dst_row ) { |
dstp = (Uint8 *)dst->pixels + (dst_row*dst->pitch) |
+ (dstrect->x*bpp); |
while ( pos >= 0x10000L ) { |
srcp = (Uint8 *)src->pixels + (src_row*src->pitch) |
+ (srcrect->x*bpp); |
++src_row; |
pos -= 0x10000L; |
} |
#ifdef USE_ASM_STRETCH |
switch (bpp) { |
case 3: |
copy_row3(srcp, srcrect->w, dstp, dstrect->w); |
break; |
default: |
#ifdef __GNUC__ |
__asm__ __volatile__ ("call _copy_row" |
: "=&D" (u1), "=&S" (u2) |
: "0" (dstp), "1" (srcp) |
: "memory" ); |
#else |
#ifdef WIN32 |
{ void *code = ©_row; |
__asm { |
push edi |
push esi |
mov edi, dstp |
mov esi, srcp |
call dword ptr code |
pop esi |
pop edi |
} |
} |
#else |
#error Need inline assembly for this compiler |
#endif |
#endif /* __GNUC__ */ |
break; |
} |
#else |
switch (bpp) { |
case 1: |
copy_row1(srcp, srcrect->w, dstp, dstrect->w); |
break; |
case 2: |
copy_row2((Uint16 *)srcp, srcrect->w, |
(Uint16 *)dstp, dstrect->w); |
break; |
case 3: |
copy_row3(srcp, srcrect->w, dstp, dstrect->w); |
break; |
case 4: |
copy_row4((Uint32 *)srcp, srcrect->w, |
(Uint32 *)dstp, dstrect->w); |
break; |
} |
#endif |
pos += inc; |
} |
return(0); |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_stretch_c.h |
---|
0,0 → 1,33 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_stretch_c.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* Perform a stretch blit between two surfaces of the same format. |
NOTE: This function is not safe to call from multiple threads! |
*/ |
extern int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect); |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_surface.c |
---|
0,0 → 1,816 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_sysvideo.h" |
#include "SDL_cursor_c.h" |
#include "SDL_blit.h" |
#include "SDL_RLEaccel_c.h" |
#include "SDL_pixels_c.h" |
#include "SDL_memops.h" |
#include "SDL_leaks.h" |
/* Public routines */ |
/* |
* Create an empty RGB surface of the appropriate depth |
*/ |
SDL_Surface * SDL_CreateRGBSurface (Uint32 flags, |
int width, int height, int depth, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
SDL_Surface *screen; |
SDL_Surface *surface; |
/* Check to see if we desire the surface in video memory */ |
if ( video ) { |
screen = SDL_PublicSurface; |
} else { |
screen = NULL; |
} |
if ( screen && ((screen->flags&SDL_HWSURFACE) == SDL_HWSURFACE) ) { |
if ( (flags&(SDL_SRCCOLORKEY|SDL_SRCALPHA)) != 0 ) { |
flags |= SDL_HWSURFACE; |
} |
if ( (flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) { |
if ( ! current_video->info.blit_hw_CC ) { |
flags &= ~SDL_HWSURFACE; |
} |
} |
if ( (flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { |
if ( ! current_video->info.blit_hw_A ) { |
flags &= ~SDL_HWSURFACE; |
} |
} |
} else { |
flags &= ~SDL_HWSURFACE; |
} |
/* Allocate the surface */ |
surface = (SDL_Surface *)malloc(sizeof(*surface)); |
if ( surface == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
surface->flags = SDL_SWSURFACE; |
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { |
depth = screen->format->BitsPerPixel; |
Rmask = screen->format->Rmask; |
Gmask = screen->format->Gmask; |
Bmask = screen->format->Bmask; |
Amask = screen->format->Amask; |
} |
surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask); |
if ( surface->format == NULL ) { |
free(surface); |
return(NULL); |
} |
if ( Amask ) { |
surface->flags |= SDL_SRCALPHA; |
} |
surface->w = width; |
surface->h = height; |
surface->pitch = SDL_CalculatePitch(surface); |
surface->pixels = NULL; |
surface->offset = 0; |
surface->hwdata = NULL; |
surface->locked = 0; |
surface->map = NULL; |
surface->format_version = 0; |
SDL_SetClipRect(surface, NULL); |
/* Get the pixels */ |
if ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) || |
(video->AllocHWSurface(this, surface) < 0) ) { |
if ( surface->w && surface->h ) { |
surface->pixels = malloc(surface->h*surface->pitch); |
if ( surface->pixels == NULL ) { |
SDL_FreeSurface(surface); |
SDL_OutOfMemory(); |
return(NULL); |
} |
/* This is important for bitmaps */ |
memset(surface->pixels, 0, surface->h*surface->pitch); |
} |
} |
/* Allocate an empty mapping */ |
surface->map = SDL_AllocBlitMap(); |
if ( surface->map == NULL ) { |
SDL_FreeSurface(surface); |
return(NULL); |
} |
/* The surface is ready to go */ |
surface->refcount = 1; |
#ifdef CHECK_LEAKS |
++surfaces_allocated; |
#endif |
return(surface); |
} |
/* |
* Create an RGB surface from an existing memory buffer |
*/ |
SDL_Surface * SDL_CreateRGBSurfaceFrom (void *pixels, |
int width, int height, int depth, int pitch, |
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) |
{ |
SDL_Surface *surface; |
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, depth, |
Rmask, Gmask, Bmask, Amask); |
if ( surface != NULL ) { |
surface->flags |= SDL_PREALLOC; |
surface->pixels = pixels; |
surface->w = width; |
surface->h = height; |
surface->pitch = pitch; |
SDL_SetClipRect(surface, NULL); |
} |
return(surface); |
} |
/* |
* Set the color key in a blittable surface |
*/ |
int SDL_SetColorKey (SDL_Surface *surface, Uint32 flag, Uint32 key) |
{ |
/* Sanity check the flag as it gets passed in */ |
if ( flag & SDL_SRCCOLORKEY ) { |
if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) { |
flag = (SDL_SRCCOLORKEY | SDL_RLEACCELOK); |
} else { |
flag = SDL_SRCCOLORKEY; |
} |
} else { |
flag = 0; |
} |
/* Optimize away operations that don't change anything */ |
if ( (flag == (surface->flags & (SDL_SRCCOLORKEY|SDL_RLEACCELOK))) && |
(key == surface->format->colorkey) ) { |
return(0); |
} |
/* UnRLE surfaces before we change the colorkey */ |
if ( surface->flags & SDL_RLEACCEL ) { |
SDL_UnRLESurface(surface, 1); |
} |
if ( flag ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
surface->flags |= SDL_SRCCOLORKEY; |
surface->format->colorkey = key; |
if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) { |
if ( (video->SetHWColorKey == NULL) || |
(video->SetHWColorKey(this, surface, key) < 0) ) { |
surface->flags &= ~SDL_HWACCEL; |
} |
} |
if ( flag & SDL_RLEACCELOK ) { |
surface->flags |= SDL_RLEACCELOK; |
} else { |
surface->flags &= ~SDL_RLEACCELOK; |
} |
} else { |
surface->flags &= ~(SDL_SRCCOLORKEY|SDL_RLEACCELOK); |
surface->format->colorkey = 0; |
} |
SDL_InvalidateMap(surface->map); |
return(0); |
} |
int SDL_SetAlpha (SDL_Surface *surface, Uint32 flag, Uint8 value) |
{ |
Uint32 oldflags = surface->flags; |
Uint32 oldalpha = surface->format->alpha; |
/* Sanity check the flag as it gets passed in */ |
if ( flag & SDL_SRCALPHA ) { |
if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) { |
flag = (SDL_SRCALPHA | SDL_RLEACCELOK); |
} else { |
flag = SDL_SRCALPHA; |
} |
} else { |
flag = 0; |
} |
/* Optimize away operations that don't change anything */ |
if ( (flag == (surface->flags & (SDL_SRCALPHA|SDL_RLEACCELOK))) && |
(!flag || value == oldalpha) ) { |
return(0); |
} |
if(!(flag & SDL_RLEACCELOK) && (surface->flags & SDL_RLEACCEL)) |
SDL_UnRLESurface(surface, 1); |
if ( flag ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
surface->flags |= SDL_SRCALPHA; |
surface->format->alpha = value; |
if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) { |
if ( (video->SetHWAlpha == NULL) || |
(video->SetHWAlpha(this, surface, value) < 0) ) { |
surface->flags &= ~SDL_HWACCEL; |
} |
} |
if ( flag & SDL_RLEACCELOK ) { |
surface->flags |= SDL_RLEACCELOK; |
} else { |
surface->flags &= ~SDL_RLEACCELOK; |
} |
} else { |
surface->flags &= ~SDL_SRCALPHA; |
surface->format->alpha = SDL_ALPHA_OPAQUE; |
} |
/* |
* The representation for software surfaces is independent of |
* per-surface alpha, so no need to invalidate the blit mapping |
* if just the alpha value was changed. (If either is 255, we still |
* need to invalidate.) |
*/ |
if((surface->flags & SDL_HWACCEL) == SDL_HWACCEL |
|| oldflags != surface->flags |
|| (((oldalpha + 1) ^ (value + 1)) & 0x100)) |
SDL_InvalidateMap(surface->map); |
return(0); |
} |
/* |
* A function to calculate the intersection of two rectangles: |
* return true if the rectangles intersect, false otherwise |
*/ |
static __inline__ |
SDL_bool SDL_IntersectRect(SDL_Rect *A, SDL_Rect *B, SDL_Rect *intersection) |
{ |
int Amin, Amax, Bmin, Bmax; |
/* Horizontal intersection */ |
Amin = A->x; |
Amax = Amin + A->w; |
Bmin = B->x; |
Bmax = Bmin + B->w; |
if(Bmin > Amin) |
Amin = Bmin; |
intersection->x = Amin; |
if(Bmax < Amax) |
Amax = Bmax; |
intersection->w = Amax - Amin > 0 ? Amax - Amin : 0; |
/* Vertical intersection */ |
Amin = A->y; |
Amax = Amin + A->h; |
Bmin = B->y; |
Bmax = Bmin + B->h; |
if(Bmin > Amin) |
Amin = Bmin; |
intersection->y = Amin; |
if(Bmax < Amax) |
Amax = Bmax; |
intersection->h = Amax - Amin > 0 ? Amax - Amin : 0; |
return (intersection->w && intersection->h); |
} |
/* |
* Set the clipping rectangle for a blittable surface |
*/ |
SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) |
{ |
SDL_Rect full_rect; |
/* Don't do anything if there's no surface to act on */ |
if ( ! surface ) { |
return SDL_FALSE; |
} |
/* Set up the full surface rectangle */ |
full_rect.x = 0; |
full_rect.y = 0; |
full_rect.w = surface->w; |
full_rect.h = surface->h; |
/* Set the clipping rectangle */ |
if ( ! rect ) { |
surface->clip_rect = full_rect; |
return 1; |
} |
return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect); |
} |
void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) |
{ |
if ( surface && rect ) { |
*rect = surface->clip_rect; |
} |
} |
/* |
* Set up a blit between two surfaces -- split into three parts: |
* The upper part, SDL_UpperBlit(), performs clipping and rectangle |
* verification. The lower part is a pointer to a low level |
* accelerated blitting function. |
* |
* These parts are separated out and each used internally by this |
* library in the optimimum places. They are exported so that if |
* you know exactly what you are doing, you can optimize your code |
* by calling the one(s) you need. |
*/ |
int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
SDL_blit do_blit; |
/* Check to make sure the blit mapping is valid */ |
if ( (src->map->dst != dst) || |
(src->map->dst->format_version != src->map->format_version) ) { |
if ( SDL_MapSurface(src, dst) < 0 ) { |
return(-1); |
} |
} |
/* Figure out which blitter to use */ |
if ( (src->flags & SDL_HWACCEL) == SDL_HWACCEL ) { |
do_blit = src->map->hw_blit; |
} else { |
do_blit = src->map->sw_blit; |
} |
return(do_blit(src, srcrect, dst, dstrect)); |
} |
int SDL_UpperBlit (SDL_Surface *src, SDL_Rect *srcrect, |
SDL_Surface *dst, SDL_Rect *dstrect) |
{ |
SDL_Rect fulldst; |
int srcx, srcy, w, h; |
/* Make sure the surfaces aren't locked */ |
if ( ! src || ! dst ) { |
SDL_SetError("SDL_UpperBlit: passed a NULL surface"); |
return(-1); |
} |
if ( src->locked || dst->locked ) { |
SDL_SetError("Surfaces must not be locked during blit"); |
return(-1); |
} |
/* If the destination rectangle is NULL, use the entire dest surface */ |
if ( dstrect == NULL ) { |
fulldst.x = fulldst.y = 0; |
dstrect = &fulldst; |
} |
/* clip the source rectangle to the source surface */ |
if(srcrect) { |
int maxw, maxh; |
srcx = srcrect->x; |
w = srcrect->w; |
if(srcx < 0) { |
w += srcx; |
dstrect->x -= srcx; |
srcx = 0; |
} |
maxw = src->w - srcx; |
if(maxw < w) |
w = maxw; |
srcy = srcrect->y; |
h = srcrect->h; |
if(srcy < 0) { |
h += srcy; |
dstrect->y -= srcy; |
srcy = 0; |
} |
maxh = src->h - srcy; |
if(maxh < h) |
h = maxh; |
} else { |
srcx = srcy = 0; |
w = src->w; |
h = src->h; |
} |
/* clip the destination rectangle against the clip rectangle */ |
{ |
SDL_Rect *clip = &dst->clip_rect; |
int dx, dy; |
dx = clip->x - dstrect->x; |
if(dx > 0) { |
w -= dx; |
dstrect->x += dx; |
srcx += dx; |
} |
dx = dstrect->x + w - clip->x - clip->w; |
if(dx > 0) |
w -= dx; |
dy = clip->y - dstrect->y; |
if(dy > 0) { |
h -= dy; |
dstrect->y += dy; |
srcy += dy; |
} |
dy = dstrect->y + h - clip->y - clip->h; |
if(dy > 0) |
h -= dy; |
} |
if(w > 0 && h > 0) { |
SDL_Rect sr; |
sr.x = srcx; |
sr.y = srcy; |
sr.w = dstrect->w = w; |
sr.h = dstrect->h = h; |
return SDL_LowerBlit(src, &sr, dst, dstrect); |
} |
dstrect->w = dstrect->h = 0; |
return 0; |
} |
/* |
* This function performs a fast fill of the given rectangle with 'color' |
*/ |
int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
int x, y; |
Uint8 *row; |
/* If 'dstrect' == NULL, then fill the whole surface */ |
if ( dstrect ) { |
/* Perform clipping */ |
if ( !SDL_IntersectRect(dstrect, &dst->clip_rect, dstrect) ) { |
return(0); |
} |
} else { |
dstrect = &dst->clip_rect; |
} |
/* Check for hardware acceleration */ |
if ( ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) && |
video->info.blit_fill ) { |
return(video->FillHWRect(this, dst, dstrect, color)); |
} |
/* Perform software fill */ |
if ( SDL_LockSurface(dst) != 0 ) { |
return(-1); |
} |
row = (Uint8 *)dst->pixels+dstrect->y*dst->pitch+ |
dstrect->x*dst->format->BytesPerPixel; |
if ( dst->format->palette || (color == 0) ) { |
x = dstrect->w*dst->format->BytesPerPixel; |
if ( !color && !((long)row&3) && !(x&3) && !(dst->pitch&3) ) { |
int n = x >> 2; |
for ( y=dstrect->h; y; --y ) { |
SDL_memset4(row, 0, n); |
row += dst->pitch; |
} |
} else { |
#ifdef __powerpc__ |
/* |
* memset() on PPC (both glibc and codewarrior) uses |
* the dcbz (Data Cache Block Zero) instruction, which |
* causes an alignment exception if the destination is |
* uncachable, so only use it on software surfaces |
*/ |
if((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) { |
if(dstrect->w >= 8) { |
/* |
* 64-bit stores are probably most |
* efficient to uncached video memory |
*/ |
double fill; |
memset(&fill, color, (sizeof fill)); |
for(y = dstrect->h; y; y--) { |
Uint8 *d = row; |
unsigned n = x; |
unsigned nn; |
Uint8 c = color; |
double f = fill; |
while((unsigned long)d |
& (sizeof(double) - 1)) { |
*d++ = c; |
n--; |
} |
nn = n / (sizeof(double) * 4); |
while(nn) { |
((double *)d)[0] = f; |
((double *)d)[1] = f; |
((double *)d)[2] = f; |
((double *)d)[3] = f; |
d += 4*sizeof(double); |
nn--; |
} |
n &= ~(sizeof(double) * 4 - 1); |
nn = n / sizeof(double); |
while(nn) { |
*(double *)d = f; |
d += sizeof(double); |
nn--; |
} |
n &= ~(sizeof(double) - 1); |
while(n) { |
*d++ = c; |
n--; |
} |
row += dst->pitch; |
} |
} else { |
/* narrow boxes */ |
for(y = dstrect->h; y; y--) { |
Uint8 *d = row; |
Uint8 c = color; |
int n = x; |
while(n) { |
*d++ = c; |
n--; |
} |
row += dst->pitch; |
} |
} |
} else |
#endif /* __powerpc__ */ |
{ |
for(y = dstrect->h; y; y--) { |
memset(row, color, x); |
row += dst->pitch; |
} |
} |
} |
} else { |
switch (dst->format->BytesPerPixel) { |
case 2: |
for ( y=dstrect->h; y; --y ) { |
Uint16 *pixels = (Uint16 *)row; |
Uint16 c = color; |
Uint32 cc = (Uint32)c << 16 | c; |
int n = dstrect->w; |
if((unsigned long)pixels & 3) { |
*pixels++ = c; |
n--; |
} |
if(n >> 1) |
SDL_memset4(pixels, cc, n >> 1); |
if(n & 1) |
pixels[n - 1] = c; |
row += dst->pitch; |
} |
break; |
case 3: |
if(SDL_BYTEORDER == SDL_BIG_ENDIAN) |
color <<= 8; |
for ( y=dstrect->h; y; --y ) { |
Uint8 *pixels = row; |
for ( x=dstrect->w; x; --x ) { |
memcpy(pixels, &color, 3); |
pixels += 3; |
} |
row += dst->pitch; |
} |
break; |
case 4: |
for(y = dstrect->h; y; --y) { |
SDL_memset4(row, color, dstrect->w); |
row += dst->pitch; |
} |
break; |
} |
} |
SDL_UnlockSurface(dst); |
/* We're done! */ |
return(0); |
} |
/* |
* Lock a surface to directly access the pixels |
* -- Do not call this from any blit function, as SDL_DrawCursor() may recurse |
* Instead, use: |
* if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) |
* video->LockHWSurface(video, surface); |
*/ |
int SDL_LockSurface (SDL_Surface *surface) |
{ |
if ( ! surface->locked ) { |
/* Perform the lock */ |
if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video->LockHWSurface(this, surface) < 0 ) { |
return(-1); |
} |
} |
if ( surface->flags & SDL_RLEACCEL ) { |
SDL_UnRLESurface(surface, 1); |
surface->flags |= SDL_RLEACCEL; /* save accel'd state */ |
} |
/* This needs to be done here in case pixels changes value */ |
surface->pixels = (Uint8 *)surface->pixels + surface->offset; |
} |
/* Increment the surface lock count, for recursive locks */ |
++surface->locked; |
/* Ready to go.. */ |
return(0); |
} |
/* |
* Unlock a previously locked surface |
* -- Do not call this from any blit function, as SDL_DrawCursor() may recurse |
* Instead, use: |
* if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) |
* video->UnlockHWSurface(video, surface); |
*/ |
void SDL_UnlockSurface (SDL_Surface *surface) |
{ |
/* Only perform an unlock if we are locked */ |
if ( ! surface->locked || (--surface->locked > 0) ) { |
return; |
} |
/* Perform the unlock */ |
surface->pixels = (Uint8 *)surface->pixels - surface->offset; |
/* Unlock hardware or accelerated surfaces */ |
if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->UnlockHWSurface(this, surface); |
} else { |
/* Update RLE encoded surface with new data */ |
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { |
surface->flags &= ~SDL_RLEACCEL; /* stop lying */ |
SDL_RLESurface(surface); |
} |
} |
} |
/* |
* Convert a surface into the specified pixel format. |
*/ |
SDL_Surface * SDL_ConvertSurface (SDL_Surface *surface, |
SDL_PixelFormat *format, Uint32 flags) |
{ |
SDL_Surface *convert; |
Uint32 colorkey = 0; |
Uint8 alpha = 0; |
Uint32 surface_flags; |
SDL_Rect bounds; |
/* Check for empty destination palette! (results in empty image) */ |
if ( format->palette != NULL ) { |
int i; |
for ( i=0; i<format->palette->ncolors; ++i ) { |
if ( (format->palette->colors[i].r != 0) || |
(format->palette->colors[i].g != 0) || |
(format->palette->colors[i].b != 0) ) |
break; |
} |
if ( i == format->palette->ncolors ) { |
SDL_SetError("Empty destination palette"); |
return(NULL); |
} |
} |
/* Create a new surface with the desired format */ |
convert = SDL_CreateRGBSurface(flags, |
surface->w, surface->h, format->BitsPerPixel, |
format->Rmask, format->Gmask, format->Bmask, format->Amask); |
if ( convert == NULL ) { |
return(NULL); |
} |
/* Copy the palette if any */ |
if ( format->palette && convert->format->palette ) { |
memcpy(convert->format->palette->colors, |
format->palette->colors, |
format->palette->ncolors*sizeof(SDL_Color)); |
convert->format->palette->ncolors = format->palette->ncolors; |
} |
/* Save the original surface color key and alpha */ |
surface_flags = surface->flags; |
if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) { |
/* Convert colourkeyed surfaces to RGBA if requested */ |
if((flags & SDL_SRCCOLORKEY) != SDL_SRCCOLORKEY |
&& format->Amask) { |
surface_flags &= ~SDL_SRCCOLORKEY; |
} else { |
colorkey = surface->format->colorkey; |
SDL_SetColorKey(surface, 0, 0); |
} |
} |
if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { |
alpha = surface->format->alpha; |
SDL_SetAlpha(surface, 0, 0); |
} |
/* Copy over the image data */ |
bounds.x = 0; |
bounds.y = 0; |
bounds.w = surface->w; |
bounds.h = surface->h; |
SDL_LowerBlit(surface, &bounds, convert, &bounds); |
/* Clean up the original surface, and update converted surface */ |
if ( convert != NULL ) { |
SDL_SetClipRect(convert, &surface->clip_rect); |
} |
if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) { |
Uint32 cflags = surface_flags&(SDL_SRCCOLORKEY|SDL_RLEACCELOK); |
if ( convert != NULL ) { |
Uint8 keyR, keyG, keyB; |
SDL_GetRGB(colorkey,surface->format,&keyR,&keyG,&keyB); |
SDL_SetColorKey(convert, cflags|(flags&SDL_RLEACCELOK), |
SDL_MapRGB(convert->format, keyR, keyG, keyB)); |
} |
SDL_SetColorKey(surface, cflags, colorkey); |
} |
if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { |
Uint32 aflags = surface_flags&(SDL_SRCALPHA|SDL_RLEACCELOK); |
if ( convert != NULL ) { |
SDL_SetAlpha(convert, aflags|(flags&SDL_RLEACCELOK), |
alpha); |
} |
SDL_SetAlpha(surface, aflags, alpha); |
} |
/* We're ready to go! */ |
return(convert); |
} |
/* |
* Free a surface created by the above function. |
*/ |
void SDL_FreeSurface (SDL_Surface *surface) |
{ |
/* Free anything that's not NULL, and not the screen surface */ |
if ((surface == NULL) || |
(current_video && |
((surface == SDL_ShadowSurface)||(surface == SDL_VideoSurface)))) { |
return; |
} |
if ( --surface->refcount > 0 ) { |
return; |
} |
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { |
SDL_UnRLESurface(surface, 0); |
} |
if ( surface->format ) { |
SDL_FreeFormat(surface->format); |
surface->format = NULL; |
} |
if ( surface->map != NULL ) { |
SDL_FreeBlitMap(surface->map); |
surface->map = NULL; |
} |
if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
video->FreeHWSurface(this, surface); |
} |
if ( surface->pixels && |
((surface->flags & SDL_PREALLOC) != SDL_PREALLOC) ) { |
free(surface->pixels); |
} |
free(surface); |
#ifdef CHECK_LEAKS |
--surfaces_allocated; |
#endif |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_sysvideo.h |
---|
0,0 → 1,399 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_sysvideo.h,v 1.6 2001/06/19 13:33:53 hercules Exp $"; |
#endif |
#ifndef _SDL_sysvideo_h |
#define _SDL_sysvideo_h |
#include "SDL_mouse.h" |
#define SDL_PROTOTYPES_ONLY |
#include "SDL_syswm.h" |
#undef SDL_PROTOTYPES_ONLY |
/* This file prototypes the video driver implementation. |
This is designed to be easily converted to C++ in the future. |
*/ |
/* OpenGL is pretty much available on all Windows systems */ |
#ifdef WIN32UNDEFINED |
#ifndef _WIN32_WCE |
#define HAVE_OPENGL |
#endif |
#include <windows.h> |
#endif |
#ifdef HAVE_OPENGL |
#ifdef MACOSX |
#include <OpenGL/gl.h> /* OpenGL.framework */ |
#else |
#include <GL/gl.h> |
#endif /* MACOSX */ |
#endif /* HAVE_OPENGL */ |
/* The SDL video driver */ |
typedef struct SDL_VideoDevice SDL_VideoDevice; |
/* Define the SDL video driver structure */ |
#define _THIS SDL_VideoDevice *_this |
#ifndef _STATUS |
#define _STATUS SDL_status *status |
#endif |
struct SDL_VideoDevice { |
/* * * */ |
/* The name of this video driver */ |
const char *name; |
/* * * */ |
/* Initialization/Query functions */ |
/* Initialize the native video subsystem, filling 'vformat' with the |
"best" display pixel format, returning 0 or -1 if there's an error. |
*/ |
int (*VideoInit)(_THIS, SDL_PixelFormat *vformat); |
/* List the available video modes for the given pixel format, sorted |
from largest to smallest. |
*/ |
SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags); |
/* Set the requested video mode, returning a surface which will be |
set to the SDL_VideoSurface. The width and height will already |
be verified by ListModes(), and the video subsystem is free to |
set the mode to a supported bit depth different from the one |
specified -- the desired bpp will be emulated with a shadow |
surface if necessary. If a new mode is returned, this function |
should take care of cleaning up the current mode. |
*/ |
SDL_Surface *(*SetVideoMode)(_THIS, SDL_Surface *current, |
int width, int height, int bpp, Uint32 flags); |
/* Toggle the fullscreen mode */ |
int (*ToggleFullScreen)(_THIS, int on); |
/* This is called after the video mode has been set, to get the |
initial mouse state. It should queue events as necessary to |
properly represent the current mouse focus and position. |
*/ |
void (*UpdateMouse)(_THIS); |
/* Create a YUV video surface (possibly overlay) of the given |
format. The hardware should be able to perform at least 2x |
scaling on display. |
*/ |
SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height, |
Uint32 format, SDL_Surface *display); |
/* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) } |
of the physical palette to those in 'colors'. If the device is |
using a software palette (SDL_HWPALETTE not set), then the |
changes are reflected in the logical palette of the screen |
as well. |
The return value is 1 if all entries could be set properly |
or 0 otherwise. |
*/ |
int (*SetColors)(_THIS, int firstcolor, int ncolors, |
SDL_Color *colors); |
/* This pointer should exist in the native video subsystem and should |
point to an appropriate update function for the current video mode |
*/ |
void (*UpdateRects)(_THIS, int numrects, SDL_Rect *rects); |
/* Reverse the effects VideoInit() -- called if VideoInit() fails |
or if the application is shutting down the video subsystem. |
*/ |
void (*VideoQuit)(_THIS); |
/* * * */ |
/* Hardware acceleration functions */ |
/* Information about the video hardware */ |
SDL_VideoInfo info; |
/* Allocates a surface in video memory */ |
int (*AllocHWSurface)(_THIS, SDL_Surface *surface); |
/* Sets the hardware accelerated blit function, if any, based |
on the current flags of the surface (colorkey, alpha, etc.) |
*/ |
int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst); |
/* Fills a surface rectangle with the given color */ |
int (*FillHWRect)(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color); |
/* Sets video mem colorkey and accelerated blit function */ |
int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key); |
/* Sets per surface hardware alpha value */ |
int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value); |
/* Returns a readable/writable surface */ |
int (*LockHWSurface)(_THIS, SDL_Surface *surface); |
void (*UnlockHWSurface)(_THIS, SDL_Surface *surface); |
/* Performs hardware flipping */ |
int (*FlipHWSurface)(_THIS, SDL_Surface *surface); |
/* Frees a previously allocated video surface */ |
void (*FreeHWSurface)(_THIS, SDL_Surface *surface); |
/* * * */ |
/* Gamma support */ |
Uint16 *gamma; |
/* Set the gamma correction directly (emulated with gamma ramps) */ |
int (*SetGamma)(_THIS, float red, float green, float blue); |
/* Get the gamma correction directly (emulated with gamma ramps) */ |
int (*GetGamma)(_THIS, float *red, float *green, float *blue); |
/* Set the gamma ramp */ |
int (*SetGammaRamp)(_THIS, Uint16 *ramp); |
/* Get the gamma ramp */ |
int (*GetGammaRamp)(_THIS, Uint16 *ramp); |
/* * * */ |
/* OpenGL support */ |
/* Sets the dll to use for OpenGL and loads it */ |
int (*GL_LoadLibrary)(_THIS, const char *path); |
/* Retrieves the address of a function in the gl library */ |
void* (*GL_GetProcAddress)(_THIS, const char *proc); |
/* Get attribute information from the windowing system. */ |
int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value); |
/* Make the context associated with this driver current */ |
int (*GL_MakeCurrent)(_THIS); |
/* Swap the current buffers in double buffer mode. */ |
void (*GL_SwapBuffers)(_THIS); |
/* OpenGL functions for SDL_OPENGLBLIT */ |
#ifdef HAVE_OPENGL |
#ifndef WIN32UNDEFINED |
#define WINAPI |
#endif |
#define SDL_PROC(ret,func,params) ret (WINAPI *func) params; |
#include "SDL_glfuncs.h" |
#undef SDL_PROC |
/* Texture id */ |
GLuint texture; |
#endif |
int is_32bit; |
/* * * */ |
/* Window manager functions */ |
/* Set the title and icon text */ |
void (*SetCaption)(_THIS, const char *title, const char *icon); |
/* Set the window icon image */ |
void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask); |
/* Iconify the window. |
This function returns 1 if there is a window manager and the |
window was actually iconified, it returns 0 otherwise. |
*/ |
int (*IconifyWindow)(_THIS); |
/* Grab or ungrab keyboard and mouse input */ |
SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode); |
/* Get some platform dependent window information */ |
int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info); |
/* * * */ |
/* Cursor manager functions */ |
/* Free a window manager cursor |
This function can be NULL if CreateWMCursor is also NULL. |
*/ |
void (*FreeWMCursor)(_THIS, WMcursor *cursor); |
/* If not NULL, create a black/white window manager cursor */ |
WMcursor *(*CreateWMCursor)(_THIS, |
Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); |
/* Show the specified cursor, or hide if cursor is NULL */ |
int (*ShowWMCursor)(_THIS, WMcursor *cursor); |
/* Warp the window manager cursor to (x,y) |
If NULL, a mouse motion event is posted internally. |
*/ |
void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y); |
/* If not NULL, this is called when a mouse motion event occurs */ |
void (*MoveWMCursor)(_THIS, int x, int y); |
/* Determine whether the mouse should be in relative mode or not. |
This function is called when the input grab state or cursor |
visibility state changes. |
If the cursor is not visible, and the input is grabbed, the |
driver can place the mouse in relative mode, which may result |
in higher accuracy sampling of the pointer motion. |
*/ |
void (*CheckMouseMode)(_THIS); |
/* * * */ |
/* Event manager functions */ |
/* Initialize keyboard mapping for this driver */ |
void (*InitOSKeymap)(_THIS); |
/* Handle any queued OS events */ |
void (*PumpEvents)(_THIS); |
/* * * */ |
/* Data common to all drivers */ |
SDL_Surface *screen; |
SDL_Surface *shadow; |
SDL_Surface *visible; |
SDL_Palette *physpal; /* physical palette, if != logical palette */ |
SDL_Color *gammacols; /* gamma-corrected colours, or NULL */ |
char *wm_title; |
char *wm_icon; |
int offset_x; |
int offset_y; |
SDL_GrabMode input_grab; |
/* Driver information flags */ |
int handles_any_size; /* Driver handles any size video mode */ |
/* * * */ |
/* Data used by the GL drivers */ |
struct { |
int red_size; |
int green_size; |
int blue_size; |
int alpha_size; |
int depth_size; |
int buffer_size; |
int stencil_size; |
int double_buffer; |
int accum_red_size; |
int accum_green_size; |
int accum_blue_size; |
int accum_alpha_size; |
int driver_loaded; |
char driver_path[256]; |
void* dll_handle; |
} gl_config; |
/* * * */ |
/* Data private to this driver */ |
struct SDL_PrivateVideoData *hidden; |
struct SDL_PrivateGLData *gl_data; |
/* * * */ |
/* The function used to dispose of this structure */ |
void (*free)(_THIS); |
}; |
#undef _THIS |
typedef struct VideoBootStrap { |
const char *name; |
const char *desc; |
int (*available)(void); |
SDL_VideoDevice *(*create)(int devindex); |
} VideoBootStrap; |
#ifdef ENABLE_X11 |
extern VideoBootStrap X11_bootstrap; |
#endif |
#ifdef ENABLE_DGA |
extern VideoBootStrap DGA_bootstrap; |
#endif |
#ifdef ENABLE_NANOX |
extern VideoBootStrap NX_bootstrap; |
#endif |
#ifdef ENABLE_FBCON |
extern VideoBootStrap FBCON_bootstrap; |
#endif |
#ifdef ENABLE_PS2GS |
extern VideoBootStrap PS2GS_bootstrap; |
#endif |
#ifdef ENABLE_GGI |
extern VideoBootStrap GGI_bootstrap; |
#endif |
#ifdef ENABLE_VGL |
extern VideoBootStrap VGL_bootstrap; |
#endif |
#ifdef ENABLE_SVGALIB |
extern VideoBootStrap SVGALIB_bootstrap; |
#endif |
#ifdef ENABLE_AALIB |
extern VideoBootStrap AALIB_bootstrap; |
#endif |
#ifdef ENABLE_WINDIB |
extern VideoBootStrap WINDIB_bootstrap; |
#endif |
#ifdef ENABLE_DIRECTX |
extern VideoBootStrap DIRECTX_bootstrap; |
#endif |
#ifdef ENABLE_BWINDOW |
extern VideoBootStrap BWINDOW_bootstrap; |
#endif |
#ifdef ENABLE_DUMMYVIDEO |
extern VideoBootStrap DUMMY_bootstrap; |
#endif |
#ifdef ENABLE_PHOTON |
extern VideoBootStrap ph_bootstrap; |
#endif |
/* MacOS X gets the proper defines from configure */ |
#if defined(macintosh) && !defined(MACOSX) |
#define ENABLE_TOOLBOX |
#if !TARGET_API_MAC_CARBON |
#define ENABLE_DRAWSPROCKET |
#endif |
#endif |
#ifdef ENABLE_TOOLBOX |
extern VideoBootStrap TOOLBOX_bootstrap; |
#endif |
#ifdef ENABLE_DRAWSPROCKET |
extern VideoBootStrap DSp_bootstrap; |
#endif |
#ifdef ENABLE_QUARTZ |
extern VideoBootStrap QZ_bootstrap; |
#endif |
#ifdef ENABLE_CYBERGRAPHICS |
extern VideoBootStrap CGX_bootstrap; |
#endif |
#ifdef ENABLE_MENUETOS |
extern VideoBootStrap mosvideo_bootstrab; |
#endif |
/* This is the current video device */ |
extern SDL_VideoDevice *current_video; |
#define SDL_VideoSurface (current_video->screen) |
#define SDL_ShadowSurface (current_video->shadow) |
#define SDL_PublicSurface (current_video->visible) |
#endif /* _SDL_sysvideo_h */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_sysvideo.h.BAK |
---|
0,0 → 1,399 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_sysvideo.h,v 1.6 2001/06/19 13:33:53 hercules Exp $"; |
#endif |
#ifndef _SDL_sysvideo_h |
#define _SDL_sysvideo_h |
#include "SDL_mouse.h" |
#define SDL_PROTOTYPES_ONLY |
#include "SDL_syswm.h" |
#undef SDL_PROTOTYPES_ONLY |
/* This file prototypes the video driver implementation. |
This is designed to be easily converted to C++ in the future. |
*/ |
/* OpenGL is pretty much available on all Windows systems */ |
#ifdef WIN32 |
#ifndef _WIN32_WCE |
#define HAVE_OPENGL |
#endif |
#include <windows.h> |
#endif |
#ifdef HAVE_OPENGL |
#ifdef MACOSX |
#include <OpenGL/gl.h> /* OpenGL.framework */ |
#else |
#include <GL/gl.h> |
#endif /* MACOSX */ |
#endif /* HAVE_OPENGL */ |
/* The SDL video driver */ |
typedef struct SDL_VideoDevice SDL_VideoDevice; |
/* Define the SDL video driver structure */ |
#define _THIS SDL_VideoDevice *_this |
#ifndef _STATUS |
#define _STATUS SDL_status *status |
#endif |
struct SDL_VideoDevice { |
/* * * */ |
/* The name of this video driver */ |
const char *name; |
/* * * */ |
/* Initialization/Query functions */ |
/* Initialize the native video subsystem, filling 'vformat' with the |
"best" display pixel format, returning 0 or -1 if there's an error. |
*/ |
int (*VideoInit)(_THIS, SDL_PixelFormat *vformat); |
/* List the available video modes for the given pixel format, sorted |
from largest to smallest. |
*/ |
SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags); |
/* Set the requested video mode, returning a surface which will be |
set to the SDL_VideoSurface. The width and height will already |
be verified by ListModes(), and the video subsystem is free to |
set the mode to a supported bit depth different from the one |
specified -- the desired bpp will be emulated with a shadow |
surface if necessary. If a new mode is returned, this function |
should take care of cleaning up the current mode. |
*/ |
SDL_Surface *(*SetVideoMode)(_THIS, SDL_Surface *current, |
int width, int height, int bpp, Uint32 flags); |
/* Toggle the fullscreen mode */ |
int (*ToggleFullScreen)(_THIS, int on); |
/* This is called after the video mode has been set, to get the |
initial mouse state. It should queue events as necessary to |
properly represent the current mouse focus and position. |
*/ |
void (*UpdateMouse)(_THIS); |
/* Create a YUV video surface (possibly overlay) of the given |
format. The hardware should be able to perform at least 2x |
scaling on display. |
*/ |
SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height, |
Uint32 format, SDL_Surface *display); |
/* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) } |
of the physical palette to those in 'colors'. If the device is |
using a software palette (SDL_HWPALETTE not set), then the |
changes are reflected in the logical palette of the screen |
as well. |
The return value is 1 if all entries could be set properly |
or 0 otherwise. |
*/ |
int (*SetColors)(_THIS, int firstcolor, int ncolors, |
SDL_Color *colors); |
/* This pointer should exist in the native video subsystem and should |
point to an appropriate update function for the current video mode |
*/ |
void (*UpdateRects)(_THIS, int numrects, SDL_Rect *rects); |
/* Reverse the effects VideoInit() -- called if VideoInit() fails |
or if the application is shutting down the video subsystem. |
*/ |
void (*VideoQuit)(_THIS); |
/* * * */ |
/* Hardware acceleration functions */ |
/* Information about the video hardware */ |
SDL_VideoInfo info; |
/* Allocates a surface in video memory */ |
int (*AllocHWSurface)(_THIS, SDL_Surface *surface); |
/* Sets the hardware accelerated blit function, if any, based |
on the current flags of the surface (colorkey, alpha, etc.) |
*/ |
int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst); |
/* Fills a surface rectangle with the given color */ |
int (*FillHWRect)(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color); |
/* Sets video mem colorkey and accelerated blit function */ |
int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key); |
/* Sets per surface hardware alpha value */ |
int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value); |
/* Returns a readable/writable surface */ |
int (*LockHWSurface)(_THIS, SDL_Surface *surface); |
void (*UnlockHWSurface)(_THIS, SDL_Surface *surface); |
/* Performs hardware flipping */ |
int (*FlipHWSurface)(_THIS, SDL_Surface *surface); |
/* Frees a previously allocated video surface */ |
void (*FreeHWSurface)(_THIS, SDL_Surface *surface); |
/* * * */ |
/* Gamma support */ |
Uint16 *gamma; |
/* Set the gamma correction directly (emulated with gamma ramps) */ |
int (*SetGamma)(_THIS, float red, float green, float blue); |
/* Get the gamma correction directly (emulated with gamma ramps) */ |
int (*GetGamma)(_THIS, float *red, float *green, float *blue); |
/* Set the gamma ramp */ |
int (*SetGammaRamp)(_THIS, Uint16 *ramp); |
/* Get the gamma ramp */ |
int (*GetGammaRamp)(_THIS, Uint16 *ramp); |
/* * * */ |
/* OpenGL support */ |
/* Sets the dll to use for OpenGL and loads it */ |
int (*GL_LoadLibrary)(_THIS, const char *path); |
/* Retrieves the address of a function in the gl library */ |
void* (*GL_GetProcAddress)(_THIS, const char *proc); |
/* Get attribute information from the windowing system. */ |
int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value); |
/* Make the context associated with this driver current */ |
int (*GL_MakeCurrent)(_THIS); |
/* Swap the current buffers in double buffer mode. */ |
void (*GL_SwapBuffers)(_THIS); |
/* OpenGL functions for SDL_OPENGLBLIT */ |
#ifdef HAVE_OPENGL |
#ifndef WIN32 |
#define WINAPI |
#endif |
#define SDL_PROC(ret,func,params) ret (WINAPI *func) params; |
#include "SDL_glfuncs.h" |
#undef SDL_PROC |
/* Texture id */ |
GLuint texture; |
#endif |
int is_32bit; |
/* * * */ |
/* Window manager functions */ |
/* Set the title and icon text */ |
void (*SetCaption)(_THIS, const char *title, const char *icon); |
/* Set the window icon image */ |
void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask); |
/* Iconify the window. |
This function returns 1 if there is a window manager and the |
window was actually iconified, it returns 0 otherwise. |
*/ |
int (*IconifyWindow)(_THIS); |
/* Grab or ungrab keyboard and mouse input */ |
SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode); |
/* Get some platform dependent window information */ |
int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info); |
/* * * */ |
/* Cursor manager functions */ |
/* Free a window manager cursor |
This function can be NULL if CreateWMCursor is also NULL. |
*/ |
void (*FreeWMCursor)(_THIS, WMcursor *cursor); |
/* If not NULL, create a black/white window manager cursor */ |
WMcursor *(*CreateWMCursor)(_THIS, |
Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); |
/* Show the specified cursor, or hide if cursor is NULL */ |
int (*ShowWMCursor)(_THIS, WMcursor *cursor); |
/* Warp the window manager cursor to (x,y) |
If NULL, a mouse motion event is posted internally. |
*/ |
void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y); |
/* If not NULL, this is called when a mouse motion event occurs */ |
void (*MoveWMCursor)(_THIS, int x, int y); |
/* Determine whether the mouse should be in relative mode or not. |
This function is called when the input grab state or cursor |
visibility state changes. |
If the cursor is not visible, and the input is grabbed, the |
driver can place the mouse in relative mode, which may result |
in higher accuracy sampling of the pointer motion. |
*/ |
void (*CheckMouseMode)(_THIS); |
/* * * */ |
/* Event manager functions */ |
/* Initialize keyboard mapping for this driver */ |
void (*InitOSKeymap)(_THIS); |
/* Handle any queued OS events */ |
void (*PumpEvents)(_THIS); |
/* * * */ |
/* Data common to all drivers */ |
SDL_Surface *screen; |
SDL_Surface *shadow; |
SDL_Surface *visible; |
SDL_Palette *physpal; /* physical palette, if != logical palette */ |
SDL_Color *gammacols; /* gamma-corrected colours, or NULL */ |
char *wm_title; |
char *wm_icon; |
int offset_x; |
int offset_y; |
SDL_GrabMode input_grab; |
/* Driver information flags */ |
int handles_any_size; /* Driver handles any size video mode */ |
/* * * */ |
/* Data used by the GL drivers */ |
struct { |
int red_size; |
int green_size; |
int blue_size; |
int alpha_size; |
int depth_size; |
int buffer_size; |
int stencil_size; |
int double_buffer; |
int accum_red_size; |
int accum_green_size; |
int accum_blue_size; |
int accum_alpha_size; |
int driver_loaded; |
char driver_path[256]; |
void* dll_handle; |
} gl_config; |
/* * * */ |
/* Data private to this driver */ |
struct SDL_PrivateVideoData *hidden; |
struct SDL_PrivateGLData *gl_data; |
/* * * */ |
/* The function used to dispose of this structure */ |
void (*free)(_THIS); |
}; |
#undef _THIS |
typedef struct VideoBootStrap { |
const char *name; |
const char *desc; |
int (*available)(void); |
SDL_VideoDevice *(*create)(int devindex); |
} VideoBootStrap; |
#ifdef ENABLE_X11 |
extern VideoBootStrap X11_bootstrap; |
#endif |
#ifdef ENABLE_DGA |
extern VideoBootStrap DGA_bootstrap; |
#endif |
#ifdef ENABLE_NANOX |
extern VideoBootStrap NX_bootstrap; |
#endif |
#ifdef ENABLE_FBCON |
extern VideoBootStrap FBCON_bootstrap; |
#endif |
#ifdef ENABLE_PS2GS |
extern VideoBootStrap PS2GS_bootstrap; |
#endif |
#ifdef ENABLE_GGI |
extern VideoBootStrap GGI_bootstrap; |
#endif |
#ifdef ENABLE_VGL |
extern VideoBootStrap VGL_bootstrap; |
#endif |
#ifdef ENABLE_SVGALIB |
extern VideoBootStrap SVGALIB_bootstrap; |
#endif |
#ifdef ENABLE_AALIB |
extern VideoBootStrap AALIB_bootstrap; |
#endif |
#ifdef ENABLE_WINDIB |
extern VideoBootStrap WINDIB_bootstrap; |
#endif |
#ifdef ENABLE_DIRECTX |
extern VideoBootStrap DIRECTX_bootstrap; |
#endif |
#ifdef ENABLE_BWINDOW |
extern VideoBootStrap BWINDOW_bootstrap; |
#endif |
#ifdef ENABLE_DUMMYVIDEO |
extern VideoBootStrap DUMMY_bootstrap; |
#endif |
#ifdef ENABLE_PHOTON |
extern VideoBootStrap ph_bootstrap; |
#endif |
/* MacOS X gets the proper defines from configure */ |
#if defined(macintosh) && !defined(MACOSX) |
#define ENABLE_TOOLBOX |
#if !TARGET_API_MAC_CARBON |
#define ENABLE_DRAWSPROCKET |
#endif |
#endif |
#ifdef ENABLE_TOOLBOX |
extern VideoBootStrap TOOLBOX_bootstrap; |
#endif |
#ifdef ENABLE_DRAWSPROCKET |
extern VideoBootStrap DSp_bootstrap; |
#endif |
#ifdef ENABLE_QUARTZ |
extern VideoBootStrap QZ_bootstrap; |
#endif |
#ifdef ENABLE_CYBERGRAPHICS |
extern VideoBootStrap CGX_bootstrap; |
#endif |
#ifdef ENABLE_MENUETOS |
extern VideoBootStrap mosvideo_bootstrab; |
#endif |
/* This is the current video device */ |
extern SDL_VideoDevice *current_video; |
#define SDL_VideoSurface (current_video->screen) |
#define SDL_ShadowSurface (current_video->shadow) |
#define SDL_PublicSurface (current_video->visible) |
#endif /* _SDL_sysvideo_h */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_video.c |
---|
0,0 → 1,1802 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* The high-level video driver subsystem */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL.h" |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_events.h" |
#include "SDL_mutex.h" |
#include "SDL_sysvideo.h" |
#include "SDL_sysevents.h" |
#include "SDL_blit.h" |
#include "SDL_pixels_c.h" |
#include "SDL_events_c.h" |
#include "SDL_cursor_c.h" |
/* Available video drivers */ |
static VideoBootStrap *bootstrap[] = { |
#ifdef ENABLE_X11 |
&X11_bootstrap, |
#endif |
#ifdef ENABLE_DGA |
&DGA_bootstrap, |
#endif |
#ifdef ENABLE_NANOX |
&NX_bootstrap, |
#endif |
#ifdef ENABLE_FBCON |
&FBCON_bootstrap, |
#endif |
#ifdef ENABLE_PS2GS |
&PS2GS_bootstrap, |
#endif |
#ifdef ENABLE_GGI |
&GGI_bootstrap, |
#endif |
#ifdef ENABLE_VGL |
&VGL_bootstrap, |
#endif |
#ifdef ENABLE_SVGALIB |
&SVGALIB_bootstrap, |
#endif |
#ifdef ENABLE_AALIB |
&AALIB_bootstrap, |
#endif |
#ifdef ENABLE_DIRECTX |
&DIRECTX_bootstrap, |
#endif |
#ifdef ENABLE_WINDIB |
&WINDIB_bootstrap, |
#endif |
#ifdef ENABLE_BWINDOW |
&BWINDOW_bootstrap, |
#endif |
#ifdef ENABLE_TOOLBOX |
&TOOLBOX_bootstrap, |
#endif |
#ifdef ENABLE_DRAWSPROCKET |
&DSp_bootstrap, |
#endif |
#ifdef ENABLE_QUARTZ |
&QZ_bootstrap, |
#endif |
#ifdef ENABLE_CYBERGRAPHICS |
&CGX_bootstrap, |
#endif |
#ifdef ENABLE_DUMMYVIDEO |
&DUMMY_bootstrap, |
#endif |
#ifdef ENABLE_PHOTON |
&ph_bootstrap, |
#endif |
#ifdef ENABLE_MENUETOS |
&mosvideo_bootstrab, |
#endif |
NULL |
}; |
SDL_VideoDevice *current_video = NULL; |
/* Various local functions */ |
int SDL_VideoInit(const char *driver_name, Uint32 flags); |
void SDL_VideoQuit(void); |
void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects); |
static SDL_GrabMode SDL_WM_GrabInputOff(void); |
#ifdef HAVE_OPENGL |
static int lock_count = 0; |
#endif |
/* |
* Initialize the video and event subsystems -- determine native pixel format |
*/ |
int SDL_VideoInit (const char *driver_name, Uint32 flags) |
{ |
SDL_VideoDevice *video; |
int index; |
int i; |
SDL_PixelFormat vformat; |
Uint32 video_flags; |
/* Toggle the event thread flags, based on OS requirements */ |
#if defined(MUST_THREAD_EVENTS) |
flags |= SDL_INIT_EVENTTHREAD; |
#elif defined(CANT_THREAD_EVENTS) |
if ( (flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) { |
SDL_SetError("OS doesn't support threaded events"); |
return(-1); |
} |
#endif |
/* Check to make sure we don't overwrite 'current_video' */ |
if ( current_video != NULL ) { |
SDL_VideoQuit(); |
} |
/* Select the proper video driver */ |
index = 0; |
video = NULL; |
if ( driver_name != NULL ) { |
for ( i=0; bootstrap[i]; ++i ) { |
if ( strncmp(bootstrap[i]->name, driver_name, |
strlen(bootstrap[i]->name)) == 0 ) { |
if ( bootstrap[i]->available() ) { |
video = bootstrap[i]->create(index); |
break; |
} |
} |
} |
} else { |
for ( i=0; bootstrap[i]; ++i ) { |
if ( bootstrap[i]->available() ) { |
video = bootstrap[i]->create(index); |
if ( video != NULL ) { |
break; |
} |
} |
} |
} |
if ( video == NULL ) { |
SDL_SetError("No available video device"); |
return(-1); |
} |
current_video = video; |
current_video->name = bootstrap[i]->name; |
/* Do some basic variable initialization */ |
video->screen = NULL; |
video->shadow = NULL; |
video->visible = NULL; |
video->physpal = NULL; |
video->gammacols = NULL; |
video->gamma = NULL; |
video->wm_title = NULL; |
video->wm_icon = NULL; |
video->offset_x = 0; |
video->offset_y = 0; |
memset(&video->info, 0, (sizeof video->info)); |
/* Set some very sane GL defaults */ |
video->gl_config.driver_loaded = 0; |
video->gl_config.dll_handle = NULL; |
video->gl_config.red_size = 5; |
#if 1 /* This seems to work on more video cards, as a default */ |
video->gl_config.green_size = 5; |
#else |
video->gl_config.green_size = 6; |
#endif |
video->gl_config.blue_size = 5; |
video->gl_config.alpha_size = 0; |
video->gl_config.buffer_size = 0; |
video->gl_config.depth_size = 16; |
video->gl_config.stencil_size = 0; |
video->gl_config.double_buffer = 1; |
video->gl_config.accum_red_size = 0; |
video->gl_config.accum_green_size = 0; |
video->gl_config.accum_blue_size = 0; |
video->gl_config.accum_alpha_size = 0; |
/* Initialize the video subsystem */ |
memset(&vformat, 0, sizeof(vformat)); |
if ( video->VideoInit(video, &vformat) < 0 ) { |
SDL_VideoQuit(); |
return(-1); |
} |
/* Create a zero sized video surface of the appropriate format */ |
video_flags = SDL_SWSURFACE; |
SDL_VideoSurface = SDL_CreateRGBSurface(video_flags, 0, 0, |
vformat.BitsPerPixel, |
vformat.Rmask, vformat.Gmask, vformat.Bmask, 0); |
if ( SDL_VideoSurface == NULL ) { |
SDL_VideoQuit(); |
return(-1); |
} |
SDL_PublicSurface = NULL; /* Until SDL_SetVideoMode() */ |
#if 0 /* Don't change the current palette - may be used by other programs. |
* The application can't do anything with the display surface until |
* a video mode has been set anyway. :) |
*/ |
/* If we have a palettized surface, create a default palette */ |
if ( SDL_VideoSurface->format->palette ) { |
SDL_PixelFormat *vf = SDL_VideoSurface->format; |
SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel); |
video->SetColors(video, |
0, vf->palette->ncolors, vf->palette->colors); |
} |
#endif |
video->info.vfmt = SDL_VideoSurface->format; |
/* Start the event loop */ |
if ( SDL_StartEventLoop(flags) < 0 ) { |
SDL_VideoQuit(); |
return(-1); |
} |
SDL_CursorInit(flags & SDL_INIT_EVENTTHREAD); |
/* We're ready to go! */ |
return(0); |
} |
char *SDL_VideoDriverName(char *namebuf, int maxlen) |
{ |
if ( current_video != NULL ) { |
strncpy(namebuf, current_video->name, maxlen-1); |
namebuf[maxlen-1] = '\0'; |
return(namebuf); |
} |
return(NULL); |
} |
/* |
* Get the current display surface |
*/ |
SDL_Surface *SDL_GetVideoSurface(void) |
{ |
SDL_Surface *visible; |
visible = NULL; |
if ( current_video ) { |
visible = current_video->visible; |
} |
return(visible); |
} |
/* |
* Get the current information about the video hardware |
*/ |
const SDL_VideoInfo *SDL_GetVideoInfo(void) |
{ |
const SDL_VideoInfo *info; |
info = NULL; |
if ( current_video ) { |
info = ¤t_video->info; |
} |
return(info); |
} |
/* |
* Return a pointer to an array of available screen dimensions for the |
* given format, sorted largest to smallest. Returns NULL if there are |
* no dimensions available for a particular format, or (SDL_Rect **)-1 |
* if any dimension is okay for the given format. If 'format' is NULL, |
* the mode list will be for the format given by SDL_GetVideoInfo()->vfmt |
*/ |
SDL_Rect ** SDL_ListModes (SDL_PixelFormat *format, Uint32 flags) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
SDL_Rect **modes; |
modes = NULL; |
if ( SDL_VideoSurface ) { |
if ( format == NULL ) { |
format = SDL_VideoSurface->format; |
} |
modes = video->ListModes(this, format, flags); |
} |
return(modes); |
} |
/* |
* Check to see if a particular video mode is supported. |
* It returns 0 if the requested mode is not supported under any bit depth, |
* or returns the bits-per-pixel of the closest available mode with the |
* given width and height. If this bits-per-pixel is different from the |
* one used when setting the video mode, SDL_SetVideoMode() will succeed, |
* but will emulate the requested bits-per-pixel with a shadow surface. |
*/ |
static Uint8 SDL_closest_depths[4][8] = { |
/* 8 bit closest depth ordering */ |
{ 0, 8, 16, 15, 32, 24, 0, 0 }, |
/* 15,16 bit closest depth ordering */ |
{ 0, 16, 15, 32, 24, 8, 0, 0 }, |
/* 24 bit closest depth ordering */ |
{ 0, 24, 32, 16, 15, 8, 0, 0 }, |
/* 32 bit closest depth ordering */ |
{ 0, 32, 16, 15, 24, 8, 0, 0 } |
}; |
int SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags) |
{ |
int table, b, i; |
int supported; |
SDL_PixelFormat format; |
SDL_Rect **sizes; |
/* Currently 1 and 4 bpp are not supported */ |
if ( bpp < 8 || bpp > 32 ) { |
return(0); |
} |
if ( (width == 0) || (height == 0) ) { |
return(0); |
} |
/* Search through the list valid of modes */ |
memset(&format, 0, sizeof(format)); |
supported = 0; |
table = ((bpp+7)/8)-1; |
SDL_closest_depths[table][0] = bpp; |
SDL_closest_depths[table][7] = 0; |
for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) { |
format.BitsPerPixel = SDL_closest_depths[table][b]; |
sizes = SDL_ListModes(&format, flags); |
if ( sizes == (SDL_Rect **)0 ) { |
/* No sizes supported at this bit-depth */ |
continue; |
} else |
#ifdef macintosh /* MPW optimization bug? */ |
if ( (sizes == (SDL_Rect **)0xFFFFFFFF) || |
#else |
if ( (sizes == (SDL_Rect **)-1) || |
#endif |
current_video->handles_any_size ) { |
/* Any size supported at this bit-depth */ |
supported = 1; |
continue; |
} else |
for ( i=0; sizes[i]; ++i ) { |
if ((sizes[i]->w == width) && (sizes[i]->h == height)) { |
supported = 1; |
break; |
} |
} |
} |
if ( supported ) { |
--b; |
return(SDL_closest_depths[table][b]); |
} else { |
return(0); |
} |
} |
/* |
* Get the closest non-emulated video mode to the one requested |
*/ |
static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags) |
{ |
int table, b, i; |
int supported; |
int native_bpp; |
SDL_PixelFormat format; |
SDL_Rect **sizes; |
/* Try the original video mode, get the closest depth */ |
native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags); |
if ( native_bpp == *BitsPerPixel ) { |
return(1); |
} |
if ( native_bpp > 0 ) { |
*BitsPerPixel = native_bpp; |
return(1); |
} |
/* No exact size match at any depth, look for closest match */ |
memset(&format, 0, sizeof(format)); |
supported = 0; |
table = ((*BitsPerPixel+7)/8)-1; |
SDL_closest_depths[table][0] = *BitsPerPixel; |
SDL_closest_depths[table][7] = SDL_VideoSurface->format->BitsPerPixel; |
for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) { |
format.BitsPerPixel = SDL_closest_depths[table][b]; |
sizes = SDL_ListModes(&format, flags); |
if ( sizes == (SDL_Rect **)0 ) { |
/* No sizes supported at this bit-depth */ |
continue; |
} |
for ( i=0; sizes[i]; ++i ) { |
if ((sizes[i]->w < *w) || (sizes[i]->h < *h)) { |
if ( i > 0 ) { |
--i; |
*w = sizes[i]->w; |
*h = sizes[i]->h; |
*BitsPerPixel = SDL_closest_depths[table][b]; |
supported = 1; |
} else { |
/* Largest mode too small... */; |
} |
break; |
} |
} |
if ( (i > 0) && ! sizes[i] ) { |
/* The smallest mode was larger than requested, OK */ |
--i; |
*w = sizes[i]->w; |
*h = sizes[i]->h; |
*BitsPerPixel = SDL_closest_depths[table][b]; |
supported = 1; |
} |
} |
if ( ! supported ) { |
SDL_SetError("No video mode large enough for %dx%d", *w, *h); |
} |
return(supported); |
} |
/* This should probably go somewhere else -- like SDL_surface.c */ |
static void SDL_ClearSurface(SDL_Surface *surface) |
{ |
Uint32 black; |
black = SDL_MapRGB(surface->format, 0, 0, 0); |
SDL_FillRect(surface, NULL, black); |
if ((surface->flags&SDL_HWSURFACE) && (surface->flags&SDL_DOUBLEBUF)) { |
SDL_Flip(surface); |
SDL_FillRect(surface, NULL, black); |
} |
SDL_Flip(surface); |
} |
/* |
* Create a shadow surface suitable for fooling the app. :-) |
*/ |
static void SDL_CreateShadowSurface(int depth) |
{ |
Uint32 Rmask, Gmask, Bmask; |
/* Allocate the shadow surface */ |
if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) { |
Rmask = (SDL_VideoSurface->format)->Rmask; |
Gmask = (SDL_VideoSurface->format)->Gmask; |
Bmask = (SDL_VideoSurface->format)->Bmask; |
} else { |
Rmask = Gmask = Bmask = 0; |
} |
SDL_ShadowSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, |
SDL_VideoSurface->w, SDL_VideoSurface->h, |
depth, Rmask, Gmask, Bmask, 0); |
if ( SDL_ShadowSurface == NULL ) { |
return; |
} |
/* 8-bit shadow surfaces report that they have exclusive palette */ |
if ( SDL_ShadowSurface->format->palette ) { |
SDL_ShadowSurface->flags |= SDL_HWPALETTE; |
if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) { |
memcpy(SDL_ShadowSurface->format->palette->colors, |
SDL_VideoSurface->format->palette->colors, |
SDL_VideoSurface->format->palette->ncolors* |
sizeof(SDL_Color)); |
} else { |
SDL_DitherColors( |
SDL_ShadowSurface->format->palette->colors, depth); |
} |
} |
/* If the video surface is resizable, the shadow should say so */ |
if ( (SDL_VideoSurface->flags & SDL_RESIZABLE) == SDL_RESIZABLE ) { |
SDL_ShadowSurface->flags |= SDL_RESIZABLE; |
} |
/* If the video surface has no frame, the shadow should say so */ |
if ( (SDL_VideoSurface->flags & SDL_NOFRAME) == SDL_NOFRAME ) { |
SDL_ShadowSurface->flags |= SDL_NOFRAME; |
} |
/* If the video surface is fullscreen, the shadow should say so */ |
if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { |
SDL_ShadowSurface->flags |= SDL_FULLSCREEN; |
} |
/* If the video surface is flippable, the shadow should say so */ |
if ( (SDL_VideoSurface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { |
SDL_ShadowSurface->flags |= SDL_DOUBLEBUF; |
} |
return; |
} |
/* |
* Set the requested video mode, allocating a shadow buffer if necessary. |
*/ |
SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) |
{ |
SDL_VideoDevice *video, *this; |
SDL_Surface *prev_mode, *mode; |
int video_w; |
int video_h; |
int video_bpp; |
int is_opengl; |
SDL_GrabMode saved_grab; |
/* Start up the video driver, if necessary.. |
WARNING: This is the only function protected this way! |
*/ |
if ( ! current_video ) { |
if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) < 0 ) { |
return(NULL); |
} |
} |
this = video = current_video; |
/* Default to the current video bpp */ |
if ( bpp == 0 ) { |
flags |= SDL_ANYFORMAT; |
bpp = SDL_VideoSurface->format->BitsPerPixel; |
} |
/* Get a good video mode, the closest one possible */ |
video_w = width; |
video_h = height; |
video_bpp = bpp; |
if ( ! SDL_GetVideoMode(&video_w, &video_h, &video_bpp, flags) ) { |
return(NULL); |
} |
/* Check the requested flags */ |
/* There's no palette in > 8 bits-per-pixel mode */ |
if ( video_bpp > 8 ) { |
flags &= ~SDL_HWPALETTE; |
} |
#if 0 |
if ( (flags&SDL_FULLSCREEN) != SDL_FULLSCREEN ) { |
/* There's no windowed double-buffering */ |
flags &= ~SDL_DOUBLEBUF; |
} |
#endif |
if ( (flags&SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { |
/* Use hardware surfaces when double-buffering */ |
flags |= SDL_HWSURFACE; |
} |
is_opengl = ( ( flags & SDL_OPENGL ) == SDL_OPENGL ); |
if ( is_opengl ) { |
/* These flags are for 2D video modes only */ |
flags &= ~(SDL_HWSURFACE|SDL_DOUBLEBUF); |
} |
/* Reset the keyboard here so event callbacks can run */ |
SDL_ResetKeyboard(); |
/* Clean up any previous video mode */ |
if ( SDL_PublicSurface != NULL ) { |
SDL_PublicSurface = NULL; |
} |
if ( SDL_ShadowSurface != NULL ) { |
SDL_Surface *ready_to_go; |
ready_to_go = SDL_ShadowSurface; |
SDL_ShadowSurface = NULL; |
SDL_FreeSurface(ready_to_go); |
} |
if ( video->physpal ) { |
free(video->physpal->colors); |
free(video->physpal); |
video->physpal = NULL; |
} |
if( video->gammacols) { |
free(video->gammacols); |
video->gammacols = NULL; |
} |
/* Save the previous grab state and turn off grab for mode switch */ |
saved_grab = SDL_WM_GrabInputOff(); |
/* Try to set the video mode, along with offset and clipping */ |
prev_mode = SDL_VideoSurface; |
SDL_LockCursor(); |
SDL_VideoSurface = NULL; /* In case it's freed by driver */ |
mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags); |
if ( mode ) { /* Prevent resize events from mode change */ |
SDL_PrivateResize(mode->w, mode->h); |
} |
/* |
* rcg11292000 |
* If you try to set an SDL_OPENGL surface, and fail to find a |
* matching visual, then the next call to SDL_SetVideoMode() |
* will segfault, since we no longer point to a dummy surface, |
* but rather NULL. |
* Sam 11/29/00 |
* WARNING, we need to make sure that the previous mode hasn't |
* already been freed by the video driver. What do we do in |
* that case? Should we call SDL_VideoInit() again? |
*/ |
SDL_VideoSurface = (mode != NULL) ? mode : prev_mode; |
if ( (mode != NULL) && (!is_opengl) ) { |
/* Sanity check */ |
if ( (mode->w < width) || (mode->h < height) ) { |
SDL_SetError("Video mode smaller than requested"); |
return(NULL); |
} |
/* If we have a palettized surface, create a default palette */ |
if ( mode->format->palette ) { |
SDL_PixelFormat *vf = mode->format; |
SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel); |
video->SetColors(this, 0, vf->palette->ncolors, |
vf->palette->colors); |
} |
/* Clear the surface to black */ |
video->offset_x = 0; |
video->offset_y = 0; |
mode->offset = 0; |
SDL_SetClipRect(mode, NULL); |
SDL_ClearSurface(mode); |
/* Now adjust the offsets to match the desired mode */ |
video->offset_x = (mode->w-width)/2; |
video->offset_y = (mode->h-height)/2; |
mode->offset = video->offset_y*mode->pitch + |
video->offset_x*mode->format->BytesPerPixel; |
#ifdef DEBUG_VIDEO |
SDL_printf("Requested mode: %dx%dx%d, obtained mode %dx%dx%d (offset %d)\n", |
width, height, bpp, |
mode->w, mode->h, mode->format->BitsPerPixel, mode->offset); |
#endif |
mode->w = width; |
mode->h = height; |
SDL_SetClipRect(mode, NULL); |
} |
SDL_ResetCursor(); |
SDL_UnlockCursor(); |
/* If we failed setting a video mode, return NULL... (Uh Oh!) */ |
if ( mode == NULL ) { |
return(NULL); |
} |
/* If there is no window manager, set the SDL_NOFRAME flag */ |
if ( ! video->info.wm_available ) { |
mode->flags |= SDL_NOFRAME; |
} |
/* Reset the mouse cursor and grab for new video mode */ |
SDL_SetCursor(NULL); |
if ( video->UpdateMouse ) { |
video->UpdateMouse(this); |
} |
SDL_WM_GrabInput(saved_grab); |
SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */ |
/* If we're running OpenGL, make the context current */ |
if ( (video->screen->flags & SDL_OPENGL) && |
video->GL_MakeCurrent ) { |
if ( video->GL_MakeCurrent(this) < 0 ) { |
return(NULL); |
} |
} |
/* Set up a fake SDL surface for OpenGL "blitting" */ |
if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) { |
/* Load GL functions for performing the texture updates */ |
#ifdef HAVE_OPENGL |
#define SDL_PROC(ret,func,params) \ |
do { \ |
video->func = SDL_GL_GetProcAddress(#func); \ |
if ( ! video->func ) { \ |
SDL_SetError("Couldn't load GL function: %s\n", #func); \ |
return(NULL); \ |
} \ |
} while ( 0 ); |
#include "SDL_glfuncs.h" |
#undef SDL_PROC |
/* Create a software surface for blitting */ |
#ifdef GL_VERSION_1_2 |
/* If the implementation either supports the packed pixels |
extension, or implements the core OpenGL 1.2 API, it will |
support the GL_UNSIGNED_SHORT_5_6_5 texture format. |
*/ |
if ( (bpp == 16) && |
(strstr((const char *)video->glGetString(GL_EXTENSIONS), |
"GL_EXT_packed_pixels") || |
(strncmp((const char *)video->glGetString(GL_VERSION), |
"1.2", 3) == 0)) ) |
{ |
video->is_32bit = 0; |
SDL_VideoSurface = SDL_CreateRGBSurface( |
flags, |
width, |
height, |
16, |
31 << 11, |
63 << 5, |
31, |
0 |
); |
} |
else |
#endif /* OpenGL 1.2 */ |
{ |
video->is_32bit = 1; |
SDL_VideoSurface = SDL_CreateRGBSurface( |
flags, |
width, |
height, |
32, |
#if SDL_BYTEORDER == SDL_LIL_ENDIAN |
0x000000FF, |
0x0000FF00, |
0x00FF0000, |
0xFF000000 |
#else |
0xFF000000, |
0x00FF0000, |
0x0000FF00, |
0x000000FF |
#endif |
); |
} |
if ( ! SDL_VideoSurface ) { |
return(NULL); |
} |
SDL_VideoSurface->flags = mode->flags | SDL_OPENGLBLIT; |
/* Free the original video mode surface (is this safe?) */ |
SDL_FreeSurface(mode); |
/* Set the surface completely opaque & white by default */ |
memset( SDL_VideoSurface->pixels, 255, SDL_VideoSurface->h * SDL_VideoSurface->pitch ); |
video->glGenTextures( 1, &video->texture ); |
video->glBindTexture( GL_TEXTURE_2D, video->texture ); |
video->glTexImage2D( |
GL_TEXTURE_2D, |
0, |
video->is_32bit ? GL_RGBA : GL_RGB, |
256, |
256, |
0, |
video->is_32bit ? GL_RGBA : GL_RGB, |
#ifdef GL_VERSION_1_2 |
video->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5, |
#else |
GL_UNSIGNED_BYTE, |
#endif |
NULL); |
video->UpdateRects = SDL_GL_UpdateRectsLock; |
#else |
SDL_SetError("Somebody forgot to #define HAVE_OPENGL"); |
return(NULL); |
#endif |
} |
/* Create a shadow surface if necessary */ |
/* There are three conditions under which we create a shadow surface: |
1. We need a particular bits-per-pixel that we didn't get. |
2. We need a hardware palette and didn't get one. |
3. We need a software surface and got a hardware surface. |
*/ |
if ( !(SDL_VideoSurface->flags & SDL_OPENGL) && |
( |
( !(flags&SDL_ANYFORMAT) && |
(SDL_VideoSurface->format->BitsPerPixel != bpp)) || |
( (flags&SDL_HWPALETTE) && |
!(SDL_VideoSurface->flags&SDL_HWPALETTE)) || |
/* If the surface is in hardware, video writes are visible |
as soon as they are performed, so we need to buffer them |
*/ |
( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) && |
(SDL_VideoSurface->flags&SDL_HWSURFACE)) |
) ) { |
SDL_CreateShadowSurface(bpp); |
if ( SDL_ShadowSurface == NULL ) { |
SDL_SetError("Couldn't create shadow surface"); |
return(NULL); |
} |
SDL_PublicSurface = SDL_ShadowSurface; |
} else { |
SDL_PublicSurface = SDL_VideoSurface; |
} |
video->info.vfmt = SDL_VideoSurface->format; |
/* We're done! */ |
return(SDL_PublicSurface); |
} |
/* |
* Convert a surface into the video pixel format. |
*/ |
SDL_Surface * SDL_DisplayFormat (SDL_Surface *surface) |
{ |
Uint32 flags; |
if ( ! SDL_PublicSurface ) { |
SDL_SetError("No video mode has been set"); |
return(NULL); |
} |
/* Set the flags appropriate for copying to display surface */ |
flags = (SDL_PublicSurface->flags&SDL_HWSURFACE); |
#ifdef AUTORLE_DISPLAYFORMAT |
flags |= (surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA)); |
flags |= SDL_RLEACCELOK; |
#else |
flags |= surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA|SDL_RLEACCELOK); |
#endif |
return(SDL_ConvertSurface(surface, SDL_PublicSurface->format, flags)); |
} |
/* |
* Convert a surface into a format that's suitable for blitting to |
* the screen, but including an alpha channel. |
*/ |
SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface) |
{ |
SDL_PixelFormat *vf; |
SDL_PixelFormat *format; |
SDL_Surface *converted; |
Uint32 flags; |
/* default to ARGB8888 */ |
Uint32 amask = 0xff000000; |
Uint32 rmask = 0x00ff0000; |
Uint32 gmask = 0x0000ff00; |
Uint32 bmask = 0x000000ff; |
if ( ! SDL_PublicSurface ) { |
SDL_SetError("No video mode has been set"); |
return(NULL); |
} |
vf = SDL_PublicSurface->format; |
switch(vf->BytesPerPixel) { |
case 2: |
/* For XGY5[56]5, use, AXGY8888, where {X, Y} = {R, B}. |
For anything else (like ARGB4444) it doesn't matter |
since we have no special code for it anyway */ |
if ( (vf->Rmask == 0x1f) && |
(vf->Bmask == 0xf800 || vf->Bmask == 0x7c00)) { |
rmask = 0xff; |
bmask = 0xff0000; |
} |
break; |
case 3: |
case 4: |
/* Keep the video format, as long as the high 8 bits are |
unused or alpha */ |
if ( (vf->Rmask == 0xff) && (vf->Bmask == 0xff0000) ) { |
rmask = 0xff; |
bmask = 0xff0000; |
} |
break; |
default: |
/* We have no other optimised formats right now. When/if a new |
optimised alpha format is written, add the converter here */ |
break; |
} |
format = SDL_AllocFormat(32, rmask, gmask, bmask, amask); |
flags = SDL_PublicSurface->flags & SDL_HWSURFACE; |
flags |= surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK); |
converted = SDL_ConvertSurface(surface, format, flags); |
SDL_FreeFormat(format); |
return(converted); |
} |
/* |
* Update a specific portion of the physical screen |
*/ |
void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h) |
{ |
if ( screen ) { |
SDL_Rect rect; |
/* Perform some checking */ |
if ( w == 0 ) |
w = screen->w; |
if ( h == 0 ) |
h = screen->h; |
if ( (int)(x+w) > screen->w ) |
return; |
if ( (int)(y+h) > screen->h ) |
return; |
/* Fill the rectangle */ |
rect.x = x; |
rect.y = y; |
rect.w = w; |
rect.h = h; |
SDL_UpdateRects(screen, 1, &rect); |
} |
} |
void SDL_UpdateRects (SDL_Surface *screen, int numrects, SDL_Rect *rects) |
{ |
int i; |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( screen == SDL_ShadowSurface ) { |
/* Blit the shadow surface using saved mapping */ |
SDL_Palette *pal = screen->format->palette; |
SDL_Color *saved_colors = NULL; |
if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) { |
/* simulated 8bpp, use correct physical palette */ |
saved_colors = pal->colors; |
if ( video->gammacols ) { |
/* gamma-corrected palette */ |
pal->colors = video->gammacols; |
} else if ( video->physpal ) { |
/* physical palette different from logical */ |
pal->colors = video->physpal->colors; |
} |
} |
if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { |
SDL_LockCursor(); |
SDL_DrawCursor(SDL_ShadowSurface); |
for ( i=0; i<numrects; ++i ) { |
SDL_LowerBlit(SDL_ShadowSurface, &rects[i], |
SDL_VideoSurface, &rects[i]); |
} |
SDL_EraseCursor(SDL_ShadowSurface); |
SDL_UnlockCursor(); |
} else { |
for ( i=0; i<numrects; ++i ) { |
SDL_LowerBlit(SDL_ShadowSurface, &rects[i], |
SDL_VideoSurface, &rects[i]); |
} |
} |
if ( saved_colors ) |
pal->colors = saved_colors; |
/* Fall through to video surface update */ |
screen = SDL_VideoSurface; |
} |
if ( screen == SDL_VideoSurface ) { |
/* Update the video surface */ |
if ( screen->offset ) { |
for ( i=0; i<numrects; ++i ) { |
rects[i].x += video->offset_x; |
rects[i].y += video->offset_y; |
} |
video->UpdateRects(this, numrects, rects); |
for ( i=0; i<numrects; ++i ) { |
rects[i].x -= video->offset_x; |
rects[i].y -= video->offset_y; |
} |
} else { |
video->UpdateRects(this, numrects, rects); |
} |
} |
} |
/* |
* Performs hardware double buffering, if possible, or a full update if not. |
*/ |
int SDL_Flip(SDL_Surface *screen) |
{ |
SDL_VideoDevice *video = current_video; |
/* Copy the shadow surface to the video surface */ |
if ( screen == SDL_ShadowSurface ) { |
SDL_Rect rect; |
SDL_Palette *pal = screen->format->palette; |
SDL_Color *saved_colors = NULL; |
if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) { |
/* simulated 8bpp, use correct physical palette */ |
saved_colors = pal->colors; |
if ( video->gammacols ) { |
/* gamma-corrected palette */ |
pal->colors = video->gammacols; |
} else if ( video->physpal ) { |
/* physical palette different from logical */ |
pal->colors = video->physpal->colors; |
} |
} |
rect.x = 0; |
rect.y = 0; |
rect.w = screen->w; |
rect.h = screen->h; |
SDL_LowerBlit(SDL_ShadowSurface,&rect, SDL_VideoSurface,&rect); |
if ( saved_colors ) |
pal->colors = saved_colors; |
screen = SDL_VideoSurface; |
} |
if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { |
SDL_VideoDevice *this = current_video; |
return(video->FlipHWSurface(this, SDL_VideoSurface)); |
} else { |
SDL_UpdateRect(screen, 0, 0, 0, 0); |
} |
return(0); |
} |
static void SetPalette_logical(SDL_Surface *screen, SDL_Color *colors, |
int firstcolor, int ncolors) |
{ |
SDL_Palette *pal = screen->format->palette; |
SDL_Palette *vidpal; |
if ( colors != (pal->colors + firstcolor) ) { |
memcpy(pal->colors + firstcolor, colors, |
ncolors * sizeof(*colors)); |
} |
vidpal = SDL_VideoSurface->format->palette; |
if ( (screen == SDL_ShadowSurface) && vidpal ) { |
/* |
* This is a shadow surface, and the physical |
* framebuffer is also indexed. Propagate the |
* changes to its logical palette so that |
* updates are always identity blits |
*/ |
memcpy(vidpal->colors + firstcolor, colors, |
ncolors * sizeof(*colors)); |
} |
SDL_FormatChanged(screen); |
} |
static int SetPalette_physical(SDL_Surface *screen, |
SDL_Color *colors, int firstcolor, int ncolors) |
{ |
SDL_VideoDevice *video = current_video; |
int gotall = 1; |
if ( video->physpal ) { |
/* We need to copy the new colors, since we haven't |
* already done the copy in the logical set above. |
*/ |
memcpy(video->physpal->colors + firstcolor, |
colors, ncolors * sizeof(*colors)); |
} |
if ( screen == SDL_ShadowSurface ) { |
if ( SDL_VideoSurface->flags & SDL_HWPALETTE ) { |
/* |
* The real screen is also indexed - set its physical |
* palette. The physical palette does not include the |
* gamma modification, we apply it directly instead, |
* but this only happens if we have hardware palette. |
*/ |
screen = SDL_VideoSurface; |
} else { |
/* |
* The video surface is not indexed - invalidate any |
* active shadow-to-video blit mappings. |
*/ |
if ( screen->map->dst == SDL_VideoSurface ) { |
SDL_InvalidateMap(screen->map); |
} |
if ( video->gamma ) { |
if( ! video->gammacols ) { |
SDL_Palette *pp = video->physpal; |
if(!pp) |
pp = screen->format->palette; |
video->gammacols = malloc(pp->ncolors |
* sizeof(SDL_Color)); |
SDL_ApplyGamma(video->gamma, |
pp->colors, |
video->gammacols, |
pp->ncolors); |
} else { |
SDL_ApplyGamma(video->gamma, colors, |
video->gammacols |
+ firstcolor, |
ncolors); |
} |
} |
SDL_UpdateRect(screen, 0, 0, 0, 0); |
} |
} |
if ( screen == SDL_VideoSurface ) { |
SDL_Color gcolors[256]; |
if ( video->gamma ) { |
SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors); |
colors = gcolors; |
} |
gotall = video->SetColors(video, firstcolor, ncolors, colors); |
if ( ! gotall ) { |
/* The video flags shouldn't have SDL_HWPALETTE, and |
the video driver is responsible for copying back the |
correct colors into the video surface palette. |
*/ |
; |
} |
SDL_CursorPaletteChanged(); |
} |
return gotall; |
} |
/* |
* Set the physical and/or logical colormap of a surface: |
* Only the screen has a physical colormap. It determines what is actually |
* sent to the display. |
* The logical colormap is used to map blits to/from the surface. |
* 'which' is one or both of SDL_LOGPAL, SDL_PHYSPAL |
* |
* Return nonzero if all colours were set as requested, or 0 otherwise. |
*/ |
int SDL_SetPalette(SDL_Surface *screen, int which, |
SDL_Color *colors, int firstcolor, int ncolors) |
{ |
SDL_Palette *pal; |
int gotall; |
int palsize; |
if ( ! current_video ) { |
return 0; |
} |
if ( screen != SDL_PublicSurface ) { |
/* only screens have physical palettes */ |
which &= ~SDL_PHYSPAL; |
} else if( (screen->flags & SDL_HWPALETTE) != SDL_HWPALETTE ) { |
/* hardware palettes required for split colormaps */ |
which |= SDL_PHYSPAL | SDL_LOGPAL; |
} |
/* Verify the parameters */ |
pal = screen->format->palette; |
if( !pal ) { |
return 0; /* not a palettized surface */ |
} |
gotall = 1; |
palsize = 1 << screen->format->BitsPerPixel; |
if ( ncolors > (palsize - firstcolor) ) { |
ncolors = (palsize - firstcolor); |
gotall = 0; |
} |
if ( which & SDL_LOGPAL ) { |
/* |
* Logical palette change: The actual screen isn't affected, |
* but the internal colormap is altered so that the |
* interpretation of the pixel values (for blits etc) is |
* changed. |
*/ |
SetPalette_logical(screen, colors, firstcolor, ncolors); |
} |
if ( which & SDL_PHYSPAL ) { |
SDL_VideoDevice *video = current_video; |
/* |
* Physical palette change: This doesn't affect the |
* program's idea of what the screen looks like, but changes |
* its actual appearance. |
*/ |
if(!video) |
return gotall; /* video not yet initialized */ |
if(!video->physpal && !(which & SDL_LOGPAL) ) { |
/* Lazy physical palette allocation */ |
int size; |
SDL_Palette *pp = malloc(sizeof(*pp)); |
current_video->physpal = pp; |
pp->ncolors = pal->ncolors; |
size = pp->ncolors * sizeof(SDL_Color); |
pp->colors = malloc(size); |
memcpy(pp->colors, pal->colors, size); |
} |
if ( ! SetPalette_physical(screen, |
colors, firstcolor, ncolors) ) { |
gotall = 0; |
} |
} |
return gotall; |
} |
int SDL_SetColors(SDL_Surface *screen, SDL_Color *colors, int firstcolor, |
int ncolors) |
{ |
return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL, |
colors, firstcolor, ncolors); |
} |
/* |
* Clean up the video subsystem |
*/ |
void SDL_VideoQuit (void) |
{ |
SDL_Surface *ready_to_go; |
if ( current_video ) { |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* Halt event processing before doing anything else */ |
SDL_StopEventLoop(); |
/* Clean up allocated window manager items */ |
if ( SDL_PublicSurface ) { |
SDL_PublicSurface = NULL; |
} |
SDL_CursorQuit(); |
/* Just in case... */ |
SDL_WM_GrabInputOff(); |
/* Clean up the system video */ |
video->VideoQuit(this); |
/* Free any lingering surfaces */ |
ready_to_go = SDL_ShadowSurface; |
SDL_ShadowSurface = NULL; |
SDL_FreeSurface(ready_to_go); |
if ( SDL_VideoSurface != NULL ) { |
ready_to_go = SDL_VideoSurface; |
SDL_VideoSurface = NULL; |
SDL_FreeSurface(ready_to_go); |
} |
SDL_PublicSurface = NULL; |
/* Clean up miscellaneous memory */ |
if ( video->physpal ) { |
free(video->physpal->colors); |
free(video->physpal); |
video->physpal = NULL; |
} |
if ( video->gammacols ) { |
free(video->gammacols); |
video->gammacols = NULL; |
} |
if ( video->gamma ) { |
free(video->gamma); |
video->gamma = NULL; |
} |
if ( video->wm_title != NULL ) { |
free(video->wm_title); |
video->wm_title = NULL; |
} |
if ( video->wm_icon != NULL ) { |
free(video->wm_icon); |
video->wm_icon = NULL; |
} |
/* Finish cleaning up video subsystem */ |
video->free(this); |
current_video = NULL; |
} |
return; |
} |
/* Load the GL driver library */ |
int SDL_GL_LoadLibrary(const char *path) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
int retval; |
retval = -1; |
if ( video && video->GL_LoadLibrary ) { |
retval = video->GL_LoadLibrary(this, path); |
} else { |
SDL_SetError("No dynamic GL support in video driver"); |
} |
return(retval); |
} |
void *SDL_GL_GetProcAddress(const char* proc) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
void *func; |
func = NULL; |
if ( video->GL_GetProcAddress ) { |
if ( video->gl_config.driver_loaded ) { |
func = video->GL_GetProcAddress(this, proc); |
} else { |
SDL_SetError("No GL driver has been loaded"); |
} |
} else { |
SDL_SetError("No dynamic GL support in video driver"); |
} |
return func; |
} |
/* Set the specified GL attribute for setting up a GL video mode */ |
int SDL_GL_SetAttribute( SDL_GLattr attr, int value ) |
{ |
int retval; |
SDL_VideoDevice *video = current_video; |
retval = 0; |
switch (attr) { |
case SDL_GL_RED_SIZE: |
video->gl_config.red_size = value; |
break; |
case SDL_GL_GREEN_SIZE: |
video->gl_config.green_size = value; |
break; |
case SDL_GL_BLUE_SIZE: |
video->gl_config.blue_size = value; |
break; |
case SDL_GL_ALPHA_SIZE: |
video->gl_config.alpha_size = value; |
break; |
case SDL_GL_DOUBLEBUFFER: |
video->gl_config.double_buffer = value; |
break; |
case SDL_GL_BUFFER_SIZE: |
video->gl_config.buffer_size = value; |
break; |
case SDL_GL_DEPTH_SIZE: |
video->gl_config.depth_size = value; |
break; |
case SDL_GL_STENCIL_SIZE: |
video->gl_config.stencil_size = value; |
break; |
case SDL_GL_ACCUM_RED_SIZE: |
video->gl_config.accum_red_size = value; |
break; |
case SDL_GL_ACCUM_GREEN_SIZE: |
video->gl_config.accum_green_size = value; |
break; |
case SDL_GL_ACCUM_BLUE_SIZE: |
video->gl_config.accum_blue_size = value; |
break; |
case SDL_GL_ACCUM_ALPHA_SIZE: |
video->gl_config.accum_alpha_size = value; |
break; |
default: |
SDL_SetError("Unknown OpenGL attribute"); |
retval = -1; |
break; |
} |
return(retval); |
} |
/* Retrieve an attribute value from the windowing system. */ |
int SDL_GL_GetAttribute(SDL_GLattr attr, int* value) |
{ |
int retval = -1; |
SDL_VideoDevice* video = current_video; |
SDL_VideoDevice* this = current_video; |
if ( video->GL_GetAttribute ) { |
retval = this->GL_GetAttribute(this, attr, value); |
} else { |
*value = 0; |
SDL_SetError("GL_GetAttribute not supported"); |
} |
return retval; |
} |
/* Perform a GL buffer swap on the current GL context */ |
void SDL_GL_SwapBuffers(void) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video->screen->flags & SDL_OPENGL ) { |
video->GL_SwapBuffers( this ); |
} |
} |
/* Update rects with locking */ |
void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect *rects) |
{ |
SDL_GL_Lock(); |
SDL_GL_UpdateRects(numrects, rects); |
SDL_GL_Unlock(); |
} |
/* Update rects without state setting and changing (the caller is responsible for it) */ |
void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects) |
{ |
#ifdef HAVE_OPENGL |
SDL_VideoDevice *this = current_video; |
SDL_Rect update, tmp; |
int x, y, i; |
for ( i = 0; i < numrects; i++ ) |
{ |
tmp.y = rects[i].y; |
tmp.h = rects[i].h; |
for ( y = 0; y <= rects[i].h / 256; y++ ) |
{ |
tmp.x = rects[i].x; |
tmp.w = rects[i].w; |
for ( x = 0; x <= rects[i].w / 256; x++ ) |
{ |
update.x = tmp.x; |
update.y = tmp.y; |
update.w = tmp.w; |
update.h = tmp.h; |
if ( update.w > 256 ) |
update.w = 256; |
if ( update.h > 256 ) |
update.h = 256; |
this->glFlush(); |
this->glTexSubImage2D( |
GL_TEXTURE_2D, |
0, |
0, |
0, |
update.w, |
update.h, |
this->is_32bit? GL_RGBA : GL_RGB, |
#ifdef GL_VERSION_1_2 |
this->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5, |
#else |
GL_UNSIGNED_BYTE, |
#endif |
(Uint8 *)this->screen->pixels + |
this->screen->format->BytesPerPixel * update.x + |
update.y * this->screen->pitch ); |
this->glFlush(); |
/* |
* Note the parens around the function name: |
* This is because some OpenGL implementations define glTexCoord etc |
* as macros, and we don't want them expanded here. |
*/ |
this->glBegin(GL_TRIANGLE_STRIP); |
(this->glTexCoord2f)( 0.0, 0.0 ); |
(this->glVertex2i)( update.x, update.y ); |
(this->glTexCoord2f)( (float)(update.w / 256.0), 0.0 ); |
(this->glVertex2i)( update.x + update.w, update.y ); |
(this->glTexCoord2f)( 0.0, (float)(update.h / 256.0) ); |
(this->glVertex2i)( update.x, update.y + update.h ); |
(this->glTexCoord2f)( (float)(update.w / 256.0), (float)(update.h / 256.0) ); |
(this->glVertex2i)( update.x + update.w , update.y + update.h ); |
this->glEnd(); |
tmp.x += 256; |
tmp.w -= 256; |
} |
tmp.y += 256; |
tmp.h -= 256; |
} |
} |
#endif |
} |
/* Lock == save current state */ |
void SDL_GL_Lock() |
{ |
#ifdef HAVE_OPENGL |
lock_count--; |
if (lock_count==-1) |
{ |
SDL_VideoDevice *this = current_video; |
this->glPushAttrib( GL_ALL_ATTRIB_BITS ); /* TODO: narrow range of what is saved */ |
this->glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT ); |
this->glEnable(GL_TEXTURE_2D); |
this->glEnable(GL_BLEND); |
this->glDisable(GL_FOG); |
this->glDisable(GL_ALPHA_TEST); |
this->glDisable(GL_DEPTH_TEST); |
this->glDisable(GL_SCISSOR_TEST); |
this->glDisable(GL_STENCIL_TEST); |
this->glDisable(GL_CULL_FACE); |
this->glBindTexture( GL_TEXTURE_2D, this->texture ); |
this->glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); |
this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); |
this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); |
this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); |
this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); |
this->glPixelStorei( GL_UNPACK_ROW_LENGTH, this->screen->pitch / this->screen->format->BytesPerPixel ); |
this->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
(this->glColor4f)(1.0, 1.0, 1.0, 1.0); /* Solaris workaround */ |
this->glViewport(0, 0, this->screen->w, this->screen->h); |
this->glMatrixMode(GL_PROJECTION); |
this->glPushMatrix(); |
this->glLoadIdentity(); |
this->glOrtho(0.0, (GLdouble) this->screen->w, (GLdouble) this->screen->h, 0.0, 0.0, 1.0); |
this->glMatrixMode(GL_MODELVIEW); |
this->glPushMatrix(); |
this->glLoadIdentity(); |
} |
#endif |
} |
/* Unlock == restore saved state */ |
void SDL_GL_Unlock() |
{ |
#ifdef HAVE_OPENGL |
lock_count++; |
if (lock_count==0) |
{ |
SDL_VideoDevice *this = current_video; |
this->glPopMatrix(); |
this->glMatrixMode(GL_PROJECTION); |
this->glPopMatrix(); |
this->glPopClientAttrib(); |
this->glPopAttrib(); |
} |
#endif |
} |
/* |
* Sets/Gets the title and icon text of the display window, if any. |
*/ |
void SDL_WM_SetCaption (const char *title, const char *icon) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video ) { |
if ( title ) { |
if ( video->wm_title ) { |
free(video->wm_title); |
} |
video->wm_title = (char *)malloc(strlen(title)+1); |
if ( video->wm_title != NULL ) { |
strcpy(video->wm_title, title); |
} |
} |
if ( icon ) { |
if ( video->wm_icon ) { |
free(video->wm_icon); |
} |
video->wm_icon = (char *)malloc(strlen(icon)+1); |
if ( video->wm_icon != NULL ) { |
strcpy(video->wm_icon, icon); |
} |
} |
if ( (title || icon) && (video->SetCaption != NULL) ) { |
video->SetCaption(this, video->wm_title,video->wm_icon); |
} |
} |
} |
void SDL_WM_GetCaption (char **title, char **icon) |
{ |
SDL_VideoDevice *video = current_video; |
if ( video ) { |
if ( title ) { |
*title = video->wm_title; |
} |
if ( icon ) { |
*icon = video->wm_icon; |
} |
} |
} |
/* Utility function used by SDL_WM_SetIcon() */ |
static void CreateMaskFromColorKey(SDL_Surface *icon, Uint8 *mask) |
{ |
int x, y; |
Uint32 colorkey; |
#define SET_MASKBIT(icon, x, y, mask) \ |
mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8))) |
colorkey = icon->format->colorkey; |
switch (icon->format->BytesPerPixel) { |
case 1: { Uint8 *pixels; |
for ( y=0; y<icon->h; ++y ) { |
pixels = (Uint8 *)icon->pixels + y*icon->pitch; |
for ( x=0; x<icon->w; ++x ) { |
if ( *pixels++ == colorkey ) { |
SET_MASKBIT(icon, x, y, mask); |
} |
} |
} |
} |
break; |
case 2: { Uint16 *pixels; |
for ( y=0; y<icon->h; ++y ) { |
pixels = (Uint16 *)icon->pixels + |
y*icon->pitch/2; |
for ( x=0; x<icon->w; ++x ) { |
if ( *pixels++ == colorkey ) { |
SET_MASKBIT(icon, x, y, mask); |
} |
} |
} |
} |
break; |
case 4: { Uint32 *pixels; |
for ( y=0; y<icon->h; ++y ) { |
pixels = (Uint32 *)icon->pixels + |
y*icon->pitch/4; |
for ( x=0; x<icon->w; ++x ) { |
if ( *pixels++ == colorkey ) { |
SET_MASKBIT(icon, x, y, mask); |
} |
} |
} |
} |
break; |
} |
} |
/* |
* Sets the window manager icon for the display window. |
*/ |
void SDL_WM_SetIcon (SDL_Surface *icon, Uint8 *mask) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( icon && video->SetIcon ) { |
/* Generate a mask if necessary, and create the icon! */ |
if ( mask == NULL ) { |
int mask_len = icon->h*(icon->w+7)/8; |
mask = (Uint8 *)malloc(mask_len); |
if ( mask == NULL ) { |
return; |
} |
memset(mask, ~0, mask_len); |
if ( icon->flags & SDL_SRCCOLORKEY ) { |
CreateMaskFromColorKey(icon, mask); |
} |
video->SetIcon(video, icon, mask); |
free(mask); |
} else { |
video->SetIcon(this, icon, mask); |
} |
} |
} |
/* |
* Grab or ungrab the keyboard and mouse input. |
* This function returns the final grab mode after calling the |
* driver dependent function. |
*/ |
static SDL_GrabMode SDL_WM_GrabInputRaw(SDL_GrabMode mode) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
/* Only do something if we have support for grabs */ |
/*if ( video->GrabInput == NULL ) { |
return(video->input_grab); |
}*/ |
/* If the final grab mode if off, only then do we actually grab */ |
#ifdef DEBUG_GRAB |
SDL_printf("SDL_WM_GrabInputRaw(%d) ... ", mode); |
#endif |
/*if ( mode == SDL_GRAB_OFF ) { |
if ( video->input_grab != SDL_GRAB_OFF ) { |
mode = video->GrabInput(this, mode); |
} |
} else { |
if ( video->input_grab == SDL_GRAB_OFF ) { |
mode = video->GrabInput(this, mode); |
} |
}*/ |
if ( mode != video->input_grab ) { |
video->input_grab = mode; |
if ( video->CheckMouseMode ) { |
video->CheckMouseMode(this); |
} |
} |
#ifdef DEBUG_GRAB |
SDL_printf("Final mode %d\n", video->input_grab); |
#endif |
/* Return the final grab state */ |
if ( mode >= SDL_GRAB_FULLSCREEN ) { |
mode -= SDL_GRAB_FULLSCREEN; |
} |
return(mode); |
} |
SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode) |
{ |
SDL_VideoDevice *video = current_video; |
/* If the video isn't initialized yet, we can't do anything */ |
if ( ! video ) { |
return SDL_GRAB_OFF; |
} |
/* Return the current mode on query */ |
if ( mode == SDL_GRAB_QUERY ) { |
mode = video->input_grab; |
if ( mode >= SDL_GRAB_FULLSCREEN ) { |
mode -= SDL_GRAB_FULLSCREEN; |
} |
return(mode); |
} |
#ifdef DEBUG_GRAB |
SDL_printf("SDL_WM_GrabInput(%d) ... ", mode); |
#endif |
/* If the video surface is fullscreen, we always grab */ |
if ( mode >= SDL_GRAB_FULLSCREEN ) { |
mode -= SDL_GRAB_FULLSCREEN; |
} |
if ( SDL_VideoSurface && (SDL_VideoSurface->flags & SDL_FULLSCREEN) ) { |
mode += SDL_GRAB_FULLSCREEN; |
} |
return(SDL_WM_GrabInputRaw(mode)); |
} |
static SDL_GrabMode SDL_WM_GrabInputOff(void) |
{ |
SDL_GrabMode mode; |
/* First query the current grab state */ |
mode = SDL_WM_GrabInput(SDL_GRAB_QUERY); |
/* Now explicitly turn off input grab */ |
SDL_WM_GrabInputRaw(SDL_GRAB_OFF); |
/* Return the old state */ |
return(mode); |
} |
/* |
* Iconify the window in window managed environments. |
* A successful iconification will result in an SDL_APPACTIVE loss event. |
*/ |
int SDL_WM_IconifyWindow(void) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
int retval; |
retval = 0; |
if ( video->IconifyWindow ) { |
retval = video->IconifyWindow(this); |
} |
return(retval); |
} |
/* |
* Toggle fullscreen mode |
*/ |
int SDL_WM_ToggleFullScreen(SDL_Surface *surface) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
int toggled; |
toggled = 0; |
if ( SDL_PublicSurface && (surface == SDL_PublicSurface) && |
video->ToggleFullScreen ) { |
if ( surface->flags & SDL_FULLSCREEN ) { |
toggled = video->ToggleFullScreen(this, 0); |
if ( toggled ) { |
SDL_VideoSurface->flags &= ~SDL_FULLSCREEN; |
SDL_PublicSurface->flags &= ~SDL_FULLSCREEN; |
} |
} else { |
toggled = video->ToggleFullScreen(this, 1); |
if ( toggled ) { |
SDL_VideoSurface->flags |= SDL_FULLSCREEN; |
SDL_PublicSurface->flags |= SDL_FULLSCREEN; |
} |
} |
/* Double-check the grab state inside SDL_WM_GrabInput() */ |
if ( toggled ) { |
SDL_WM_GrabInput(video->input_grab); |
} |
} |
return(toggled); |
} |
/* |
* Get some platform dependent window manager information |
*/ |
int SDL_GetWMInfo (SDL_SysWMinfo *info) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
if ( video && video->GetWMInfo ) { |
return(video->GetWMInfo(this, info)); |
} else { |
return(0); |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_yuv.c |
---|
0,0 → 1,89 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
/* This is the implementation of the YUV video surface support */ |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_getenv.h" |
#include "SDL_video.h" |
#include "SDL_sysvideo.h" |
#include "SDL_yuvfuncs.h" |
#include "SDL_yuv_sw_c.h" |
SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format, |
SDL_Surface *display) |
{ |
SDL_VideoDevice *video = current_video; |
SDL_VideoDevice *this = current_video; |
const char *yuv_hwaccel; |
SDL_Overlay *overlay; |
overlay = NULL; |
/* Display directly on video surface, if possible */ |
if ( getenv("SDL_VIDEO_YUV_DIRECT") ) { |
if ( (display == SDL_PublicSurface) && |
((SDL_VideoSurface->format->BytesPerPixel == 2) || |
(SDL_VideoSurface->format->BytesPerPixel == 4)) ) { |
display = SDL_VideoSurface; |
} |
} |
yuv_hwaccel = getenv("SDL_VIDEO_YUV_HWACCEL"); |
if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) && |
(!yuv_hwaccel || (atoi(yuv_hwaccel) > 0)) ) { |
overlay = video->CreateYUVOverlay(this, w, h, format, display); |
} |
/* If hardware YUV overlay failed ... */ |
if ( overlay == NULL ) { |
overlay = SDL_CreateYUV_SW(this, w, h, format, display); |
} |
return overlay; |
} |
int SDL_LockYUVOverlay(SDL_Overlay *overlay) |
{ |
return overlay->hwfuncs->Lock(current_video, overlay); |
} |
void SDL_UnlockYUVOverlay(SDL_Overlay *overlay) |
{ |
overlay->hwfuncs->Unlock(current_video, overlay); |
} |
int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect) |
{ |
return overlay->hwfuncs->Display(current_video, overlay, dstrect); |
} |
void SDL_FreeYUVOverlay(SDL_Overlay *overlay) |
{ |
if ( overlay ) { |
if ( overlay->hwfuncs ) { |
overlay->hwfuncs->FreeHW(current_video, overlay); |
} |
free(overlay); |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_yuv_mmx.c |
---|
0,0 → 1,418 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) |
#include "SDL_types.h" |
#ifdef __ELF__ |
#define ASM_VAR(X) _##X |
#else |
#define ASM_VAR(X) X |
#endif |
#define static |
static unsigned int ASM_VAR(MMX_0080w)[] = {0x00800080, 0x00800080}; |
static unsigned int ASM_VAR(MMX_00FFw)[] = {0x00ff00ff, 0x00ff00ff}; |
static unsigned int ASM_VAR(MMX_FF00w)[] = {0xff00ff00, 0xff00ff00}; |
static unsigned short ASM_VAR(MMX_Ycoeff)[] = {0x004a, 0x004a, 0x004a, 0x004a}; |
static unsigned short ASM_VAR(MMX_UbluRGB)[] = {0x0072, 0x0072, 0x0072, 0x0072}; |
static unsigned short ASM_VAR(MMX_VredRGB)[] = {0x0059, 0x0059, 0x0059, 0x0059}; |
static unsigned short ASM_VAR(MMX_UgrnRGB)[] = {0xffea, 0xffea, 0xffea, 0xffea}; |
static unsigned short ASM_VAR(MMX_VgrnRGB)[] = {0xffd2, 0xffd2, 0xffd2, 0xffd2}; |
static unsigned short ASM_VAR(MMX_Ublu5x5)[] = {0x0081, 0x0081, 0x0081, 0x0081}; |
static unsigned short ASM_VAR(MMX_Vred5x5)[] = {0x0066, 0x0066, 0x0066, 0x0066}; |
static unsigned short ASM_VAR(MMX_Ugrn555)[] = {0xffe7, 0xffe7, 0xffe7, 0xffe7}; |
static unsigned short ASM_VAR(MMX_Vgrn555)[] = {0xffcc, 0xffcc, 0xffcc, 0xffcc}; |
static unsigned short ASM_VAR(MMX_Ugrn565)[] = {0xffe8, 0xffe8, 0xffe8, 0xffe8}; |
static unsigned short ASM_VAR(MMX_Vgrn565)[] = {0xffcd, 0xffcd, 0xffcd, 0xffcd}; |
static unsigned short ASM_VAR(MMX_red555)[] = {0x7c00, 0x7c00, 0x7c00, 0x7c00}; |
static unsigned short ASM_VAR(MMX_red565)[] = {0xf800, 0xf800, 0xf800, 0xf800}; |
static unsigned short ASM_VAR(MMX_grn555)[] = {0x03e0, 0x03e0, 0x03e0, 0x03e0}; |
static unsigned short ASM_VAR(MMX_grn565)[] = {0x07e0, 0x07e0, 0x07e0, 0x07e0}; |
static unsigned short ASM_VAR(MMX_blu5x5)[] = {0x001f, 0x001f, 0x001f, 0x001f}; |
/** |
This MMX assembler is my first assembler/MMX program ever. |
Thus it maybe buggy. |
Send patches to: |
mvogt@rhrk.uni-kl.de |
After it worked fine I have "obfuscated" the code a bit to have |
more parallism in the MMX units. This means I moved |
initilisation around and delayed other instruction. |
Performance measurement did not show that this brought any advantage |
but in theory it _should_ be faster this way. |
The overall performanve gain to the C based dither was 30%-40%. |
The MMX routine calculates 256bit=8RGB values in each cycle |
(4 for row1 & 4 for row2) |
The red/green/blue.. coefficents are taken from the mpeg_play |
player. They look nice, but I dont know if you can have |
better values, to avoid integer rounding errors. |
IMPORTANT: |
========== |
It is a requirement that the cr/cb/lum are 8 byte aligned and |
the out are 16byte aligned or you will/may get segfaults |
*/ |
void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
Uint32 *row1; |
Uint32 *row2; |
unsigned char* y = lum +cols*rows; // Pointer to the end |
int x=0; |
row1 = (Uint32 *)out; // 32 bit target |
row2 = (Uint32 *)out+cols+mod; // start of second row |
mod = (mod+cols+mod)*4; // increment for row1 in byte |
__asm__ __volatile__ ( |
/* We don't really care about PIC - the code should be rewritten to use |
relative addressing for the static tables, so right now we take the |
COW hit on the pages this code resides. Big deal. |
This spill is just to reduce register pressure in the PIC case. */ |
"pushl %%ebx\n" |
"movl %0, %%ebx\n" |
".align 8\n" |
"1:\n" |
// create Cr (result in mm1) |
"movd (%%ebx), %%mm1\n" // 0 0 0 0 v3 v2 v1 v0 |
"pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00 |
"movd (%2), %%mm2\n" // 0 0 0 0 l3 l2 l1 l0 |
"punpcklbw %%mm7,%%mm1\n" // 0 v3 0 v2 00 v1 00 v0 |
"punpckldq %%mm1,%%mm1\n" // 00 v1 00 v0 00 v1 00 v0 |
"psubw _MMX_0080w,%%mm1\n" // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 |
// create Cr_g (result in mm0) |
"movq %%mm1,%%mm0\n" // r1 r1 r0 r0 r1 r1 r0 r0 |
"pmullw _MMX_VgrnRGB,%%mm0\n"// red*-46dec=0.7136*64 |
"pmullw _MMX_VredRGB,%%mm1\n"// red*89dec=1.4013*64 |
"psraw $6, %%mm0\n" // red=red/64 |
"psraw $6, %%mm1\n" // red=red/64 |
// create L1 L2 (result in mm2,mm4) |
// L2=lum+cols |
"movq (%2,%4),%%mm3\n" // 0 0 0 0 L3 L2 L1 L0 |
"punpckldq %%mm3,%%mm2\n" // L3 L2 L1 L0 l3 l2 l1 l0 |
"movq %%mm2,%%mm4\n" // L3 L2 L1 L0 l3 l2 l1 l0 |
"pand _MMX_FF00w,%%mm2\n" // L3 0 L1 0 l3 0 l1 0 |
"pand _MMX_00FFw,%%mm4\n" // 0 L2 0 L0 0 l2 0 l0 |
"psrlw $8,%%mm2\n" // 0 L3 0 L1 0 l3 0 l1 |
// create R (result in mm6) |
"movq %%mm2,%%mm5\n" // 0 L3 0 L1 0 l3 0 l1 |
"movq %%mm4,%%mm6\n" // 0 L2 0 L0 0 l2 0 l0 |
"paddsw %%mm1, %%mm5\n" // lum1+red:x R3 x R1 x r3 x r1 |
"paddsw %%mm1, %%mm6\n" // lum1+red:x R2 x R0 x r2 x r0 |
"packuswb %%mm5,%%mm5\n" // R3 R1 r3 r1 R3 R1 r3 r1 |
"packuswb %%mm6,%%mm6\n" // R2 R0 r2 r0 R2 R0 r2 r0 |
"pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00 |
"punpcklbw %%mm5,%%mm6\n" // R3 R2 R1 R0 r3 r2 r1 r0 |
// create Cb (result in mm1) |
"movd (%1), %%mm1\n" // 0 0 0 0 u3 u2 u1 u0 |
"punpcklbw %%mm7,%%mm1\n" // 0 u3 0 u2 00 u1 00 u0 |
"punpckldq %%mm1,%%mm1\n" // 00 u1 00 u0 00 u1 00 u0 |
"psubw _MMX_0080w,%%mm1\n" // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 |
// create Cb_g (result in mm5) |
"movq %%mm1,%%mm5\n" // u1 u1 u0 u0 u1 u1 u0 u0 |
"pmullw _MMX_UgrnRGB,%%mm5\n" // blue*-109dec=1.7129*64 |
"pmullw _MMX_UbluRGB,%%mm1\n" // blue*114dec=1.78125*64 |
"psraw $6, %%mm5\n" // blue=red/64 |
"psraw $6, %%mm1\n" // blue=blue/64 |
// create G (result in mm7) |
"movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1 |
"movq %%mm4,%%mm7\n" // 0 L2 0 L0 0 l2 0 l1 |
"paddsw %%mm5, %%mm3\n" // lum1+Cb_g:x G3t x G1t x g3t x g1t |
"paddsw %%mm5, %%mm7\n" // lum1+Cb_g:x G2t x G0t x g2t x g0t |
"paddsw %%mm0, %%mm3\n" // lum1+Cr_g:x G3 x G1 x g3 x g1 |
"paddsw %%mm0, %%mm7\n" // lum1+blue:x G2 x G0 x g2 x g0 |
"packuswb %%mm3,%%mm3\n" // G3 G1 g3 g1 G3 G1 g3 g1 |
"packuswb %%mm7,%%mm7\n" // G2 G0 g2 g0 G2 G0 g2 g0 |
"punpcklbw %%mm3,%%mm7\n" // G3 G2 G1 G0 g3 g2 g1 g0 |
// create B (result in mm5) |
"movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1 |
"movq %%mm4,%%mm5\n" // 0 L2 0 L0 0 l2 0 l1 |
"paddsw %%mm1, %%mm3\n" // lum1+blue:x B3 x B1 x b3 x b1 |
"paddsw %%mm1, %%mm5\n" // lum1+blue:x B2 x B0 x b2 x b0 |
"packuswb %%mm3,%%mm3\n" // B3 B1 b3 b1 B3 B1 b3 b1 |
"packuswb %%mm5,%%mm5\n" // B2 B0 b2 b0 B2 B0 b2 b0 |
"punpcklbw %%mm3,%%mm5\n" // B3 B2 B1 B0 b3 b2 b1 b0 |
// fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) |
"pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 |
"pxor %%mm4,%%mm4\n" // 0 0 0 0 0 0 0 0 |
"movq %%mm6,%%mm1\n" // R3 R2 R1 R0 r3 r2 r1 r0 |
"movq %%mm5,%%mm3\n" // B3 B2 B1 B0 b3 b2 b1 b0 |
// process lower lum |
"punpcklbw %%mm4,%%mm1\n" // 0 r3 0 r2 0 r1 0 r0 |
"punpcklbw %%mm4,%%mm3\n" // 0 b3 0 b2 0 b1 0 b0 |
"movq %%mm1,%%mm2\n" // 0 r3 0 r2 0 r1 0 r0 |
"movq %%mm3,%%mm0\n" // 0 b3 0 b2 0 b1 0 b0 |
"punpcklwd %%mm1,%%mm3\n" // 0 r1 0 b1 0 r0 0 b0 |
"punpckhwd %%mm2,%%mm0\n" // 0 r3 0 b3 0 r2 0 b2 |
"pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 |
"movq %%mm7,%%mm1\n" // G3 G2 G1 G0 g3 g2 g1 g0 |
"punpcklbw %%mm1,%%mm2\n" // g3 0 g2 0 g1 0 g0 0 |
"punpcklwd %%mm4,%%mm2\n" // 0 0 g1 0 0 0 g0 0 |
"por %%mm3, %%mm2\n" // 0 r1 g1 b1 0 r0 g0 b0 |
"movq %%mm2,(%3)\n" // wrote out ! row1 |
"pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 |
"punpcklbw %%mm1,%%mm4\n" // g3 0 g2 0 g1 0 g0 0 |
"punpckhwd %%mm2,%%mm4\n" // 0 0 g3 0 0 0 g2 0 |
"por %%mm0, %%mm4\n" // 0 r3 g3 b3 0 r2 g2 b2 |
"movq %%mm4,8(%3)\n" // wrote out ! row1 |
// fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) |
// this can be done "destructive" |
"pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 |
"punpckhbw %%mm2,%%mm6\n" // 0 R3 0 R2 0 R1 0 R0 |
"punpckhbw %%mm1,%%mm5\n" // G3 B3 G2 B2 G1 B1 G0 B0 |
"movq %%mm5,%%mm1\n" // G3 B3 G2 B2 G1 B1 G0 B0 |
"punpcklwd %%mm6,%%mm1\n" // 0 R1 G1 B1 0 R0 G0 B0 |
"movq %%mm1,(%5)\n" // wrote out ! row2 |
"punpckhwd %%mm6,%%mm5\n" // 0 R3 G3 B3 0 R2 G2 B2 |
"movq %%mm5,8(%5)\n" // wrote out ! row2 |
"addl $4,%2\n" // lum+4 |
"leal 16(%3),%3\n" // row1+16 |
"leal 16(%5),%5\n" // row2+16 |
"addl $2, %%ebx\n" // cr+2 |
"addl $2, %1\n" // cb+2 |
"addl $4,%6\n" // x+4 |
"cmpl %4,%6\n" |
"jl 1b\n" |
"addl %4, %2\n" // lum += cols |
"addl %8, %3\n" // row1+= mod |
"addl %8, %5\n" // row2+= mod |
"movl $0, %6\n" // x=0 |
"cmpl %7, %2\n" |
"jl 1b\n" |
"emms\n" |
"popl %%ebx\n" |
: |
: "m" (cr), "r"(cb),"r"(lum), |
"r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod) |
: "%ebx" |
); |
} |
void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
Uint16 *row1; |
Uint16 *row2; |
unsigned char* y = lum +cols*rows; /* Pointer to the end */ |
int x=0; |
row1 = (Uint16 *)out; /* 16 bit target */ |
row2 = (Uint16 *)out+cols+mod; /* start of second row */ |
mod = (mod+cols+mod)*2; /* increment for row1 in byte */ |
__asm__ __volatile__( |
"pushl %%ebx\n" |
"movl %0, %%ebx\n" |
".align 8\n" |
"1:\n" |
"movd (%1), %%mm0\n" // 4 Cb 0 0 0 0 u3 u2 u1 u0 |
"pxor %%mm7, %%mm7\n" |
"movd (%%ebx), %%mm1\n" // 4 Cr 0 0 0 0 v3 v2 v1 v0 |
"punpcklbw %%mm7, %%mm0\n" // 4 W cb 0 u3 0 u2 0 u1 0 u0 |
"punpcklbw %%mm7, %%mm1\n" // 4 W cr 0 v3 0 v2 0 v1 0 v0 |
"psubw _MMX_0080w, %%mm0\n" |
"psubw _MMX_0080w, %%mm1\n" |
"movq %%mm0, %%mm2\n" // Cb 0 u3 0 u2 0 u1 0 u0 |
"movq %%mm1, %%mm3\n" // Cr |
"pmullw _MMX_Ugrn565, %%mm2\n" // Cb2green 0 R3 0 R2 0 R1 0 R0 |
"movq (%2), %%mm6\n" // L1 l7 L6 L5 L4 L3 L2 L1 L0 |
"pmullw _MMX_Ublu5x5, %%mm0\n" // Cb2blue |
"pand _MMX_00FFw, %%mm6\n" // L1 00 L6 00 L4 00 L2 00 L0 |
"pmullw _MMX_Vgrn565, %%mm3\n" // Cr2green |
"movq (%2), %%mm7\n" // L2 |
"pmullw _MMX_Vred5x5, %%mm1\n" // Cr2red |
"psrlw $8, %%mm7\n" // L2 00 L7 00 L5 00 L3 00 L1 |
"pmullw _MMX_Ycoeff, %%mm6\n" // lum1 |
"paddw %%mm3, %%mm2\n" // Cb2green + Cr2green == green |
"pmullw _MMX_Ycoeff, %%mm7\n" // lum2 |
"movq %%mm6, %%mm4\n" // lum1 |
"paddw %%mm0, %%mm6\n" // lum1 +blue 00 B6 00 B4 00 B2 00 B0 |
"movq %%mm4, %%mm5\n" // lum1 |
"paddw %%mm1, %%mm4\n" // lum1 +red 00 R6 00 R4 00 R2 00 R0 |
"paddw %%mm2, %%mm5\n" // lum1 +green 00 G6 00 G4 00 G2 00 G0 |
"psraw $6, %%mm4\n" // R1 0 .. 64 |
"movq %%mm7, %%mm3\n" // lum2 00 L7 00 L5 00 L3 00 L1 |
"psraw $6, %%mm5\n" // G1 - .. + |
"paddw %%mm0, %%mm7\n" // Lum2 +blue 00 B7 00 B5 00 B3 00 B1 |
"psraw $6, %%mm6\n" // B1 0 .. 64 |
"packuswb %%mm4, %%mm4\n" // R1 R1 |
"packuswb %%mm5, %%mm5\n" // G1 G1 |
"packuswb %%mm6, %%mm6\n" // B1 B1 |
"punpcklbw %%mm4, %%mm4\n" |
"punpcklbw %%mm5, %%mm5\n" |
"pand _MMX_red565, %%mm4\n" |
"psllw $3, %%mm5\n" // GREEN 1 |
"punpcklbw %%mm6, %%mm6\n" |
"pand _MMX_grn565, %%mm5\n" |
"pand _MMX_red565, %%mm6\n" |
"por %%mm5, %%mm4\n" // |
"psrlw $11, %%mm6\n" // BLUE 1 |
"movq %%mm3, %%mm5\n" // lum2 |
"paddw %%mm1, %%mm3\n" // lum2 +red 00 R7 00 R5 00 R3 00 R1 |
"paddw %%mm2, %%mm5\n" // lum2 +green 00 G7 00 G5 00 G3 00 G1 |
"psraw $6, %%mm3\n" // R2 |
"por %%mm6, %%mm4\n" // MM4 |
"psraw $6, %%mm5\n" // G2 |
"movq (%2, %4), %%mm6\n" // L3 load lum2 |
"psraw $6, %%mm7\n" |
"packuswb %%mm3, %%mm3\n" |
"packuswb %%mm5, %%mm5\n" |
"packuswb %%mm7, %%mm7\n" |
"pand _MMX_00FFw, %%mm6\n" // L3 |
"punpcklbw %%mm3, %%mm3\n" |
"punpcklbw %%mm5, %%mm5\n" |
"pmullw _MMX_Ycoeff, %%mm6\n" // lum3 |
"punpcklbw %%mm7, %%mm7\n" |
"psllw $3, %%mm5\n" // GREEN 2 |
"pand _MMX_red565, %%mm7\n" |
"pand _MMX_red565, %%mm3\n" |
"psrlw $11, %%mm7\n" // BLUE 2 |
"pand _MMX_grn565, %%mm5\n" |
"por %%mm7, %%mm3\n" |
"movq (%2,%4), %%mm7\n" // L4 load lum2 |
"por %%mm5, %%mm3\n" // |
"psrlw $8, %%mm7\n" // L4 |
"movq %%mm4, %%mm5\n" |
"punpcklwd %%mm3, %%mm4\n" |
"pmullw _MMX_Ycoeff, %%mm7\n" // lum4 |
"punpckhwd %%mm3, %%mm5\n" |
"movq %%mm4, (%3)\n" // write row1 |
"movq %%mm5, 8(%3)\n" // write row1 |
"movq %%mm6, %%mm4\n" // Lum3 |
"paddw %%mm0, %%mm6\n" // Lum3 +blue |
"movq %%mm4, %%mm5\n" // Lum3 |
"paddw %%mm1, %%mm4\n" // Lum3 +red |
"paddw %%mm2, %%mm5\n" // Lum3 +green |
"psraw $6, %%mm4\n" |
"movq %%mm7, %%mm3\n" // Lum4 |
"psraw $6, %%mm5\n" |
"paddw %%mm0, %%mm7\n" // Lum4 +blue |
"psraw $6, %%mm6\n" // Lum3 +blue |
"movq %%mm3, %%mm0\n" // Lum4 |
"packuswb %%mm4, %%mm4\n" |
"paddw %%mm1, %%mm3\n" // Lum4 +red |
"packuswb %%mm5, %%mm5\n" |
"paddw %%mm2, %%mm0\n" // Lum4 +green |
"packuswb %%mm6, %%mm6\n" |
"punpcklbw %%mm4, %%mm4\n" |
"punpcklbw %%mm5, %%mm5\n" |
"punpcklbw %%mm6, %%mm6\n" |
"psllw $3, %%mm5\n" // GREEN 3 |
"pand _MMX_red565, %%mm4\n" |
"psraw $6, %%mm3\n" // psr 6 |
"psraw $6, %%mm0\n" |
"pand _MMX_red565, %%mm6\n" // BLUE |
"pand _MMX_grn565, %%mm5\n" |
"psrlw $11, %%mm6\n" // BLUE 3 |
"por %%mm5, %%mm4\n" |
"psraw $6, %%mm7\n" |
"por %%mm6, %%mm4\n" |
"packuswb %%mm3, %%mm3\n" |
"packuswb %%mm0, %%mm0\n" |
"packuswb %%mm7, %%mm7\n" |
"punpcklbw %%mm3, %%mm3\n" |
"punpcklbw %%mm0, %%mm0\n" |
"punpcklbw %%mm7, %%mm7\n" |
"pand _MMX_red565, %%mm3\n" |
"pand _MMX_red565, %%mm7\n" // BLUE |
"psllw $3, %%mm0\n" // GREEN 4 |
"psrlw $11, %%mm7\n" |
"pand _MMX_grn565, %%mm0\n" |
"por %%mm7, %%mm3\n" |
"por %%mm0, %%mm3\n" |
"movq %%mm4, %%mm5\n" |
"punpcklwd %%mm3, %%mm4\n" |
"punpckhwd %%mm3, %%mm5\n" |
"movq %%mm4, (%5)\n" |
"movq %%mm5, 8(%5)\n" |
"addl $8, %6\n" |
"addl $8, %2\n" |
"addl $4, %%ebx\n" |
"addl $4, %1\n" |
"cmpl %4, %6\n" |
"leal 16(%3), %3\n" |
"leal 16(%5),%5\n" // row2+16 |
"jl 1b\n" |
"addl %4, %2\n" // lum += cols |
"addl %8, %3\n" // row1+= mod |
"addl %8, %5\n" // row2+= mod |
"movl $0, %6\n" // x=0 |
"cmpl %7, %2\n" |
"jl 1b\n" |
"emms\n" |
"popl %%ebx\n" |
: |
:"m" (cr), "r"(cb),"r"(lum), |
"r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod) |
: "%ebx" |
); |
} |
#endif /* GCC i386 inline assembly */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_yuv_sw.c |
---|
0,0 → 1,1316 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_yuv_sw.c,v 1.3 2001/04/27 20:25:25 hercules Exp $"; |
#endif |
/* This is the software implementation of the YUV video overlay support */ |
/* This code was derived from code carrying the following copyright notices: |
* Copyright (c) 1995 The Regents of the University of California. |
* All rights reserved. |
* |
* Permission to use, copy, modify, and distribute this software and its |
* documentation for any purpose, without fee, and without written agreement is |
* hereby granted, provided that the above copyright notice and the following |
* two paragraphs appear in all copies of this software. |
* |
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR |
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF |
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* |
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO |
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
* Copyright (c) 1995 Erik Corry |
* All rights reserved. |
* |
* Permission to use, copy, modify, and distribute this software and its |
* documentation for any purpose, without fee, and without written agreement is |
* hereby granted, provided that the above copyright notice and the following |
* two paragraphs appear in all copies of this software. |
* |
* IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, |
* SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF |
* THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED |
* OF THE POSSIBILITY OF SUCH DAMAGE. |
* |
* ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
* PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" |
* BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, |
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
* Portions of this software Copyright (c) 1995 Brown University. |
* All rights reserved. |
* |
* Permission to use, copy, modify, and distribute this software and its |
* documentation for any purpose, without fee, and without written agreement |
* is hereby granted, provided that the above copyright notice and the |
* following two paragraphs appear in all copies of this software. |
* |
* IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR |
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN |
* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* |
* BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
* PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" |
* BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, |
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
*/ |
#include <stdlib.h> |
#include <string.h> |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_stretch_c.h" |
#include "SDL_yuvfuncs.h" |
#include "SDL_yuv_sw_c.h" |
/* Function to check the CPU flags */ |
#define MMX_CPU 0x800000 |
#ifdef USE_ASMBLIT |
#define CPU_Flags() Hermes_X86_CPU() |
#else |
#define CPU_Flags() 0L |
#endif |
#ifdef USE_ASMBLIT |
#define X86_ASSEMBLER |
#define HermesConverterInterface void |
#define HermesClearInterface void |
#define STACKCALL |
typedef Uint32 int32; |
#include "HeadX86.h" |
#endif |
/* The functions used to manipulate software video overlays */ |
static struct private_yuvhwfuncs sw_yuvfuncs = { |
SDL_LockYUV_SW, |
SDL_UnlockYUV_SW, |
SDL_DisplayYUV_SW, |
SDL_FreeYUV_SW |
}; |
/* RGB conversion lookup tables */ |
struct private_yuvhwdata { |
SDL_Surface *stretch; |
SDL_Surface *display; |
Uint8 *pixels; |
int *colortab; |
Uint32 *rgb_2_pix; |
void (*Display1X)(int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ); |
void (*Display2X)(int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ); |
/* These are just so we don't have to allocate them separately */ |
Uint16 pitches[3]; |
Uint8 *planes[3]; |
}; |
/* The colorspace conversion functions */ |
extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ); |
extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ); |
static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned short* row1; |
unsigned short* row2; |
unsigned char* lum2; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
row1 = (unsigned short*) out; |
row2 = row1 + cols + mod; |
lum2 = lum + cols; |
mod += cols + mod; |
y = rows / 2; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
++cr; ++cb; |
L = *lum++; |
*row1++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
L = *lum++; |
*row1++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
/* Now, do second row. */ |
L = *lum2++; |
*row2++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
L = *lum2++; |
*row2++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
} |
/* |
* These values are at the start of the next line, (due |
* to the ++'s above),but they need to be at the start |
* of the line after that. |
*/ |
lum += cols; |
lum2 += cols; |
row1 += mod; |
row2 += mod; |
} |
} |
static void Color24DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int value; |
unsigned char* row1; |
unsigned char* row2; |
unsigned char* lum2; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
row1 = out; |
row2 = row1 + cols*3 + mod*3; |
lum2 = lum + cols; |
mod += cols + mod; |
mod *= 3; |
y = rows / 2; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
++cr; ++cb; |
L = *lum++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
*row1++ = (value ) & 0xFF; |
*row1++ = (value >> 8) & 0xFF; |
*row1++ = (value >> 16) & 0xFF; |
L = *lum++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
*row1++ = (value ) & 0xFF; |
*row1++ = (value >> 8) & 0xFF; |
*row1++ = (value >> 16) & 0xFF; |
/* Now, do second row. */ |
L = *lum2++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
*row2++ = (value ) & 0xFF; |
*row2++ = (value >> 8) & 0xFF; |
*row2++ = (value >> 16) & 0xFF; |
L = *lum2++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
*row2++ = (value ) & 0xFF; |
*row2++ = (value >> 8) & 0xFF; |
*row2++ = (value >> 16) & 0xFF; |
} |
/* |
* These values are at the start of the next line, (due |
* to the ++'s above),but they need to be at the start |
* of the line after that. |
*/ |
lum += cols; |
lum2 += cols; |
row1 += mod; |
row2 += mod; |
} |
} |
static void Color32DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int* row1; |
unsigned int* row2; |
unsigned char* lum2; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
row1 = (unsigned int*) out; |
row2 = row1 + cols + mod; |
lum2 = lum + cols; |
mod += cols + mod; |
y = rows / 2; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
++cr; ++cb; |
L = *lum++; |
*row1++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
L = *lum++; |
*row1++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
/* Now, do second row. */ |
L = *lum2++; |
*row2++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
L = *lum2++; |
*row2++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
} |
/* |
* These values are at the start of the next line, (due |
* to the ++'s above),but they need to be at the start |
* of the line after that. |
*/ |
lum += cols; |
lum2 += cols; |
row1 += mod; |
row2 += mod; |
} |
} |
/* |
* In this function I make use of a nasty trick. The tables have the lower |
* 16 bits replicated in the upper 16. This means I can write ints and get |
* the horisontal doubling for free (almost). |
*/ |
static void Color16DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int* row1 = (unsigned int*) out; |
const int next_row = cols+(mod/2); |
unsigned int* row2 = row1 + 2*next_row; |
unsigned char* lum2; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
lum2 = lum + cols; |
mod = (next_row * 3) + (mod/2); |
y = rows / 2; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
++cr; ++cb; |
L = *lum++; |
row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row1++; |
L = *lum++; |
row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row1++; |
/* Now, do second row. */ |
L = *lum2++; |
row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row2++; |
L = *lum2++; |
row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row2++; |
} |
/* |
* These values are at the start of the next line, (due |
* to the ++'s above),but they need to be at the start |
* of the line after that. |
*/ |
lum += cols; |
lum2 += cols; |
row1 += mod; |
row2 += mod; |
} |
} |
static void Color24DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int value; |
unsigned char* row1 = out; |
const int next_row = (cols*2 + mod) * 3; |
unsigned char* row2 = row1 + 2*next_row; |
unsigned char* lum2; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
lum2 = lum + cols; |
mod = next_row*3 + mod*3; |
y = rows / 2; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
++cr; ++cb; |
L = *lum++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] = |
(value ) & 0xFF; |
row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] = |
(value >> 8) & 0xFF; |
row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] = |
(value >> 16) & 0xFF; |
row1 += 2*3; |
L = *lum++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] = |
(value ) & 0xFF; |
row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] = |
(value >> 8) & 0xFF; |
row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] = |
(value >> 16) & 0xFF; |
row1 += 2*3; |
/* Now, do second row. */ |
L = *lum2++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] = |
(value ) & 0xFF; |
row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] = |
(value >> 8) & 0xFF; |
row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] = |
(value >> 16) & 0xFF; |
row2 += 2*3; |
L = *lum2++; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] = |
(value ) & 0xFF; |
row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] = |
(value >> 8) & 0xFF; |
row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] = |
(value >> 16) & 0xFF; |
row2 += 2*3; |
} |
/* |
* These values are at the start of the next line, (due |
* to the ++'s above),but they need to be at the start |
* of the line after that. |
*/ |
lum += cols; |
lum2 += cols; |
row1 += mod; |
row2 += mod; |
} |
} |
static void Color32DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int* row1 = (unsigned int*) out; |
const int next_row = cols*2+mod; |
unsigned int* row2 = row1 + 2*next_row; |
unsigned char* lum2; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
lum2 = lum + cols; |
mod = (next_row * 3) + mod; |
y = rows / 2; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
++cr; ++cb; |
L = *lum++; |
row1[0] = row1[1] = row1[next_row] = row1[next_row+1] = |
(rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row1 += 2; |
L = *lum++; |
row1[0] = row1[1] = row1[next_row] = row1[next_row+1] = |
(rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row1 += 2; |
/* Now, do second row. */ |
L = *lum2++; |
row2[0] = row2[1] = row2[next_row] = row2[next_row+1] = |
(rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row2 += 2; |
L = *lum2++; |
row2[0] = row2[1] = row2[next_row] = row2[next_row+1] = |
(rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row2 += 2; |
} |
/* |
* These values are at the start of the next line, (due |
* to the ++'s above),but they need to be at the start |
* of the line after that. |
*/ |
lum += cols; |
lum2 += cols; |
row1 += mod; |
row2 += mod; |
} |
} |
static void Color16DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned short* row; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
row = (unsigned short*) out; |
y = rows; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
cr += 4; cb += 4; |
L = *lum; lum += 2; |
*row++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
L = *lum; lum += 2; |
*row++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
} |
row += mod; |
} |
} |
static void Color24DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int value; |
unsigned char* row; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
row = (unsigned char*) out; |
mod *= 3; |
y = rows; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
cr += 4; cb += 4; |
L = *lum; lum += 2; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
*row++ = (value ) & 0xFF; |
*row++ = (value >> 8) & 0xFF; |
*row++ = (value >> 16) & 0xFF; |
L = *lum; lum += 2; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
*row++ = (value ) & 0xFF; |
*row++ = (value >> 8) & 0xFF; |
*row++ = (value >> 16) & 0xFF; |
} |
row += mod; |
} |
} |
static void Color32DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int* row; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
row = (unsigned int*) out; |
y = rows; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
cr += 4; cb += 4; |
L = *lum; lum += 2; |
*row++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
L = *lum; lum += 2; |
*row++ = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
} |
row += mod; |
} |
} |
/* |
* In this function I make use of a nasty trick. The tables have the lower |
* 16 bits replicated in the upper 16. This means I can write ints and get |
* the horisontal doubling for free (almost). |
*/ |
static void Color16DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int* row = (unsigned int*) out; |
const int next_row = cols+(mod/2); |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
y = rows; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
cr += 4; cb += 4; |
L = *lum; lum += 2; |
row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row++; |
L = *lum; lum += 2; |
row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row++; |
} |
row += next_row; |
} |
} |
static void Color24DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int value; |
unsigned char* row = out; |
const int next_row = (cols*2 + mod) * 3; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
y = rows; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
cr += 4; cb += 4; |
L = *lum; lum += 2; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] = |
(value ) & 0xFF; |
row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] = |
(value >> 8) & 0xFF; |
row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] = |
(value >> 16) & 0xFF; |
row += 2*3; |
L = *lum; lum += 2; |
value = (rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] = |
(value ) & 0xFF; |
row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] = |
(value >> 8) & 0xFF; |
row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] = |
(value >> 16) & 0xFF; |
row += 2*3; |
} |
row += next_row; |
} |
} |
static void Color32DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix, |
unsigned char *lum, unsigned char *cr, |
unsigned char *cb, unsigned char *out, |
int rows, int cols, int mod ) |
{ |
unsigned int* row = (unsigned int*) out; |
const int next_row = cols*2+mod; |
int x, y; |
int cr_r; |
int crb_g; |
int cb_b; |
int cols_2 = cols / 2; |
mod+=mod; |
y = rows; |
while( y-- ) |
{ |
x = cols_2; |
while( x-- ) |
{ |
register int L; |
cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; |
crb_g = 1*768+256 + colortab[ *cr + 1*256 ] |
+ colortab[ *cb + 2*256 ]; |
cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; |
cr += 4; cb += 4; |
L = *lum; lum += 2; |
row[0] = row[1] = row[next_row] = row[next_row+1] = |
(rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row += 2; |
L = *lum; lum += 2; |
row[0] = row[1] = row[next_row] = row[next_row+1] = |
(rgb_2_pix[ L + cr_r ] | |
rgb_2_pix[ L + crb_g ] | |
rgb_2_pix[ L + cb_b ]); |
row += 2; |
} |
row += next_row; |
} |
} |
/* |
* How many 1 bits are there in the Uint32. |
* Low performance, do not call often. |
*/ |
static int number_of_bits_set( Uint32 a ) |
{ |
if(!a) return 0; |
if(a & 1) return 1 + number_of_bits_set(a >> 1); |
return(number_of_bits_set(a >> 1)); |
} |
/* |
* How many 0 bits are there at least significant end of Uint32. |
* Low performance, do not call often. |
*/ |
static int free_bits_at_bottom( Uint32 a ) |
{ |
/* assume char is 8 bits */ |
if(!a) return sizeof(Uint32) * 8; |
if(((Sint32)a) & 1l) return 0; |
return 1 + free_bits_at_bottom ( a >> 1); |
} |
SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display) |
{ |
SDL_Overlay *overlay; |
struct private_yuvhwdata *swdata; |
int *Cr_r_tab; |
int *Cr_g_tab; |
int *Cb_g_tab; |
int *Cb_b_tab; |
Uint32 *r_2_pix_alloc; |
Uint32 *g_2_pix_alloc; |
Uint32 *b_2_pix_alloc; |
int i, cpu_mmx; |
int CR, CB; |
Uint32 Rmask, Gmask, Bmask; |
/* Only RGB packed pixel conversion supported */ |
if ( (display->format->BytesPerPixel != 2) && |
(display->format->BytesPerPixel != 3) && |
(display->format->BytesPerPixel != 4) ) { |
SDL_SetError("Can't use YUV data on non 16/24/32 bit surfaces"); |
return(NULL); |
} |
/* Verify that we support the format */ |
switch (format) { |
case SDL_YV12_OVERLAY: |
case SDL_IYUV_OVERLAY: |
case SDL_YUY2_OVERLAY: |
case SDL_UYVY_OVERLAY: |
case SDL_YVYU_OVERLAY: |
break; |
default: |
SDL_SetError("Unsupported YUV format"); |
return(NULL); |
} |
/* Create the overlay structure */ |
overlay = (SDL_Overlay *)malloc(sizeof *overlay); |
if ( overlay == NULL ) { |
SDL_OutOfMemory(); |
return(NULL); |
} |
memset(overlay, 0, (sizeof *overlay)); |
/* Fill in the basic members */ |
overlay->format = format; |
overlay->w = width; |
overlay->h = height; |
/* Set up the YUV surface function structure */ |
overlay->hwfuncs = &sw_yuvfuncs; |
/* Create the pixel data and lookup tables */ |
swdata = (struct private_yuvhwdata *)malloc(sizeof *swdata); |
overlay->hwdata = swdata; |
if ( swdata == NULL ) { |
SDL_OutOfMemory(); |
SDL_FreeYUVOverlay(overlay); |
return(NULL); |
} |
swdata->stretch = NULL; |
swdata->display = display; |
swdata->pixels = (Uint8 *) malloc(width*height*2); |
swdata->colortab = (int *)malloc(4*256*sizeof(int)); |
Cr_r_tab = &swdata->colortab[0*256]; |
Cr_g_tab = &swdata->colortab[1*256]; |
Cb_g_tab = &swdata->colortab[2*256]; |
Cb_b_tab = &swdata->colortab[3*256]; |
swdata->rgb_2_pix = (Uint32 *)malloc(3*768*sizeof(Uint32)); |
r_2_pix_alloc = &swdata->rgb_2_pix[0*768]; |
g_2_pix_alloc = &swdata->rgb_2_pix[1*768]; |
b_2_pix_alloc = &swdata->rgb_2_pix[2*768]; |
if ( ! swdata->pixels || ! swdata->colortab || ! swdata->rgb_2_pix ) { |
SDL_OutOfMemory(); |
SDL_FreeYUVOverlay(overlay); |
return(NULL); |
} |
/* Generate the tables for the display surface */ |
for (i=0; i<256; i++) { |
/* Gamma correction (luminescence table) and chroma correction |
would be done here. See the Berkeley mpeg_play sources. |
*/ |
CB = CR = (i-128); |
Cr_r_tab[i] = (int) ( (0.419/0.299) * CR); |
Cr_g_tab[i] = (int) (-(0.299/0.419) * CR); |
Cb_g_tab[i] = (int) (-(0.114/0.331) * CB); |
Cb_b_tab[i] = (int) ( (0.587/0.331) * CB); |
} |
/* |
* Set up entries 0-255 in rgb-to-pixel value tables. |
*/ |
Rmask = display->format->Rmask; |
Gmask = display->format->Gmask; |
Bmask = display->format->Bmask; |
for ( i=0; i<256; ++i ) { |
r_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Rmask)); |
r_2_pix_alloc[i+256] <<= free_bits_at_bottom(Rmask); |
g_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Gmask)); |
g_2_pix_alloc[i+256] <<= free_bits_at_bottom(Gmask); |
b_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Bmask)); |
b_2_pix_alloc[i+256] <<= free_bits_at_bottom(Bmask); |
} |
/* |
* If we have 16-bit output depth, then we double the value |
* in the top word. This means that we can write out both |
* pixels in the pixel doubling mode with one op. It is |
* harmless in the normal case as storing a 32-bit value |
* through a short pointer will lose the top bits anyway. |
*/ |
if( display->format->BytesPerPixel == 2 ) { |
for ( i=0; i<256; ++i ) { |
r_2_pix_alloc[i+256] |= (r_2_pix_alloc[i+256]) << 16; |
g_2_pix_alloc[i+256] |= (g_2_pix_alloc[i+256]) << 16; |
b_2_pix_alloc[i+256] |= (b_2_pix_alloc[i+256]) << 16; |
} |
} |
/* |
* Spread out the values we have to the rest of the array so that |
* we do not need to check for overflow. |
*/ |
for ( i=0; i<256; ++i ) { |
r_2_pix_alloc[i] = r_2_pix_alloc[256]; |
r_2_pix_alloc[i+512] = r_2_pix_alloc[511]; |
g_2_pix_alloc[i] = g_2_pix_alloc[256]; |
g_2_pix_alloc[i+512] = g_2_pix_alloc[511]; |
b_2_pix_alloc[i] = b_2_pix_alloc[256]; |
b_2_pix_alloc[i+512] = b_2_pix_alloc[511]; |
} |
/* You have chosen wisely... */ |
switch (format) { |
case SDL_YV12_OVERLAY: |
case SDL_IYUV_OVERLAY: |
cpu_mmx = CPU_Flags() & MMX_CPU; |
if ( display->format->BytesPerPixel == 2 ) { |
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) |
/* inline assembly functions */ |
if ( cpu_mmx && (Rmask == 0xF800) && |
(Gmask == 0x07E0) && |
(Bmask == 0x001F) && |
(width & 15) == 0) { |
/*printf("Using MMX 16-bit 565 dither\n");*/ |
swdata->Display1X = Color565DitherYV12MMX1X; |
} else { |
/*printf("Using C 16-bit dither\n");*/ |
swdata->Display1X = Color16DitherYV12Mod1X; |
} |
#else |
swdata->Display1X = Color16DitherYV12Mod1X; |
#endif |
swdata->Display2X = Color16DitherYV12Mod2X; |
} |
if ( display->format->BytesPerPixel == 3 ) { |
swdata->Display1X = Color24DitherYV12Mod1X; |
swdata->Display2X = Color24DitherYV12Mod2X; |
} |
if ( display->format->BytesPerPixel == 4 ) { |
#if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) |
/* inline assembly functions */ |
if ( cpu_mmx && (Rmask == 0x00FF0000) && |
(Gmask == 0x0000FF00) && |
(Bmask == 0x000000FF) && |
(width & 15) == 0) { |
/*printf("Using MMX 32-bit dither\n");*/ |
swdata->Display1X = ColorRGBDitherYV12MMX1X; |
} else { |
/*printf("Using C 32-bit dither\n");*/ |
swdata->Display1X = Color32DitherYV12Mod1X; |
} |
#else |
swdata->Display1X = Color32DitherYV12Mod1X; |
#endif |
swdata->Display2X = Color32DitherYV12Mod2X; |
} |
break; |
case SDL_YUY2_OVERLAY: |
case SDL_UYVY_OVERLAY: |
case SDL_YVYU_OVERLAY: |
if ( display->format->BytesPerPixel == 2 ) { |
swdata->Display1X = Color16DitherYUY2Mod1X; |
swdata->Display2X = Color16DitherYUY2Mod2X; |
} |
if ( display->format->BytesPerPixel == 3 ) { |
swdata->Display1X = Color24DitherYUY2Mod1X; |
swdata->Display2X = Color24DitherYUY2Mod2X; |
} |
if ( display->format->BytesPerPixel == 4 ) { |
swdata->Display1X = Color32DitherYUY2Mod1X; |
swdata->Display2X = Color32DitherYUY2Mod2X; |
} |
break; |
default: |
/* We should never get here (caught above) */ |
break; |
} |
/* Find the pitch and offset values for the overlay */ |
overlay->pitches = swdata->pitches; |
overlay->pixels = swdata->planes; |
switch (format) { |
case SDL_YV12_OVERLAY: |
case SDL_IYUV_OVERLAY: |
overlay->pitches[0] = overlay->w; |
overlay->pitches[1] = overlay->pitches[0] / 2; |
overlay->pitches[2] = overlay->pitches[0] / 2; |
overlay->pixels[0] = swdata->pixels; |
overlay->pixels[1] = overlay->pixels[0] + |
overlay->pitches[0] * overlay->h; |
overlay->pixels[2] = overlay->pixels[1] + |
overlay->pitches[1] * overlay->h / 2; |
overlay->planes = 3; |
break; |
case SDL_YUY2_OVERLAY: |
case SDL_UYVY_OVERLAY: |
case SDL_YVYU_OVERLAY: |
overlay->pitches[0] = overlay->w*2; |
overlay->pixels[0] = swdata->pixels; |
overlay->planes = 1; |
break; |
default: |
/* We should never get here (caught above) */ |
break; |
} |
/* We're all done.. */ |
return(overlay); |
} |
int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay) |
{ |
return(0); |
} |
void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay) |
{ |
return; |
} |
int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect) |
{ |
struct private_yuvhwdata *swdata; |
SDL_Surface *stretch; |
SDL_Surface *display; |
int scale_2x; |
Uint8 *lum, *Cr, *Cb; |
Uint8 *dst; |
int mod; |
swdata = overlay->hwdata; |
scale_2x = 0; |
stretch = 0; |
if ( (overlay->w != dstrect->w) || (overlay->h != dstrect->h) ) { |
if ( (dstrect->w == 2*overlay->w) && |
(dstrect->h == 2*overlay->h) ) { |
scale_2x = 1; |
} else { |
if ( ! swdata->stretch ) { |
display = swdata->display; |
swdata->stretch = SDL_CreateRGBSurface( |
SDL_SWSURFACE, |
overlay->w, overlay->h, |
display->format->BitsPerPixel, |
display->format->Rmask, |
display->format->Gmask, |
display->format->Bmask, 0); |
if ( ! swdata->stretch ) { |
return(-1); |
} |
} |
stretch = swdata->stretch; |
} |
} |
if ( stretch ) { |
display = stretch; |
} else { |
display = swdata->display; |
} |
switch (overlay->format) { |
case SDL_YV12_OVERLAY: |
lum = overlay->pixels[0]; |
Cr = overlay->pixels[1]; |
Cb = overlay->pixels[2]; |
break; |
case SDL_IYUV_OVERLAY: |
lum = overlay->pixels[0]; |
Cr = overlay->pixels[2]; |
Cb = overlay->pixels[1]; |
break; |
case SDL_YUY2_OVERLAY: |
lum = overlay->pixels[0]; |
Cr = lum + 3; |
Cb = lum + 1; |
break; |
case SDL_UYVY_OVERLAY: |
lum = overlay->pixels[0]+1; |
Cr = lum + 1; |
Cb = lum - 1; |
break; |
case SDL_YVYU_OVERLAY: |
lum = overlay->pixels[0]; |
Cr = lum + 1; |
Cb = lum + 3; |
break; |
default: |
SDL_SetError("Unsupported YUV format in blit (??)"); |
return(-1); |
} |
if ( SDL_MUSTLOCK(display) ) { |
if ( SDL_LockSurface(display) < 0 ) { |
return(-1); |
} |
} |
if ( stretch ) { |
dst = (Uint8 *)stretch->pixels; |
} else { |
dst = (Uint8 *)display->pixels |
+ dstrect->x * display->format->BytesPerPixel |
+ dstrect->y * display->pitch; |
} |
mod = (display->pitch / display->format->BytesPerPixel); |
if ( scale_2x ) { |
mod -= (overlay->w * 2); |
swdata->Display2X(swdata->colortab, swdata->rgb_2_pix, |
lum, Cr, Cb, dst, overlay->h, overlay->w,mod); |
} else { |
mod -= overlay->w; |
swdata->Display1X(swdata->colortab, swdata->rgb_2_pix, |
lum, Cr, Cb, dst, overlay->h, overlay->w,mod); |
} |
if ( SDL_MUSTLOCK(display) ) { |
SDL_UnlockSurface(display); |
} |
if ( stretch ) { |
display = swdata->display; |
SDL_SoftStretch(stretch, NULL, display, dstrect); |
} |
SDL_UpdateRects(display, 1, dstrect); |
return(0); |
} |
void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay) |
{ |
struct private_yuvhwdata *swdata; |
swdata = overlay->hwdata; |
if ( swdata ) { |
if ( swdata->stretch ) { |
SDL_FreeSurface(swdata->stretch); |
} |
if ( swdata->pixels ) { |
free(swdata->pixels); |
} |
if ( swdata->colortab ) { |
free(swdata->colortab); |
} |
if ( swdata->rgb_2_pix ) { |
free(swdata->rgb_2_pix); |
} |
free(swdata); |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_yuv_sw_c.h |
---|
0,0 → 1,41 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_yuv_sw_c.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
#include "SDL_video.h" |
#include "SDL_sysvideo.h" |
/* This is the software implementation of the YUV video overlay support */ |
extern SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display); |
extern int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay); |
extern void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay); |
extern int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect); |
extern void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay); |
/contrib/sdk/sources/SDL-1.2.2/src/video/SDL_yuvfuncs.h |
---|
0,0 → 1,41 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: SDL_yuvfuncs.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* This is the definition of the YUV video surface function structure */ |
#include "SDL_video.h" |
#include "SDL_sysvideo.h" |
#ifndef _THIS |
#define _THIS SDL_VideoDevice *_this |
#endif |
struct private_yuvhwfuncs { |
int (*Lock)(_THIS, SDL_Overlay *overlay); |
void (*Unlock)(_THIS, SDL_Overlay *overlay); |
int (*Display)(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect); |
void (*FreeHW)(_THIS, SDL_Overlay *overlay); |
}; |
/contrib/sdk/sources/SDL-1.2.2/src/video/blank_cursor.h |
---|
0,0 → 1,38 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: blank_cursor.h,v 1.2 2001/04/26 16:50:18 hercules Exp $"; |
#endif |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
* A default blank 8x8 cursor */ |
#define BLANK_CWIDTH 8 |
#define BLANK_CHEIGHT 8 |
#define BLANK_CHOTX 0 |
#define BLANK_CHOTY 0 |
static unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
static unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
/contrib/sdk/sources/SDL-1.2.2/src/video/default_cursor.h |
---|
0,0 → 1,121 |
/* |
SDL - Simple DirectMedia Layer |
Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
This library is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public |
License as published by the Free Software Foundation; either |
version 2 of the License, or (at your option) any later version. |
This library is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
You should have received a copy of the GNU Library General Public |
License along with this library; if not, write to the Free |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Sam Lantinga |
slouken@devolution.com |
*/ |
#ifdef SAVE_RCSID |
static char rcsid = |
"@(#) $Id: default_cursor.h,v 1.3 2001/05/10 20:13:28 hercules Exp $"; |
#endif |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
* Default cursor - it happens to be the Mac cursor, but could be anything */ |
#define DEFAULT_CWIDTH 16 |
#define DEFAULT_CHEIGHT 16 |
#define DEFAULT_CHOTX 0 |
#define DEFAULT_CHOTY 0 |
/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */ |
#define USE_MACOS_CURSOR |
#ifdef USE_MACOS_CURSOR |
static unsigned char default_cdata[] = |
{ |
0x00,0x00, |
0x40,0x00, |
0x60,0x00, |
0x70,0x00, |
0x78,0x00, |
0x7C,0x00, |
0x7E,0x00, |
0x7F,0x00, |
0x7F,0x80, |
0x7C,0x00, |
0x6C,0x00, |
0x46,0x00, |
0x06,0x00, |
0x03,0x00, |
0x03,0x00, |
0x00,0x00 |
}; |
static unsigned char default_cmask[] = |
{ |
0xC0,0x00, |
0xE0,0x00, |
0xF0,0x00, |
0xF8,0x00, |
0xFC,0x00, |
0xFE,0x00, |
0xFF,0x00, |
0xFF,0x80, |
0xFF,0xC0, |
0xFF,0xE0, |
0xFE,0x00, |
0xEF,0x00, |
0xCF,0x00, |
0x87,0x80, |
0x07,0x80, |
0x03,0x00 |
}; |
#else |
static unsigned char default_cdata[] = |
{ |
0x00,0x00, |
0x40,0x00, |
0x60,0x00, |
0x70,0x00, |
0x78,0x00, |
0x7C,0x00, |
0x7E,0x00, |
0x7F,0x00, |
0x7F,0x80, |
0x7C,0x00, |
0x6C,0x00, |
0x46,0x00, |
0x06,0x00, |
0x03,0x00, |
0x03,0x00, |
0x00,0x00 |
}; |
static unsigned char default_cmask[] = |
{ |
0x40,0x00, |
0xE0,0x00, |
0xF0,0x00, |
0xF8,0x00, |
0xFC,0x00, |
0xFE,0x00, |
0xFF,0x00, |
0xFF,0x80, |
0xFF,0xC0, |
0xFF,0x80, |
0xFE,0x00, |
0xEF,0x00, |
0x4F,0x00, |
0x07,0x80, |
0x07,0x80, |
0x03,0x00 |
}; |
#endif /* TRUE_MACINTOSH_CURSOR */ |
/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetevents.c |
---|
0,0 → 1,244 |
#include<menuet/os.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include "SDL.h" |
#include "SDL_sysevents.h" |
#include "SDL_sysvideo.h" |
#include "SDL_events_c.h" |
#include "SDL_menuetvideo.h" |
extern void MenuetOS_SDL_RepaintWnd(void); |
void MenuetOS_InitOSKeymap(_THIS) |
{ |
__asm__("int $0x40"::"a"(66),"b"(1),"c"(1)); |
} |
#define LSHIFT 1 |
#define RSHIFT 2 |
#define LCTRL 4 |
#define RCTRL 8 |
#define LALT 0x10 |
#define RALT 0x20 |
#define CAPS 0x40 |
#define NUML 0x80 |
#define SCRL 0x100 |
#define SHIFT (LSHIFT+RSHIFT) |
#define CTRL (LCTRL+RCTRL) |
#define ALT (LALT+RALT) |
static SDLMod GetModState(void) |
{ |
unsigned controlstate; |
__asm__("int $0x40":"=a"(controlstate):"a"(66),"b"(3)); |
SDLMod res = 0; |
if (controlstate & LSHIFT) |
res |= KMOD_LSHIFT; |
if (controlstate & RSHIFT) |
res |= KMOD_RSHIFT; |
if (controlstate & LCTRL) |
res |= KMOD_LCTRL; |
if (controlstate & RCTRL) |
res |= KMOD_RCTRL; |
if (controlstate & LALT) |
res |= KMOD_LALT; |
if (controlstate & RALT) |
res |= KMOD_RALT; |
if (controlstate & CAPS) |
res |= KMOD_CAPS; |
if (controlstate & NUML) |
res |= KMOD_NUM; |
return res; |
} |
/*static __u8 scan2ascii(__u8 n,SDLMod mod) |
{ |
__u8 layout[128]; |
int layouttype; |
int bControlLayout = 0; |
if (mod & KMOD_ALT) |
layouttype = 3; |
else if (mod & KMOD_SHIFT) |
layouttype = 2; |
else |
{ |
if (mod & KMOD_CTRL) |
bControlLayout = 1; |
layouttype = 1; |
} |
__asm__("int $0x40" :: "a"(26),"b"(2),"c"(layouttype),"d"(layout)); |
__u8 res = layout[n]; |
if (bControlLayout) |
res -= 0x60; |
return res; |
}*/ |
static SDLKey sdlkeys[0x80] = |
{ |
// 0x0* |
0, SDLK_ESCAPE, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, |
SDLK_7, SDLK_8, SDLK_9, SDLK_0, SDLK_MINUS, SDLK_EQUALS, SDLK_BACKSPACE, SDLK_TAB, |
// 0x1* |
SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i, |
SDLK_o, SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET, SDLK_RETURN, SDLK_LCTRL, SDLK_a, SDLK_s, |
// 0x2* |
SDLK_d, SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, SDLK_SEMICOLON, |
SDLK_QUOTE, SDLK_BACKQUOTE, SDLK_LSHIFT, SDLK_BACKSLASH, SDLK_z, SDLK_x, SDLK_c, SDLK_v, |
// 0x3* |
SDLK_b, SDLK_n, SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_RSHIFT, SDLK_KP_MULTIPLY, |
SDLK_LALT, SDLK_SPACE, SDLK_CAPSLOCK, SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, |
// 0x4* |
SDLK_F6, SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_NUMLOCK, SDLK_SCROLLOCK, SDLK_KP7, |
SDLK_KP8, SDLK_KP9, SDLK_KP_MINUS, SDLK_KP4, SDLK_KP5, SDLK_KP6, SDLK_KP_PLUS, SDLK_KP1, |
// 0x5* |
SDLK_KP2, SDLK_KP3, SDLK_KP0, SDLK_KP_PERIOD, 0, 0, 0, SDLK_F11, |
SDLK_F12, 0, 0, 0, 0, 0, 0, 0, |
// 0x6* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
// 0x7* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0 |
}; |
static SDLKey sdlkeys_shift[0x80] = |
{ |
// 0x0* |
0, SDLK_ESCAPE, SDLK_EXCLAIM, SDLK_AT, SDLK_HASH, SDLK_DOLLAR, '%', SDLK_CARET, |
SDLK_AMPERSAND, SDLK_ASTERISK, SDLK_LEFTPAREN, SDLK_RIGHTPAREN, SDLK_UNDERSCORE, SDLK_PLUS, SDLK_BACKSPACE, SDLK_TAB, |
// 0x1* |
SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i, |
SDLK_o, SDLK_p, '{', '}', SDLK_RETURN, SDLK_LCTRL, SDLK_a, SDLK_s, |
// 0x2* |
SDLK_d, SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, SDLK_COLON, |
SDLK_QUOTEDBL, '~', SDLK_LSHIFT, '|', SDLK_z, SDLK_x, SDLK_c, SDLK_v, |
// 0x3* |
SDLK_b, SDLK_n, SDLK_m, SDLK_LESS, SDLK_GREATER, SDLK_QUESTION, SDLK_RSHIFT, SDLK_KP_MULTIPLY, |
SDLK_LALT, SDLK_SPACE, SDLK_CAPSLOCK, SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, |
// 0x4* |
SDLK_F6, SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_NUMLOCK, SDLK_SCROLLOCK, SDLK_KP7, |
SDLK_KP8, SDLK_KP9, SDLK_KP_MINUS, SDLK_KP4, SDLK_KP5, SDLK_KP6, SDLK_KP_PLUS, SDLK_KP1, |
// 0x5* |
SDLK_KP2, SDLK_KP3, SDLK_KP0, SDLK_KP_PERIOD, 0, 0, 0, SDLK_F11, |
SDLK_F12, 0, 0, 0, 0, 0, 0, 0, |
// 0x6* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
// 0x7* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0 |
}; |
static SDLKey sdlkeys_e0[0x80] = |
{ |
// 0x0* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
// 0x1* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, SDLK_KP_ENTER, SDLK_RCTRL, 0, 0, |
// 0x2* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
// 0x3* |
0, 0, 0, 0, 0, SDLK_KP_DIVIDE, 0, SDLK_PRINT, |
SDLK_RALT, 0, 0, 0, 0, 0, 0, 0, |
// 0x4* |
0, 0, 0, 0, 0, 0, 0, SDLK_HOME, |
SDLK_UP, SDLK_PAGEUP, 0, SDLK_LEFT, 0, SDLK_RIGHT, 0, SDLK_END, |
// 0x5* |
SDLK_DOWN, SDLK_PAGEDOWN, SDLK_INSERT, SDLK_DELETE, 0, 0, 0, 0, |
0, 0, 0, SDLK_LSUPER, SDLK_RSUPER, SDLK_MENU, 0, 0, |
// 0x6* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
// 0x7* |
0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, |
}; |
extern void KolibriOS_CheckMouseMode(_THIS); |
void MenuetOS_PumpEvents(_THIS) |
{ |
int i; |
SDL_keysym key; |
static int ext_code=0; |
static __u8 old_mode=0; |
for (;;) { |
i=__menuet__check_for_event(); |
switch(i) |
{ |
case 0: |
return; |
case 1: |
MenuetOS_SDL_RepaintWnd(); |
break; |
case 2: |
key.scancode = __menuet__getkey(); |
if (key.scancode == 0xE0 || key.scancode == 0xE1) |
{ext_code=key.scancode;break;} |
if (ext_code == 0xE1 && (key.scancode & 0x7F) == 0x1D) break; |
if (ext_code == 0xE1 && key.scancode == 0xC5) {ext_code=0;break;} |
key.mod = GetModState(); |
if (ext_code == 0xE1) key.mod &= ~KMOD_CTRL; |
if (!(key.scancode&0x80)) |
old_mode = key.mod; |
SDL_SetModState(key.mod); |
int code = (key.scancode & 0x80) ? SDL_RELEASED : SDL_PRESSED; |
key.scancode &= 0x7F; |
// key.sym = scan2ascii(key.scancode,key.mod); |
if (ext_code == 0xE1 && key.scancode == 0x45) |
key.sym = SDLK_PAUSE; |
else if (ext_code == 0xE0) |
key.sym = sdlkeys_e0[key.scancode]; |
else if (old_mode & KMOD_SHIFT) |
key.sym = sdlkeys_shift[key.scancode]; |
else |
key.sym = sdlkeys[key.scancode]; |
ext_code = 0; |
if (!key.sym) break; |
SDL_PrivateKeyboard(code,&key); |
break; |
case 3: |
if(__menuet__get_button_id()==1) exit(0); |
break; |
case 6: { |
int __tmp,mx,my; |
static int oldmousestate = 0; |
__asm__("int $0x40":"=a"(__tmp):"a"(37),"b"(1)); |
mx=(__tmp>>16); |
my=(__tmp&0xffff); |
if(mx>=0 && mx<this->hidden->win_size_x && |
my>=0 && my<this->hidden->win_size_y || this->input_grab != SDL_GRAB_OFF) |
{ |
if (this->input_grab != SDL_GRAB_OFF) |
{ |
int dx=mx-this->hidden->win_size_x/2; |
int dy=my-this->hidden->win_size_y/2; |
if (dx||dy) |
{ |
SDL_PrivateMouseMotion(0,1,dx,dy); |
KolibriOS_CheckMouseMode(this); |
} |
} |
else |
SDL_PrivateMouseMotion(0,0,mx,my); |
__asm__("int $0x40":"=a"(__tmp):"a"(37),"b"(2)); |
if ((__tmp^oldmousestate)&1) { |
if(__tmp&1) |
{ |
SDL_PrivateMouseButton(SDL_PRESSED,SDL_BUTTON_LMASK,0,0); |
} else { |
SDL_PrivateMouseButton(SDL_RELEASED,SDL_BUTTON_LMASK,0,0); |
} } |
if ((__tmp^oldmousestate)&2) { |
if(__tmp&2) |
{ |
SDL_PrivateMouseButton(SDL_PRESSED,SDL_BUTTON_RMASK,0,0); |
} else { |
SDL_PrivateMouseButton(SDL_RELEASED,SDL_BUTTON_RMASK,0,0); |
} } |
oldmousestate = __tmp; |
} |
} |
} |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetvideo.c |
---|
0,0 → 1,324 |
#include <stdlib.h> |
#include <stdio.h> |
#include <menuet/os.h> |
#include "SDL.h" |
#include "SDL_error.h" |
#include "SDL_video.h" |
#include "SDL_mouse.h" |
#include "SDL_sysvideo.h" |
#include "SDL_pixels_c.h" |
#include "SDL_events_c.h" |
#include "SDL_menuetvideo.h" |
#include <string.h> |
static SDL_VideoDevice * vm_suf=NULL; |
static int was_initialized=0; |
static int has_null_cursor=0; |
static int null_cursor; |
inline int get_skinh(void) |
{ |
int res; |
__asm__ ("int $0x40" : "=a"(res) : "a"(48),"b"(4)); |
return res; |
} |
//#define KEEP_OBSOLETE_STYLE3 |
#ifdef KEEP_OBSOLETE_STYLE3 |
static int IsStyle4Available=0; |
#endif |
void MenuetOS_SDL_RepaintWnd(void) |
{ |
__menuet__window_redraw(1); |
__menuet__define_window(1,1,vm_suf->hidden->win_size_x+9,vm_suf->hidden->win_size_y+get_skinh()+4, |
#ifdef KEEP_OBSOLETE_STYLE3 |
IsStyle4Available?0x34000000:0x33000000 |
#else |
0x34000000 |
#endif |
,0,(int)vm_suf->hidden->__title); |
if(vm_suf && vm_suf->hidden->__video_buffer) |
__menuet__putimage(0,0, |
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y, |
vm_suf->hidden->__video_buffer); |
__menuet__window_redraw(2); |
} |
static int MenuetOS_AllocHWSurface(_THIS,SDL_Surface * surface) |
{ |
return -1; |
} |
static void MenuetOS_FreeHWSurface(_THIS,SDL_Surface * surface) |
{ |
} |
static int MenuetOS_LockHWSurface(_THIS,SDL_Surface * surface) |
{ |
return 0; |
} |
static void MenuetOS_UnlockHWSurface(_THIS,SDL_Surface * surface) |
{ |
} |
static void MenuetOS_DirectUpdate(_THIS,int numrects,SDL_Rect * rects) |
{ |
if(numrects) |
{ |
__menuet__putimage(0,0, |
vm_suf->hidden->win_size_x,vm_suf->hidden->win_size_y, |
this->hidden->__video_buffer); |
} |
} |
int MenuetOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) |
{ |
return 0; |
} |
void MenuetOS_VideoQuit(_THIS) |
{ |
if (has_null_cursor) |
{ |
__asm__("int $0x40"::"a"(37),"b"(6),"c"(null_cursor)); |
has_null_cursor = 0; |
} |
} |
void MenuetOS_FinalQuit(void) |
{ |
} |
void MenuetOS_SetCaption(_THIS,const char * title,const char * icon) |
{ |
this->hidden->__title=(char *)title; |
if(was_initialized) __asm__("int $0x40"::"a"(71),"b"(1),"c"(title)); |
} |
SDL_Surface * MenuetOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags) |
{ |
int ly; |
char * lx; |
if(bpp!=24) return NULL; |
current->flags=flags; |
current->w=width; |
current->h=height; |
current->pitch=width*(bpp>>3); |
current->pixels=this->hidden->__video_buffer=realloc(this->hidden->__video_buffer, |
current->pitch*current->h); |
this->hidden->__lines=(unsigned char **)realloc(this->hidden->__lines, |
sizeof(unsigned char *)*current->h); |
for(ly=0,lx=current->pixels;ly<current->h;ly++,lx+=current->pitch) |
this->hidden->__lines[ly]=lx; |
this->UpdateRects=MenuetOS_DirectUpdate; |
this->hidden->win_size_x=width; |
this->hidden->win_size_y=height; |
vm_suf=this; |
if (was_initialized) |
{ |
unsigned newheight = height+get_skinh()+4; |
unsigned newwidth = width+9; |
__asm__("int $0x40"::"a"(67),"b"(-1),"c"(-1),"d"(newwidth),"S"(newheight)); |
} |
else |
{ |
__menuet__set_bitfield_for_wanted_events(0x27); |
was_initialized=1; |
MenuetOS_SDL_RepaintWnd(); |
} |
return current; |
} |
/*static SDL_Rect video_mode[4]; |
static SDL_Rect * SDL_modelist[4]={NULL,NULL,NULL,NULL};*/ |
static SDL_Rect ** MenuetOS_ListModes(_THIS,SDL_PixelFormat * fmt,Uint32 flags) |
{ |
// return (&SDL_modelist[((fmt->BitsPerPixel+7)/8)-1]); |
if (fmt->BitsPerPixel==24) |
return (SDL_Rect**)-1; |
else |
return NULL; |
} |
static int MenuetOS_Available(void) |
{ |
return 1; |
} |
static void MenuetOS_DeleteDevice(_THIS) |
{ |
// free(this->hidden->__video_buffer); // it will be freed as current->pixels |
free(this->hidden->__lines); |
} |
static int MenuetOS_VideoInit(_THIS,SDL_PixelFormat * vformat) |
{ |
#ifdef KEEP_OBSOLETE_STYLE3 |
char buf[16]; |
__asm__("int $0x40"::"a"(18),"b"(13),"c"(buf)); |
if (buf[5]=='K' && buf[6]=='o' && buf[7]=='l' && buf[8]=='i') |
/* kernels up to 0.7.0.0 do not support style 4 */; |
else if (*(unsigned*)(buf+5) >= 549) |
/* window style 4 was introduced in revision 549 */ |
IsStyle4Available = 1; |
#endif |
vformat->BitsPerPixel=24; |
vformat->BytesPerPixel=3; |
this->info.wm_available=1; |
this->info.hw_available=0; |
this->info.video_mem=0x200000; |
/* video_mode[3].x=0; |
video_mode[3].y=0; |
video_mode[3].w=320; |
video_mode[3].h=200; |
video_mode[2].x=0; |
video_mode[2].y=0; |
video_mode[2].w=640; |
video_mode[2].h=400; |
video_mode[1].x=0; |
video_mode[1].y=0; |
video_mode[1].w=320; |
video_mode[1].h=240; |
video_mode[0].x=0; |
video_mode[0].y=0; |
video_mode[0].w=640; |
video_mode[0].h=480; |
SDL_modelist[2]=video_mode+0;*/ |
return 0; |
} |
static int MenuetOS_FlipHWSurface(_THIS,SDL_Surface * surface) |
{ |
__menuet__putimage(0,0,surface->w,surface->h, |
surface->pixels); |
return 0; |
} |
WMcursor* KolibriOS_CreateWMCursor(_THIS, |
Uint8* data, Uint8* mask, int w, int h, int hot_x, int hot_y) |
{ |
int i,j; |
Uint32* cursor; |
WMcursor* res; |
if (w>32 || h>32) return NULL; |
if (w%8 || h%8) return NULL; |
cursor = (Uint32*)malloc(32*32*4); |
if (!cursor) return NULL; |
for (i=0;i<32;i++) |
for (j=0;j<32;j++) |
{ |
if (i>=h || j>=w) |
{ |
cursor[i*32+j] = 0x00000000; |
continue; |
} |
if (mask[i*w/8+j/8] & (0x80>>(j&7))) |
cursor[i*32+j] = (data[i*w/8+j/8] & (0x80>>(j&7)))?0xFF000000:0xFFFFFFFF; |
else |
cursor[i*32+j] = 0x00000000; |
} |
__asm__ ("int $0x40" : "=a"(res) : "a"(37),"b"(4), |
"c"(cursor),"d"((hot_x<<24)+(hot_y<<16)+2)); |
free(cursor); |
return res; |
} |
int KolibriOS_ShowWMCursor(_THIS,WMcursor*cursor) |
{ |
if (!cursor) |
{ |
if (!has_null_cursor) |
{ |
unsigned* u = malloc(32*32*4); |
if (!u) return 1; |
memset(u,0,32*32*4); |
__asm__("int $0x40":"=a"(null_cursor): |
"a"(37),"b"(4),"c"(u),"d"(2)); |
free(u); |
has_null_cursor = 1; |
} |
cursor = (WMcursor*)null_cursor; |
} |
__asm__("int $0x40" : : "a"(37),"b"(5),"c"(cursor)); |
return 1; |
} |
void KolibriOS_FreeWMCursor(_THIS,WMcursor*cursor) |
{ |
__asm__("int $0x40" : : "a"(37),"b"(6),"c"(cursor)); |
} |
void KolibriOS_CheckMouseMode(_THIS) |
{ |
if (this->input_grab == SDL_GRAB_OFF) |
return; |
struct process_table_entry buf; |
int res; |
__asm__ volatile("int $0x40" : "=a"(res): "a"(9), "b"(&buf), "c"(-1)); |
if (res == buf.pos_in_windowing_stack) |
{ |
int x = buf.winx_start + buf.client_left + this->hidden->win_size_x/2; |
int y = buf.winy_start + buf.client_top + this->hidden->win_size_y/2; |
__asm__("int $0x40" : : "a"(18),"b"(19),"c"(4), |
"d"(x*65536+y)); |
} |
} |
char def_title[] = "KolibriOS SDL App"; |
static SDL_VideoDevice * MenuetOS_CreateDevice(int indx) |
{ |
SDL_VideoDevice * dev; |
dev=(SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice)); |
if(dev) |
{ |
memset(dev,0,(sizeof *dev)); |
dev->hidden = (struct SDL_PrivateVideoData *)malloc((sizeof *dev->hidden)); |
} |
if((dev==NULL) || (dev->hidden==NULL)) |
{ |
SDL_OutOfMemory(); |
if(dev) |
{ |
free(dev); |
} |
return(0); |
} |
memset(dev->hidden,0,(sizeof *dev->hidden)); |
dev->hidden->__title = def_title; |
dev->VideoInit=MenuetOS_VideoInit; |
dev->ListModes=MenuetOS_ListModes; |
dev->SetVideoMode=MenuetOS_SetVideoMode; |
dev->SetColors=MenuetOS_SetColors; |
dev->UpdateRects=NULL; |
dev->VideoQuit=MenuetOS_VideoQuit; |
dev->AllocHWSurface=MenuetOS_AllocHWSurface; |
dev->CheckHWBlit=NULL; |
dev->FillHWRect=NULL; |
dev->SetHWColorKey=NULL; |
dev->SetHWAlpha=NULL; |
dev->LockHWSurface=MenuetOS_LockHWSurface; |
dev->UnlockHWSurface=MenuetOS_UnlockHWSurface; |
dev->FlipHWSurface=MenuetOS_FlipHWSurface; |
dev->FreeHWSurface=MenuetOS_FreeHWSurface; |
dev->SetCaption=MenuetOS_SetCaption; |
dev->SetIcon=NULL; |
dev->IconifyWindow=NULL; |
dev->GrabInput=NULL; |
dev->GetWMInfo=NULL; |
dev->InitOSKeymap=MenuetOS_InitOSKeymap; |
dev->PumpEvents=MenuetOS_PumpEvents; |
dev->free=MenuetOS_DeleteDevice; |
dev->CreateWMCursor = KolibriOS_CreateWMCursor; |
dev->FreeWMCursor = KolibriOS_FreeWMCursor; |
dev->ShowWMCursor = KolibriOS_ShowWMCursor; |
dev->CheckMouseMode = KolibriOS_CheckMouseMode; |
return dev; |
} |
VideoBootStrap mosvideo_bootstrab={ |
"menuetos","MenuetOS Device Driver", |
MenuetOS_Available,MenuetOS_CreateDevice, |
}; |
/contrib/sdk/sources/SDL-1.2.2/src/video/menuetos/SDL_menuetvideo.h |
---|
0,0 → 1,20 |
#ifndef _SDL_menuetvideo_h |
#define _SDL_menuetvideo_h |
#include "SDL_mouse.h" |
#include "SDL_sysvideo.h" |
#define _THIS SDL_VideoDevice *this |
struct SDL_PrivateVideoData { |
unsigned char * __video_buffer; |
char * __title; |
int win_size_x,win_size_y; |
int vx_ofs,vy_ofs; |
unsigned char** __lines; |
}; |
void MenuetOS_InitOSKeymap(_THIS); |
void MenuetOS_PumpEvents(_THIS); |
#endif |
/contrib/sdk/sources/SDL-1.2.2/test/Makefile.bmp |
---|
0,0 → 1,6 |
OUTFILE = sdltestb |
OBJS = testbitmap.o |
CFLAGS = -I../include |
LIBS = -L../src -lSDL |
include $(MENUETDEV)/makefiles/Makefile_for_program |
/contrib/sdk/sources/SDL-1.2.2/test/Makefile.test |
---|
0,0 → 1,5 |
OUTFILE = SDLtest |
OBJS = sdltest.o |
LIBS = -lSDL |
include $(MENUETDEV)/makefiles/Makefile_for_program |
/contrib/sdk/sources/SDL-1.2.2/test/picture.xbm |
---|
0,0 → 1,14 |
#define picture_width 32 |
#define picture_height 32 |
static char picture_bits[] = { |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18, |
0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f, |
0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08, |
0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08, |
0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48, |
0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a, |
0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a, |
0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28, |
0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50, |
0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
/contrib/sdk/sources/SDL-1.2.2/test/sdltest.c |
---|
0,0 → 1,28 |
#include"SDL.h" |
#include<menuet/os.h> |
SDL_Surface * screen; |
static int done=0; |
void app_main(void) |
{ |
SDL_Event event; |
if(SDL_Init(SDL_INIT_VIDEO)<0) __menuet__sys_exit(); |
atexit(SDL_Quit); |
screen=SDL_SetVideoMode(320,200,8,SDL_SWSURFACE); |
while(!done) |
{ |
while(SDL_PollEvent(&event)) |
{ |
switch(event.type) |
{ |
case SDL_KEYDOWN: |
case SDL_QUIT: |
done=1; |
break; |
default: |
break; |
} |
} |
} |
} |
/contrib/sdk/sources/SDL-1.2.2/test/testbitmap.c |
---|
0,0 → 1,125 |
/* Simple program: Test bitmap blits */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "SDL.h" |
#include "picture.xbm" |
SDL_Surface *LoadXBM(SDL_Surface *screen, int w, int h, Uint8 *bits) |
{ |
SDL_Surface *bitmap; |
Uint8 *line; |
/* Allocate the bitmap */ |
bitmap = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 1, 0, 0, 0, 0); |
if ( bitmap == NULL ) { |
fprintf(stderr, "Couldn't allocate bitmap: %s\n", |
SDL_GetError()); |
return(NULL); |
} |
/* Copy the pixels */ |
line = (Uint8 *)bitmap->pixels; |
w = (w+7)/8; |
while ( h-- ) { |
memcpy(line, bits, w); |
/* X11 Bitmap images have the bits reversed */ |
{ int i, j; Uint8 *buf, byte; |
for ( buf=line, i=0; i<w; ++i, ++buf ) { |
byte = *buf; |
*buf = 0; |
for ( j=7; j>=0; --j ) { |
*buf |= (byte&0x01)<<j; |
byte >>= 1; |
} |
} |
} |
line += bitmap->pitch; |
bits += w; |
} |
return(bitmap); |
} |
void app_main(int argc, char *argv[]) |
{ |
SDL_Surface *screen; |
SDL_Surface *bitmap; |
Uint8 video_bpp; |
Uint32 videoflags; |
Uint8 *buffer; |
int i, done; |
SDL_Event event; |
/* Initialize SDL */ |
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { |
fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); |
exit(1); |
} |
atexit(SDL_Quit); |
video_bpp = 0; |
videoflags = SDL_SWSURFACE; |
/* Set 640x480 video mode */ |
if ( (screen=SDL_SetVideoMode(640,480,video_bpp,videoflags)) == NULL ) { |
fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", |
video_bpp, SDL_GetError()); |
exit(2); |
} |
/* Set the surface pixels and refresh! */ |
if ( SDL_LockSurface(screen) < 0 ) { |
fprintf(stderr, "Couldn't lock the display surface: %s\n", |
SDL_GetError()); |
exit(2); |
} |
buffer=(Uint8 *)screen->pixels; |
for ( i=0; i<screen->h; ++i ) { |
memset(buffer,(i*255)/screen->h, screen->pitch); |
buffer += screen->pitch; |
} |
SDL_UnlockSurface(screen); |
SDL_UpdateRect(screen, 0, 0, 0, 0); |
/* Load the bitmap */ |
bitmap = LoadXBM(screen, picture_width, picture_height, |
(Uint8 *)picture_bits); |
if ( bitmap == NULL ) { |
exit(1); |
} |
/* Wait for a keystroke */ |
done = 0; |
while ( !done ) { |
/* Check for events */ |
while ( SDL_PollEvent(&event) ) { |
switch (event.type) { |
case SDL_MOUSEBUTTONDOWN: { |
SDL_Rect dst; |
dst.x = event.button.x - bitmap->w/2; |
dst.y = event.button.y - bitmap->h/2; |
dst.w = bitmap->w; |
dst.h = bitmap->h; |
SDL_BlitSurface(bitmap, NULL, |
screen, &dst); |
SDL_UpdateRects(screen,1,&dst); |
} |
break; |
case SDL_KEYDOWN: |
/* Any key press quits the app... */ |
done = 1; |
break; |
case SDL_QUIT: |
done = 1; |
break; |
default: |
break; |
} |
} |
} |
SDL_FreeSurface(bitmap); |
return(0); |
} |