mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 07:15:27 +00:00
Remove prebuilt binaries
This commit is contained in:
parent
dbfdc2fd14
commit
24d60dd3ab
@ -1 +0,0 @@
|
|||||||
Versions/Current/Headers
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/Resources
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/SDL2
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/Resources
|
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
HIDAPI Authors:
|
|
||||||
|
|
||||||
Alan Ott <alan@signal11.us>:
|
|
||||||
Original Author and Maintainer
|
|
||||||
Linux, Windows, and Mac implementations
|
|
||||||
|
|
||||||
Ludovic Rousseau <rousseau@debian.org>:
|
|
||||||
Formatting for Doxygen documentation
|
|
||||||
Bug fixes
|
|
||||||
Correctness fixes
|
|
||||||
|
|
||||||
|
|
||||||
For a comprehensive list of contributions, see the commit list at github:
|
|
||||||
https://github.com/libusb/hidapi/commits/master
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BuildMachineOSBuild</key>
|
|
||||||
<string>19H114</string>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>English</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>hidapi</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.libsdl.hidapi</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>hidapi</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
|
||||||
<array>
|
|
||||||
<string>MacOSX</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>DTCompiler</key>
|
|
||||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
||||||
<key>DTPlatformBuild</key>
|
|
||||||
<string>12C33</string>
|
|
||||||
<key>DTPlatformName</key>
|
|
||||||
<string>macosx</string>
|
|
||||||
<key>DTPlatformVersion</key>
|
|
||||||
<string>11.1</string>
|
|
||||||
<key>DTSDKBuild</key>
|
|
||||||
<string>20C63</string>
|
|
||||||
<key>DTSDKName</key>
|
|
||||||
<string>macosx11.1</string>
|
|
||||||
<key>DTXcode</key>
|
|
||||||
<string>1230</string>
|
|
||||||
<key>DTXcodeBuild</key>
|
|
||||||
<string>12C33</string>
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
|
||||||
<string>10.6</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,26 +0,0 @@
|
|||||||
Copyright (c) 2010, Alan Ott, Signal 11 Software
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
* Neither the name of Signal 11 Software nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, 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
|
|
||||||
them 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 prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If 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 convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU 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
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state 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 program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@ -1,9 +0,0 @@
|
|||||||
HIDAPI - Multi-Platform library for
|
|
||||||
communication with HID devices.
|
|
||||||
|
|
||||||
Copyright 2009, Alan Ott, Signal 11 Software.
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
This software may be used by anyone for any reason so
|
|
||||||
long as the copyright notice in the source files
|
|
||||||
remains intact.
|
|
@ -1,13 +0,0 @@
|
|||||||
HIDAPI can be used under one of three licenses.
|
|
||||||
|
|
||||||
1. The GNU General Public License, version 3.0, in LICENSE-gpl3.txt
|
|
||||||
2. A BSD-Style License, in LICENSE-bsd.txt.
|
|
||||||
3. The more liberal original HIDAPI license. LICENSE-orig.txt
|
|
||||||
|
|
||||||
The license chosen is at the discretion of the user of HIDAPI. For example:
|
|
||||||
1. An author of GPL software would likely use HIDAPI under the terms of the
|
|
||||||
GPL.
|
|
||||||
|
|
||||||
2. An author of commercial closed-source software would likely use HIDAPI
|
|
||||||
under the terms of the BSD-style license or the original HIDAPI license.
|
|
||||||
|
|
@ -1,207 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>files</key>
|
|
||||||
<dict>
|
|
||||||
<key>Resources/AUTHORS.txt</key>
|
|
||||||
<data>
|
|
||||||
MKG+c/Ng8ZXbj7p1G5WReTJm06Y=
|
|
||||||
</data>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<data>
|
|
||||||
8Yk54YzUKmLCGTNkmc8LiukTgFM=
|
|
||||||
</data>
|
|
||||||
<key>Resources/LICENSE-bsd.txt</key>
|
|
||||||
<data>
|
|
||||||
fd5CtMb9r65yLY0HVWttnbpNKWM=
|
|
||||||
</data>
|
|
||||||
<key>Resources/LICENSE-gpl3.txt</key>
|
|
||||||
<data>
|
|
||||||
hiS82uVbru8AzRHV38+mD2hxCgI=
|
|
||||||
</data>
|
|
||||||
<key>Resources/LICENSE-orig.txt</key>
|
|
||||||
<data>
|
|
||||||
ZgR9vPP9aJyZRyJm9a0UHFPW8sY=
|
|
||||||
</data>
|
|
||||||
<key>Resources/LICENSE.txt</key>
|
|
||||||
<data>
|
|
||||||
9VS7iq5RUyXd9/XSbbwcYpQMum4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>files2</key>
|
|
||||||
<dict>
|
|
||||||
<key>Resources/AUTHORS.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
MKG+c/Ng8ZXbj7p1G5WReTJm06Y=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
syens6RZflkCVW7D6EB8vdHiiKvUYjt7S1bRTUnoTss=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
8Yk54YzUKmLCGTNkmc8LiukTgFM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
g8uVTrv9wFcDsYV6z37oNILYTKi5mgge59ixh4aBoo4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/LICENSE-bsd.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
fd5CtMb9r65yLY0HVWttnbpNKWM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
MOsb7ym0b4unq4tBYDXb2TywNKRUgd2XgVuUQoRYLNI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/LICENSE-gpl3.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
hiS82uVbru8AzRHV38+mD2hxCgI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/LICENSE-orig.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ZgR9vPP9aJyZRyJm9a0UHFPW8sY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
+1Q2qmPRtxqN+/dOyvGltOHsTff4AHTRH+yZKE9pyl8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/LICENSE.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
9VS7iq5RUyXd9/XSbbwcYpQMum4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
fTsIfDTzXU1TjjvN3R/49m6S+e8zaIGZlIKADd+ECRM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>rules</key>
|
|
||||||
<dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version.plist$</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>rules2</key>
|
|
||||||
<dict>
|
|
||||||
<key>.*\.dSYM($|/)</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>11</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(.*/)?\.DS_Store$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>2000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Info\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^PkgInfo$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^[^/]+$</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^embedded\.provisionprofile$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
A
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/hidapi
|
|
@ -1,138 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL.h
|
|
||||||
*
|
|
||||||
* Main include header for the SDL library
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SDL_h_
|
|
||||||
#define SDL_h_
|
|
||||||
|
|
||||||
#include "SDL_main.h"
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_assert.h"
|
|
||||||
#include "SDL_atomic.h"
|
|
||||||
#include "SDL_audio.h"
|
|
||||||
#include "SDL_clipboard.h"
|
|
||||||
#include "SDL_cpuinfo.h"
|
|
||||||
#include "SDL_endian.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_events.h"
|
|
||||||
#include "SDL_filesystem.h"
|
|
||||||
#include "SDL_gamecontroller.h"
|
|
||||||
#include "SDL_haptic.h"
|
|
||||||
#include "SDL_hints.h"
|
|
||||||
#include "SDL_joystick.h"
|
|
||||||
#include "SDL_loadso.h"
|
|
||||||
#include "SDL_log.h"
|
|
||||||
#include "SDL_messagebox.h"
|
|
||||||
#include "SDL_metal.h"
|
|
||||||
#include "SDL_mutex.h"
|
|
||||||
#include "SDL_power.h"
|
|
||||||
#include "SDL_render.h"
|
|
||||||
#include "SDL_rwops.h"
|
|
||||||
#include "SDL_sensor.h"
|
|
||||||
#include "SDL_shape.h"
|
|
||||||
#include "SDL_system.h"
|
|
||||||
#include "SDL_thread.h"
|
|
||||||
#include "SDL_timer.h"
|
|
||||||
#include "SDL_version.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
#include "SDL_locale.h"
|
|
||||||
#include "SDL_misc.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 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name SDL_INIT_*
|
|
||||||
*
|
|
||||||
* These are the flags which may be passed to SDL_Init(). You should
|
|
||||||
* specify the subsystems which you will be using in your application.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_INIT_TIMER 0x00000001u
|
|
||||||
#define SDL_INIT_AUDIO 0x00000010u
|
|
||||||
#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
|
|
||||||
#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
|
|
||||||
#define SDL_INIT_HAPTIC 0x00001000u
|
|
||||||
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
|
|
||||||
#define SDL_INIT_EVENTS 0x00004000u
|
|
||||||
#define SDL_INIT_SENSOR 0x00008000u
|
|
||||||
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
|
|
||||||
#define SDL_INIT_EVERYTHING ( \
|
|
||||||
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
|
||||||
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
|
|
||||||
)
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function initializes the subsystems specified by \c flags
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function initializes specific SDL subsystems
|
|
||||||
*
|
|
||||||
* Subsystem initialization is ref-counted, you must call
|
|
||||||
* SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
|
|
||||||
* shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
|
|
||||||
* If a subsystem is already loaded then this call will
|
|
||||||
* increase the ref-count and return.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function cleans up specific SDL subsystems
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns a mask of the specified subsystems which have
|
|
||||||
* previously been initialized.
|
|
||||||
*
|
|
||||||
* If \c flags is 0, it returns a mask of all initialized subsystems.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function cleans up all initialized subsystems. You should
|
|
||||||
* call it upon all exit conditions.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Quit(void);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,295 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_assert_h_
|
|
||||||
#define SDL_assert_h_
|
|
||||||
|
|
||||||
#include "SDL_config.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_ASSERT_LEVEL
|
|
||||||
#ifdef SDL_DEFAULT_ASSERT_LEVEL
|
|
||||||
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
|
|
||||||
#elif defined(_DEBUG) || defined(DEBUG) || \
|
|
||||||
(defined(__GNUC__) && !defined(__OPTIMIZE__))
|
|
||||||
#define SDL_ASSERT_LEVEL 2
|
|
||||||
#else
|
|
||||||
#define SDL_ASSERT_LEVEL 1
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_ASSERT_LEVEL */
|
|
||||||
|
|
||||||
/*
|
|
||||||
These are macros and not first class functions so that the debugger breaks
|
|
||||||
on the assertion line and not in some random guts of SDL, and so each
|
|
||||||
assert can have unique static variables associated with it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
/* Don't include intrin.h here because it contains C++ code */
|
|
||||||
extern void __cdecl __debugbreak(void);
|
|
||||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
|
||||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
|
||||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
|
||||||
#elif defined(__APPLE__) && defined(__arm__)
|
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
|
||||||
#elif defined(__386__) && defined(__WATCOMC__)
|
|
||||||
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
|
||||||
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
|
|
||||||
#include <signal.h>
|
|
||||||
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
|
|
||||||
#else
|
|
||||||
/* How do we trigger breakpoints on this platform? */
|
|
||||||
#define SDL_TriggerBreakpoint()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
|
||||||
# define SDL_FUNCTION __func__
|
|
||||||
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
|
|
||||||
# define SDL_FUNCTION __FUNCTION__
|
|
||||||
#else
|
|
||||||
# define SDL_FUNCTION "???"
|
|
||||||
#endif
|
|
||||||
#define SDL_FILE __FILE__
|
|
||||||
#define SDL_LINE __LINE__
|
|
||||||
|
|
||||||
/*
|
|
||||||
sizeof (x) makes the compiler still parse the expression even without
|
|
||||||
assertions enabled, so the code is always checked at compile time, but
|
|
||||||
doesn't actually generate code for it, so there are no side effects or
|
|
||||||
expensive checks at run time, just the constant size of what x WOULD be,
|
|
||||||
which presumably gets optimized out as unused.
|
|
||||||
This also solves the problem of...
|
|
||||||
|
|
||||||
int somevalue = blah();
|
|
||||||
SDL_assert(somevalue == 1);
|
|
||||||
|
|
||||||
...which would cause compiles to complain that somevalue is unused if we
|
|
||||||
disable assertions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
|
|
||||||
this condition isn't constant. And looks like an owl's face! */
|
|
||||||
#ifdef _MSC_VER /* stupid /W4 warnings. */
|
|
||||||
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
|
|
||||||
#else
|
|
||||||
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SDL_disabled_assert(condition) \
|
|
||||||
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
|
|
||||||
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
|
|
||||||
SDL_ASSERTION_ABORT, /**< Terminate the program. */
|
|
||||||
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
|
|
||||||
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
|
|
||||||
} SDL_AssertState;
|
|
||||||
|
|
||||||
typedef struct SDL_AssertData
|
|
||||||
{
|
|
||||||
int always_ignore;
|
|
||||||
unsigned int trigger_count;
|
|
||||||
const char *condition;
|
|
||||||
const char *filename;
|
|
||||||
int linenum;
|
|
||||||
const char *function;
|
|
||||||
const struct SDL_AssertData *next;
|
|
||||||
} SDL_AssertData;
|
|
||||||
|
|
||||||
#if (SDL_ASSERT_LEVEL > 0)
|
|
||||||
|
|
||||||
/* Never call this directly. Use the SDL_assert* macros. */
|
|
||||||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
|
||||||
const char *,
|
|
||||||
const char *, int)
|
|
||||||
#if defined(__clang__)
|
|
||||||
#if __has_feature(attribute_analyzer_noreturn)
|
|
||||||
/* this tells Clang's static analysis that we're a custom assert function,
|
|
||||||
and that the analyzer should assume the condition was always true past this
|
|
||||||
SDL_assert test. */
|
|
||||||
__attribute__((analyzer_noreturn))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
/* the do {} while(0) avoids dangling else problems:
|
|
||||||
if (x) SDL_assert(y); else blah();
|
|
||||||
... without the do/while, the "else" could attach to this macro's "if".
|
|
||||||
We try to handle just the minimum we need here in a macro...the loop,
|
|
||||||
the static vars, and break points. The heavy lifting is handled in
|
|
||||||
SDL_ReportAssertion(), in SDL_assert.c.
|
|
||||||
*/
|
|
||||||
#define SDL_enabled_assert(condition) \
|
|
||||||
do { \
|
|
||||||
while ( !(condition) ) { \
|
|
||||||
static struct SDL_AssertData sdl_assert_data = { \
|
|
||||||
0, 0, #condition, 0, 0, 0, 0 \
|
|
||||||
}; \
|
|
||||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
|
||||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
|
||||||
continue; /* go again. */ \
|
|
||||||
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
|
|
||||||
SDL_TriggerBreakpoint(); \
|
|
||||||
} \
|
|
||||||
break; /* not retrying. */ \
|
|
||||||
} \
|
|
||||||
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
|
||||||
|
|
||||||
#endif /* enabled assertions support code */
|
|
||||||
|
|
||||||
/* Enable various levels of assertions. */
|
|
||||||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
|
||||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
||||||
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
|
|
||||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
||||||
#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
|
|
||||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
|
|
||||||
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
|
|
||||||
# define SDL_assert(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
|
|
||||||
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
|
|
||||||
#else
|
|
||||||
# error Unknown assertion level.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* this assertion is never disabled at any level. */
|
|
||||||
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
|
|
||||||
|
|
||||||
|
|
||||||
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
|
||||||
const SDL_AssertData* data, void* userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set an application-defined assertion handler.
|
|
||||||
*
|
|
||||||
* This allows an app to show its own assertion UI and/or force the
|
|
||||||
* response to an assertion failure. If the app doesn't provide this, SDL
|
|
||||||
* will try to do the right thing, popping up a system-specific GUI dialog,
|
|
||||||
* and probably minimizing any fullscreen windows.
|
|
||||||
*
|
|
||||||
* This callback may fire from any thread, but it runs wrapped in a mutex, so
|
|
||||||
* it will only fire from one thread at a time.
|
|
||||||
*
|
|
||||||
* Setting the callback to NULL restores SDL's original internal handler.
|
|
||||||
*
|
|
||||||
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
|
|
||||||
*
|
|
||||||
* Return SDL_AssertState value of how to handle the assertion failure.
|
|
||||||
*
|
|
||||||
* \param handler Callback function, called when an assertion fails.
|
|
||||||
* \param userdata A pointer passed to the callback as-is.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
|
||||||
SDL_AssertionHandler handler,
|
|
||||||
void *userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the default assertion handler.
|
|
||||||
*
|
|
||||||
* This returns the function pointer that is called by default when an
|
|
||||||
* assertion is triggered. This is an internal function provided by SDL,
|
|
||||||
* that is used for assertions when SDL_SetAssertionHandler() hasn't been
|
|
||||||
* used to provide a different function.
|
|
||||||
*
|
|
||||||
* \return The default SDL_AssertionHandler that is called when an assert triggers.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current assertion handler.
|
|
||||||
*
|
|
||||||
* This returns the function pointer that is called when an assertion is
|
|
||||||
* triggered. This is either the value last passed to
|
|
||||||
* SDL_SetAssertionHandler(), or if no application-specified function is
|
|
||||||
* set, is equivalent to calling SDL_GetDefaultAssertionHandler().
|
|
||||||
*
|
|
||||||
* \param puserdata Pointer to a void*, which will store the "userdata"
|
|
||||||
* pointer that was passed to SDL_SetAssertionHandler().
|
|
||||||
* This value will always be NULL for the default handler.
|
|
||||||
* If you don't care about this data, it is safe to pass
|
|
||||||
* a NULL pointer to this function to ignore it.
|
|
||||||
* \return The SDL_AssertionHandler that is called when an assert triggers.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a list of all assertion failures.
|
|
||||||
*
|
|
||||||
* Get all assertions triggered since last call to SDL_ResetAssertionReport(),
|
|
||||||
* or the start of the program.
|
|
||||||
*
|
|
||||||
* The proper way to examine this data looks something like this:
|
|
||||||
*
|
|
||||||
* <code>
|
|
||||||
* const SDL_AssertData *item = SDL_GetAssertionReport();
|
|
||||||
* while (item) {
|
|
||||||
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
|
|
||||||
* item->condition, item->function, item->filename,
|
|
||||||
* item->linenum, item->trigger_count,
|
|
||||||
* item->always_ignore ? "yes" : "no");
|
|
||||||
* item = item->next;
|
|
||||||
* }
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* \return List of all assertions.
|
|
||||||
* \sa SDL_ResetAssertionReport
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Reset the list of all assertion failures.
|
|
||||||
*
|
|
||||||
* Reset list of all assertions triggered.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetAssertionReport
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* these had wrong naming conventions until 2.0.4. Please update your app! */
|
|
||||||
#define SDL_assert_state SDL_AssertState
|
|
||||||
#define SDL_assert_data SDL_AssertData
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_assert_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,295 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_atomic.h
|
|
||||||
*
|
|
||||||
* Atomic operations.
|
|
||||||
*
|
|
||||||
* IMPORTANT:
|
|
||||||
* If you are not an expert in concurrent lockless programming, you should
|
|
||||||
* only be using the atomic lock and reference counting functions in this
|
|
||||||
* file. In all other cases you should be protecting your data structures
|
|
||||||
* with full mutexes.
|
|
||||||
*
|
|
||||||
* The list of "safe" functions to use are:
|
|
||||||
* SDL_AtomicLock()
|
|
||||||
* SDL_AtomicUnlock()
|
|
||||||
* SDL_AtomicIncRef()
|
|
||||||
* SDL_AtomicDecRef()
|
|
||||||
*
|
|
||||||
* Seriously, here be dragons!
|
|
||||||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
*
|
|
||||||
* You can find out a little more about lockless programming and the
|
|
||||||
* subtle issues that can arise here:
|
|
||||||
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
|
|
||||||
*
|
|
||||||
* There's also lots of good information here:
|
|
||||||
* http://www.1024cores.net/home/lock-free-algorithms
|
|
||||||
* http://preshing.com/
|
|
||||||
*
|
|
||||||
* These operations may or may not actually be implemented using
|
|
||||||
* processor specific atomic operations. When possible they are
|
|
||||||
* implemented as true processor specific atomic operations. When that
|
|
||||||
* is not possible the are implemented using locks that *do* use the
|
|
||||||
* available atomic operations.
|
|
||||||
*
|
|
||||||
* All of the atomic operations that modify memory are full memory barriers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_atomic_h_
|
|
||||||
#define SDL_atomic_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name SDL AtomicLock
|
|
||||||
*
|
|
||||||
* The atomic locks are efficient spinlocks using CPU instructions,
|
|
||||||
* but are vulnerable to starvation and can spin forever if a thread
|
|
||||||
* holding a lock has been terminated. For this reason you should
|
|
||||||
* minimize the code executed inside an atomic lock and never do
|
|
||||||
* expensive things like API or system calls while holding them.
|
|
||||||
*
|
|
||||||
* The atomic locks are not safe to lock recursively.
|
|
||||||
*
|
|
||||||
* Porting Note:
|
|
||||||
* The spin lock functions and type are required and can not be
|
|
||||||
* emulated because they are used in the atomic emulation code.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
typedef int SDL_SpinLock;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Try to lock a spin lock by setting it to a non-zero value.
|
|
||||||
*
|
|
||||||
* \param lock Points to the lock.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Lock a spin lock by setting it to a non-zero value.
|
|
||||||
*
|
|
||||||
* \param lock Points to the lock.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Unlock a spin lock by setting it to 0. Always returns immediately
|
|
||||||
*
|
|
||||||
* \param lock Points to the lock.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
|
||||||
|
|
||||||
/* @} *//* SDL AtomicLock */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The compiler barrier prevents the compiler from reordering
|
|
||||||
* reads and writes to globally visible variables across the call.
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
|
|
||||||
void _ReadWriteBarrier(void);
|
|
||||||
#pragma intrinsic(_ReadWriteBarrier)
|
|
||||||
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
|
||||||
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
|
||||||
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
|
||||||
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
extern _inline void SDL_CompilerBarrier (void);
|
|
||||||
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
|
|
||||||
#else
|
|
||||||
#define SDL_CompilerBarrier() \
|
|
||||||
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Memory barriers are designed to prevent reads and writes from being
|
|
||||||
* reordered by the compiler and being seen out of order on multi-core CPUs.
|
|
||||||
*
|
|
||||||
* A typical pattern would be for thread A to write some data and a flag,
|
|
||||||
* and for thread B to read the flag and get the data. In this case you
|
|
||||||
* would insert a release barrier between writing the data and the flag,
|
|
||||||
* guaranteeing that the data write completes no later than the flag is
|
|
||||||
* written, and you would insert an acquire barrier between reading the
|
|
||||||
* flag and reading the data, to ensure that all the reads associated
|
|
||||||
* with the flag have completed.
|
|
||||||
*
|
|
||||||
* In this pattern you should always see a release barrier paired with
|
|
||||||
* an acquire barrier and you should gate the data reads/writes with a
|
|
||||||
* single flag variable.
|
|
||||||
*
|
|
||||||
* For more information on these semantics, take a look at the blog post:
|
|
||||||
* http://preshing.com/20120913/acquire-and-release-semantics
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
|
|
||||||
#elif defined(__GNUC__) && defined(__aarch64__)
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
|
||||||
#elif defined(__GNUC__) && defined(__arm__)
|
|
||||||
#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
|
|
||||||
/* Information from:
|
|
||||||
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
|
|
||||||
|
|
||||||
The Linux kernel provides a helper function which provides the right code for a memory barrier,
|
|
||||||
hard-coded at address 0xffff0fa0
|
|
||||||
*/
|
|
||||||
typedef void (*SDL_KernelMemoryBarrierFunc)();
|
|
||||||
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
|
||||||
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
|
|
||||||
#elif 0 /* defined(__QNXNTO__) */
|
|
||||||
#include <sys/cpuinline.h>
|
|
||||||
|
|
||||||
#define SDL_MemoryBarrierRelease() __cpu_membarrier()
|
|
||||||
#define SDL_MemoryBarrierAcquire() __cpu_membarrier()
|
|
||||||
#else
|
|
||||||
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
|
||||||
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
|
|
||||||
#ifdef __thumb__
|
|
||||||
/* The mcr instruction isn't available in thumb mode, use real functions */
|
|
||||||
#define SDL_MEMORY_BARRIER_USES_FUNCTION
|
|
||||||
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
|
|
||||||
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
|
|
||||||
#else
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
|
|
||||||
#endif /* __thumb__ */
|
|
||||||
#else
|
|
||||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
|
|
||||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
|
|
||||||
#endif /* __LINUX__ || __ANDROID__ */
|
|
||||||
#endif /* __GNUC__ && __arm__ */
|
|
||||||
#else
|
|
||||||
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
|
||||||
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
|
|
||||||
#include <mbarrier.h>
|
|
||||||
#define SDL_MemoryBarrierRelease() __machine_rel_barrier()
|
|
||||||
#define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
|
|
||||||
#else
|
|
||||||
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
|
|
||||||
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
|
|
||||||
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A type representing an atomic integer value. It is a struct
|
|
||||||
* so people don't accidentally use numeric operations on it.
|
|
||||||
*/
|
|
||||||
typedef struct { int value; } SDL_atomic_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set an atomic variable to a new value if it is currently an old value.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \note If you don't know what this function is for, you shouldn't use it!
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set an atomic variable to a value.
|
|
||||||
*
|
|
||||||
* \return The previous value of the atomic variable.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the value of an atomic variable
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Add to an atomic variable.
|
|
||||||
*
|
|
||||||
* \return The previous value of the atomic variable.
|
|
||||||
*
|
|
||||||
* \note This same style can be used for any number operation
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Increment an atomic variable used as a reference count.
|
|
||||||
*/
|
|
||||||
#ifndef SDL_AtomicIncRef
|
|
||||||
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Decrement an atomic variable used as a reference count.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the variable reached zero after decrementing,
|
|
||||||
* SDL_FALSE otherwise
|
|
||||||
*/
|
|
||||||
#ifndef SDL_AtomicDecRef
|
|
||||||
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set a pointer to a new value if it is currently an old value.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* \note If you don't know what this function is for, you shouldn't use it!
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set a pointer to a value atomically.
|
|
||||||
*
|
|
||||||
* \return The previous value of the pointer.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the value of a pointer atomically.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_atomic_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,859 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_audio.h
|
|
||||||
*
|
|
||||||
* Access to the raw audio mixing buffer for the SDL library.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_audio_h_
|
|
||||||
#define SDL_audio_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_endian.h"
|
|
||||||
#include "SDL_mutex.h"
|
|
||||||
#include "SDL_thread.h"
|
|
||||||
#include "SDL_rwops.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Audio format flags.
|
|
||||||
*
|
|
||||||
* These are what the 16 bits in SDL_AudioFormat currently mean...
|
|
||||||
* (Unspecified bits are always zero).
|
|
||||||
*
|
|
||||||
* \verbatim
|
|
||||||
++-----------------------sample is signed if set
|
|
||||||
||
|
|
||||||
|| ++-----------sample is bigendian if set
|
|
||||||
|| ||
|
|
||||||
|| || ++---sample is float if set
|
|
||||||
|| || ||
|
|
||||||
|| || || +---sample bit size---+
|
|
||||||
|| || || | |
|
|
||||||
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
|
||||||
\endverbatim
|
|
||||||
*
|
|
||||||
* There are macros in SDL 2.0 and later to query these bits.
|
|
||||||
*/
|
|
||||||
typedef Uint16 SDL_AudioFormat;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Audio flags
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
|
|
||||||
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
|
|
||||||
#define SDL_AUDIO_MASK_ENDIAN (1<<12)
|
|
||||||
#define SDL_AUDIO_MASK_SIGNED (1<<15)
|
|
||||||
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
|
|
||||||
#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
|
|
||||||
#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
|
|
||||||
#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
|
|
||||||
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
|
|
||||||
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
|
|
||||||
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Audio format flags
|
|
||||||
*
|
|
||||||
* Defaults to LSB byte order.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
|
|
||||||
#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
|
|
||||||
#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
|
|
||||||
#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
|
|
||||||
#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
|
|
||||||
#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
|
|
||||||
#define AUDIO_U16 AUDIO_U16LSB
|
|
||||||
#define AUDIO_S16 AUDIO_S16LSB
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name int32 support
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */
|
|
||||||
#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */
|
|
||||||
#define AUDIO_S32 AUDIO_S32LSB
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name float32 support
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */
|
|
||||||
#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */
|
|
||||||
#define AUDIO_F32 AUDIO_F32LSB
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Native audio byte ordering
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
|
||||||
#define AUDIO_U16SYS AUDIO_U16LSB
|
|
||||||
#define AUDIO_S16SYS AUDIO_S16LSB
|
|
||||||
#define AUDIO_S32SYS AUDIO_S32LSB
|
|
||||||
#define AUDIO_F32SYS AUDIO_F32LSB
|
|
||||||
#else
|
|
||||||
#define AUDIO_U16SYS AUDIO_U16MSB
|
|
||||||
#define AUDIO_S16SYS AUDIO_S16MSB
|
|
||||||
#define AUDIO_S32SYS AUDIO_S32MSB
|
|
||||||
#define AUDIO_F32SYS AUDIO_F32MSB
|
|
||||||
#endif
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Allow change flags
|
|
||||||
*
|
|
||||||
* Which audio format changes are allowed when opening a device.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
|
|
||||||
#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
|
|
||||||
#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
|
|
||||||
#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008
|
|
||||||
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/* @} *//* Audio flags */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function is called when the audio device needs more data.
|
|
||||||
*
|
|
||||||
* \param userdata An application-specific parameter saved in
|
|
||||||
* the SDL_AudioSpec structure
|
|
||||||
* \param stream A pointer to the audio data buffer.
|
|
||||||
* \param len The length of that buffer in bytes.
|
|
||||||
*
|
|
||||||
* Once the callback returns, the buffer will no longer be valid.
|
|
||||||
* Stereo samples are stored in a LRLRLR ordering.
|
|
||||||
*
|
|
||||||
* You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
|
|
||||||
* you like. Just open your audio device with a NULL callback.
|
|
||||||
*/
|
|
||||||
typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
|
||||||
int len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
|
||||||
*
|
|
||||||
* For multi-channel audio, the default SDL channel mapping is:
|
|
||||||
* 2: FL FR (stereo)
|
|
||||||
* 3: FL FR LFE (2.1 surround)
|
|
||||||
* 4: FL FR BL BR (quad)
|
|
||||||
* 5: FL FR FC BL BR (quad + center)
|
|
||||||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
|
||||||
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
|
||||||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_AudioSpec
|
|
||||||
{
|
|
||||||
int freq; /**< DSP frequency -- samples per second */
|
|
||||||
SDL_AudioFormat format; /**< Audio data format */
|
|
||||||
Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
|
|
||||||
Uint8 silence; /**< Audio buffer silence value (calculated) */
|
|
||||||
Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */
|
|
||||||
Uint16 padding; /**< Necessary for some compile environments */
|
|
||||||
Uint32 size; /**< Audio buffer size in bytes (calculated) */
|
|
||||||
SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */
|
|
||||||
void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */
|
|
||||||
} SDL_AudioSpec;
|
|
||||||
|
|
||||||
|
|
||||||
struct SDL_AudioCVT;
|
|
||||||
typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
|
|
||||||
SDL_AudioFormat format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Upper limit of filters in SDL_AudioCVT
|
|
||||||
*
|
|
||||||
* The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
|
|
||||||
* currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
|
|
||||||
* one of which is the terminating NULL pointer.
|
|
||||||
*/
|
|
||||||
#define SDL_AUDIOCVT_MAX_FILTERS 9
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \struct SDL_AudioCVT
|
|
||||||
* \brief A structure to hold a set of audio conversion filters and buffers.
|
|
||||||
*
|
|
||||||
* Note that various parts of the conversion pipeline can take advantage
|
|
||||||
* of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require
|
|
||||||
* you to pass it aligned data, but can possibly run much faster if you
|
|
||||||
* set both its (buf) field to a pointer that is aligned to 16 bytes, and its
|
|
||||||
* (len) field to something that's a multiple of 16, if possible.
|
|
||||||
*/
|
|
||||||
#ifdef __GNUC__
|
|
||||||
/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
|
|
||||||
pad it out to 88 bytes to guarantee ABI compatibility between compilers.
|
|
||||||
vvv
|
|
||||||
The next time we rev the ABI, make sure to size the ints and add padding.
|
|
||||||
*/
|
|
||||||
#define SDL_AUDIOCVT_PACKED __attribute__((packed))
|
|
||||||
#else
|
|
||||||
#define SDL_AUDIOCVT_PACKED
|
|
||||||
#endif
|
|
||||||
/* */
|
|
||||||
typedef struct SDL_AudioCVT
|
|
||||||
{
|
|
||||||
int needed; /**< Set to 1 if conversion possible */
|
|
||||||
SDL_AudioFormat src_format; /**< Source audio format */
|
|
||||||
SDL_AudioFormat dst_format; /**< Target audio format */
|
|
||||||
double rate_incr; /**< Rate conversion increment */
|
|
||||||
Uint8 *buf; /**< Buffer to hold entire audio data */
|
|
||||||
int len; /**< Length of original audio buffer */
|
|
||||||
int len_cvt; /**< Length of converted audio buffer */
|
|
||||||
int len_mult; /**< buffer must be len*len_mult big */
|
|
||||||
double len_ratio; /**< Given len, final size is len*len_ratio */
|
|
||||||
SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */
|
|
||||||
int filter_index; /**< Current audio conversion function */
|
|
||||||
} SDL_AUDIOCVT_PACKED SDL_AudioCVT;
|
|
||||||
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Driver discovery functions
|
|
||||||
*
|
|
||||||
* These functions return the list of built in audio drivers, in the
|
|
||||||
* order that they are normally initialized by default.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Initialization and cleanup
|
|
||||||
*
|
|
||||||
* \internal These functions are used internally, and should not be used unless
|
|
||||||
* you have a specific need to specify the audio driver you want to
|
|
||||||
* use. You should normally use SDL_Init() or SDL_InitSubSystem().
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the name of the current audio driver, or NULL
|
|
||||||
* if no driver has been initialized.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function opens the audio device with the desired parameters, and
|
|
||||||
* returns 0 if successful, placing the actual hardware parameters in the
|
|
||||||
* structure pointed to by \c obtained. If \c obtained is NULL, the audio
|
|
||||||
* data passed to the callback function will be guaranteed to be in the
|
|
||||||
* requested format, and will be automatically converted to the hardware
|
|
||||||
* audio format if necessary. This function returns -1 if it failed
|
|
||||||
* to open the audio device, or couldn't set up the audio thread.
|
|
||||||
*
|
|
||||||
* When filling in the desired audio spec structure,
|
|
||||||
* - \c desired->freq should be the desired audio frequency in samples-per-
|
|
||||||
* second.
|
|
||||||
* - \c desired->format should be the desired audio format.
|
|
||||||
* - \c desired->samples is the desired size of the audio buffer, in
|
|
||||||
* samples. This number should be a power of two, and may be adjusted by
|
|
||||||
* the audio driver to a value more suitable for the hardware. Good values
|
|
||||||
* seem to range between 512 and 8096 inclusive, depending on the
|
|
||||||
* application and CPU speed. Smaller values yield faster response time,
|
|
||||||
* but can lead to underflow if the application is doing heavy processing
|
|
||||||
* and cannot fill the audio buffer in time. A stereo sample consists of
|
|
||||||
* both right and left channels in LR ordering.
|
|
||||||
* Note that the number of samples is directly related to time by the
|
|
||||||
* following formula: \code ms = (samples*1000)/freq \endcode
|
|
||||||
* - \c desired->size is the size in bytes of the audio buffer, and is
|
|
||||||
* calculated by SDL_OpenAudio().
|
|
||||||
* - \c desired->silence is the value used to set the buffer to silence,
|
|
||||||
* and is calculated by SDL_OpenAudio().
|
|
||||||
* - \c desired->callback should be set to a function that will be called
|
|
||||||
* when the audio device is ready for more data. It is passed a pointer
|
|
||||||
* to the audio buffer, and the length in bytes of the audio buffer.
|
|
||||||
* This function usually runs in a separate thread, and so you should
|
|
||||||
* protect data structures that it accesses by calling SDL_LockAudio()
|
|
||||||
* and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
|
|
||||||
* pointer here, and call SDL_QueueAudio() with some frequency, to queue
|
|
||||||
* more audio samples to be played (or for capture devices, call
|
|
||||||
* SDL_DequeueAudio() with some frequency, to obtain audio samples).
|
|
||||||
* - \c desired->userdata is passed as the first parameter to your callback
|
|
||||||
* function. If you passed a NULL callback, this value is ignored.
|
|
||||||
*
|
|
||||||
* The audio device starts out playing silence when it's opened, and should
|
|
||||||
* be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
|
|
||||||
* for your audio callback function to be called. Since the audio driver
|
|
||||||
* may modify the requested size of the audio buffer, you should allocate
|
|
||||||
* any local mixing buffers after you open the audio device.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
|
|
||||||
SDL_AudioSpec * obtained);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SDL Audio Device IDs.
|
|
||||||
*
|
|
||||||
* A successful call to SDL_OpenAudio() is always device id 1, and legacy
|
|
||||||
* SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
|
|
||||||
* always returns devices >= 2 on success. The legacy calls are good both
|
|
||||||
* for backwards compatibility and when you don't care about multiple,
|
|
||||||
* specific, or capture devices.
|
|
||||||
*/
|
|
||||||
typedef Uint32 SDL_AudioDeviceID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of available devices exposed by the current driver.
|
|
||||||
* Only valid after a successfully initializing the audio subsystem.
|
|
||||||
* Returns -1 if an explicit list of devices can't be determined; this is
|
|
||||||
* not an error. For example, if SDL is set up to talk to a remote audio
|
|
||||||
* server, it can't list every one available on the Internet, but it will
|
|
||||||
* still allow a specific host to be specified to SDL_OpenAudioDevice().
|
|
||||||
*
|
|
||||||
* In many common cases, when this function returns a value <= 0, it can still
|
|
||||||
* successfully open the default device (NULL for first argument of
|
|
||||||
* SDL_OpenAudioDevice()).
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the human-readable name of a specific audio device.
|
|
||||||
* Must be a value between 0 and (number of audio devices-1).
|
|
||||||
* Only valid after a successfully initializing the audio subsystem.
|
|
||||||
* The values returned by this function reflect the latest call to
|
|
||||||
* SDL_GetNumAudioDevices(); recall that function to redetect available
|
|
||||||
* hardware.
|
|
||||||
*
|
|
||||||
* The string returned by this function is UTF-8 encoded, read-only, and
|
|
||||||
* managed internally. You are not to free it. If you need to keep the
|
|
||||||
* string for any length of time, you should make your own copy of it, as it
|
|
||||||
* will be invalid next time any of several other SDL functions is called.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
|
||||||
int iscapture);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a specific audio device. Passing in a device name of NULL requests
|
|
||||||
* the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
|
|
||||||
*
|
|
||||||
* The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
|
|
||||||
* some drivers allow arbitrary and driver-specific strings, such as a
|
|
||||||
* hostname/IP address for a remote audio server, or a filename in the
|
|
||||||
* diskaudio driver.
|
|
||||||
*
|
|
||||||
* \return 0 on error, a valid device ID that is >= 2 on success.
|
|
||||||
*
|
|
||||||
* SDL_OpenAudio(), unlike this function, always acts on device ID 1.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
|
|
||||||
*device,
|
|
||||||
int iscapture,
|
|
||||||
const
|
|
||||||
SDL_AudioSpec *
|
|
||||||
desired,
|
|
||||||
SDL_AudioSpec *
|
|
||||||
obtained,
|
|
||||||
int
|
|
||||||
allowed_changes);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Audio state
|
|
||||||
*
|
|
||||||
* Get the current audio state.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_AUDIO_STOPPED = 0,
|
|
||||||
SDL_AUDIO_PLAYING,
|
|
||||||
SDL_AUDIO_PAUSED
|
|
||||||
} SDL_AudioStatus;
|
|
||||||
extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_AudioStatus SDLCALL
|
|
||||||
SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
|
|
||||||
/* @} *//* Audio State */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Pause audio functions
|
|
||||||
*
|
|
||||||
* These functions pause and unpause the audio callback processing.
|
|
||||||
* They should be called with a parameter of 0 after opening the audio
|
|
||||||
* device to start playing sound. This is so you can safely initialize
|
|
||||||
* data for your callback function after opening the audio device.
|
|
||||||
* Silence will be written to the audio device during the pause.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
|
|
||||||
int pause_on);
|
|
||||||
/* @} *//* Pause audio functions */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Load the audio data of a WAVE file into memory
|
|
||||||
*
|
|
||||||
* Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len
|
|
||||||
* to be valid pointers. The entire data portion of the file is then loaded
|
|
||||||
* into memory and decoded if necessary.
|
|
||||||
*
|
|
||||||
* If \c freesrc is non-zero, the data source gets automatically closed and
|
|
||||||
* freed before the function returns.
|
|
||||||
*
|
|
||||||
* Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits),
|
|
||||||
* IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and
|
|
||||||
* µ-law (8 bits). Other formats are currently unsupported and cause an error.
|
|
||||||
*
|
|
||||||
* If this function succeeds, the pointer returned by it is equal to \c spec
|
|
||||||
* and the pointer to the audio data allocated by the function is written to
|
|
||||||
* \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec
|
|
||||||
* members \c freq, \c channels, and \c format are set to the values of the
|
|
||||||
* audio data in the buffer. The \c samples member is set to a sane default and
|
|
||||||
* all others are set to zero.
|
|
||||||
*
|
|
||||||
* It's necessary to use SDL_FreeWAV() to free the audio data returned in
|
|
||||||
* \c audio_buf when it is no longer used.
|
|
||||||
*
|
|
||||||
* Because of the underspecification of the Waveform format, there are many
|
|
||||||
* problematic files in the wild that cause issues with strict decoders. To
|
|
||||||
* provide compatibility with these files, this decoder is lenient in regards
|
|
||||||
* to the truncation of the file, the fact chunk, and the size of the RIFF
|
|
||||||
* chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION,
|
|
||||||
* and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the
|
|
||||||
* loading process.
|
|
||||||
*
|
|
||||||
* Any file that is invalid (due to truncation, corruption, or wrong values in
|
|
||||||
* the headers), too big, or unsupported causes an error. Additionally, any
|
|
||||||
* critical I/O error from the data source will terminate the loading process
|
|
||||||
* with an error. The function returns NULL on error and in all cases (with the
|
|
||||||
* exception of \c src being NULL), an appropriate error message will be set.
|
|
||||||
*
|
|
||||||
* It is required that the data source supports seeking.
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* \code
|
|
||||||
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* \param src The data source with the WAVE data
|
|
||||||
* \param freesrc A integer value that makes the function close the data source if non-zero
|
|
||||||
* \param spec A pointer filled with the audio format of the audio data
|
|
||||||
* \param audio_buf A pointer filled with the audio data allocated by the function
|
|
||||||
* \param audio_len A pointer filled with the length of the audio data buffer in bytes
|
|
||||||
* \return NULL on error, or non-NULL on success.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
|
|
||||||
int freesrc,
|
|
||||||
SDL_AudioSpec * spec,
|
|
||||||
Uint8 ** audio_buf,
|
|
||||||
Uint32 * audio_len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads a WAV from a file.
|
|
||||||
* Compatibility convenience function.
|
|
||||||
*/
|
|
||||||
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
|
|
||||||
SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function frees data previously allocated with SDL_LoadWAV_RW()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function takes a source format and rate and a destination format
|
|
||||||
* and rate, and initializes the \c cvt structure with information needed
|
|
||||||
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
|
|
||||||
* to the other. An unsupported format causes an error and -1 will be returned.
|
|
||||||
*
|
|
||||||
* \return 0 if no conversion is needed, 1 if the audio filter is set up,
|
|
||||||
* or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
|
||||||
SDL_AudioFormat src_format,
|
|
||||||
Uint8 src_channels,
|
|
||||||
int src_rate,
|
|
||||||
SDL_AudioFormat dst_format,
|
|
||||||
Uint8 dst_channels,
|
|
||||||
int dst_rate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
|
|
||||||
* created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
|
|
||||||
* audio data in the source format, this function will convert it in-place
|
|
||||||
* to the desired format.
|
|
||||||
*
|
|
||||||
* The data conversion may expand the size of the audio data, so the buffer
|
|
||||||
* \c cvt->buf should be allocated after the \c cvt structure is initialized by
|
|
||||||
* SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
|
|
||||||
*
|
|
||||||
* \return 0 on success or -1 if \c cvt->buf is NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt);
|
|
||||||
|
|
||||||
/* SDL_AudioStream is a new audio conversion interface.
|
|
||||||
The benefits vs SDL_AudioCVT:
|
|
||||||
- it can handle resampling data in chunks without generating
|
|
||||||
artifacts, when it doesn't have the complete buffer available.
|
|
||||||
- it can handle incoming data in any variable size.
|
|
||||||
- You push data as you have it, and pull it when you need it
|
|
||||||
*/
|
|
||||||
/* this is opaque to the outside world. */
|
|
||||||
struct _SDL_AudioStream;
|
|
||||||
typedef struct _SDL_AudioStream SDL_AudioStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new audio stream
|
|
||||||
*
|
|
||||||
* \param src_format The format of the source audio
|
|
||||||
* \param src_channels The number of channels of the source audio
|
|
||||||
* \param src_rate The sampling rate of the source audio
|
|
||||||
* \param dst_format The format of the desired audio output
|
|
||||||
* \param dst_channels The number of channels of the desired audio output
|
|
||||||
* \param dst_rate The sampling rate of the desired audio output
|
|
||||||
* \return 0 on success, or -1 on error.
|
|
||||||
*
|
|
||||||
* \sa SDL_AudioStreamPut
|
|
||||||
* \sa SDL_AudioStreamGet
|
|
||||||
* \sa SDL_AudioStreamAvailable
|
|
||||||
* \sa SDL_AudioStreamFlush
|
|
||||||
* \sa SDL_AudioStreamClear
|
|
||||||
* \sa SDL_FreeAudioStream
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format,
|
|
||||||
const Uint8 src_channels,
|
|
||||||
const int src_rate,
|
|
||||||
const SDL_AudioFormat dst_format,
|
|
||||||
const Uint8 dst_channels,
|
|
||||||
const int dst_rate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add data to be converted/resampled to the stream
|
|
||||||
*
|
|
||||||
* \param stream The stream the audio data is being added to
|
|
||||||
* \param buf A pointer to the audio data to add
|
|
||||||
* \param len The number of bytes to write to the stream
|
|
||||||
* \return 0 on success, or -1 on error.
|
|
||||||
*
|
|
||||||
* \sa SDL_NewAudioStream
|
|
||||||
* \sa SDL_AudioStreamGet
|
|
||||||
* \sa SDL_AudioStreamAvailable
|
|
||||||
* \sa SDL_AudioStreamFlush
|
|
||||||
* \sa SDL_AudioStreamClear
|
|
||||||
* \sa SDL_FreeAudioStream
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get converted/resampled data from the stream
|
|
||||||
*
|
|
||||||
* \param stream The stream the audio is being requested from
|
|
||||||
* \param buf A buffer to fill with audio data
|
|
||||||
* \param len The maximum number of bytes to fill
|
|
||||||
* \return The number of bytes read from the stream, or -1 on error
|
|
||||||
*
|
|
||||||
* \sa SDL_NewAudioStream
|
|
||||||
* \sa SDL_AudioStreamPut
|
|
||||||
* \sa SDL_AudioStreamAvailable
|
|
||||||
* \sa SDL_AudioStreamFlush
|
|
||||||
* \sa SDL_AudioStreamClear
|
|
||||||
* \sa SDL_FreeAudioStream
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of converted/resampled bytes available. The stream may be
|
|
||||||
* buffering data behind the scenes until it has enough to resample
|
|
||||||
* correctly, so this number might be lower than what you expect, or even
|
|
||||||
* be zero. Add more data or flush the stream if you need the data now.
|
|
||||||
*
|
|
||||||
* \sa SDL_NewAudioStream
|
|
||||||
* \sa SDL_AudioStreamPut
|
|
||||||
* \sa SDL_AudioStreamGet
|
|
||||||
* \sa SDL_AudioStreamFlush
|
|
||||||
* \sa SDL_AudioStreamClear
|
|
||||||
* \sa SDL_FreeAudioStream
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tell the stream that you're done sending data, and anything being buffered
|
|
||||||
* should be converted/resampled and made available immediately.
|
|
||||||
*
|
|
||||||
* It is legal to add more data to a stream after flushing, but there will
|
|
||||||
* be audio gaps in the output. Generally this is intended to signal the
|
|
||||||
* end of input, so the complete output becomes available.
|
|
||||||
*
|
|
||||||
* \sa SDL_NewAudioStream
|
|
||||||
* \sa SDL_AudioStreamPut
|
|
||||||
* \sa SDL_AudioStreamGet
|
|
||||||
* \sa SDL_AudioStreamAvailable
|
|
||||||
* \sa SDL_AudioStreamClear
|
|
||||||
* \sa SDL_FreeAudioStream
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear any pending data in the stream without converting it
|
|
||||||
*
|
|
||||||
* \sa SDL_NewAudioStream
|
|
||||||
* \sa SDL_AudioStreamPut
|
|
||||||
* \sa SDL_AudioStreamGet
|
|
||||||
* \sa SDL_AudioStreamAvailable
|
|
||||||
* \sa SDL_AudioStreamFlush
|
|
||||||
* \sa SDL_FreeAudioStream
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Free an audio stream
|
|
||||||
*
|
|
||||||
* \sa SDL_NewAudioStream
|
|
||||||
* \sa SDL_AudioStreamPut
|
|
||||||
* \sa SDL_AudioStreamGet
|
|
||||||
* \sa SDL_AudioStreamAvailable
|
|
||||||
* \sa SDL_AudioStreamFlush
|
|
||||||
* \sa SDL_AudioStreamClear
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
|
|
||||||
|
|
||||||
#define SDL_MIX_MAXVOLUME 128
|
|
||||||
/**
|
|
||||||
* This takes two audio buffers of the playing audio format and mixes
|
|
||||||
* them, performing addition, volume adjustment, and overflow clipping.
|
|
||||||
* The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
|
|
||||||
* for full audio volume. Note this does not change hardware volume.
|
|
||||||
* This is provided for convenience -- you can mix your own audio data.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
|
|
||||||
Uint32 len, int volume);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This works like SDL_MixAudio(), but you specify the audio format instead of
|
|
||||||
* using the format of audio device 1. Thus it can be used when no audio
|
|
||||||
* device is open at all.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
|
||||||
const Uint8 * src,
|
|
||||||
SDL_AudioFormat format,
|
|
||||||
Uint32 len, int volume);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Queue more audio on non-callback devices.
|
|
||||||
*
|
|
||||||
* (If you are looking to retrieve queued audio from a non-callback capture
|
|
||||||
* device, you want SDL_DequeueAudio() instead. This will return -1 to
|
|
||||||
* signify an error if you use it with capture devices.)
|
|
||||||
*
|
|
||||||
* SDL offers two ways to feed audio to the device: you can either supply a
|
|
||||||
* callback that SDL triggers with some frequency to obtain more audio
|
|
||||||
* (pull method), or you can supply no callback, and then SDL will expect
|
|
||||||
* you to supply data at regular intervals (push method) with this function.
|
|
||||||
*
|
|
||||||
* There are no limits on the amount of data you can queue, short of
|
|
||||||
* exhaustion of address space. Queued data will drain to the device as
|
|
||||||
* necessary without further intervention from you. If the device needs
|
|
||||||
* audio but there is not enough queued, it will play silence to make up
|
|
||||||
* the difference. This means you will have skips in your audio playback
|
|
||||||
* if you aren't routinely queueing sufficient data.
|
|
||||||
*
|
|
||||||
* This function copies the supplied data, so you are safe to free it when
|
|
||||||
* the function returns. This function is thread-safe, but queueing to the
|
|
||||||
* same device from two threads at once does not promise which buffer will
|
|
||||||
* be queued first.
|
|
||||||
*
|
|
||||||
* You may not queue audio on a device that is using an application-supplied
|
|
||||||
* callback; doing so returns an error. You have to use the audio callback
|
|
||||||
* or queue audio with this function, but not both.
|
|
||||||
*
|
|
||||||
* You should not call SDL_LockAudio() on the device before queueing; SDL
|
|
||||||
* handles locking internally for this function.
|
|
||||||
*
|
|
||||||
* \param dev The device ID to which we will queue audio.
|
|
||||||
* \param data The data to queue to the device for later playback.
|
|
||||||
* \param len The number of bytes (not samples!) to which (data) points.
|
|
||||||
* \return 0 on success, or -1 on error.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetQueuedAudioSize
|
|
||||||
* \sa SDL_ClearQueuedAudio
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dequeue more audio on non-callback devices.
|
|
||||||
*
|
|
||||||
* (If you are looking to queue audio for output on a non-callback playback
|
|
||||||
* device, you want SDL_QueueAudio() instead. This will always return 0
|
|
||||||
* if you use it with playback devices.)
|
|
||||||
*
|
|
||||||
* SDL offers two ways to retrieve audio from a capture device: you can
|
|
||||||
* either supply a callback that SDL triggers with some frequency as the
|
|
||||||
* device records more audio data, (push method), or you can supply no
|
|
||||||
* callback, and then SDL will expect you to retrieve data at regular
|
|
||||||
* intervals (pull method) with this function.
|
|
||||||
*
|
|
||||||
* There are no limits on the amount of data you can queue, short of
|
|
||||||
* exhaustion of address space. Data from the device will keep queuing as
|
|
||||||
* necessary without further intervention from you. This means you will
|
|
||||||
* eventually run out of memory if you aren't routinely dequeueing data.
|
|
||||||
*
|
|
||||||
* Capture devices will not queue data when paused; if you are expecting
|
|
||||||
* to not need captured audio for some length of time, use
|
|
||||||
* SDL_PauseAudioDevice() to stop the capture device from queueing more
|
|
||||||
* data. This can be useful during, say, level loading times. When
|
|
||||||
* unpaused, capture devices will start queueing data from that point,
|
|
||||||
* having flushed any capturable data available while paused.
|
|
||||||
*
|
|
||||||
* This function is thread-safe, but dequeueing from the same device from
|
|
||||||
* two threads at once does not promise which thread will dequeued data
|
|
||||||
* first.
|
|
||||||
*
|
|
||||||
* You may not dequeue audio from a device that is using an
|
|
||||||
* application-supplied callback; doing so returns an error. You have to use
|
|
||||||
* the audio callback, or dequeue audio with this function, but not both.
|
|
||||||
*
|
|
||||||
* You should not call SDL_LockAudio() on the device before queueing; SDL
|
|
||||||
* handles locking internally for this function.
|
|
||||||
*
|
|
||||||
* \param dev The device ID from which we will dequeue audio.
|
|
||||||
* \param data A pointer into where audio data should be copied.
|
|
||||||
* \param len The number of bytes (not samples!) to which (data) points.
|
|
||||||
* \return number of bytes dequeued, which could be less than requested.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetQueuedAudioSize
|
|
||||||
* \sa SDL_ClearQueuedAudio
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of bytes of still-queued audio.
|
|
||||||
*
|
|
||||||
* For playback device:
|
|
||||||
*
|
|
||||||
* This is the number of bytes that have been queued for playback with
|
|
||||||
* SDL_QueueAudio(), but have not yet been sent to the hardware. This
|
|
||||||
* number may shrink at any time, so this only informs of pending data.
|
|
||||||
*
|
|
||||||
* Once we've sent it to the hardware, this function can not decide the
|
|
||||||
* exact byte boundary of what has been played. It's possible that we just
|
|
||||||
* gave the hardware several kilobytes right before you called this
|
|
||||||
* function, but it hasn't played any of it yet, or maybe half of it, etc.
|
|
||||||
*
|
|
||||||
* For capture devices:
|
|
||||||
*
|
|
||||||
* This is the number of bytes that have been captured by the device and
|
|
||||||
* are waiting for you to dequeue. This number may grow at any time, so
|
|
||||||
* this only informs of the lower-bound of available data.
|
|
||||||
*
|
|
||||||
* You may not queue audio on a device that is using an application-supplied
|
|
||||||
* callback; calling this function on such a device always returns 0.
|
|
||||||
* You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
|
|
||||||
* the audio callback, but not both.
|
|
||||||
*
|
|
||||||
* You should not call SDL_LockAudio() on the device before querying; SDL
|
|
||||||
* handles locking internally for this function.
|
|
||||||
*
|
|
||||||
* \param dev The device ID of which we will query queued audio size.
|
|
||||||
* \return Number of bytes (not samples!) of queued audio.
|
|
||||||
*
|
|
||||||
* \sa SDL_QueueAudio
|
|
||||||
* \sa SDL_ClearQueuedAudio
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Drop any queued audio data. For playback devices, this is any queued data
|
|
||||||
* still waiting to be submitted to the hardware. For capture devices, this
|
|
||||||
* is any data that was queued by the device that hasn't yet been dequeued by
|
|
||||||
* the application.
|
|
||||||
*
|
|
||||||
* Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For
|
|
||||||
* playback devices, the hardware will start playing silence if more audio
|
|
||||||
* isn't queued. Unpaused capture devices will start filling the queue again
|
|
||||||
* as soon as they have more data available (which, depending on the state
|
|
||||||
* of the hardware and the thread, could be before this function call
|
|
||||||
* returns!).
|
|
||||||
*
|
|
||||||
* This will not prevent playback of queued audio that's already been sent
|
|
||||||
* to the hardware, as we can not undo that, so expect there to be some
|
|
||||||
* fraction of a second of audio that might still be heard. This can be
|
|
||||||
* useful if you want to, say, drop any pending music during a level change
|
|
||||||
* in your game.
|
|
||||||
*
|
|
||||||
* You may not queue audio on a device that is using an application-supplied
|
|
||||||
* callback; calling this function on such a device is always a no-op.
|
|
||||||
* You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
|
|
||||||
* the audio callback, but not both.
|
|
||||||
*
|
|
||||||
* You should not call SDL_LockAudio() on the device before clearing the
|
|
||||||
* queue; SDL handles locking internally for this function.
|
|
||||||
*
|
|
||||||
* This function always succeeds and thus returns void.
|
|
||||||
*
|
|
||||||
* \param dev The device ID of which to clear the audio queue.
|
|
||||||
*
|
|
||||||
* \sa SDL_QueueAudio
|
|
||||||
* \sa SDL_GetQueuedAudioSize
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Audio lock functions
|
|
||||||
*
|
|
||||||
* The lock manipulated by these functions protects the callback function.
|
|
||||||
* During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
|
|
||||||
* the callback function is not running. Do not call these from the callback
|
|
||||||
* function or you will cause deadlock.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LockAudio(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev);
|
|
||||||
/* @} *//* Audio lock functions */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function shuts down audio processing and closes the audio device.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_audio_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,126 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_bits.h
|
|
||||||
*
|
|
||||||
* Functions for fiddling with bits and bitmasks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_bits_h_
|
|
||||||
#define SDL_bits_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_bits.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the index of the most significant bit. Result is undefined when called
|
|
||||||
* with 0. This operation can also be stated as "count leading zeroes" and
|
|
||||||
* "log base 2".
|
|
||||||
*
|
|
||||||
* \return Index of the most significant bit, or -1 if the value is 0.
|
|
||||||
*/
|
|
||||||
#if defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern _inline int _SDL_bsr_watcom (Uint32);
|
|
||||||
#pragma aux _SDL_bsr_watcom = \
|
|
||||||
"bsr eax, eax" \
|
|
||||||
parm [eax] nomemory \
|
|
||||||
value [eax] \
|
|
||||||
modify exact [eax] nomemory;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_FORCE_INLINE int
|
|
||||||
SDL_MostSignificantBitIndex32(Uint32 x)
|
|
||||||
{
|
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
|
||||||
/* Count Leading Zeroes builtin in GCC.
|
|
||||||
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
|
|
||||||
*/
|
|
||||||
if (x == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 31 - __builtin_clz(x);
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
if (x == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return _SDL_bsr_watcom(x);
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
unsigned long index;
|
|
||||||
if (_BitScanReverse(&index, x)) {
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
#else
|
|
||||||
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
|
|
||||||
* <seander@cs.stanford.edu>, released in the public domain.
|
|
||||||
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
|
|
||||||
*/
|
|
||||||
const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
|
|
||||||
const int S[] = {1, 2, 4, 8, 16};
|
|
||||||
|
|
||||||
int msbIndex = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (x == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 4; i >= 0; i--)
|
|
||||||
{
|
|
||||||
if (x & b[i])
|
|
||||||
{
|
|
||||||
x >>= S[i];
|
|
||||||
msbIndex |= S[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return msbIndex;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_FORCE_INLINE SDL_bool
|
|
||||||
SDL_HasExactlyOneBitSet32(Uint32 x)
|
|
||||||
{
|
|
||||||
if (x && !(x & (x - 1))) {
|
|
||||||
return SDL_TRUE;
|
|
||||||
}
|
|
||||||
return SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_bits_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,123 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_blendmode.h
|
|
||||||
*
|
|
||||||
* Header file declaring the SDL_BlendMode enumeration
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_blendmode_h_
|
|
||||||
#define SDL_blendmode_h_
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
|
|
||||||
dstRGBA = srcRGBA */
|
|
||||||
SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
|
|
||||||
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
|
|
||||||
dstA = srcA + (dstA * (1-srcA)) */
|
|
||||||
SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
|
|
||||||
dstRGB = (srcRGB * srcA) + dstRGB
|
|
||||||
dstA = dstA */
|
|
||||||
SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate
|
|
||||||
dstRGB = srcRGB * dstRGB
|
|
||||||
dstA = dstA */
|
|
||||||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
|
||||||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
|
||||||
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
|
|
||||||
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
|
||||||
|
|
||||||
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
|
||||||
|
|
||||||
} SDL_BlendMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The blend operation used when combining source and destination pixel components
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
|
||||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
|
||||||
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
|
||||||
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */
|
|
||||||
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */
|
|
||||||
|
|
||||||
} SDL_BlendOperation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The normalized factor used to multiply pixel components
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */
|
|
||||||
SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */
|
|
||||||
SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */
|
|
||||||
SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */
|
|
||||||
SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */
|
|
||||||
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */
|
|
||||||
SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */
|
|
||||||
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
|
|
||||||
SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */
|
|
||||||
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
|
|
||||||
|
|
||||||
} SDL_BlendFactor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a custom blend mode, which may or may not be supported by a given renderer
|
|
||||||
*
|
|
||||||
* \param srcColorFactor source color factor
|
|
||||||
* \param dstColorFactor destination color factor
|
|
||||||
* \param colorOperation color operation
|
|
||||||
* \param srcAlphaFactor source alpha factor
|
|
||||||
* \param dstAlphaFactor destination alpha factor
|
|
||||||
* \param alphaOperation alpha operation
|
|
||||||
*
|
|
||||||
* The result of the blend mode operation will be:
|
|
||||||
* dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
|
|
||||||
* and
|
|
||||||
* dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
|
|
||||||
SDL_BlendFactor dstColorFactor,
|
|
||||||
SDL_BlendOperation colorOperation,
|
|
||||||
SDL_BlendFactor srcAlphaFactor,
|
|
||||||
SDL_BlendFactor dstAlphaFactor,
|
|
||||||
SDL_BlendOperation alphaOperation);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_blendmode_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_clipboard.h
|
|
||||||
*
|
|
||||||
* Include file for SDL clipboard handling
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_clipboard_h_
|
|
||||||
#define SDL_clipboard_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Put UTF-8 text into the clipboard
|
|
||||||
*
|
|
||||||
* \sa SDL_GetClipboardText()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
|
|
||||||
*
|
|
||||||
* \sa SDL_SetClipboardText()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
|
|
||||||
*
|
|
||||||
* \sa SDL_GetClipboardText()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_clipboard_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_config.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Add any platform that doesn't build using the configure system. */
|
|
||||||
#if defined(__WIN32__)
|
|
||||||
#include "SDL_config_windows.h"
|
|
||||||
#elif defined(__WINRT__)
|
|
||||||
#include "SDL_config_winrt.h"
|
|
||||||
#elif defined(__MACOSX__)
|
|
||||||
#include "SDL_config_macosx.h"
|
|
||||||
#elif defined(__IPHONEOS__)
|
|
||||||
#include "SDL_config_iphoneos.h"
|
|
||||||
#elif defined(__ANDROID__)
|
|
||||||
#include "SDL_config_android.h"
|
|
||||||
#elif defined(__PSP__)
|
|
||||||
#include "SDL_config_psp.h"
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
#include "SDL_config_os2.h"
|
|
||||||
#else
|
|
||||||
/* This is a minimal configuration just to get SDL running on new platforms. */
|
|
||||||
#include "SDL_config_minimal.h"
|
|
||||||
#endif /* platform config */
|
|
||||||
|
|
||||||
#ifdef USING_GENERATED_CONFIG_H
|
|
||||||
#error Wrong SDL_config.h, check your include path?
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_h_ */
|
|
@ -1,270 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_macosx_h_
|
|
||||||
#define SDL_config_macosx_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
|
|
||||||
#include <AvailabilityMacros.h>
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_FLOAT_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_LIMITS_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_LIBUNWIND_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOK_R 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ACOSF 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
#define HAVE_ASINF 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATANF 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ATAN2F 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_CEILF 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COPYSIGNF 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_EXP 1
|
|
||||||
#define HAVE_EXPF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FABSF 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_FLOORF 1
|
|
||||||
#define HAVE_FMOD 1
|
|
||||||
#define HAVE_FMODF 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_LOGF 1
|
|
||||||
#define HAVE_LOG10 1
|
|
||||||
#define HAVE_LOG10F 1
|
|
||||||
#define HAVE_LROUND 1
|
|
||||||
#define HAVE_LROUNDF 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_POWF 1
|
|
||||||
#define HAVE_ROUND 1
|
|
||||||
#define HAVE_ROUNDF 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SCALBNF 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_TRUNC 1
|
|
||||||
#define HAVE_TRUNCF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_SYSCONF 1
|
|
||||||
#define HAVE_SYSCTLBYNAME 1
|
|
||||||
|
|
||||||
#define HAVE_GCC_ATOMICS 1
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#define SDL_JOYSTICK_HIDAPI 1
|
|
||||||
#define SDL_JOYSTICK_IOKIT 1
|
|
||||||
#define SDL_JOYSTICK_VIRTUAL 1
|
|
||||||
#define SDL_HAPTIC_IOKIT 1
|
|
||||||
|
|
||||||
/* The MFI controller support requires ARC Objective C runtime */
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)
|
|
||||||
#define SDL_JOYSTICK_MFI 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable the dummy sensor driver */
|
|
||||||
#define SDL_SENSOR_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_COCOA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XDBE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
|
|
||||||
|
|
||||||
#ifdef MAC_OS_X_VERSION_10_8
|
|
||||||
/*
|
|
||||||
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
|
|
||||||
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
|
|
||||||
* used an older Xlib.
|
|
||||||
*/
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL
|
|
||||||
#define SDL_VIDEO_RENDER_OGL 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL_ES2
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Metal only supported on 64-bit architectures with 10.11+ */
|
|
||||||
#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
|
|
||||||
#define SDL_PLATFORM_SUPPORTS_METAL 1
|
|
||||||
#else
|
|
||||||
#define SDL_PLATFORM_SUPPORTS_METAL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_METAL
|
|
||||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
|
||||||
#define SDL_VIDEO_RENDER_METAL 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_RENDER_METAL 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#ifndef SDL_VIDEO_OPENGL
|
|
||||||
#define SDL_VIDEO_OPENGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_ES2
|
|
||||||
#define SDL_VIDEO_OPENGL_ES2 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_EGL
|
|
||||||
#define SDL_VIDEO_OPENGL_EGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_CGL
|
|
||||||
#define SDL_VIDEO_OPENGL_CGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_GLX
|
|
||||||
#define SDL_VIDEO_OPENGL_GLX 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable Vulkan and Metal support */
|
|
||||||
#ifndef SDL_VIDEO_VULKAN
|
|
||||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_VULKAN 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_METAL
|
|
||||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
|
||||||
#define SDL_VIDEO_METAL 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_METAL 0
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_MACOSX 1
|
|
||||||
|
|
||||||
/* enable filesystem support */
|
|
||||||
#define SDL_FILESYSTEM_COCOA 1
|
|
||||||
|
|
||||||
/* Enable assembly routines */
|
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
|
||||||
#ifdef __ppc__
|
|
||||||
#define SDL_ALTIVEC_BLITTERS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_macosx_h_ */
|
|
@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
@ -1,299 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_cpuinfo.h
|
|
||||||
*
|
|
||||||
* CPU feature detection for SDL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_cpuinfo_h_
|
|
||||||
#define SDL_cpuinfo_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
/* Need to do this here because intrin.h has C++ code in it */
|
|
||||||
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
|
|
||||||
#ifdef __clang__
|
|
||||||
/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */
|
|
||||||
#undef __MMX__
|
|
||||||
#undef __SSE__
|
|
||||||
#undef __SSE2__
|
|
||||||
#else
|
|
||||||
#include <intrin.h>
|
|
||||||
#ifndef _WIN64
|
|
||||||
#ifndef __MMX__
|
|
||||||
#define __MMX__
|
|
||||||
#endif
|
|
||||||
#ifndef __3dNOW__
|
|
||||||
#define __3dNOW__
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef __SSE__
|
|
||||||
#define __SSE__
|
|
||||||
#endif
|
|
||||||
#ifndef __SSE2__
|
|
||||||
#define __SSE2__
|
|
||||||
#endif
|
|
||||||
#endif /* __clang__ */
|
|
||||||
#elif defined(__MINGW64_VERSION_MAJOR)
|
|
||||||
#include <intrin.h>
|
|
||||||
#else
|
|
||||||
/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */
|
|
||||||
#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
|
|
||||||
#include <altivec.h>
|
|
||||||
#endif
|
|
||||||
#if !defined(SDL_DISABLE_ARM_NEON_H)
|
|
||||||
# if defined(__ARM_NEON)
|
|
||||||
# include <arm_neon.h>
|
|
||||||
# elif defined(__WINDOWS__) || defined(__WINRT__)
|
|
||||||
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
|
||||||
# if defined(_M_ARM)
|
|
||||||
# include <armintr.h>
|
|
||||||
# include <arm_neon.h>
|
|
||||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
|
||||||
# endif
|
|
||||||
# if defined (_M_ARM64)
|
|
||||||
# include <arm64intr.h>
|
|
||||||
# include <arm64_neon.h>
|
|
||||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
|
||||||
#include <mm3dnow.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
|
||||||
#include <immintrin.h>
|
|
||||||
#else
|
|
||||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
|
|
||||||
#include <mmintrin.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H)
|
|
||||||
#include <xmmintrin.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H)
|
|
||||||
#include <emmintrin.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H)
|
|
||||||
#include <pmmintrin.h>
|
|
||||||
#endif
|
|
||||||
#endif /* HAVE_IMMINTRIN_H */
|
|
||||||
#endif /* compiler version */
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is a guess for the cacheline size used for padding.
|
|
||||||
* Most x86 processors have a 64 byte cache line.
|
|
||||||
* The 64-bit PowerPC processors have a 128 byte cache line.
|
|
||||||
* We'll use the larger value to be generally safe.
|
|
||||||
*/
|
|
||||||
#define SDL_CACHELINE_SIZE 128
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the number of CPU cores available.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the L1 cache line size of the CPU
|
|
||||||
*
|
|
||||||
* This is useful for determining multi-threaded structure padding
|
|
||||||
* or SIMD prefetch sizes.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has the RDTSC instruction.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has AltiVec features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has MMX features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has 3DNow! features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has SSE features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has SSE2 features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has SSE3 features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has SSE4.1 features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has SSE4.2 features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has AVX features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has AVX2 features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has AVX-512F (foundation) features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has ARM SIMD (ARMv6) features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns true if the CPU has NEON (ARM SIMD) features.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function returns the amount of RAM configured in the system, in MB.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Report the alignment this system needs for SIMD allocations.
|
|
||||||
*
|
|
||||||
* This will return the minimum number of bytes to which a pointer must be
|
|
||||||
* aligned to be compatible with SIMD instructions on the current machine.
|
|
||||||
* For example, if the machine supports SSE only, it will return 16, but if
|
|
||||||
* it supports AVX-512F, it'll return 64 (etc). This only reports values for
|
|
||||||
* instruction sets SDL knows about, so if your SDL build doesn't have
|
|
||||||
* SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
|
|
||||||
* not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
|
|
||||||
* Plan accordingly.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Allocate memory in a SIMD-friendly way.
|
|
||||||
*
|
|
||||||
* This will allocate a block of memory that is suitable for use with SIMD
|
|
||||||
* instructions. Specifically, it will be properly aligned and padded for
|
|
||||||
* the system's supported vector instructions.
|
|
||||||
*
|
|
||||||
* The memory returned will be padded such that it is safe to read or write
|
|
||||||
* an incomplete vector at the end of the memory block. This can be useful
|
|
||||||
* so you don't have to drop back to a scalar fallback at the end of your
|
|
||||||
* SIMD processing loop to deal with the final elements without overflowing
|
|
||||||
* the allocated buffer.
|
|
||||||
*
|
|
||||||
* You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
|
|
||||||
* or delete[], etc.
|
|
||||||
*
|
|
||||||
* Note that SDL will only deal with SIMD instruction sets it is aware of;
|
|
||||||
* for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
|
|
||||||
* (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
|
|
||||||
* know that AVX-512 wants 64. To be clear: if you can't decide to use an
|
|
||||||
* instruction set with an SDL_Has*() function, don't use that instruction
|
|
||||||
* set with memory allocated through here.
|
|
||||||
*
|
|
||||||
* SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
|
|
||||||
* out of memory.
|
|
||||||
*
|
|
||||||
* \param len The length, in bytes, of the block to allocated. The actual
|
|
||||||
* allocated block might be larger due to padding, etc.
|
|
||||||
* \return Pointer to newly-allocated block, NULL if out of memory.
|
|
||||||
*
|
|
||||||
* \sa SDL_SIMDAlignment
|
|
||||||
* \sa SDL_SIMDRealloc
|
|
||||||
* \sa SDL_SIMDFree
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Reallocate memory obtained from SDL_SIMDAlloc
|
|
||||||
*
|
|
||||||
* It is not valid to use this function on a pointer from anything but
|
|
||||||
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
|
|
||||||
* SDL_malloc, memalign, new[], etc.
|
|
||||||
*
|
|
||||||
* \param mem The pointer obtained from SDL_SIMDAlloc. This function also
|
|
||||||
* accepts NULL, at which point this function is the same as
|
|
||||||
* calling SDL_realloc with a NULL pointer.
|
|
||||||
* \param len The length, in bytes, of the block to allocated. The actual
|
|
||||||
* allocated block might be larger due to padding, etc. Passing 0
|
|
||||||
* will return a non-NULL pointer, assuming the system isn't out of
|
|
||||||
* memory.
|
|
||||||
* \return Pointer to newly-reallocated block, NULL if out of memory.
|
|
||||||
*
|
|
||||||
* \sa SDL_SIMDAlignment
|
|
||||||
* \sa SDL_SIMDAlloc
|
|
||||||
* \sa SDL_SIMDFree
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Deallocate memory obtained from SDL_SIMDAlloc
|
|
||||||
*
|
|
||||||
* It is not valid to use this function on a pointer from anything but
|
|
||||||
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
|
|
||||||
* SDL_malloc, memalign, new[], etc.
|
|
||||||
*
|
|
||||||
* However, SDL_SIMDFree(NULL) is a legal no-op.
|
|
||||||
*
|
|
||||||
* \sa SDL_SIMDAlloc
|
|
||||||
* \sa SDL_SIMDRealloc
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_cpuinfo_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,304 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_endian.h
|
|
||||||
*
|
|
||||||
* Functions for reading and writing endian-specific values
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_endian_h_
|
|
||||||
#define SDL_endian_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <intrin.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name The two types of endianness
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_LIL_ENDIAN 1234
|
|
||||||
#define SDL_BIG_ENDIAN 4321
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
|
||||||
#ifdef __linux__
|
|
||||||
#include <endian.h>
|
|
||||||
#define SDL_BYTEORDER __BYTE_ORDER
|
|
||||||
#elif defined(__OpenBSD__)
|
|
||||||
#include <endian.h>
|
|
||||||
#define SDL_BYTEORDER BYTE_ORDER
|
|
||||||
#elif defined(__FreeBSD__)
|
|
||||||
#include <sys/endian.h>
|
|
||||||
#define SDL_BYTEORDER BYTE_ORDER
|
|
||||||
#else
|
|
||||||
#if defined(__hppa__) || \
|
|
||||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
|
||||||
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
|
||||||
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
|
|
||||||
defined(__sparc__)
|
|
||||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
|
||||||
#else
|
|
||||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
|
||||||
#endif
|
|
||||||
#endif /* __linux__ */
|
|
||||||
#endif /* !SDL_BYTEORDER */
|
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_endian.h
|
|
||||||
*/
|
|
||||||
#if (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 2))) || \
|
|
||||||
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
|
|
||||||
#define SDL_Swap16(x) __builtin_bswap16(x)
|
|
||||||
#elif defined(__GNUC__) && defined(__i386__) && \
|
|
||||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
int result;
|
|
||||||
|
|
||||||
__asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
|
|
||||||
return (Uint16)result;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && defined(__aarch64__)
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("rev16 %w1, %w0" : "=r"(x) : "r"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
__asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#pragma intrinsic(_byteswap_ushort)
|
|
||||||
#define SDL_Swap16(x) _byteswap_ushort(x)
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern _inline Uint16 SDL_Swap16(Uint16);
|
|
||||||
#pragma aux SDL_Swap16 = \
|
|
||||||
"xchg al, ah" \
|
|
||||||
parm [ax] \
|
|
||||||
modify [ax];
|
|
||||||
#else
|
|
||||||
SDL_FORCE_INLINE Uint16
|
|
||||||
SDL_Swap16(Uint16 x)
|
|
||||||
{
|
|
||||||
return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined(__clang__) && (__clang_major__ > 2 || (__clang_major__ == 2 && __clang_minor__ >= 6))) || \
|
|
||||||
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
|
||||||
#define SDL_Swap32(x) __builtin_bswap32(x)
|
|
||||||
#elif defined(__GNUC__) && defined(__i386__) && \
|
|
||||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("bswap %0": "=r"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("bswapl %0": "=r"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
Uint32 result;
|
|
||||||
|
|
||||||
__asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
|
|
||||||
__asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
|
|
||||||
__asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && defined(__aarch64__)
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("rev %w1, %w0": "=r"(x):"r"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
extern _inline Uint32 SDL_Swap32(Uint32);
|
|
||||||
#ifndef __SW_3 /* 486+ */
|
|
||||||
#pragma aux SDL_Swap32 = \
|
|
||||||
"bswap eax" \
|
|
||||||
parm [eax] \
|
|
||||||
modify [eax];
|
|
||||||
#else /* 386-only */
|
|
||||||
#pragma aux SDL_Swap32 = \
|
|
||||||
"xchg al, ah" \
|
|
||||||
"ror eax, 16" \
|
|
||||||
"xchg al, ah" \
|
|
||||||
parm [eax] \
|
|
||||||
modify [eax];
|
|
||||||
#endif
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#pragma intrinsic(_byteswap_ulong)
|
|
||||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
|
||||||
#else
|
|
||||||
SDL_FORCE_INLINE Uint32
|
|
||||||
SDL_Swap32(Uint32 x)
|
|
||||||
{
|
|
||||||
return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
|
|
||||||
((x >> 8) & 0x0000FF00) | (x >> 24)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined(__clang__) && (__clang_major__ > 2 || (__clang_major__ == 2 && __clang_minor__ >= 6))) || \
|
|
||||||
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
|
||||||
#define SDL_Swap64(x) __builtin_bswap64(x)
|
|
||||||
#elif defined(__GNUC__) && defined(__i386__) && \
|
|
||||||
!(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
|
|
||||||
SDL_FORCE_INLINE Uint64
|
|
||||||
SDL_Swap64(Uint64 x)
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Uint32 a, b;
|
|
||||||
} s;
|
|
||||||
Uint64 u;
|
|
||||||
} v;
|
|
||||||
v.u = x;
|
|
||||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
|
|
||||||
"1"(v.s.
|
|
||||||
b));
|
|
||||||
return v.u;
|
|
||||||
}
|
|
||||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
|
||||||
SDL_FORCE_INLINE Uint64
|
|
||||||
SDL_Swap64(Uint64 x)
|
|
||||||
{
|
|
||||||
__asm__("bswapq %0": "=r"(x):"0"(x));
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#pragma intrinsic(_byteswap_uint64)
|
|
||||||
#define SDL_Swap64(x) _byteswap_uint64(x)
|
|
||||||
#else
|
|
||||||
SDL_FORCE_INLINE Uint64
|
|
||||||
SDL_Swap64(Uint64 x)
|
|
||||||
{
|
|
||||||
Uint32 hi, lo;
|
|
||||||
|
|
||||||
/* Separate into high and low 32-bit values and swap them */
|
|
||||||
lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
|
||||||
x >>= 32;
|
|
||||||
hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
|
|
||||||
x = SDL_Swap32(lo);
|
|
||||||
x <<= 32;
|
|
||||||
x |= SDL_Swap32(hi);
|
|
||||||
return (x);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
SDL_FORCE_INLINE float
|
|
||||||
SDL_SwapFloat(float x)
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
float f;
|
|
||||||
Uint32 ui32;
|
|
||||||
} swapper;
|
|
||||||
swapper.f = x;
|
|
||||||
swapper.ui32 = SDL_Swap32(swapper.ui32);
|
|
||||||
return swapper.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Swap to native
|
|
||||||
* Byteswap item from the specified endianness to the native endianness.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
|
||||||
#define SDL_SwapLE16(X) (X)
|
|
||||||
#define SDL_SwapLE32(X) (X)
|
|
||||||
#define SDL_SwapLE64(X) (X)
|
|
||||||
#define SDL_SwapFloatLE(X) (X)
|
|
||||||
#define SDL_SwapBE16(X) SDL_Swap16(X)
|
|
||||||
#define SDL_SwapBE32(X) SDL_Swap32(X)
|
|
||||||
#define SDL_SwapBE64(X) SDL_Swap64(X)
|
|
||||||
#define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
|
|
||||||
#else
|
|
||||||
#define SDL_SwapLE16(X) SDL_Swap16(X)
|
|
||||||
#define SDL_SwapLE32(X) SDL_Swap32(X)
|
|
||||||
#define SDL_SwapLE64(X) SDL_Swap64(X)
|
|
||||||
#define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
|
|
||||||
#define SDL_SwapBE16(X) (X)
|
|
||||||
#define SDL_SwapBE32(X) (X)
|
|
||||||
#define SDL_SwapBE64(X) (X)
|
|
||||||
#define SDL_SwapFloatBE(X) (X)
|
|
||||||
#endif
|
|
||||||
/* @} *//* Swap to native */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_endian_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,112 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_error.h
|
|
||||||
*
|
|
||||||
* Simple error message routines for SDL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_error_h_
|
|
||||||
#define SDL_error_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Public functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the error message for the current thread
|
|
||||||
*
|
|
||||||
* \return -1, there is no error handling for this function
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the last error message that was set
|
|
||||||
*
|
|
||||||
* SDL API functions may set error messages and then succeed, so you should
|
|
||||||
* only use the error value if a function fails.
|
|
||||||
*
|
|
||||||
* This returns a pointer to a static buffer for convenience and should not
|
|
||||||
* be called by multiple threads simultaneously.
|
|
||||||
*
|
|
||||||
* \return a pointer to the last error message that was set
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the last error message that was set for the current thread
|
|
||||||
*
|
|
||||||
* SDL API functions may set error messages and then succeed, so you should
|
|
||||||
* only use the error value if a function fails.
|
|
||||||
*
|
|
||||||
* \param errstr A buffer to fill with the last error message that was set
|
|
||||||
* for the current thread
|
|
||||||
* \param maxlen The size of the buffer pointed to by the errstr parameter
|
|
||||||
*
|
|
||||||
* \return errstr
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Clear the error message for the current thread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_ClearError(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Internal error functions
|
|
||||||
*
|
|
||||||
* \internal
|
|
||||||
* Private error reporting function - used internally.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
|
|
||||||
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
|
|
||||||
#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ENOMEM,
|
|
||||||
SDL_EFREAD,
|
|
||||||
SDL_EFWRITE,
|
|
||||||
SDL_EFSEEK,
|
|
||||||
SDL_UNSUPPORTED,
|
|
||||||
SDL_LASTERROR
|
|
||||||
} SDL_errorcode;
|
|
||||||
/* SDL_Error() unconditionally returns -1. */
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
|
|
||||||
/* @} *//* Internal error functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_error_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,827 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_events.h
|
|
||||||
*
|
|
||||||
* Include file for SDL event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_events_h_
|
|
||||||
#define SDL_events_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
#include "SDL_keyboard.h"
|
|
||||||
#include "SDL_mouse.h"
|
|
||||||
#include "SDL_joystick.h"
|
|
||||||
#include "SDL_gamecontroller.h"
|
|
||||||
#include "SDL_quit.h"
|
|
||||||
#include "SDL_gesture.h"
|
|
||||||
#include "SDL_touch.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* General keyboard/mouse state definitions */
|
|
||||||
#define SDL_RELEASED 0
|
|
||||||
#define SDL_PRESSED 1
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The types of events that can be delivered.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
|
|
||||||
|
|
||||||
/* Application events */
|
|
||||||
SDL_QUIT = 0x100, /**< User-requested quit */
|
|
||||||
|
|
||||||
/* These application events have special meaning on iOS, see README-ios.md for details */
|
|
||||||
SDL_APP_TERMINATING, /**< The application is being terminated by the OS
|
|
||||||
Called on iOS in applicationWillTerminate()
|
|
||||||
Called on Android in onDestroy()
|
|
||||||
*/
|
|
||||||
SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible.
|
|
||||||
Called on iOS in applicationDidReceiveMemoryWarning()
|
|
||||||
Called on Android in onLowMemory()
|
|
||||||
*/
|
|
||||||
SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background
|
|
||||||
Called on iOS in applicationWillResignActive()
|
|
||||||
Called on Android in onPause()
|
|
||||||
*/
|
|
||||||
SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time
|
|
||||||
Called on iOS in applicationDidEnterBackground()
|
|
||||||
Called on Android in onPause()
|
|
||||||
*/
|
|
||||||
SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground
|
|
||||||
Called on iOS in applicationWillEnterForeground()
|
|
||||||
Called on Android in onResume()
|
|
||||||
*/
|
|
||||||
SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive
|
|
||||||
Called on iOS in applicationDidBecomeActive()
|
|
||||||
Called on Android in onResume()
|
|
||||||
*/
|
|
||||||
|
|
||||||
SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */
|
|
||||||
|
|
||||||
/* Display events */
|
|
||||||
SDL_DISPLAYEVENT = 0x150, /**< Display state change */
|
|
||||||
|
|
||||||
/* Window events */
|
|
||||||
SDL_WINDOWEVENT = 0x200, /**< Window state change */
|
|
||||||
SDL_SYSWMEVENT, /**< System specific event */
|
|
||||||
|
|
||||||
/* Keyboard events */
|
|
||||||
SDL_KEYDOWN = 0x300, /**< Key pressed */
|
|
||||||
SDL_KEYUP, /**< Key released */
|
|
||||||
SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
|
|
||||||
SDL_TEXTINPUT, /**< Keyboard text input */
|
|
||||||
SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
|
|
||||||
input language or keyboard layout change.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Mouse events */
|
|
||||||
SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
|
|
||||||
SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
|
|
||||||
SDL_MOUSEBUTTONUP, /**< Mouse button released */
|
|
||||||
SDL_MOUSEWHEEL, /**< Mouse wheel motion */
|
|
||||||
|
|
||||||
/* Joystick events */
|
|
||||||
SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
|
|
||||||
SDL_JOYBALLMOTION, /**< Joystick trackball motion */
|
|
||||||
SDL_JOYHATMOTION, /**< Joystick hat position change */
|
|
||||||
SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
|
|
||||||
SDL_JOYBUTTONUP, /**< Joystick button released */
|
|
||||||
SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
|
|
||||||
SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
|
|
||||||
|
|
||||||
/* Game controller events */
|
|
||||||
SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
|
|
||||||
SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */
|
|
||||||
SDL_CONTROLLERBUTTONUP, /**< Game controller button released */
|
|
||||||
SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */
|
|
||||||
SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */
|
|
||||||
SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */
|
|
||||||
SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */
|
|
||||||
SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */
|
|
||||||
SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */
|
|
||||||
SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */
|
|
||||||
|
|
||||||
/* Touch events */
|
|
||||||
SDL_FINGERDOWN = 0x700,
|
|
||||||
SDL_FINGERUP,
|
|
||||||
SDL_FINGERMOTION,
|
|
||||||
|
|
||||||
/* Gesture events */
|
|
||||||
SDL_DOLLARGESTURE = 0x800,
|
|
||||||
SDL_DOLLARRECORD,
|
|
||||||
SDL_MULTIGESTURE,
|
|
||||||
|
|
||||||
/* Clipboard events */
|
|
||||||
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
|
|
||||||
|
|
||||||
/* Drag and drop events */
|
|
||||||
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
|
|
||||||
SDL_DROPTEXT, /**< text/plain drag-and-drop event */
|
|
||||||
SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */
|
|
||||||
SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */
|
|
||||||
|
|
||||||
/* Audio hotplug events */
|
|
||||||
SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
|
|
||||||
SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */
|
|
||||||
|
|
||||||
/* Sensor events */
|
|
||||||
SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */
|
|
||||||
|
|
||||||
/* Render events */
|
|
||||||
SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
|
|
||||||
SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
|
|
||||||
|
|
||||||
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
|
|
||||||
* and should be allocated with SDL_RegisterEvents()
|
|
||||||
*/
|
|
||||||
SDL_USEREVENT = 0x8000,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This last event is only for bounding internal arrays
|
|
||||||
*/
|
|
||||||
SDL_LASTEVENT = 0xFFFF
|
|
||||||
} SDL_EventType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Fields shared by every event
|
|
||||||
*/
|
|
||||||
typedef struct SDL_CommonEvent
|
|
||||||
{
|
|
||||||
Uint32 type;
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
} SDL_CommonEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Display state change event data (event.display.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_DisplayEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_DISPLAYEVENT */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 display; /**< The associated display index */
|
|
||||||
Uint8 event; /**< ::SDL_DisplayEventID */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
Sint32 data1; /**< event dependent data */
|
|
||||||
} SDL_DisplayEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Window state change event data (event.window.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_WindowEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_WINDOWEVENT */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The associated window */
|
|
||||||
Uint8 event; /**< ::SDL_WindowEventID */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
Sint32 data1; /**< event dependent data */
|
|
||||||
Sint32 data2; /**< event dependent data */
|
|
||||||
} SDL_WindowEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Keyboard button event structure (event.key.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_KeyboardEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
|
||||||
Uint8 repeat; /**< Non-zero if this is a key repeat */
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
SDL_Keysym keysym; /**< The key that was pressed or released */
|
|
||||||
} SDL_KeyboardEvent;
|
|
||||||
|
|
||||||
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
|
|
||||||
/**
|
|
||||||
* \brief Keyboard text editing event structure (event.edit.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_TextEditingEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_TEXTEDITING */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
|
||||||
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
|
|
||||||
Sint32 start; /**< The start cursor of selected editing text */
|
|
||||||
Sint32 length; /**< The length of selected editing text */
|
|
||||||
} SDL_TextEditingEvent;
|
|
||||||
|
|
||||||
|
|
||||||
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
|
|
||||||
/**
|
|
||||||
* \brief Keyboard text input event structure (event.text.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_TextInputEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_TEXTINPUT */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The window with keyboard focus, if any */
|
|
||||||
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
|
|
||||||
} SDL_TextInputEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Mouse motion event structure (event.motion.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_MouseMotionEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_MOUSEMOTION */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
|
||||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
|
||||||
Uint32 state; /**< The current button state */
|
|
||||||
Sint32 x; /**< X coordinate, relative to window */
|
|
||||||
Sint32 y; /**< Y coordinate, relative to window */
|
|
||||||
Sint32 xrel; /**< The relative motion in the X direction */
|
|
||||||
Sint32 yrel; /**< The relative motion in the Y direction */
|
|
||||||
} SDL_MouseMotionEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Mouse button event structure (event.button.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_MouseButtonEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
|
||||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
|
||||||
Uint8 button; /**< The mouse button index */
|
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
|
||||||
Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
|
|
||||||
Uint8 padding1;
|
|
||||||
Sint32 x; /**< X coordinate, relative to window */
|
|
||||||
Sint32 y; /**< Y coordinate, relative to window */
|
|
||||||
} SDL_MouseButtonEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Mouse wheel event structure (event.wheel.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_MouseWheelEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_MOUSEWHEEL */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The window with mouse focus, if any */
|
|
||||||
Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
|
|
||||||
Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
|
|
||||||
Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
|
|
||||||
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
|
||||||
} SDL_MouseWheelEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Joystick axis motion event structure (event.jaxis.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_JoyAxisEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_JOYAXISMOTION */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Uint8 axis; /**< The joystick axis index */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
Sint16 value; /**< The axis value (range: -32768 to 32767) */
|
|
||||||
Uint16 padding4;
|
|
||||||
} SDL_JoyAxisEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Joystick trackball motion event structure (event.jball.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_JoyBallEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Uint8 ball; /**< The joystick trackball index */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
Sint16 xrel; /**< The relative motion in the X direction */
|
|
||||||
Sint16 yrel; /**< The relative motion in the Y direction */
|
|
||||||
} SDL_JoyBallEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Joystick hat position change event structure (event.jhat.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_JoyHatEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_JOYHATMOTION */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Uint8 hat; /**< The joystick hat index */
|
|
||||||
Uint8 value; /**< The hat position value.
|
|
||||||
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
|
|
||||||
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
|
|
||||||
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
|
|
||||||
*
|
|
||||||
* Note that zero means the POV is centered.
|
|
||||||
*/
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
} SDL_JoyHatEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Joystick button event structure (event.jbutton.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_JoyButtonEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Uint8 button; /**< The joystick button index */
|
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
} SDL_JoyButtonEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Joystick device event structure (event.jdevice.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_JoyDeviceEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
|
||||||
} SDL_JoyDeviceEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Game controller axis motion event structure (event.caxis.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_ControllerAxisEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
Sint16 value; /**< The axis value (range: -32768 to 32767) */
|
|
||||||
Uint16 padding4;
|
|
||||||
} SDL_ControllerAxisEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Game controller button event structure (event.cbutton.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_ControllerButtonEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Uint8 button; /**< The controller button (SDL_GameControllerButton) */
|
|
||||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
} SDL_ControllerButtonEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Controller device event structure (event.cdevice.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_ControllerDeviceEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
|
|
||||||
} SDL_ControllerDeviceEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Game controller touchpad event structure (event.ctouchpad.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_ControllerTouchpadEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Sint32 touchpad; /**< The index of the touchpad */
|
|
||||||
Sint32 finger; /**< The index of the finger on the touchpad */
|
|
||||||
float x; /**< Normalized in the range 0...1 with 0 being on the left */
|
|
||||||
float y; /**< Normalized in the range 0...1 with 0 being at the top */
|
|
||||||
float pressure; /**< Normalized in the range 0...1 */
|
|
||||||
} SDL_ControllerTouchpadEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Game controller sensor event structure (event.csensor.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_ControllerSensorEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_JoystickID which; /**< The joystick instance id */
|
|
||||||
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
|
||||||
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
|
||||||
} SDL_ControllerSensorEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Audio device event structure (event.adevice.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_AudioDeviceEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
|
||||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
|
||||||
Uint8 padding1;
|
|
||||||
Uint8 padding2;
|
|
||||||
Uint8 padding3;
|
|
||||||
} SDL_AudioDeviceEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Touch finger event structure (event.tfinger.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_TouchFingerEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_TouchID touchId; /**< The touch device id */
|
|
||||||
SDL_FingerID fingerId;
|
|
||||||
float x; /**< Normalized in the range 0...1 */
|
|
||||||
float y; /**< Normalized in the range 0...1 */
|
|
||||||
float dx; /**< Normalized in the range -1...1 */
|
|
||||||
float dy; /**< Normalized in the range -1...1 */
|
|
||||||
float pressure; /**< Normalized in the range 0...1 */
|
|
||||||
Uint32 windowID; /**< The window underneath the finger, if any */
|
|
||||||
} SDL_TouchFingerEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Multiple Finger Gesture Event (event.mgesture.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_MultiGestureEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_MULTIGESTURE */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_TouchID touchId; /**< The touch device id */
|
|
||||||
float dTheta;
|
|
||||||
float dDist;
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
Uint16 numFingers;
|
|
||||||
Uint16 padding;
|
|
||||||
} SDL_MultiGestureEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Dollar Gesture Event (event.dgesture.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_DollarGestureEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_TouchID touchId; /**< The touch device id */
|
|
||||||
SDL_GestureID gestureId;
|
|
||||||
Uint32 numFingers;
|
|
||||||
float error;
|
|
||||||
float x; /**< Normalized center of gesture */
|
|
||||||
float y; /**< Normalized center of gesture */
|
|
||||||
} SDL_DollarGestureEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief An event used to request a file open by the system (event.drop.*)
|
|
||||||
* This event is enabled by default, you can disable it with SDL_EventState().
|
|
||||||
* \note If this event is enabled, you must free the filename in the event.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_DropEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
|
|
||||||
Uint32 windowID; /**< The window that was dropped on, if any */
|
|
||||||
} SDL_DropEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Sensor event structure (event.sensor.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_SensorEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_SENSORUPDATE */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Sint32 which; /**< The instance ID of the sensor */
|
|
||||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
|
|
||||||
} SDL_SensorEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The "quit requested" event
|
|
||||||
*/
|
|
||||||
typedef struct SDL_QuitEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_QUIT */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
} SDL_QuitEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief OS Specific event
|
|
||||||
*/
|
|
||||||
typedef struct SDL_OSEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_QUIT */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
} SDL_OSEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A user-defined event type (event.user.*)
|
|
||||||
*/
|
|
||||||
typedef struct SDL_UserEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
Uint32 windowID; /**< The associated window if any */
|
|
||||||
Sint32 code; /**< User defined event code */
|
|
||||||
void *data1; /**< User defined data pointer */
|
|
||||||
void *data2; /**< User defined data pointer */
|
|
||||||
} SDL_UserEvent;
|
|
||||||
|
|
||||||
|
|
||||||
struct SDL_SysWMmsg;
|
|
||||||
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A video driver dependent system event (event.syswm.*)
|
|
||||||
* This event is disabled by default, you can enable it with SDL_EventState()
|
|
||||||
*
|
|
||||||
* \note If you want to use this event, you should include SDL_syswm.h.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_SysWMEvent
|
|
||||||
{
|
|
||||||
Uint32 type; /**< ::SDL_SYSWMEVENT */
|
|
||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
|
||||||
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
|
||||||
} SDL_SysWMEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief General event structure
|
|
||||||
*/
|
|
||||||
typedef union SDL_Event
|
|
||||||
{
|
|
||||||
Uint32 type; /**< Event type, shared with all events */
|
|
||||||
SDL_CommonEvent common; /**< Common event data */
|
|
||||||
SDL_DisplayEvent display; /**< Display event data */
|
|
||||||
SDL_WindowEvent window; /**< Window event data */
|
|
||||||
SDL_KeyboardEvent key; /**< Keyboard event data */
|
|
||||||
SDL_TextEditingEvent edit; /**< Text editing event data */
|
|
||||||
SDL_TextInputEvent text; /**< Text input event data */
|
|
||||||
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
|
|
||||||
SDL_MouseButtonEvent button; /**< Mouse button event data */
|
|
||||||
SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
|
|
||||||
SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
|
|
||||||
SDL_JoyBallEvent jball; /**< Joystick ball event data */
|
|
||||||
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
|
|
||||||
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
|
|
||||||
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
|
|
||||||
SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
|
|
||||||
SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
|
|
||||||
SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
|
|
||||||
SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */
|
|
||||||
SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */
|
|
||||||
SDL_AudioDeviceEvent adevice; /**< Audio device event data */
|
|
||||||
SDL_SensorEvent sensor; /**< Sensor event data */
|
|
||||||
SDL_QuitEvent quit; /**< Quit request event data */
|
|
||||||
SDL_UserEvent user; /**< Custom event data */
|
|
||||||
SDL_SysWMEvent syswm; /**< System dependent window event data */
|
|
||||||
SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
|
|
||||||
SDL_MultiGestureEvent mgesture; /**< Gesture event data */
|
|
||||||
SDL_DollarGestureEvent dgesture; /**< Gesture event data */
|
|
||||||
SDL_DropEvent drop; /**< Drag and drop event data */
|
|
||||||
|
|
||||||
/* This is necessary for ABI compatibility between Visual C++ and GCC
|
|
||||||
Visual C++ will respect the push pack pragma and use 52 bytes for
|
|
||||||
this structure, and GCC will use the alignment of the largest datatype
|
|
||||||
within the union, which is 8 bytes.
|
|
||||||
|
|
||||||
So... we'll add padding to force the size to be 56 bytes for both.
|
|
||||||
*/
|
|
||||||
Uint8 padding[56];
|
|
||||||
} SDL_Event;
|
|
||||||
|
|
||||||
/* Make sure we haven't broken binary compatibility */
|
|
||||||
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56);
|
|
||||||
|
|
||||||
|
|
||||||
/* 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 SDLCALL SDL_PumpEvents(void);
|
|
||||||
|
|
||||||
/* @{ */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ADDEVENT,
|
|
||||||
SDL_PEEKEVENT,
|
|
||||||
SDL_GETEVENT
|
|
||||||
} SDL_eventaction;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks the event queue for messages and optionally returns them.
|
|
||||||
*
|
|
||||||
* If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
|
|
||||||
* the back of the event queue.
|
|
||||||
*
|
|
||||||
* If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
|
|
||||||
* of the event queue, within the specified minimum and maximum type,
|
|
||||||
* will be returned and will not be removed from the queue.
|
|
||||||
*
|
|
||||||
* If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
|
|
||||||
* of the event queue, within the specified minimum and maximum type,
|
|
||||||
* will be returned and will be removed from the queue.
|
|
||||||
*
|
|
||||||
* \return The number of events actually stored, or -1 if there was an error.
|
|
||||||
*
|
|
||||||
* This function is thread-safe.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
|
||||||
SDL_eventaction action,
|
|
||||||
Uint32 minType, Uint32 maxType);
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks to see if certain event types are in the event queue.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function clears events from the event queue
|
|
||||||
* This function only affects currently queued events. If you want to make
|
|
||||||
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
|
||||||
* on the main thread immediately before the flush call.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Polls for currently pending events.
|
|
||||||
*
|
|
||||||
* \return 1 if there are any pending events, or 0 if there are none available.
|
|
||||||
*
|
|
||||||
* \param event If not NULL, the next event is removed from the queue and
|
|
||||||
* stored in that area.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Waits indefinitely for the next available event.
|
|
||||||
*
|
|
||||||
* \return 1, or 0 if there was an error while waiting for events.
|
|
||||||
*
|
|
||||||
* \param event If not NULL, the next event is removed from the queue and
|
|
||||||
* stored in that area.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Waits until the specified timeout (in milliseconds) for the next
|
|
||||||
* available event.
|
|
||||||
*
|
|
||||||
* \return 1, or 0 if there was an error while waiting for events.
|
|
||||||
*
|
|
||||||
* \param event If not NULL, the next event is removed from the queue and
|
|
||||||
* stored in that area.
|
|
||||||
* \param timeout The timeout (in milliseconds) to wait for next event.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
|
|
||||||
int timeout);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Add an event to the event queue.
|
|
||||||
*
|
|
||||||
* \return 1 on success, 0 if the event was filtered, or -1 if the event queue
|
|
||||||
* was full or there was some other error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
|
|
||||||
|
|
||||||
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets up a filter to process all events before they change internal state and
|
|
||||||
* are posted to the internal event queue.
|
|
||||||
*
|
|
||||||
* The filter is prototyped as:
|
|
||||||
* \code
|
|
||||||
* int SDL_EventFilter(void *userdata, SDL_Event * event);
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* If the filter returns 1, then the event will be added to the internal queue.
|
|
||||||
* If it returns 0, then the event will be dropped from the queue, but the
|
|
||||||
* internal state will still be updated. This allows selective filtering of
|
|
||||||
* dynamically arriving events.
|
|
||||||
*
|
|
||||||
* \warning Be very careful of what you do in the event filter function, as
|
|
||||||
* it may run in a different thread!
|
|
||||||
*
|
|
||||||
* There is one caveat when dealing with the ::SDL_QuitEvent event type. The
|
|
||||||
* event filter is only called when the window manager desires to close the
|
|
||||||
* application window. If the event filter returns 1, then the window will
|
|
||||||
* be closed, otherwise the window will remain open if possible.
|
|
||||||
*
|
|
||||||
* If the quit event is generated by an interrupt signal, it will bypass the
|
|
||||||
* internal queue and be delivered to the application at the next event poll.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
|
|
||||||
void *userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the current event filter - can be used to "chain" filters.
|
|
||||||
* If there is no event filter set, this function returns SDL_FALSE.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
|
|
||||||
void **userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a function which is called when an event is added to the queue.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
|
|
||||||
void *userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove an event watch function added with SDL_AddEventWatch()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
|
|
||||||
void *userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run the filter function on the current event queue, removing any
|
|
||||||
* events for which the filter returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
|
||||||
void *userdata);
|
|
||||||
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_QUERY -1
|
|
||||||
#define SDL_IGNORE 0
|
|
||||||
#define SDL_DISABLE 0
|
|
||||||
#define SDL_ENABLE 1
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function allows you to set the state of processing certain events.
|
|
||||||
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
|
|
||||||
* dropped from the event queue and will not be filtered.
|
|
||||||
* - If \c state is set to ::SDL_ENABLE, that event will be processed
|
|
||||||
* normally.
|
|
||||||
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
|
|
||||||
* current processing state of the specified event.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
|
|
||||||
/* @} */
|
|
||||||
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function allocates a set of user-defined events, and returns
|
|
||||||
* the beginning event number for that set of events.
|
|
||||||
*
|
|
||||||
* If there aren't enough user-defined events left, this function
|
|
||||||
* returns (Uint32)-1
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_events_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_filesystem.h
|
|
||||||
*
|
|
||||||
* \brief Include file for filesystem SDL API functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_filesystem_h_
|
|
||||||
#define SDL_filesystem_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the path where the application resides.
|
|
||||||
*
|
|
||||||
* Get the "base path". This is the directory where the application was run
|
|
||||||
* from, which is probably the installation directory, and may or may not
|
|
||||||
* be the process's current working directory.
|
|
||||||
*
|
|
||||||
* This returns an absolute path in UTF-8 encoding, and is guaranteed to
|
|
||||||
* end with a path separator ('\\' on Windows, '/' most other places).
|
|
||||||
*
|
|
||||||
* The pointer returned by this function is owned by you. Please call
|
|
||||||
* SDL_free() on the pointer when you are done with it, or it will be a
|
|
||||||
* memory leak. This is not necessarily a fast call, though, so you should
|
|
||||||
* call this once near startup and save the string if you need it.
|
|
||||||
*
|
|
||||||
* Some platforms can't determine the application's path, and on other
|
|
||||||
* platforms, this might be meaningless. In such cases, this function will
|
|
||||||
* return NULL.
|
|
||||||
*
|
|
||||||
* \return String of base dir in UTF-8 encoding, or NULL on error.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetPrefPath
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the user-and-app-specific path where files can be written.
|
|
||||||
*
|
|
||||||
* Get the "pref dir". This is meant to be where users can write personal
|
|
||||||
* files (preferences and save games, etc) that are specific to your
|
|
||||||
* application. This directory is unique per user, per application.
|
|
||||||
*
|
|
||||||
* This function will decide the appropriate location in the native filesystem,
|
|
||||||
* create the directory if necessary, and return a string of the absolute
|
|
||||||
* path to the directory in UTF-8 encoding.
|
|
||||||
*
|
|
||||||
* On Windows, the string might look like:
|
|
||||||
* "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
|
|
||||||
*
|
|
||||||
* On Linux, the string might look like:
|
|
||||||
* "/home/bob/.local/share/My Program Name/"
|
|
||||||
*
|
|
||||||
* On Mac OS X, the string might look like:
|
|
||||||
* "/Users/bob/Library/Application Support/My Program Name/"
|
|
||||||
*
|
|
||||||
* (etc.)
|
|
||||||
*
|
|
||||||
* You specify the name of your organization (if it's not a real organization,
|
|
||||||
* your name or an Internet domain you own might do) and the name of your
|
|
||||||
* application. These should be untranslated proper names.
|
|
||||||
*
|
|
||||||
* Both the org and app strings may become part of a directory name, so
|
|
||||||
* please follow these rules:
|
|
||||||
*
|
|
||||||
* - Try to use the same org string (including case-sensitivity) for
|
|
||||||
* all your applications that use this function.
|
|
||||||
* - Always use a unique app string for each one, and make sure it never
|
|
||||||
* changes for an app once you've decided on it.
|
|
||||||
* - Unicode characters are legal, as long as it's UTF-8 encoded, but...
|
|
||||||
* - ...only use letters, numbers, and spaces. Avoid punctuation like
|
|
||||||
* "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
|
|
||||||
*
|
|
||||||
* This returns an absolute path in UTF-8 encoding, and is guaranteed to
|
|
||||||
* end with a path separator ('\\' on Windows, '/' most other places).
|
|
||||||
*
|
|
||||||
* The pointer returned by this function is owned by you. Please call
|
|
||||||
* SDL_free() on the pointer when you are done with it, or it will be a
|
|
||||||
* memory leak. This is not necessarily a fast call, though, so you should
|
|
||||||
* call this once near startup and save the string if you need it.
|
|
||||||
*
|
|
||||||
* You should assume the path returned by this function is the only safe
|
|
||||||
* place to write files (and that SDL_GetBasePath(), while it might be
|
|
||||||
* writable, or even the parent of the returned path, aren't where you
|
|
||||||
* should be writing things).
|
|
||||||
*
|
|
||||||
* Some platforms can't determine the pref path, and on other
|
|
||||||
* platforms, this might be meaningless. In such cases, this function will
|
|
||||||
* return NULL.
|
|
||||||
*
|
|
||||||
* \param org The name of your organization.
|
|
||||||
* \param app The name of your application.
|
|
||||||
* \return UTF-8 string of user dir in platform-dependent notation. NULL
|
|
||||||
* if there's a problem (creating directory failed, etc).
|
|
||||||
*
|
|
||||||
* \sa SDL_GetBasePath
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_filesystem_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,541 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_gamecontroller.h
|
|
||||||
*
|
|
||||||
* Include file for SDL game controller event handling
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_gamecontroller_h_
|
|
||||||
#define SDL_gamecontroller_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_rwops.h"
|
|
||||||
#include "SDL_sensor.h"
|
|
||||||
#include "SDL_joystick.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_gamecontroller.h
|
|
||||||
*
|
|
||||||
* In order to use these functions, SDL_Init() must have been called
|
|
||||||
* with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system
|
|
||||||
* for game controllers, and load appropriate drivers.
|
|
||||||
*
|
|
||||||
* If you would like to receive controller updates while the application
|
|
||||||
* is in the background, you should set the following hint before calling
|
|
||||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The gamecontroller structure used to identify an SDL game controller
|
|
||||||
*/
|
|
||||||
struct _SDL_GameController;
|
|
||||||
typedef struct _SDL_GameController SDL_GameController;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_CONTROLLER_TYPE_UNKNOWN = 0,
|
|
||||||
SDL_CONTROLLER_TYPE_XBOX360,
|
|
||||||
SDL_CONTROLLER_TYPE_XBOXONE,
|
|
||||||
SDL_CONTROLLER_TYPE_PS3,
|
|
||||||
SDL_CONTROLLER_TYPE_PS4,
|
|
||||||
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO,
|
|
||||||
SDL_CONTROLLER_TYPE_VIRTUAL,
|
|
||||||
SDL_CONTROLLER_TYPE_PS5
|
|
||||||
} SDL_GameControllerType;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_CONTROLLER_BINDTYPE_NONE = 0,
|
|
||||||
SDL_CONTROLLER_BINDTYPE_BUTTON,
|
|
||||||
SDL_CONTROLLER_BINDTYPE_AXIS,
|
|
||||||
SDL_CONTROLLER_BINDTYPE_HAT
|
|
||||||
} SDL_GameControllerBindType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the SDL joystick layer binding for this controller button/axis mapping
|
|
||||||
*/
|
|
||||||
typedef struct SDL_GameControllerButtonBind
|
|
||||||
{
|
|
||||||
SDL_GameControllerBindType bindType;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
int button;
|
|
||||||
int axis;
|
|
||||||
struct {
|
|
||||||
int hat;
|
|
||||||
int hat_mask;
|
|
||||||
} hat;
|
|
||||||
} value;
|
|
||||||
|
|
||||||
} SDL_GameControllerButtonBind;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To count the number of game controllers in the system for the following:
|
|
||||||
* int nJoysticks = SDL_NumJoysticks();
|
|
||||||
* int nGameControllers = 0;
|
|
||||||
* for (int i = 0; i < nJoysticks; i++) {
|
|
||||||
* if (SDL_IsGameController(i)) {
|
|
||||||
* nGameControllers++;
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
|
||||||
* guid,name,mappings
|
|
||||||
*
|
|
||||||
* Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
|
|
||||||
* Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
|
|
||||||
* The mapping format for joystick is:
|
|
||||||
* bX - a joystick button, index X
|
|
||||||
* hX.Y - hat X with value Y
|
|
||||||
* aX - axis X of the joystick
|
|
||||||
* Buttons can be used as a controller axis and vice versa.
|
|
||||||
*
|
|
||||||
* This string shows an example of a valid mapping for a controller
|
|
||||||
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform()
|
|
||||||
* A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
|
|
||||||
*
|
|
||||||
* If \c freerw is non-zero, the stream will be closed after being read.
|
|
||||||
*
|
|
||||||
* \return number of mappings added, -1 on error
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
|
|
||||||
*
|
|
||||||
* Convenience macro.
|
|
||||||
*/
|
|
||||||
#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add or update an existing mapping configuration
|
|
||||||
*
|
|
||||||
* \return 1 if mapping is added, 0 if updated, -1 on error
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of mappings installed
|
|
||||||
*
|
|
||||||
* \return the number of mappings
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the mapping at a particular index.
|
|
||||||
*
|
|
||||||
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a mapping string for a GUID
|
|
||||||
*
|
|
||||||
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a mapping string for an open GameController
|
|
||||||
*
|
|
||||||
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the joystick on this index supported by the game controller interface?
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the implementation dependent name of a game controller.
|
|
||||||
* This can be called before any controllers are opened.
|
|
||||||
* If no name can be found, this function returns NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the type of a game controller.
|
|
||||||
* This can be called before any controllers are opened.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the mapping of a game controller.
|
|
||||||
* This can be called before any controllers are opened.
|
|
||||||
*
|
|
||||||
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a game controller for use.
|
|
||||||
* The index passed as an argument refers to the N'th game controller on the system.
|
|
||||||
* This index is not the value which will identify this controller in future
|
|
||||||
* controller events. The joystick's instance id (::SDL_JoystickID) will be
|
|
||||||
* used there instead.
|
|
||||||
*
|
|
||||||
* \return A controller identifier, or NULL if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the SDL_GameController associated with an instance id.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the SDL_GameController associated with a player index.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the name for this currently opened controller
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the type of this currently opened controller
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the player index of an opened game controller, or -1 if it's not available
|
|
||||||
*
|
|
||||||
* For XInput controllers this returns the XInput user index.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the player index of an opened game controller
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the USB vendor ID of an opened controller, if available.
|
|
||||||
* If the vendor ID isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the USB product ID of an opened controller, if available.
|
|
||||||
* If the product ID isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the product version of an opened controller, if available.
|
|
||||||
* If the product version isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the serial number of an opened controller, if available.
|
|
||||||
*
|
|
||||||
* Returns the serial number of the controller, or NULL if it is not available.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns SDL_TRUE if the controller has been opened and currently connected,
|
|
||||||
* or SDL_FALSE if it has not.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the underlying joystick object used by a controller
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable/disable controller event polling.
|
|
||||||
*
|
|
||||||
* If controller events are disabled, you must call SDL_GameControllerUpdate()
|
|
||||||
* yourself and check the state of the controller when you want controller
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the current state of the open game controllers.
|
|
||||||
*
|
|
||||||
* This is called automatically by the event loop if any game controller
|
|
||||||
* events are enabled.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The list of axes available from a controller
|
|
||||||
*
|
|
||||||
* Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
|
|
||||||
* and are centered within ~8000 of zero, though advanced UI will allow users to set
|
|
||||||
* or autodetect the dead zone, which varies between controllers.
|
|
||||||
*
|
|
||||||
* Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_CONTROLLER_AXIS_INVALID = -1,
|
|
||||||
SDL_CONTROLLER_AXIS_LEFTX,
|
|
||||||
SDL_CONTROLLER_AXIS_LEFTY,
|
|
||||||
SDL_CONTROLLER_AXIS_RIGHTX,
|
|
||||||
SDL_CONTROLLER_AXIS_RIGHTY,
|
|
||||||
SDL_CONTROLLER_AXIS_TRIGGERLEFT,
|
|
||||||
SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
|
|
||||||
SDL_CONTROLLER_AXIS_MAX
|
|
||||||
} SDL_GameControllerAxis;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* turn this string into a axis mapping
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* turn this axis enum into a string mapping
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the SDL joystick layer binding for this controller button mapping
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
|
|
||||||
SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
|
|
||||||
SDL_GameControllerAxis axis);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether a game controller has a given axis
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL
|
|
||||||
SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of an axis control on a game controller.
|
|
||||||
*
|
|
||||||
* The state is a value ranging from -32768 to 32767 (except for the triggers,
|
|
||||||
* which range from 0 to 32767).
|
|
||||||
*
|
|
||||||
* The axis indices start at index 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint16 SDLCALL
|
|
||||||
SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The list of buttons available from a controller
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_CONTROLLER_BUTTON_INVALID = -1,
|
|
||||||
SDL_CONTROLLER_BUTTON_A,
|
|
||||||
SDL_CONTROLLER_BUTTON_B,
|
|
||||||
SDL_CONTROLLER_BUTTON_X,
|
|
||||||
SDL_CONTROLLER_BUTTON_Y,
|
|
||||||
SDL_CONTROLLER_BUTTON_BACK,
|
|
||||||
SDL_CONTROLLER_BUTTON_GUIDE,
|
|
||||||
SDL_CONTROLLER_BUTTON_START,
|
|
||||||
SDL_CONTROLLER_BUTTON_LEFTSTICK,
|
|
||||||
SDL_CONTROLLER_BUTTON_RIGHTSTICK,
|
|
||||||
SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
|
|
||||||
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
|
|
||||||
SDL_CONTROLLER_BUTTON_DPAD_UP,
|
|
||||||
SDL_CONTROLLER_BUTTON_DPAD_DOWN,
|
|
||||||
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
|
||||||
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
|
||||||
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */
|
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
|
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
|
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
|
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
|
|
||||||
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
|
||||||
SDL_CONTROLLER_BUTTON_MAX
|
|
||||||
} SDL_GameControllerButton;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* turn this string into a button mapping
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* turn this button enum into a string mapping
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the SDL joystick layer binding for this controller button mapping
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
|
|
||||||
SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
|
|
||||||
SDL_GameControllerButton button);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether a game controller has a given button
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller,
|
|
||||||
SDL_GameControllerButton button);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of a button on a game controller.
|
|
||||||
*
|
|
||||||
* The button indices start at index 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
|
|
||||||
SDL_GameControllerButton button);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of touchpads on a game controller.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of supported simultaneous fingers on a touchpad on a game controller.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of a finger on a touchpad on a game controller.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether a game controller has a particular sensor.
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to query
|
|
||||||
* \param type The type of sensor to query
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set whether data reporting for a game controller sensor is enabled
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to update
|
|
||||||
* \param type The type of sensor to enable/disable
|
|
||||||
* \param enabled Whether data reporting should be enabled
|
|
||||||
*
|
|
||||||
* \return 0 or -1 if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query whether sensor data reporting is enabled for a game controller
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to query
|
|
||||||
* \param type The type of sensor to query
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of a game controller sensor.
|
|
||||||
*
|
|
||||||
* The number of values and interpretation of the data is sensor dependent.
|
|
||||||
* See SDL_sensor.h for the details for each type of sensor.
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to query
|
|
||||||
* \param type The type of sensor to query
|
|
||||||
* \param data A pointer filled with the current sensor state
|
|
||||||
* \param num_values The number of values to write to data
|
|
||||||
*
|
|
||||||
* \return 0 or -1 if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a rumble effect
|
|
||||||
* Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to vibrate
|
|
||||||
* \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if rumble isn't supported on this controller
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a rumble effect in the game controller's triggers
|
|
||||||
* Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to vibrate
|
|
||||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if rumble isn't supported on this controller
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether a controller has an LED
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to query
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update a controller's LED color.
|
|
||||||
*
|
|
||||||
* \param gamecontroller The controller to update
|
|
||||||
* \param red The intensity of the red LED
|
|
||||||
* \param green The intensity of the green LED
|
|
||||||
* \param blue The intensity of the blue LED
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if this controller does not have a modifiable LED
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a controller previously opened with SDL_GameControllerOpen().
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_gamecontroller_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_gesture.h
|
|
||||||
*
|
|
||||||
* Include file for SDL gesture event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_gesture_h_
|
|
||||||
#define SDL_gesture_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "SDL_touch.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef Sint64 SDL_GestureID;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Begin Recording a gesture on the specified touch, or all touches (-1)
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Save all currently loaded Dollar Gesture templates
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Save a currently loaded Dollar Gesture template
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Load Dollar Gesture templates from a file
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_gesture_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,499 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_joystick.h
|
|
||||||
*
|
|
||||||
* Include file for SDL joystick event handling
|
|
||||||
*
|
|
||||||
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
|
|
||||||
* behind a device_index changing as joysticks are plugged and unplugged.
|
|
||||||
*
|
|
||||||
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
|
||||||
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
|
|
||||||
*
|
|
||||||
* The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
|
|
||||||
* the device (a X360 wired controller for example). This identifier is platform dependent.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_joystick_h_
|
|
||||||
#define SDL_joystick_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_joystick.h
|
|
||||||
*
|
|
||||||
* In order to use these functions, SDL_Init() must have been called
|
|
||||||
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
|
||||||
* for joysticks, and load appropriate drivers.
|
|
||||||
*
|
|
||||||
* If you would like to receive joystick updates while the application
|
|
||||||
* is in the background, you should set the following hint before calling
|
|
||||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The joystick structure used to identify an SDL joystick
|
|
||||||
*/
|
|
||||||
struct _SDL_Joystick;
|
|
||||||
typedef struct _SDL_Joystick SDL_Joystick;
|
|
||||||
|
|
||||||
/* A structure that encodes the stable unique id for a joystick device */
|
|
||||||
typedef struct {
|
|
||||||
Uint8 data[16];
|
|
||||||
} SDL_JoystickGUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a unique ID for a joystick for the time it is connected to the system,
|
|
||||||
* and is never reused for the lifetime of the application. If the joystick is
|
|
||||||
* disconnected and reconnected, it will get a new ID.
|
|
||||||
*
|
|
||||||
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
|
||||||
*/
|
|
||||||
typedef Sint32 SDL_JoystickID;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_JOYSTICK_TYPE_UNKNOWN,
|
|
||||||
SDL_JOYSTICK_TYPE_GAMECONTROLLER,
|
|
||||||
SDL_JOYSTICK_TYPE_WHEEL,
|
|
||||||
SDL_JOYSTICK_TYPE_ARCADE_STICK,
|
|
||||||
SDL_JOYSTICK_TYPE_FLIGHT_STICK,
|
|
||||||
SDL_JOYSTICK_TYPE_DANCE_PAD,
|
|
||||||
SDL_JOYSTICK_TYPE_GUITAR,
|
|
||||||
SDL_JOYSTICK_TYPE_DRUM_KIT,
|
|
||||||
SDL_JOYSTICK_TYPE_ARCADE_PAD,
|
|
||||||
SDL_JOYSTICK_TYPE_THROTTLE
|
|
||||||
} SDL_JoystickType;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_JOYSTICK_POWER_UNKNOWN = -1,
|
|
||||||
SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */
|
|
||||||
SDL_JOYSTICK_POWER_LOW, /* <= 20% */
|
|
||||||
SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */
|
|
||||||
SDL_JOYSTICK_POWER_FULL, /* <= 100% */
|
|
||||||
SDL_JOYSTICK_POWER_WIRED,
|
|
||||||
SDL_JOYSTICK_POWER_MAX
|
|
||||||
} SDL_JoystickPowerLevel;
|
|
||||||
|
|
||||||
/* Set max recognized G-force from accelerometer
|
|
||||||
See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed
|
|
||||||
*/
|
|
||||||
#define SDL_IPHONE_MAX_GFORCE 5.0
|
|
||||||
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Locking for multi-threaded access to the joystick API
|
|
||||||
*
|
|
||||||
* If you are using the joystick API or handling events from multiple threads
|
|
||||||
* you should use these locking functions to protect access to the joysticks.
|
|
||||||
*
|
|
||||||
* In particular, you are guaranteed that the joystick list won't change, so
|
|
||||||
* the API functions that take a joystick index will be valid, and joystick
|
|
||||||
* and game controller events will not be delivered.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Count the number of joysticks attached to the system right now
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the implementation dependent name of a joystick.
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
* If no name can be found, this function returns NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the player index of a joystick, or -1 if it's not available
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the GUID for the joystick at this index
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the USB vendor ID of a joystick, if available.
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
* If the vendor ID isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the USB product ID of a joystick, if available.
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
* If the product ID isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the product version of a joystick, if available.
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
* If the product version isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the type of a joystick, if available.
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the instance ID of a joystick.
|
|
||||||
* This can be called before any joysticks are opened.
|
|
||||||
* If the index is out of range, this function will return -1.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(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 not the value which will identify this joystick in future
|
|
||||||
* joystick events. The joystick's instance id (::SDL_JoystickID) will be used
|
|
||||||
* there instead.
|
|
||||||
*
|
|
||||||
* \return A joystick identifier, or NULL if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the SDL_Joystick associated with an instance id.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the SDL_Joystick associated with a player index.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches a new virtual joystick.
|
|
||||||
* Returns the joystick's device index, or -1 if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
|
|
||||||
int naxes,
|
|
||||||
int nbuttons,
|
|
||||||
int nhats);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Detaches a virtual joystick
|
|
||||||
* Returns 0 on success, or -1 if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether or not a virtual-joystick is at a given device index.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set values on an opened, virtual-joystick's controls.
|
|
||||||
* Please note that values set here will not be applied until the next
|
|
||||||
* call to SDL_JoystickUpdate, which can either be called directly,
|
|
||||||
* or can be called indirectly through various other SDL APIS,
|
|
||||||
* including, but not limited to the following: SDL_PollEvent,
|
|
||||||
* SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent.
|
|
||||||
*
|
|
||||||
* Returns 0 on success, -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the name for this currently opened joystick.
|
|
||||||
* If no name can be found, this function returns NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the player index of an opened joystick, or -1 if it's not available
|
|
||||||
*
|
|
||||||
* For XInput controllers this returns the XInput user index.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the player index of an opened joystick
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the GUID for this opened joystick
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the USB vendor ID of an opened joystick, if available.
|
|
||||||
* If the vendor ID isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the USB product ID of an opened joystick, if available.
|
|
||||||
* If the product ID isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the product version of an opened joystick, if available.
|
|
||||||
* If the product version isn't available this function returns 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the serial number of an opened joystick, if available.
|
|
||||||
*
|
|
||||||
* Returns the serial number of the joystick, or NULL if it is not available.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the type of an opened joystick.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a string representation for this guid. pszGUID must point to at least 33 bytes
|
|
||||||
* (32 for the string plus a NULL terminator).
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert a string into a joystick guid
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the instance ID of an opened joystick or -1 if the joystick is invalid.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of general axis controls on a joystick.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of trackballs on a joystick.
|
|
||||||
*
|
|
||||||
* Joystick trackballs have only relative motion events associated
|
|
||||||
* with them and their state cannot be polled.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of POV hats on a joystick.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of buttons on a joystick.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the current state of the open joysticks.
|
|
||||||
*
|
|
||||||
* This is called automatically by the event loop if any joystick
|
|
||||||
* events are enabled.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable/disable joystick event polling.
|
|
||||||
*
|
|
||||||
* If joystick events are disabled, you must call SDL_JoystickUpdate()
|
|
||||||
* yourself and check the state of the joystick when you want joystick
|
|
||||||
* information.
|
|
||||||
*
|
|
||||||
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
|
||||||
|
|
||||||
#define SDL_JOYSTICK_AXIS_MAX 32767
|
|
||||||
#define SDL_JOYSTICK_AXIS_MIN -32768
|
|
||||||
/**
|
|
||||||
* Get the current state of an axis control on a joystick.
|
|
||||||
*
|
|
||||||
* The state is a value ranging from -32768 to 32767.
|
|
||||||
*
|
|
||||||
* The axis indices start at index 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
|
|
||||||
int axis);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the initial 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.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick,
|
|
||||||
int axis, Sint16 *state);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Hat 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)
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of a POV hat on a joystick.
|
|
||||||
*
|
|
||||||
* The hat indices start at index 0.
|
|
||||||
*
|
|
||||||
* \return The return value is one of the following positions:
|
|
||||||
* - ::SDL_HAT_CENTERED
|
|
||||||
* - ::SDL_HAT_UP
|
|
||||||
* - ::SDL_HAT_RIGHT
|
|
||||||
* - ::SDL_HAT_DOWN
|
|
||||||
* - ::SDL_HAT_LEFT
|
|
||||||
* - ::SDL_HAT_RIGHTUP
|
|
||||||
* - ::SDL_HAT_RIGHTDOWN
|
|
||||||
* - ::SDL_HAT_LEFTUP
|
|
||||||
* - ::SDL_HAT_LEFTDOWN
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
|
|
||||||
int hat);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the ball axis change since the last poll.
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if you passed it invalid parameters.
|
|
||||||
*
|
|
||||||
* The ball indices start at index 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
|
|
||||||
int ball, int *dx, int *dy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of a button on a joystick.
|
|
||||||
*
|
|
||||||
* The button indices start at index 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
|
|
||||||
int button);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a rumble effect
|
|
||||||
* Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
|
|
||||||
*
|
|
||||||
* \param joystick The joystick to vibrate
|
|
||||||
* \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if rumble isn't supported on this joystick
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start a rumble effect in the joystick's triggers
|
|
||||||
* Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
|
|
||||||
*
|
|
||||||
* \param joystick The joystick to vibrate
|
|
||||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF
|
|
||||||
* \param duration_ms The duration of the rumble effect, in milliseconds
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if trigger rumble isn't supported on this joystick
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return whether a joystick has an LED
|
|
||||||
*
|
|
||||||
* \param joystick The joystick to query
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update a joystick's LED color.
|
|
||||||
*
|
|
||||||
* \param joystick The joystick to update
|
|
||||||
* \param red The intensity of the red LED
|
|
||||||
* \param green The intensity of the green LED
|
|
||||||
* \param blue The intensity of the blue LED
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if this joystick does not have a modifiable LED
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a joystick previously opened with SDL_JoystickOpen().
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the battery level of this joystick
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_joystick_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,217 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_keyboard.h
|
|
||||||
*
|
|
||||||
* Include file for SDL keyboard event handling
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_keyboard_h_
|
|
||||||
#define SDL_keyboard_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_keycode.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The SDL keysym structure, used in key events.
|
|
||||||
*
|
|
||||||
* \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Keysym
|
|
||||||
{
|
|
||||||
SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
|
|
||||||
SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */
|
|
||||||
Uint16 mod; /**< current key modifiers */
|
|
||||||
Uint32 unused;
|
|
||||||
} SDL_Keysym;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the window which currently has keyboard focus.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a snapshot of the current state of the keyboard.
|
|
||||||
*
|
|
||||||
* \param numkeys if non-NULL, receives the length of the returned array.
|
|
||||||
*
|
|
||||||
* \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
|
|
||||||
*
|
|
||||||
* \b Example:
|
|
||||||
* \code
|
|
||||||
* const Uint8 *state = SDL_GetKeyboardState(NULL);
|
|
||||||
* if ( state[SDL_SCANCODE_RETURN] ) {
|
|
||||||
* printf("<RETURN> is pressed.\n");
|
|
||||||
* }
|
|
||||||
* \endcode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current key modifier state for the keyboard.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the current key modifier state for the keyboard.
|
|
||||||
*
|
|
||||||
* \note This does not change the keyboard state, only the key modifier flags.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the key code corresponding to the given scancode according
|
|
||||||
* to the current keyboard layout.
|
|
||||||
*
|
|
||||||
* See ::SDL_Keycode for details.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetKeyName()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the scancode corresponding to the given key code according to the
|
|
||||||
* current keyboard layout.
|
|
||||||
*
|
|
||||||
* See ::SDL_Scancode for details.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetScancodeName()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a human-readable name for a scancode.
|
|
||||||
*
|
|
||||||
* \return A pointer to the name for the scancode.
|
|
||||||
* If the scancode doesn't have a name, this function returns
|
|
||||||
* an empty string ("").
|
|
||||||
*
|
|
||||||
* \sa SDL_Scancode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a scancode from a human-readable name
|
|
||||||
*
|
|
||||||
* \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
|
|
||||||
*
|
|
||||||
* \sa SDL_Scancode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a human-readable name for a key.
|
|
||||||
*
|
|
||||||
* \return A pointer to a UTF-8 string that stays valid at least until the next
|
|
||||||
* call to this function. If you need it around any longer, you must
|
|
||||||
* copy it. If the key doesn't have a name, this function returns an
|
|
||||||
* empty string ("").
|
|
||||||
*
|
|
||||||
* \sa SDL_Keycode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a key code from a human-readable name
|
|
||||||
*
|
|
||||||
* \return key code, or SDLK_UNKNOWN if the name wasn't recognized
|
|
||||||
*
|
|
||||||
* \sa SDL_Keycode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Start accepting Unicode text input events.
|
|
||||||
* This function will show the on-screen keyboard if supported.
|
|
||||||
*
|
|
||||||
* \sa SDL_StopTextInput()
|
|
||||||
* \sa SDL_SetTextInputRect()
|
|
||||||
* \sa SDL_HasScreenKeyboardSupport()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Return whether or not Unicode text input events are enabled.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput()
|
|
||||||
* \sa SDL_StopTextInput()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Stop receiving any text input events.
|
|
||||||
* This function will hide the on-screen keyboard if supported.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput()
|
|
||||||
* \sa SDL_HasScreenKeyboardSupport()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the rectangle used to type Unicode text inputs.
|
|
||||||
* This is used as a hint for IME and on-screen keyboard placement.
|
|
||||||
*
|
|
||||||
* \sa SDL_StartTextInput()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns whether the platform has some screen keyboard support.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \note Not all screen keyboard functions are supported on all platforms.
|
|
||||||
*
|
|
||||||
* \sa SDL_IsScreenKeyboardShown()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns whether the screen keyboard is shown for given window.
|
|
||||||
*
|
|
||||||
* \param window The window for which screen keyboard should be queried.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
|
|
||||||
*
|
|
||||||
* \sa SDL_HasScreenKeyboardSupport()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_keyboard_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,351 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_keycode.h
|
|
||||||
*
|
|
||||||
* Defines constants which identify keyboard keys and modifiers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_keycode_h_
|
|
||||||
#define SDL_keycode_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_scancode.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The SDL virtual key representation.
|
|
||||||
*
|
|
||||||
* Values of this type are used to represent keyboard keys using the current
|
|
||||||
* layout of the keyboard. These values include Unicode values representing
|
|
||||||
* the unmodified character that would be generated by pressing the key, or
|
|
||||||
* an SDLK_* constant for those keys that do not generate characters.
|
|
||||||
*
|
|
||||||
* A special exception is the number keys at the top of the keyboard which
|
|
||||||
* always map to SDLK_0...SDLK_9, regardless of layout.
|
|
||||||
*/
|
|
||||||
typedef Sint32 SDL_Keycode;
|
|
||||||
|
|
||||||
#define SDLK_SCANCODE_MASK (1<<30)
|
|
||||||
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDLK_UNKNOWN = 0,
|
|
||||||
|
|
||||||
SDLK_RETURN = '\r',
|
|
||||||
SDLK_ESCAPE = '\033',
|
|
||||||
SDLK_BACKSPACE = '\b',
|
|
||||||
SDLK_TAB = '\t',
|
|
||||||
SDLK_SPACE = ' ',
|
|
||||||
SDLK_EXCLAIM = '!',
|
|
||||||
SDLK_QUOTEDBL = '"',
|
|
||||||
SDLK_HASH = '#',
|
|
||||||
SDLK_PERCENT = '%',
|
|
||||||
SDLK_DOLLAR = '$',
|
|
||||||
SDLK_AMPERSAND = '&',
|
|
||||||
SDLK_QUOTE = '\'',
|
|
||||||
SDLK_LEFTPAREN = '(',
|
|
||||||
SDLK_RIGHTPAREN = ')',
|
|
||||||
SDLK_ASTERISK = '*',
|
|
||||||
SDLK_PLUS = '+',
|
|
||||||
SDLK_COMMA = ',',
|
|
||||||
SDLK_MINUS = '-',
|
|
||||||
SDLK_PERIOD = '.',
|
|
||||||
SDLK_SLASH = '/',
|
|
||||||
SDLK_0 = '0',
|
|
||||||
SDLK_1 = '1',
|
|
||||||
SDLK_2 = '2',
|
|
||||||
SDLK_3 = '3',
|
|
||||||
SDLK_4 = '4',
|
|
||||||
SDLK_5 = '5',
|
|
||||||
SDLK_6 = '6',
|
|
||||||
SDLK_7 = '7',
|
|
||||||
SDLK_8 = '8',
|
|
||||||
SDLK_9 = '9',
|
|
||||||
SDLK_COLON = ':',
|
|
||||||
SDLK_SEMICOLON = ';',
|
|
||||||
SDLK_LESS = '<',
|
|
||||||
SDLK_EQUALS = '=',
|
|
||||||
SDLK_GREATER = '>',
|
|
||||||
SDLK_QUESTION = '?',
|
|
||||||
SDLK_AT = '@',
|
|
||||||
|
|
||||||
/*
|
|
||||||
Skip uppercase letters
|
|
||||||
*/
|
|
||||||
|
|
||||||
SDLK_LEFTBRACKET = '[',
|
|
||||||
SDLK_BACKSLASH = '\\',
|
|
||||||
SDLK_RIGHTBRACKET = ']',
|
|
||||||
SDLK_CARET = '^',
|
|
||||||
SDLK_UNDERSCORE = '_',
|
|
||||||
SDLK_BACKQUOTE = '`',
|
|
||||||
SDLK_a = 'a',
|
|
||||||
SDLK_b = 'b',
|
|
||||||
SDLK_c = 'c',
|
|
||||||
SDLK_d = 'd',
|
|
||||||
SDLK_e = 'e',
|
|
||||||
SDLK_f = 'f',
|
|
||||||
SDLK_g = 'g',
|
|
||||||
SDLK_h = 'h',
|
|
||||||
SDLK_i = 'i',
|
|
||||||
SDLK_j = 'j',
|
|
||||||
SDLK_k = 'k',
|
|
||||||
SDLK_l = 'l',
|
|
||||||
SDLK_m = 'm',
|
|
||||||
SDLK_n = 'n',
|
|
||||||
SDLK_o = 'o',
|
|
||||||
SDLK_p = 'p',
|
|
||||||
SDLK_q = 'q',
|
|
||||||
SDLK_r = 'r',
|
|
||||||
SDLK_s = 's',
|
|
||||||
SDLK_t = 't',
|
|
||||||
SDLK_u = 'u',
|
|
||||||
SDLK_v = 'v',
|
|
||||||
SDLK_w = 'w',
|
|
||||||
SDLK_x = 'x',
|
|
||||||
SDLK_y = 'y',
|
|
||||||
SDLK_z = 'z',
|
|
||||||
|
|
||||||
SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
|
|
||||||
|
|
||||||
SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
|
|
||||||
SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
|
|
||||||
SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
|
|
||||||
SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
|
|
||||||
SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
|
|
||||||
SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
|
|
||||||
SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
|
|
||||||
SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
|
|
||||||
SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
|
|
||||||
SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
|
|
||||||
SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
|
|
||||||
SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
|
|
||||||
|
|
||||||
SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
|
|
||||||
SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
|
|
||||||
SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
|
|
||||||
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
|
|
||||||
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
|
|
||||||
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
|
|
||||||
SDLK_DELETE = '\177',
|
|
||||||
SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
|
|
||||||
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
|
|
||||||
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
|
|
||||||
SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
|
|
||||||
SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
|
|
||||||
SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
|
|
||||||
|
|
||||||
SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
|
|
||||||
SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
|
|
||||||
SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
|
|
||||||
SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
|
|
||||||
SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
|
|
||||||
SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
|
|
||||||
SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
|
|
||||||
SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
|
|
||||||
SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
|
|
||||||
SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
|
|
||||||
SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
|
|
||||||
SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
|
|
||||||
SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
|
|
||||||
SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
|
|
||||||
SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
|
|
||||||
SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
|
|
||||||
SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
|
|
||||||
|
|
||||||
SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
|
|
||||||
SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
|
|
||||||
SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
|
|
||||||
SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
|
|
||||||
SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
|
|
||||||
SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
|
|
||||||
SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
|
|
||||||
SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
|
|
||||||
SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
|
|
||||||
SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
|
|
||||||
SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
|
|
||||||
SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
|
|
||||||
SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
|
|
||||||
SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
|
|
||||||
SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
|
|
||||||
SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
|
|
||||||
SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
|
|
||||||
SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
|
|
||||||
SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
|
|
||||||
SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
|
|
||||||
SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
|
|
||||||
SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
|
|
||||||
SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
|
|
||||||
SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
|
|
||||||
SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
|
|
||||||
SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
|
|
||||||
SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
|
|
||||||
SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
|
|
||||||
SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
|
|
||||||
SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
|
|
||||||
SDLK_KP_EQUALSAS400 =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
|
|
||||||
|
|
||||||
SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
|
|
||||||
SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
|
|
||||||
SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
|
|
||||||
SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
|
|
||||||
SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
|
|
||||||
SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
|
|
||||||
SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
|
|
||||||
SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
|
|
||||||
SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
|
|
||||||
SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
|
|
||||||
SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
|
|
||||||
SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
|
|
||||||
|
|
||||||
SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
|
|
||||||
SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
|
|
||||||
SDLK_THOUSANDSSEPARATOR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
|
|
||||||
SDLK_DECIMALSEPARATOR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
|
|
||||||
SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
|
|
||||||
SDLK_CURRENCYSUBUNIT =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
|
|
||||||
SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
|
|
||||||
SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
|
|
||||||
SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
|
|
||||||
SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
|
|
||||||
SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
|
|
||||||
SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
|
|
||||||
SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
|
|
||||||
SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
|
|
||||||
SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
|
|
||||||
SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
|
|
||||||
SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
|
|
||||||
SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
|
|
||||||
SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
|
|
||||||
SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
|
|
||||||
SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
|
|
||||||
SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
|
|
||||||
SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
|
|
||||||
SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
|
|
||||||
SDLK_KP_DBLAMPERSAND =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
|
|
||||||
SDLK_KP_VERTICALBAR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
|
|
||||||
SDLK_KP_DBLVERTICALBAR =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
|
|
||||||
SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
|
|
||||||
SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
|
|
||||||
SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
|
|
||||||
SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
|
|
||||||
SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
|
|
||||||
SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
|
|
||||||
SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
|
|
||||||
SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
|
|
||||||
SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
|
|
||||||
SDLK_KP_MEMSUBTRACT =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
|
|
||||||
SDLK_KP_MEMMULTIPLY =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
|
|
||||||
SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
|
|
||||||
SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
|
|
||||||
SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
|
|
||||||
SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
|
|
||||||
SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
|
|
||||||
SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
|
|
||||||
SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
|
|
||||||
SDLK_KP_HEXADECIMAL =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
|
|
||||||
|
|
||||||
SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
|
|
||||||
SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
|
|
||||||
SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
|
|
||||||
SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
|
|
||||||
SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
|
|
||||||
SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
|
|
||||||
SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
|
|
||||||
SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
|
|
||||||
|
|
||||||
SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
|
|
||||||
|
|
||||||
SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
|
|
||||||
SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
|
|
||||||
SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
|
|
||||||
SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
|
|
||||||
SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
|
|
||||||
SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
|
|
||||||
SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
|
|
||||||
SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
|
|
||||||
SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
|
|
||||||
SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
|
|
||||||
SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
|
|
||||||
SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
|
|
||||||
SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
|
|
||||||
SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
|
|
||||||
SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
|
|
||||||
SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
|
|
||||||
SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
|
|
||||||
|
|
||||||
SDLK_BRIGHTNESSDOWN =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
|
|
||||||
SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
|
|
||||||
SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
|
|
||||||
SDLK_KBDILLUMTOGGLE =
|
|
||||||
SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
|
|
||||||
SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
|
|
||||||
SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
|
|
||||||
SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
|
|
||||||
SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP),
|
|
||||||
SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1),
|
|
||||||
SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
|
|
||||||
|
|
||||||
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
|
|
||||||
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
|
|
||||||
} SDL_KeyCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Enumeration of valid key mods (possibly OR'd together).
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
KMOD_NONE = 0x0000,
|
|
||||||
KMOD_LSHIFT = 0x0001,
|
|
||||||
KMOD_RSHIFT = 0x0002,
|
|
||||||
KMOD_LCTRL = 0x0040,
|
|
||||||
KMOD_RCTRL = 0x0080,
|
|
||||||
KMOD_LALT = 0x0100,
|
|
||||||
KMOD_RALT = 0x0200,
|
|
||||||
KMOD_LGUI = 0x0400,
|
|
||||||
KMOD_RGUI = 0x0800,
|
|
||||||
KMOD_NUM = 0x1000,
|
|
||||||
KMOD_CAPS = 0x2000,
|
|
||||||
KMOD_MODE = 0x4000,
|
|
||||||
KMOD_RESERVED = 0x8000,
|
|
||||||
|
|
||||||
KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL,
|
|
||||||
KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT,
|
|
||||||
KMOD_ALT = KMOD_LALT | KMOD_RALT,
|
|
||||||
KMOD_GUI = KMOD_LGUI | KMOD_RGUI
|
|
||||||
} SDL_Keymod;
|
|
||||||
|
|
||||||
#endif /* SDL_keycode_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_loadso.h
|
|
||||||
*
|
|
||||||
* System dependent library loading routines
|
|
||||||
*
|
|
||||||
* Some things to keep in mind:
|
|
||||||
* \li These functions only work on C function names. Other languages may
|
|
||||||
* have name mangling and intrinsic language support that varies from
|
|
||||||
* compiler to compiler.
|
|
||||||
* \li Make sure you declare your function pointers with the same calling
|
|
||||||
* convention as the actual library function. Your code will crash
|
|
||||||
* mysteriously if you do not do this.
|
|
||||||
* \li Avoid namespace collisions. If you load a symbol from the library,
|
|
||||||
* it is not defined whether or not it goes into the global symbol
|
|
||||||
* namespace for the application. If it does and it conflicts with
|
|
||||||
* symbols in your code or other shared libraries, you will not get
|
|
||||||
* the results you expect. :)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_loadso_h_
|
|
||||||
#define SDL_loadso_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function dynamically loads a shared object and returns a pointer
|
|
||||||
* to the object handle (or NULL if there was an error).
|
|
||||||
* The 'sofile' parameter is a system dependent name of the object file.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given an object handle, this function looks up the address of the
|
|
||||||
* named function in the shared object and returns it. This address
|
|
||||||
* is no longer valid after calling SDL_UnloadObject().
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
|
|
||||||
const char *name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unload a shared object from memory.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_loadso_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,101 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_locale.h
|
|
||||||
*
|
|
||||||
* Include file for SDL locale services
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SDL_locale_h
|
|
||||||
#define _SDL_locale_h
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
/* *INDENT-OFF* */
|
|
||||||
extern "C" {
|
|
||||||
/* *INDENT-ON* */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct SDL_Locale
|
|
||||||
{
|
|
||||||
const char *language; /**< A language name, like "en" for English. */
|
|
||||||
const char *country; /**< A country, like "US" for America. Can be NULL. */
|
|
||||||
} SDL_Locale;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Report the user's preferred locale.
|
|
||||||
*
|
|
||||||
* This returns an array of SDL_Locale structs, the final item zeroed out.
|
|
||||||
* When the caller is done with this array, it should call SDL_free() on
|
|
||||||
* the returned value; all the memory involved is allocated in a single
|
|
||||||
* block, so a single SDL_free() will suffice.
|
|
||||||
*
|
|
||||||
* Returned language strings are in the format xx, where 'xx' is an ISO-639
|
|
||||||
* language specifier (such as "en" for English, "de" for German, etc).
|
|
||||||
* Country strings are in the format YY, where "YY" is an ISO-3166 country
|
|
||||||
* code (such as "US" for the United States, "CA" for Canada, etc). Country
|
|
||||||
* might be NULL if there's no specific guidance on them (so you might get
|
|
||||||
* { "en", "US" } for American English, but { "en", NULL } means "English
|
|
||||||
* language, generically"). Language strings are never NULL, except to
|
|
||||||
* terminate the array.
|
|
||||||
*
|
|
||||||
* Please note that not all of these strings are 2 characters; some are
|
|
||||||
* three or more.
|
|
||||||
*
|
|
||||||
* The returned list of locales are in the order of the user's preference.
|
|
||||||
* For example, a German citizen that is fluent in US English and knows
|
|
||||||
* enough Japanese to navigate around Tokyo might have a list like:
|
|
||||||
* { "de", "en_US", "jp", NULL }. Someone from England might prefer British
|
|
||||||
* English (where "color" is spelled "colour", etc), but will settle for
|
|
||||||
* anything like it: { "en_GB", "en", NULL }.
|
|
||||||
*
|
|
||||||
* This function returns NULL on error, including when the platform does not
|
|
||||||
* supply this information at all.
|
|
||||||
*
|
|
||||||
* This might be a "slow" call that has to query the operating system. It's
|
|
||||||
* best to ask for this once and save the results. However, this list can
|
|
||||||
* change, usually because the user has changed a system preference outside
|
|
||||||
* of your program; SDL will send an SDL_LOCALECHANGED event in this case,
|
|
||||||
* if possible, and you can call this function again to get an updated copy
|
|
||||||
* of preferred locales.
|
|
||||||
*
|
|
||||||
* \return array of locales, terminated with a locale with a NULL language
|
|
||||||
* field. Will return NULL on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
/* *INDENT-OFF* */
|
|
||||||
}
|
|
||||||
/* *INDENT-ON* */
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* _SDL_locale_h */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,211 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_log.h
|
|
||||||
*
|
|
||||||
* Simple log messages with categories and priorities.
|
|
||||||
*
|
|
||||||
* By default logs are quiet, but if you're debugging SDL you might want:
|
|
||||||
*
|
|
||||||
* SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
|
||||||
*
|
|
||||||
* Here's where the messages go on different platforms:
|
|
||||||
* Windows: debug output stream
|
|
||||||
* Android: log output
|
|
||||||
* Others: standard error output (stderr)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_log_h_
|
|
||||||
#define SDL_log_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The maximum size of a log message
|
|
||||||
*
|
|
||||||
* Messages longer than the maximum size will be truncated
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_LOG_MESSAGE 4096
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The predefined log categories
|
|
||||||
*
|
|
||||||
* By default the application category is enabled at the INFO level,
|
|
||||||
* the assert category is enabled at the WARN level, test is enabled
|
|
||||||
* at the VERBOSE level and all other categories are enabled at the
|
|
||||||
* CRITICAL level.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
SDL_LOG_CATEGORY_ERROR,
|
|
||||||
SDL_LOG_CATEGORY_ASSERT,
|
|
||||||
SDL_LOG_CATEGORY_SYSTEM,
|
|
||||||
SDL_LOG_CATEGORY_AUDIO,
|
|
||||||
SDL_LOG_CATEGORY_VIDEO,
|
|
||||||
SDL_LOG_CATEGORY_RENDER,
|
|
||||||
SDL_LOG_CATEGORY_INPUT,
|
|
||||||
SDL_LOG_CATEGORY_TEST,
|
|
||||||
|
|
||||||
/* Reserved for future SDL library use */
|
|
||||||
SDL_LOG_CATEGORY_RESERVED1,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED2,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED3,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED4,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED5,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED6,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED7,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED8,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED9,
|
|
||||||
SDL_LOG_CATEGORY_RESERVED10,
|
|
||||||
|
|
||||||
/* Beyond this point is reserved for application use, e.g.
|
|
||||||
enum {
|
|
||||||
MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
|
|
||||||
MYAPP_CATEGORY_AWESOME2,
|
|
||||||
MYAPP_CATEGORY_AWESOME3,
|
|
||||||
...
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
SDL_LOG_CATEGORY_CUSTOM
|
|
||||||
} SDL_LogCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The predefined log priorities
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_LOG_PRIORITY_VERBOSE = 1,
|
|
||||||
SDL_LOG_PRIORITY_DEBUG,
|
|
||||||
SDL_LOG_PRIORITY_INFO,
|
|
||||||
SDL_LOG_PRIORITY_WARN,
|
|
||||||
SDL_LOG_PRIORITY_ERROR,
|
|
||||||
SDL_LOG_PRIORITY_CRITICAL,
|
|
||||||
SDL_NUM_LOG_PRIORITIES
|
|
||||||
} SDL_LogPriority;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the priority of all log categories
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the priority of a particular log category
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
|
||||||
SDL_LogPriority priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the priority of a particular log category
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Reset all priorities to default.
|
|
||||||
*
|
|
||||||
* \note This is called in SDL_Quit().
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_PRIORITY_DEBUG
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_PRIORITY_INFO
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_PRIORITY_WARN
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_PRIORITY_ERROR
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with the specified category and priority.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
|
||||||
SDL_LogPriority priority,
|
|
||||||
SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Log a message with the specified category and priority.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
|
||||||
SDL_LogPriority priority,
|
|
||||||
const char *fmt, va_list ap);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The prototype for the log output function
|
|
||||||
*/
|
|
||||||
typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current log output function.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief This function allows you to replace the default log output
|
|
||||||
* function with one of your own.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_log_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,180 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_main_h_
|
|
||||||
#define SDL_main_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_main.h
|
|
||||||
*
|
|
||||||
* Redefine main() on some platforms so that it is called by SDL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_MAIN_HANDLED
|
|
||||||
#if defined(__WIN32__)
|
|
||||||
/* On Windows SDL provides WinMain(), which parses the command line and passes
|
|
||||||
the arguments to your main function.
|
|
||||||
|
|
||||||
If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_AVAILABLE
|
|
||||||
|
|
||||||
#elif defined(__WINRT__)
|
|
||||||
/* On WinRT, SDL provides a main function that initializes CoreApplication,
|
|
||||||
creating an instance of IFrameworkView in the process.
|
|
||||||
|
|
||||||
Please note that #include'ing SDL_main.h is not enough to get a main()
|
|
||||||
function working. In non-XAML apps, the file,
|
|
||||||
src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled
|
|
||||||
into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be
|
|
||||||
called, with a pointer to the Direct3D-hosted XAML control passed in.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#elif defined(__IPHONEOS__)
|
|
||||||
/* On iOS SDL provides a main function that creates an application delegate
|
|
||||||
and starts the iOS application run loop.
|
|
||||||
|
|
||||||
If you link with SDL dynamically on iOS, the main function can't be in a
|
|
||||||
shared library, so you need to link with libSDLmain.a, which includes a
|
|
||||||
stub main function that calls into the shared library to start execution.
|
|
||||||
|
|
||||||
See src/video/uikit/SDL_uikitappdelegate.m for more details.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#elif defined(__ANDROID__)
|
|
||||||
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
|
||||||
main activity entry point.
|
|
||||||
|
|
||||||
See docs/README-android.md for more details on extending that class.
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
/* We need to export SDL_main so it can be launched from Java */
|
|
||||||
#define SDLMAIN_DECLSPEC DECLSPEC
|
|
||||||
|
|
||||||
#elif defined(__NACL__)
|
|
||||||
/* On NACL we use ppapi_simple to set up the application helper code,
|
|
||||||
then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
|
|
||||||
starting the user main function.
|
|
||||||
All user code is run in a separate thread by ppapi_simple, thus
|
|
||||||
allowing for blocking io to take place via nacl_io
|
|
||||||
*/
|
|
||||||
#define SDL_MAIN_NEEDED
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_MAIN_HANDLED */
|
|
||||||
|
|
||||||
#ifndef SDLMAIN_DECLSPEC
|
|
||||||
#define SDLMAIN_DECLSPEC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_main.h
|
|
||||||
*
|
|
||||||
* The application's main() function must be called with C linkage,
|
|
||||||
* and should be declared like this:
|
|
||||||
* \code
|
|
||||||
* #ifdef __cplusplus
|
|
||||||
* extern "C"
|
|
||||||
* #endif
|
|
||||||
* int main(int argc, char *argv[])
|
|
||||||
* {
|
|
||||||
* }
|
|
||||||
* \endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
|
|
||||||
#define main SDL_main
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The prototype for the application's main() function
|
|
||||||
*/
|
|
||||||
typedef int (*SDL_main_func)(int argc, char *argv[]);
|
|
||||||
extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is called by the real SDL main function to let the rest of the
|
|
||||||
* library know that initialization was done properly.
|
|
||||||
*
|
|
||||||
* Calling this yourself without knowing what you're doing can cause
|
|
||||||
* crashes and hard to diagnose problems with your application.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
|
||||||
|
|
||||||
#ifdef __WIN32__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This can be called to set the application class at startup
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
|
||||||
|
|
||||||
#endif /* __WIN32__ */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WINRT__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Initializes and launches an SDL/WinRT application.
|
|
||||||
*
|
|
||||||
* \param mainFunction The SDL app's C-style main().
|
|
||||||
* \param reserved Reserved for future use; should be NULL
|
|
||||||
* \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
|
|
||||||
* information on the failure.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
|
|
||||||
|
|
||||||
#endif /* __WINRT__ */
|
|
||||||
|
|
||||||
#if defined(__IPHONEOS__)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Initializes and launches an SDL application.
|
|
||||||
*
|
|
||||||
* \param argc The argc parameter from the application's main() function
|
|
||||||
* \param argv The argv parameter from the application's main() function
|
|
||||||
* \param mainFunction The SDL app's C-style main().
|
|
||||||
* \return the return value from mainFunction
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
|
|
||||||
|
|
||||||
#endif /* __IPHONEOS__ */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_main_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,146 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_messagebox_h_
|
|
||||||
#define SDL_messagebox_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_video.h" /* For SDL_Window */
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief SDL_MessageBox flags. If supported will display warning icon, etc.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */
|
|
||||||
SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */
|
|
||||||
SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */
|
|
||||||
SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */
|
|
||||||
SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */
|
|
||||||
} SDL_MessageBoxFlags;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Flags for SDL_MessageBoxButtonData.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */
|
|
||||||
SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */
|
|
||||||
} SDL_MessageBoxButtonFlags;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Individual button data.
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */
|
|
||||||
int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */
|
|
||||||
const char * text; /**< The UTF-8 button text */
|
|
||||||
} SDL_MessageBoxButtonData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief RGB value used in a message box color scheme
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Uint8 r, g, b;
|
|
||||||
} SDL_MessageBoxColor;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_MESSAGEBOX_COLOR_BACKGROUND,
|
|
||||||
SDL_MESSAGEBOX_COLOR_TEXT,
|
|
||||||
SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
|
|
||||||
SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
|
|
||||||
SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
|
|
||||||
SDL_MESSAGEBOX_COLOR_MAX
|
|
||||||
} SDL_MessageBoxColorType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A set of colors to use for message box dialogs
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
|
|
||||||
} SDL_MessageBoxColorScheme;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief MessageBox structure containing title, text, window, etc.
|
|
||||||
*/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Uint32 flags; /**< ::SDL_MessageBoxFlags */
|
|
||||||
SDL_Window *window; /**< Parent window, can be NULL */
|
|
||||||
const char *title; /**< UTF-8 title */
|
|
||||||
const char *message; /**< UTF-8 message text */
|
|
||||||
|
|
||||||
int numbuttons;
|
|
||||||
const SDL_MessageBoxButtonData *buttons;
|
|
||||||
|
|
||||||
const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
|
|
||||||
} SDL_MessageBoxData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a modal message box.
|
|
||||||
*
|
|
||||||
* \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
|
|
||||||
* \param buttonid The pointer to which user id of hit button should be copied.
|
|
||||||
*
|
|
||||||
* \return -1 on error, otherwise 0 and buttonid contains user id of button
|
|
||||||
* hit or -1 if dialog was closed.
|
|
||||||
*
|
|
||||||
* \note This function should be called on the thread that created the parent
|
|
||||||
* window, or on the main thread if the messagebox has no parent. It will
|
|
||||||
* block execution of that thread until the user clicks a button or
|
|
||||||
* closes the messagebox.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a simple modal message box
|
|
||||||
*
|
|
||||||
* \param flags ::SDL_MessageBoxFlags
|
|
||||||
* \param title UTF-8 title text
|
|
||||||
* \param message UTF-8 message text
|
|
||||||
* \param window The parent window, or NULL for no parent
|
|
||||||
*
|
|
||||||
* \return 0 on success, -1 on error
|
|
||||||
*
|
|
||||||
* \sa SDL_ShowMessageBox
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_messagebox_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,117 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_metal.h
|
|
||||||
*
|
|
||||||
* Header file for functions to creating Metal layers and views on SDL windows.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_metal_h_
|
|
||||||
#define SDL_metal_h_
|
|
||||||
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
|
|
||||||
*
|
|
||||||
* \note This can be cast directly to an NSView or UIView.
|
|
||||||
*/
|
|
||||||
typedef void *SDL_MetalView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Metal support functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
|
|
||||||
* specified window.
|
|
||||||
*
|
|
||||||
* On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its
|
|
||||||
* own. It is up to user code to do that.
|
|
||||||
*
|
|
||||||
* The returned handle can be casted directly to a NSView or UIView.
|
|
||||||
* To access the backing CAMetalLayer, call SDL_Metal_GetLayer().
|
|
||||||
*
|
|
||||||
* \note \a window must be created with the SDL_WINDOW_METAL flag.
|
|
||||||
*
|
|
||||||
* \sa SDL_Metal_DestroyView
|
|
||||||
* \sa SDL_Metal_GetLayer
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Destroy an existing SDL_MetalView object.
|
|
||||||
*
|
|
||||||
* This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
|
|
||||||
* called after SDL_CreateWindow.
|
|
||||||
*
|
|
||||||
* \sa SDL_Metal_CreateView
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get a pointer to the backing CAMetalLayer for the given view.
|
|
||||||
*
|
|
||||||
* \sa SDL_MetalCreateView
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the size of a window's underlying drawable in pixels (for use
|
|
||||||
* with setting viewport, scissor & etc).
|
|
||||||
*
|
|
||||||
* \param window SDL_Window from which the drawable size should be queried
|
|
||||||
* \param w Pointer to variable for storing the width in pixels,
|
|
||||||
* may be NULL
|
|
||||||
* \param h Pointer to variable for storing the height in pixels,
|
|
||||||
* may be NULL
|
|
||||||
*
|
|
||||||
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
|
||||||
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
|
|
||||||
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
|
|
||||||
* by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
|
|
||||||
*
|
|
||||||
* \note On macOS high-DPI support must be enabled for an application by
|
|
||||||
* setting NSHighResolutionCapable to true in its Info.plist.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetWindowSize()
|
|
||||||
* \sa SDL_CreateWindow()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w,
|
|
||||||
int *h);
|
|
||||||
|
|
||||||
/* @} *//* Metal support functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_metal_h_ */
|
|
@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_misc.h
|
|
||||||
*
|
|
||||||
* \brief Include file for SDL API functions that don't fit elsewhere.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_misc_h_
|
|
||||||
#define SDL_misc_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Open an URL / URI in the browser or other
|
|
||||||
*
|
|
||||||
* Open a URL in a separate, system-provided application. How this works will
|
|
||||||
* vary wildly depending on the platform. This will likely launch what
|
|
||||||
* makes sense to handle a specific URL's protocol (a web browser for http://,
|
|
||||||
* etc), but it might also be able to launch file managers for directories
|
|
||||||
* and other things.
|
|
||||||
*
|
|
||||||
* What happens when you open a URL varies wildly as well: your game window
|
|
||||||
* may lose focus (and may or may not lose focus if your game was fullscreen
|
|
||||||
* or grabbing input at the time). On mobile devices, your app will likely
|
|
||||||
* move to the background or your process might be paused. Any given platform
|
|
||||||
* may or may not handle a given URL.
|
|
||||||
*
|
|
||||||
* If this is unimplemented (or simply unavailable) for a platform, this will
|
|
||||||
* fail with an error. A successful result does not mean the URL loaded, just
|
|
||||||
* that we launched something to handle it (or at least believe we did).
|
|
||||||
*
|
|
||||||
* All this to say: this function can be useful, but you should definitely
|
|
||||||
* test it on every platform you target.
|
|
||||||
*
|
|
||||||
* \param url A valid URL to open.
|
|
||||||
* \return 0 on success, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_misc_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,302 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_mouse.h
|
|
||||||
*
|
|
||||||
* Include file for SDL mouse event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_mouse_h_
|
|
||||||
#define SDL_mouse_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Cursor types for SDL_CreateSystemCursor().
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */
|
|
||||||
SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */
|
|
||||||
SDL_SYSTEM_CURSOR_WAIT, /**< Wait */
|
|
||||||
SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */
|
|
||||||
SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */
|
|
||||||
SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */
|
|
||||||
SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */
|
|
||||||
SDL_SYSTEM_CURSOR_HAND, /**< Hand */
|
|
||||||
SDL_NUM_SYSTEM_CURSORS
|
|
||||||
} SDL_SystemCursor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Scroll direction types for the Scroll event
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */
|
|
||||||
SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */
|
|
||||||
} SDL_MouseWheelDirection;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the window which currently has mouse focus.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Retrieve the current state of the mouse.
|
|
||||||
*
|
|
||||||
* The current button state is returned as a button bitmask, which can
|
|
||||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
|
||||||
* mouse cursor position relative to the focus window for the currently
|
|
||||||
* selected mouse. You can pass NULL for either x or y.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current state of the mouse, in relation to the desktop
|
|
||||||
*
|
|
||||||
* This works just like SDL_GetMouseState(), but the coordinates will be
|
|
||||||
* reported relative to the top-left of the desktop. This can be useful if
|
|
||||||
* you need to track the mouse outside of a specific window and
|
|
||||||
* SDL_CaptureMouse() doesn't fit your needs. For example, it could be
|
|
||||||
* useful if you need to track the mouse while dragging a window, where
|
|
||||||
* coordinates relative to a window might not be in sync at all times.
|
|
||||||
*
|
|
||||||
* \note SDL_GetMouseState() returns the mouse position as SDL understands
|
|
||||||
* it from the last pump of the event queue. This function, however,
|
|
||||||
* queries the OS for the current mouse position, and as such, might
|
|
||||||
* be a slightly less efficient function. Unless you know what you're
|
|
||||||
* doing and have a good reason to use this function, you probably want
|
|
||||||
* SDL_GetMouseState() instead.
|
|
||||||
*
|
|
||||||
* \param x Returns the current X coord, relative to the desktop. Can be NULL.
|
|
||||||
* \param y Returns the current Y coord, relative to the desktop. Can be NULL.
|
|
||||||
* \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetMouseState
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Retrieve the relative state of the mouse.
|
|
||||||
*
|
|
||||||
* The current button state is returned as a button bitmask, which can
|
|
||||||
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
|
|
||||||
* mouse deltas since the last call to SDL_GetRelativeMouseState().
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Moves the mouse to the given position within the window.
|
|
||||||
*
|
|
||||||
* \param window The window to move the mouse into, or NULL for the current mouse focus
|
|
||||||
* \param x The x coordinate within the window
|
|
||||||
* \param y The y coordinate within the window
|
|
||||||
*
|
|
||||||
* \note This function generates a mouse motion event
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
|
||||||
int x, int y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Moves the mouse to the given position in global screen space.
|
|
||||||
*
|
|
||||||
* \param x The x coordinate
|
|
||||||
* \param y The y coordinate
|
|
||||||
* \return 0 on success, -1 on error (usually: unsupported by a platform).
|
|
||||||
*
|
|
||||||
* \note This function generates a mouse motion event
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set relative mouse mode.
|
|
||||||
*
|
|
||||||
* \param enabled Whether or not to enable relative mode
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if relative mode is not supported.
|
|
||||||
*
|
|
||||||
* While the mouse is in relative mode, the cursor is hidden, and the
|
|
||||||
* driver will try to report continuous motion in the current window.
|
|
||||||
* Only relative motion events will be delivered, the mouse position
|
|
||||||
* will not change.
|
|
||||||
*
|
|
||||||
* \note This function will flush any pending mouse motion.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRelativeMouseMode()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Capture the mouse, to track input outside an SDL window.
|
|
||||||
*
|
|
||||||
* \param enabled Whether or not to enable capturing
|
|
||||||
*
|
|
||||||
* Capturing enables your app to obtain mouse events globally, instead of
|
|
||||||
* just within your window. Not all video targets support this function.
|
|
||||||
* When capturing is enabled, the current window will get all mouse events,
|
|
||||||
* but unlike relative mode, no change is made to the cursor and it is
|
|
||||||
* not restrained to your window.
|
|
||||||
*
|
|
||||||
* This function may also deny mouse input to other windows--both those in
|
|
||||||
* your application and others on the system--so you should use this
|
|
||||||
* function sparingly, and in small bursts. For example, you might want to
|
|
||||||
* track the mouse while the user is dragging something, until the user
|
|
||||||
* releases a mouse button. It is not recommended that you capture the mouse
|
|
||||||
* for long periods of time, such as the entire time your app is running.
|
|
||||||
*
|
|
||||||
* While captured, mouse events still report coordinates relative to the
|
|
||||||
* current (foreground) window, but those coordinates may be outside the
|
|
||||||
* bounds of the window (including negative values). Capturing is only
|
|
||||||
* allowed for the foreground window. If the window loses focus while
|
|
||||||
* capturing, the capture will be disabled automatically.
|
|
||||||
*
|
|
||||||
* While capturing is enabled, the current window will have the
|
|
||||||
* SDL_WINDOW_MOUSE_CAPTURE flag set.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if not supported.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Query whether relative mouse mode is enabled.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetRelativeMouseMode()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a cursor, using the specified bitmap data and
|
|
||||||
* mask (in MSB format).
|
|
||||||
*
|
|
||||||
* The cursor width must be a multiple of 8 bits.
|
|
||||||
*
|
|
||||||
* The cursor is created in black and white according to the following:
|
|
||||||
* <table>
|
|
||||||
* <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
|
|
||||||
* <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
|
|
||||||
* <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
|
|
||||||
* <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
|
|
||||||
* <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
|
|
||||||
* if not. </td></tr>
|
|
||||||
* </table>
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeCursor()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
|
||||||
const Uint8 * mask,
|
|
||||||
int w, int h, int hot_x,
|
|
||||||
int hot_y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a color cursor.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeCursor()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
|
||||||
int hot_x,
|
|
||||||
int hot_y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a system cursor.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreeCursor()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the active cursor.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Return the active cursor.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Return the default cursor.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Frees a cursor created with SDL_CreateCursor() or similar functions.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateCursor()
|
|
||||||
* \sa SDL_CreateColorCursor()
|
|
||||||
* \sa SDL_CreateSystemCursor()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Toggle whether or not the cursor is shown.
|
|
||||||
*
|
|
||||||
* \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
|
|
||||||
* state.
|
|
||||||
*
|
|
||||||
* \return 1 if the cursor is shown, or 0 if the cursor is hidden.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used as a mask when testing buttons in buttonstate.
|
|
||||||
* - Button 1: Left mouse button
|
|
||||||
* - Button 2: Middle mouse button
|
|
||||||
* - Button 3: Right mouse button
|
|
||||||
*/
|
|
||||||
#define SDL_BUTTON(X) (1 << ((X)-1))
|
|
||||||
#define SDL_BUTTON_LEFT 1
|
|
||||||
#define SDL_BUTTON_MIDDLE 2
|
|
||||||
#define SDL_BUTTON_RIGHT 3
|
|
||||||
#define SDL_BUTTON_X1 4
|
|
||||||
#define SDL_BUTTON_X2 5
|
|
||||||
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
|
|
||||||
#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
|
|
||||||
#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
|
|
||||||
#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
|
|
||||||
#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_mouse_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,251 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_mutex_h_
|
|
||||||
#define SDL_mutex_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_mutex.h
|
|
||||||
*
|
|
||||||
* Functions to provide thread synchronization primitives.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Mutex functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/* The SDL mutex structure, defined in SDL_sysmutex.c */
|
|
||||||
struct SDL_mutex;
|
|
||||||
typedef struct SDL_mutex SDL_mutex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a mutex, initialized unlocked.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lock the mutex.
|
|
||||||
*
|
|
||||||
* \return 0, or -1 on error.
|
|
||||||
*/
|
|
||||||
#define SDL_mutexP(m) SDL_LockMutex(m)
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Try to lock the mutex
|
|
||||||
*
|
|
||||||
* \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unlock the mutex.
|
|
||||||
*
|
|
||||||
* \return 0, or -1 on error.
|
|
||||||
*
|
|
||||||
* \warning It is an error to unlock a mutex that has not been locked by
|
|
||||||
* the current thread, and doing so results in undefined behavior.
|
|
||||||
*/
|
|
||||||
#define SDL_mutexV(m) SDL_UnlockMutex(m)
|
|
||||||
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy a mutex.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/* @} *//* Mutex functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Semaphore functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/* The SDL semaphore structure, defined in SDL_syssem.c */
|
|
||||||
struct SDL_semaphore;
|
|
||||||
typedef struct SDL_semaphore SDL_sem;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a semaphore, initialized with value, returns NULL on failure.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy a semaphore.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function suspends the calling thread until the semaphore pointed
|
|
||||||
* to by \c sem has a positive count. It then atomically decreases the
|
|
||||||
* semaphore count.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Non-blocking variant of SDL_SemWait().
|
|
||||||
*
|
|
||||||
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
|
|
||||||
* block, and -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variant of SDL_SemWait() with a timeout in milliseconds.
|
|
||||||
*
|
|
||||||
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
|
|
||||||
* succeed in the allotted time, and -1 on error.
|
|
||||||
*
|
|
||||||
* \warning On some platforms this function is implemented by looping with a
|
|
||||||
* delay of 1 ms, and so should be avoided if possible.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Atomically increases the semaphore's count (not blocking).
|
|
||||||
*
|
|
||||||
* \return 0, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the current count of the semaphore.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
|
|
||||||
|
|
||||||
/* @} *//* Semaphore functions */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Condition variable functions
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/* The SDL condition variable structure, defined in SDL_syscond.c */
|
|
||||||
struct SDL_cond;
|
|
||||||
typedef struct SDL_cond SDL_cond;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a condition variable.
|
|
||||||
*
|
|
||||||
* Typical use of condition variables:
|
|
||||||
*
|
|
||||||
* Thread A:
|
|
||||||
* SDL_LockMutex(lock);
|
|
||||||
* while ( ! condition ) {
|
|
||||||
* SDL_CondWait(cond, lock);
|
|
||||||
* }
|
|
||||||
* SDL_UnlockMutex(lock);
|
|
||||||
*
|
|
||||||
* Thread B:
|
|
||||||
* SDL_LockMutex(lock);
|
|
||||||
* ...
|
|
||||||
* condition = true;
|
|
||||||
* ...
|
|
||||||
* SDL_CondSignal(cond);
|
|
||||||
* SDL_UnlockMutex(lock);
|
|
||||||
*
|
|
||||||
* There is some discussion whether to signal the condition variable
|
|
||||||
* with the mutex locked or not. There is some potential performance
|
|
||||||
* benefit to unlocking first on some platforms, but there are some
|
|
||||||
* potential race conditions depending on how your code is structured.
|
|
||||||
*
|
|
||||||
* In general it's safer to signal the condition variable while the
|
|
||||||
* mutex is locked.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroy a condition variable.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restart one of the threads that are waiting on the condition variable.
|
|
||||||
*
|
|
||||||
* \return 0 or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restart all threads that are waiting on the condition variable.
|
|
||||||
*
|
|
||||||
* \return 0 or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait on the condition variable, unlocking the provided mutex.
|
|
||||||
*
|
|
||||||
* \warning The mutex must be locked before entering this function!
|
|
||||||
*
|
|
||||||
* The mutex is re-locked once the condition variable is signaled.
|
|
||||||
*
|
|
||||||
* \return 0 when it is signaled, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Waits for at most \c ms milliseconds, and returns 0 if the condition
|
|
||||||
* variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
|
|
||||||
* signaled in the allotted time, and -1 on error.
|
|
||||||
*
|
|
||||||
* \warning On some platforms this function is implemented by looping with a
|
|
||||||
* delay of 1 ms, and so should be avoided if possible.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
|
|
||||||
SDL_mutex * mutex, Uint32 ms);
|
|
||||||
|
|
||||||
/* @} *//* Condition variable functions */
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_mutex_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDLname_h_
|
|
||||||
#define SDLname_h_
|
|
||||||
|
|
||||||
#if defined(__STDC__) || defined(__cplusplus)
|
|
||||||
#define NeedFunctionPrototypes 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SDL_NAME(X) SDL_##X
|
|
||||||
|
|
||||||
#endif /* SDLname_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_opengles.h
|
|
||||||
*
|
|
||||||
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
|
||||||
*/
|
|
||||||
#include "SDL_config.h"
|
|
||||||
|
|
||||||
#ifdef __IPHONEOS__
|
|
||||||
#include <OpenGLES/ES1/gl.h>
|
|
||||||
#include <OpenGLES/ES1/glext.h>
|
|
||||||
#else
|
|
||||||
#include <GLES/gl.h>
|
|
||||||
#include <GLES/glext.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef APIENTRY
|
|
||||||
#define APIENTRY
|
|
||||||
#endif
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_opengles2.h
|
|
||||||
*
|
|
||||||
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
|
||||||
*/
|
|
||||||
#include "SDL_config.h"
|
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
|
||||||
|
|
||||||
#ifdef __IPHONEOS__
|
|
||||||
#include <OpenGLES/ES2/gl.h>
|
|
||||||
#include <OpenGLES/ES2/glext.h>
|
|
||||||
#else
|
|
||||||
#include <GLES2/gl2platform.h>
|
|
||||||
#include <GLES2/gl2.h>
|
|
||||||
#include <GLES2/gl2ext.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* _MSC_VER */
|
|
||||||
|
|
||||||
/* OpenGL ES2 headers for Visual Studio */
|
|
||||||
#include "SDL_opengles2_khrplatform.h"
|
|
||||||
#include "SDL_opengles2_gl2platform.h"
|
|
||||||
#include "SDL_opengles2_gl2.h"
|
|
||||||
#include "SDL_opengles2_gl2ext.h"
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
|
||||||
|
|
||||||
#ifndef APIENTRY
|
|
||||||
#define APIENTRY GL_APIENTRY
|
|
||||||
#endif
|
|
@ -1,621 +0,0 @@
|
|||||||
#ifndef __gl2_h_
|
|
||||||
#define __gl2_h_
|
|
||||||
|
|
||||||
/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
|
|
||||||
|
|
||||||
/*#include <GLES2/gl2platform.h>*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This document is licensed under the SGI Free Software B License Version
|
|
||||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
* Data type definitions
|
|
||||||
*-----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef void GLvoid;
|
|
||||||
typedef char GLchar;
|
|
||||||
typedef unsigned int GLenum;
|
|
||||||
typedef unsigned char GLboolean;
|
|
||||||
typedef unsigned int GLbitfield;
|
|
||||||
typedef khronos_int8_t GLbyte;
|
|
||||||
typedef short GLshort;
|
|
||||||
typedef int GLint;
|
|
||||||
typedef int GLsizei;
|
|
||||||
typedef khronos_uint8_t GLubyte;
|
|
||||||
typedef unsigned short GLushort;
|
|
||||||
typedef unsigned int GLuint;
|
|
||||||
typedef khronos_float_t GLfloat;
|
|
||||||
typedef khronos_float_t GLclampf;
|
|
||||||
typedef khronos_int32_t GLfixed;
|
|
||||||
|
|
||||||
/* GL types for handling large vertex buffer objects */
|
|
||||||
typedef khronos_intptr_t GLintptr;
|
|
||||||
typedef khronos_ssize_t GLsizeiptr;
|
|
||||||
|
|
||||||
/* OpenGL ES core versions */
|
|
||||||
#define GL_ES_VERSION_2_0 1
|
|
||||||
|
|
||||||
/* ClearBufferMask */
|
|
||||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
|
||||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
|
||||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
|
||||||
|
|
||||||
/* Boolean */
|
|
||||||
#define GL_FALSE 0
|
|
||||||
#define GL_TRUE 1
|
|
||||||
|
|
||||||
/* BeginMode */
|
|
||||||
#define GL_POINTS 0x0000
|
|
||||||
#define GL_LINES 0x0001
|
|
||||||
#define GL_LINE_LOOP 0x0002
|
|
||||||
#define GL_LINE_STRIP 0x0003
|
|
||||||
#define GL_TRIANGLES 0x0004
|
|
||||||
#define GL_TRIANGLE_STRIP 0x0005
|
|
||||||
#define GL_TRIANGLE_FAN 0x0006
|
|
||||||
|
|
||||||
/* AlphaFunction (not supported in ES20) */
|
|
||||||
/* GL_NEVER */
|
|
||||||
/* GL_LESS */
|
|
||||||
/* GL_EQUAL */
|
|
||||||
/* GL_LEQUAL */
|
|
||||||
/* GL_GREATER */
|
|
||||||
/* GL_NOTEQUAL */
|
|
||||||
/* GL_GEQUAL */
|
|
||||||
/* GL_ALWAYS */
|
|
||||||
|
|
||||||
/* BlendingFactorDest */
|
|
||||||
#define GL_ZERO 0
|
|
||||||
#define GL_ONE 1
|
|
||||||
#define GL_SRC_COLOR 0x0300
|
|
||||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
|
||||||
#define GL_SRC_ALPHA 0x0302
|
|
||||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
|
||||||
#define GL_DST_ALPHA 0x0304
|
|
||||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
|
||||||
|
|
||||||
/* BlendingFactorSrc */
|
|
||||||
/* GL_ZERO */
|
|
||||||
/* GL_ONE */
|
|
||||||
#define GL_DST_COLOR 0x0306
|
|
||||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
|
||||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
|
||||||
/* GL_SRC_ALPHA */
|
|
||||||
/* GL_ONE_MINUS_SRC_ALPHA */
|
|
||||||
/* GL_DST_ALPHA */
|
|
||||||
/* GL_ONE_MINUS_DST_ALPHA */
|
|
||||||
|
|
||||||
/* BlendEquationSeparate */
|
|
||||||
#define GL_FUNC_ADD 0x8006
|
|
||||||
#define GL_BLEND_EQUATION 0x8009
|
|
||||||
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
|
|
||||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
|
||||||
|
|
||||||
/* BlendSubtract */
|
|
||||||
#define GL_FUNC_SUBTRACT 0x800A
|
|
||||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
|
||||||
|
|
||||||
/* Separate Blend Functions */
|
|
||||||
#define GL_BLEND_DST_RGB 0x80C8
|
|
||||||
#define GL_BLEND_SRC_RGB 0x80C9
|
|
||||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
|
||||||
#define GL_BLEND_SRC_ALPHA 0x80CB
|
|
||||||
#define GL_CONSTANT_COLOR 0x8001
|
|
||||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
|
||||||
#define GL_CONSTANT_ALPHA 0x8003
|
|
||||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
|
||||||
#define GL_BLEND_COLOR 0x8005
|
|
||||||
|
|
||||||
/* Buffer Objects */
|
|
||||||
#define GL_ARRAY_BUFFER 0x8892
|
|
||||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
|
||||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
|
||||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
|
||||||
|
|
||||||
#define GL_STREAM_DRAW 0x88E0
|
|
||||||
#define GL_STATIC_DRAW 0x88E4
|
|
||||||
#define GL_DYNAMIC_DRAW 0x88E8
|
|
||||||
|
|
||||||
#define GL_BUFFER_SIZE 0x8764
|
|
||||||
#define GL_BUFFER_USAGE 0x8765
|
|
||||||
|
|
||||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
|
||||||
|
|
||||||
/* CullFaceMode */
|
|
||||||
#define GL_FRONT 0x0404
|
|
||||||
#define GL_BACK 0x0405
|
|
||||||
#define GL_FRONT_AND_BACK 0x0408
|
|
||||||
|
|
||||||
/* DepthFunction */
|
|
||||||
/* GL_NEVER */
|
|
||||||
/* GL_LESS */
|
|
||||||
/* GL_EQUAL */
|
|
||||||
/* GL_LEQUAL */
|
|
||||||
/* GL_GREATER */
|
|
||||||
/* GL_NOTEQUAL */
|
|
||||||
/* GL_GEQUAL */
|
|
||||||
/* GL_ALWAYS */
|
|
||||||
|
|
||||||
/* EnableCap */
|
|
||||||
#define GL_TEXTURE_2D 0x0DE1
|
|
||||||
#define GL_CULL_FACE 0x0B44
|
|
||||||
#define GL_BLEND 0x0BE2
|
|
||||||
#define GL_DITHER 0x0BD0
|
|
||||||
#define GL_STENCIL_TEST 0x0B90
|
|
||||||
#define GL_DEPTH_TEST 0x0B71
|
|
||||||
#define GL_SCISSOR_TEST 0x0C11
|
|
||||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
|
||||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
|
||||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
|
||||||
|
|
||||||
/* ErrorCode */
|
|
||||||
#define GL_NO_ERROR 0
|
|
||||||
#define GL_INVALID_ENUM 0x0500
|
|
||||||
#define GL_INVALID_VALUE 0x0501
|
|
||||||
#define GL_INVALID_OPERATION 0x0502
|
|
||||||
#define GL_OUT_OF_MEMORY 0x0505
|
|
||||||
|
|
||||||
/* FrontFaceDirection */
|
|
||||||
#define GL_CW 0x0900
|
|
||||||
#define GL_CCW 0x0901
|
|
||||||
|
|
||||||
/* GetPName */
|
|
||||||
#define GL_LINE_WIDTH 0x0B21
|
|
||||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
|
||||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
|
||||||
#define GL_CULL_FACE_MODE 0x0B45
|
|
||||||
#define GL_FRONT_FACE 0x0B46
|
|
||||||
#define GL_DEPTH_RANGE 0x0B70
|
|
||||||
#define GL_DEPTH_WRITEMASK 0x0B72
|
|
||||||
#define GL_DEPTH_CLEAR_VALUE 0x0B73
|
|
||||||
#define GL_DEPTH_FUNC 0x0B74
|
|
||||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
|
||||||
#define GL_STENCIL_FUNC 0x0B92
|
|
||||||
#define GL_STENCIL_FAIL 0x0B94
|
|
||||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
|
||||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
|
||||||
#define GL_STENCIL_REF 0x0B97
|
|
||||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
|
||||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
|
||||||
#define GL_STENCIL_BACK_FUNC 0x8800
|
|
||||||
#define GL_STENCIL_BACK_FAIL 0x8801
|
|
||||||
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
|
|
||||||
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
|
|
||||||
#define GL_STENCIL_BACK_REF 0x8CA3
|
|
||||||
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
|
|
||||||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
|
||||||
#define GL_VIEWPORT 0x0BA2
|
|
||||||
#define GL_SCISSOR_BOX 0x0C10
|
|
||||||
/* GL_SCISSOR_TEST */
|
|
||||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
|
||||||
#define GL_COLOR_WRITEMASK 0x0C23
|
|
||||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
|
||||||
#define GL_PACK_ALIGNMENT 0x0D05
|
|
||||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
|
||||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
|
||||||
#define GL_SUBPIXEL_BITS 0x0D50
|
|
||||||
#define GL_RED_BITS 0x0D52
|
|
||||||
#define GL_GREEN_BITS 0x0D53
|
|
||||||
#define GL_BLUE_BITS 0x0D54
|
|
||||||
#define GL_ALPHA_BITS 0x0D55
|
|
||||||
#define GL_DEPTH_BITS 0x0D56
|
|
||||||
#define GL_STENCIL_BITS 0x0D57
|
|
||||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
|
||||||
/* GL_POLYGON_OFFSET_FILL */
|
|
||||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
|
||||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
|
||||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
|
||||||
#define GL_SAMPLES 0x80A9
|
|
||||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
|
||||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
|
||||||
|
|
||||||
/* GetTextureParameter */
|
|
||||||
/* GL_TEXTURE_MAG_FILTER */
|
|
||||||
/* GL_TEXTURE_MIN_FILTER */
|
|
||||||
/* GL_TEXTURE_WRAP_S */
|
|
||||||
/* GL_TEXTURE_WRAP_T */
|
|
||||||
|
|
||||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
|
||||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
|
||||||
|
|
||||||
/* HintMode */
|
|
||||||
#define GL_DONT_CARE 0x1100
|
|
||||||
#define GL_FASTEST 0x1101
|
|
||||||
#define GL_NICEST 0x1102
|
|
||||||
|
|
||||||
/* HintTarget */
|
|
||||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
|
||||||
|
|
||||||
/* DataType */
|
|
||||||
#define GL_BYTE 0x1400
|
|
||||||
#define GL_UNSIGNED_BYTE 0x1401
|
|
||||||
#define GL_SHORT 0x1402
|
|
||||||
#define GL_UNSIGNED_SHORT 0x1403
|
|
||||||
#define GL_INT 0x1404
|
|
||||||
#define GL_UNSIGNED_INT 0x1405
|
|
||||||
#define GL_FLOAT 0x1406
|
|
||||||
#define GL_FIXED 0x140C
|
|
||||||
|
|
||||||
/* PixelFormat */
|
|
||||||
#define GL_DEPTH_COMPONENT 0x1902
|
|
||||||
#define GL_ALPHA 0x1906
|
|
||||||
#define GL_RGB 0x1907
|
|
||||||
#define GL_RGBA 0x1908
|
|
||||||
#define GL_LUMINANCE 0x1909
|
|
||||||
#define GL_LUMINANCE_ALPHA 0x190A
|
|
||||||
|
|
||||||
/* PixelType */
|
|
||||||
/* GL_UNSIGNED_BYTE */
|
|
||||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
|
||||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
|
||||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
|
||||||
|
|
||||||
/* Shaders */
|
|
||||||
#define GL_FRAGMENT_SHADER 0x8B30
|
|
||||||
#define GL_VERTEX_SHADER 0x8B31
|
|
||||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
|
||||||
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
|
|
||||||
#define GL_MAX_VARYING_VECTORS 0x8DFC
|
|
||||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
|
||||||
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
|
||||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
|
||||||
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
|
|
||||||
#define GL_SHADER_TYPE 0x8B4F
|
|
||||||
#define GL_DELETE_STATUS 0x8B80
|
|
||||||
#define GL_LINK_STATUS 0x8B82
|
|
||||||
#define GL_VALIDATE_STATUS 0x8B83
|
|
||||||
#define GL_ATTACHED_SHADERS 0x8B85
|
|
||||||
#define GL_ACTIVE_UNIFORMS 0x8B86
|
|
||||||
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
|
||||||
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
|
||||||
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
|
||||||
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
|
||||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
|
||||||
|
|
||||||
/* StencilFunction */
|
|
||||||
#define GL_NEVER 0x0200
|
|
||||||
#define GL_LESS 0x0201
|
|
||||||
#define GL_EQUAL 0x0202
|
|
||||||
#define GL_LEQUAL 0x0203
|
|
||||||
#define GL_GREATER 0x0204
|
|
||||||
#define GL_NOTEQUAL 0x0205
|
|
||||||
#define GL_GEQUAL 0x0206
|
|
||||||
#define GL_ALWAYS 0x0207
|
|
||||||
|
|
||||||
/* StencilOp */
|
|
||||||
/* GL_ZERO */
|
|
||||||
#define GL_KEEP 0x1E00
|
|
||||||
#define GL_REPLACE 0x1E01
|
|
||||||
#define GL_INCR 0x1E02
|
|
||||||
#define GL_DECR 0x1E03
|
|
||||||
#define GL_INVERT 0x150A
|
|
||||||
#define GL_INCR_WRAP 0x8507
|
|
||||||
#define GL_DECR_WRAP 0x8508
|
|
||||||
|
|
||||||
/* StringName */
|
|
||||||
#define GL_VENDOR 0x1F00
|
|
||||||
#define GL_RENDERER 0x1F01
|
|
||||||
#define GL_VERSION 0x1F02
|
|
||||||
#define GL_EXTENSIONS 0x1F03
|
|
||||||
|
|
||||||
/* TextureMagFilter */
|
|
||||||
#define GL_NEAREST 0x2600
|
|
||||||
#define GL_LINEAR 0x2601
|
|
||||||
|
|
||||||
/* TextureMinFilter */
|
|
||||||
/* GL_NEAREST */
|
|
||||||
/* GL_LINEAR */
|
|
||||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
|
||||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
|
||||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
|
||||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
|
||||||
|
|
||||||
/* TextureParameterName */
|
|
||||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
|
||||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
|
||||||
#define GL_TEXTURE_WRAP_S 0x2802
|
|
||||||
#define GL_TEXTURE_WRAP_T 0x2803
|
|
||||||
|
|
||||||
/* TextureTarget */
|
|
||||||
/* GL_TEXTURE_2D */
|
|
||||||
#define GL_TEXTURE 0x1702
|
|
||||||
|
|
||||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
|
||||||
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
|
||||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
|
||||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
|
|
||||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
|
|
||||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
|
|
||||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
|
||||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
|
||||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
|
||||||
|
|
||||||
/* TextureUnit */
|
|
||||||
#define GL_TEXTURE0 0x84C0
|
|
||||||
#define GL_TEXTURE1 0x84C1
|
|
||||||
#define GL_TEXTURE2 0x84C2
|
|
||||||
#define GL_TEXTURE3 0x84C3
|
|
||||||
#define GL_TEXTURE4 0x84C4
|
|
||||||
#define GL_TEXTURE5 0x84C5
|
|
||||||
#define GL_TEXTURE6 0x84C6
|
|
||||||
#define GL_TEXTURE7 0x84C7
|
|
||||||
#define GL_TEXTURE8 0x84C8
|
|
||||||
#define GL_TEXTURE9 0x84C9
|
|
||||||
#define GL_TEXTURE10 0x84CA
|
|
||||||
#define GL_TEXTURE11 0x84CB
|
|
||||||
#define GL_TEXTURE12 0x84CC
|
|
||||||
#define GL_TEXTURE13 0x84CD
|
|
||||||
#define GL_TEXTURE14 0x84CE
|
|
||||||
#define GL_TEXTURE15 0x84CF
|
|
||||||
#define GL_TEXTURE16 0x84D0
|
|
||||||
#define GL_TEXTURE17 0x84D1
|
|
||||||
#define GL_TEXTURE18 0x84D2
|
|
||||||
#define GL_TEXTURE19 0x84D3
|
|
||||||
#define GL_TEXTURE20 0x84D4
|
|
||||||
#define GL_TEXTURE21 0x84D5
|
|
||||||
#define GL_TEXTURE22 0x84D6
|
|
||||||
#define GL_TEXTURE23 0x84D7
|
|
||||||
#define GL_TEXTURE24 0x84D8
|
|
||||||
#define GL_TEXTURE25 0x84D9
|
|
||||||
#define GL_TEXTURE26 0x84DA
|
|
||||||
#define GL_TEXTURE27 0x84DB
|
|
||||||
#define GL_TEXTURE28 0x84DC
|
|
||||||
#define GL_TEXTURE29 0x84DD
|
|
||||||
#define GL_TEXTURE30 0x84DE
|
|
||||||
#define GL_TEXTURE31 0x84DF
|
|
||||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
|
||||||
|
|
||||||
/* TextureWrapMode */
|
|
||||||
#define GL_REPEAT 0x2901
|
|
||||||
#define GL_CLAMP_TO_EDGE 0x812F
|
|
||||||
#define GL_MIRRORED_REPEAT 0x8370
|
|
||||||
|
|
||||||
/* Uniform Types */
|
|
||||||
#define GL_FLOAT_VEC2 0x8B50
|
|
||||||
#define GL_FLOAT_VEC3 0x8B51
|
|
||||||
#define GL_FLOAT_VEC4 0x8B52
|
|
||||||
#define GL_INT_VEC2 0x8B53
|
|
||||||
#define GL_INT_VEC3 0x8B54
|
|
||||||
#define GL_INT_VEC4 0x8B55
|
|
||||||
#define GL_BOOL 0x8B56
|
|
||||||
#define GL_BOOL_VEC2 0x8B57
|
|
||||||
#define GL_BOOL_VEC3 0x8B58
|
|
||||||
#define GL_BOOL_VEC4 0x8B59
|
|
||||||
#define GL_FLOAT_MAT2 0x8B5A
|
|
||||||
#define GL_FLOAT_MAT3 0x8B5B
|
|
||||||
#define GL_FLOAT_MAT4 0x8B5C
|
|
||||||
#define GL_SAMPLER_2D 0x8B5E
|
|
||||||
#define GL_SAMPLER_CUBE 0x8B60
|
|
||||||
|
|
||||||
/* Vertex Arrays */
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
|
||||||
|
|
||||||
/* Read Format */
|
|
||||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
|
|
||||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
|
|
||||||
|
|
||||||
/* Shader Source */
|
|
||||||
#define GL_COMPILE_STATUS 0x8B81
|
|
||||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
|
||||||
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
|
||||||
#define GL_SHADER_COMPILER 0x8DFA
|
|
||||||
|
|
||||||
/* Shader Binary */
|
|
||||||
#define GL_SHADER_BINARY_FORMATS 0x8DF8
|
|
||||||
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
|
|
||||||
|
|
||||||
/* Shader Precision-Specified Types */
|
|
||||||
#define GL_LOW_FLOAT 0x8DF0
|
|
||||||
#define GL_MEDIUM_FLOAT 0x8DF1
|
|
||||||
#define GL_HIGH_FLOAT 0x8DF2
|
|
||||||
#define GL_LOW_INT 0x8DF3
|
|
||||||
#define GL_MEDIUM_INT 0x8DF4
|
|
||||||
#define GL_HIGH_INT 0x8DF5
|
|
||||||
|
|
||||||
/* Framebuffer Object. */
|
|
||||||
#define GL_FRAMEBUFFER 0x8D40
|
|
||||||
#define GL_RENDERBUFFER 0x8D41
|
|
||||||
|
|
||||||
#define GL_RGBA4 0x8056
|
|
||||||
#define GL_RGB5_A1 0x8057
|
|
||||||
#define GL_RGB565 0x8D62
|
|
||||||
#define GL_DEPTH_COMPONENT16 0x81A5
|
|
||||||
#define GL_STENCIL_INDEX8 0x8D48
|
|
||||||
|
|
||||||
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
|
||||||
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
|
||||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
|
||||||
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
|
|
||||||
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
|
|
||||||
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
|
|
||||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
|
||||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
|
||||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
|
||||||
|
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
|
||||||
|
|
||||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
|
||||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
|
||||||
#define GL_STENCIL_ATTACHMENT 0x8D20
|
|
||||||
|
|
||||||
#define GL_NONE 0
|
|
||||||
|
|
||||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
|
||||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
|
||||||
|
|
||||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
|
||||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
|
||||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
|
||||||
|
|
||||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
* GL core functions.
|
|
||||||
*-----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
|
|
||||||
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
|
|
||||||
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
|
|
||||||
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
|
||||||
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
|
|
||||||
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
|
|
||||||
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
|
||||||
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
|
||||||
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
|
|
||||||
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
|
|
||||||
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
|
||||||
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
|
||||||
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
|
|
||||||
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
|
||||||
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
|
|
||||||
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
|
|
||||||
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
|
||||||
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
|
|
||||||
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
|
|
||||||
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
|
||||||
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
|
|
||||||
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
|
|
||||||
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
|
|
||||||
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
|
||||||
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
|
||||||
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
|
|
||||||
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
|
|
||||||
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
|
|
||||||
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
|
|
||||||
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
|
|
||||||
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
|
|
||||||
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
|
|
||||||
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
|
|
||||||
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
|
|
||||||
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
|
|
||||||
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
|
|
||||||
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
|
|
||||||
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
|
|
||||||
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
|
|
||||||
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
|
|
||||||
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
|
||||||
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
|
||||||
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
|
|
||||||
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
|
|
||||||
GL_APICALL void GL_APIENTRY glFinish (void);
|
|
||||||
GL_APICALL void GL_APIENTRY glFlush (void);
|
|
||||||
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
|
||||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
|
||||||
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
|
|
||||||
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
|
|
||||||
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
|
|
||||||
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
|
|
||||||
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
|
|
||||||
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
|
|
||||||
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL GLenum GL_APIENTRY glGetError (void);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
|
|
||||||
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
|
|
||||||
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
|
|
||||||
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
|
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
|
||||||
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
|
|
||||||
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
|
|
||||||
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
|
||||||
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
|
||||||
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
|
||||||
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
|
||||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
|
||||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
|
|
||||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
|
||||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
|
|
||||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
|
|
||||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
|
||||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
|
||||||
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
|
|
||||||
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
|
|
||||||
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
|
||||||
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
|
||||||
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
|
||||||
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
|
||||||
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
|
||||||
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
|
|
||||||
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
|
||||||
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
|
||||||
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
|
|
||||||
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
|
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
|
|
||||||
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __gl2_h_ */
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,30 +0,0 @@
|
|||||||
#ifndef __gl2platform_h_
|
|
||||||
#define __gl2platform_h_
|
|
||||||
|
|
||||||
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This document is licensed under the SGI Free Software B License Version
|
|
||||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
|
||||||
*
|
|
||||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
|
||||||
* You are encouraged to submit all modifications to the Khronos group so that
|
|
||||||
* they can be included in future versions of this file. Please submit changes
|
|
||||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
|
||||||
* by filing a bug against product "OpenGL-ES" component "Registry".
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*#include <KHR/khrplatform.h>*/
|
|
||||||
|
|
||||||
#ifndef GL_APICALL
|
|
||||||
#define GL_APICALL KHRONOS_APICALL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef GL_APIENTRY
|
|
||||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __gl2platform_h_ */
|
|
@ -1,282 +0,0 @@
|
|||||||
#ifndef __khrplatform_h_
|
|
||||||
#define __khrplatform_h_
|
|
||||||
|
|
||||||
/*
|
|
||||||
** Copyright (c) 2008-2009 The Khronos Group Inc.
|
|
||||||
**
|
|
||||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
** copy of this software and/or associated documentation files (the
|
|
||||||
** "Materials"), to deal in the Materials without restriction, including
|
|
||||||
** without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
|
||||||
** permit persons to whom the Materials are furnished to do so, subject to
|
|
||||||
** the following conditions:
|
|
||||||
**
|
|
||||||
** The above copyright notice and this permission notice shall be included
|
|
||||||
** in all copies or substantial portions of the Materials.
|
|
||||||
**
|
|
||||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Khronos platform-specific types and definitions.
|
|
||||||
*
|
|
||||||
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
|
|
||||||
*
|
|
||||||
* Adopters may modify this file to suit their platform. Adopters are
|
|
||||||
* encouraged to submit platform specific modifications to the Khronos
|
|
||||||
* group so that they can be included in future versions of this file.
|
|
||||||
* Please submit changes by sending them to the public Khronos Bugzilla
|
|
||||||
* (http://khronos.org/bugzilla) by filing a bug against product
|
|
||||||
* "Khronos (general)" component "Registry".
|
|
||||||
*
|
|
||||||
* A predefined template which fills in some of the bug fields can be
|
|
||||||
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
|
|
||||||
* must create a Bugzilla login first.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* See the Implementer's Guidelines for information about where this file
|
|
||||||
* should be located on your system and for more details of its use:
|
|
||||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
|
||||||
*
|
|
||||||
* This file should be included as
|
|
||||||
* #include <KHR/khrplatform.h>
|
|
||||||
* by Khronos client API header files that use its types and defines.
|
|
||||||
*
|
|
||||||
* The types in khrplatform.h should only be used to define API-specific types.
|
|
||||||
*
|
|
||||||
* Types defined in khrplatform.h:
|
|
||||||
* khronos_int8_t signed 8 bit
|
|
||||||
* khronos_uint8_t unsigned 8 bit
|
|
||||||
* khronos_int16_t signed 16 bit
|
|
||||||
* khronos_uint16_t unsigned 16 bit
|
|
||||||
* khronos_int32_t signed 32 bit
|
|
||||||
* khronos_uint32_t unsigned 32 bit
|
|
||||||
* khronos_int64_t signed 64 bit
|
|
||||||
* khronos_uint64_t unsigned 64 bit
|
|
||||||
* khronos_intptr_t signed same number of bits as a pointer
|
|
||||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
|
||||||
* khronos_ssize_t signed size
|
|
||||||
* khronos_usize_t unsigned size
|
|
||||||
* khronos_float_t signed 32 bit floating point
|
|
||||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
|
||||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
|
||||||
* nanoseconds
|
|
||||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
|
||||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
|
||||||
* only be used as a base type when a client API's boolean type is
|
|
||||||
* an enum. Client APIs which use an integer or other type for
|
|
||||||
* booleans cannot use this as the base type for their boolean.
|
|
||||||
*
|
|
||||||
* Tokens defined in khrplatform.h:
|
|
||||||
*
|
|
||||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
|
||||||
*
|
|
||||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
|
||||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
|
||||||
*
|
|
||||||
* Calling convention macros defined in this file:
|
|
||||||
* KHRONOS_APICALL
|
|
||||||
* KHRONOS_APIENTRY
|
|
||||||
* KHRONOS_APIATTRIBUTES
|
|
||||||
*
|
|
||||||
* These may be used in function prototypes as:
|
|
||||||
*
|
|
||||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
|
||||||
* int arg1,
|
|
||||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
* Definition of KHRONOS_APICALL
|
|
||||||
*-------------------------------------------------------------------------
|
|
||||||
* This precedes the return type of the function in the function prototype.
|
|
||||||
*/
|
|
||||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
|
||||||
# define KHRONOS_APICALL __declspec(dllimport)
|
|
||||||
#elif defined (__SYMBIAN32__)
|
|
||||||
# define KHRONOS_APICALL IMPORT_C
|
|
||||||
#else
|
|
||||||
# define KHRONOS_APICALL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
* Definition of KHRONOS_APIENTRY
|
|
||||||
*-------------------------------------------------------------------------
|
|
||||||
* This follows the return type of the function and precedes the function
|
|
||||||
* name in the function prototype.
|
|
||||||
*/
|
|
||||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
|
||||||
/* Win32 but not WinCE */
|
|
||||||
# define KHRONOS_APIENTRY __stdcall
|
|
||||||
#else
|
|
||||||
# define KHRONOS_APIENTRY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
* Definition of KHRONOS_APIATTRIBUTES
|
|
||||||
*-------------------------------------------------------------------------
|
|
||||||
* This follows the closing parenthesis of the function prototype arguments.
|
|
||||||
*/
|
|
||||||
#if defined (__ARMCC_2__)
|
|
||||||
#define KHRONOS_APIATTRIBUTES __softfp
|
|
||||||
#else
|
|
||||||
#define KHRONOS_APIATTRIBUTES
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
|
||||||
* basic type definitions
|
|
||||||
*-----------------------------------------------------------------------*/
|
|
||||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Using <stdint.h>
|
|
||||||
*/
|
|
||||||
#include <stdint.h>
|
|
||||||
typedef int32_t khronos_int32_t;
|
|
||||||
typedef uint32_t khronos_uint32_t;
|
|
||||||
typedef int64_t khronos_int64_t;
|
|
||||||
typedef uint64_t khronos_uint64_t;
|
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
|
||||||
|
|
||||||
#elif defined(__VMS ) || defined(__sgi)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Using <inttypes.h>
|
|
||||||
*/
|
|
||||||
#include <inttypes.h>
|
|
||||||
typedef int32_t khronos_int32_t;
|
|
||||||
typedef uint32_t khronos_uint32_t;
|
|
||||||
typedef int64_t khronos_int64_t;
|
|
||||||
typedef uint64_t khronos_uint64_t;
|
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
|
||||||
|
|
||||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Win32
|
|
||||||
*/
|
|
||||||
typedef __int32 khronos_int32_t;
|
|
||||||
typedef unsigned __int32 khronos_uint32_t;
|
|
||||||
typedef __int64 khronos_int64_t;
|
|
||||||
typedef unsigned __int64 khronos_uint64_t;
|
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
|
||||||
|
|
||||||
#elif defined(__sun__) || defined(__digital__)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sun or Digital
|
|
||||||
*/
|
|
||||||
typedef int khronos_int32_t;
|
|
||||||
typedef unsigned int khronos_uint32_t;
|
|
||||||
#if defined(__arch64__) || defined(_LP64)
|
|
||||||
typedef long int khronos_int64_t;
|
|
||||||
typedef unsigned long int khronos_uint64_t;
|
|
||||||
#else
|
|
||||||
typedef long long int khronos_int64_t;
|
|
||||||
typedef unsigned long long int khronos_uint64_t;
|
|
||||||
#endif /* __arch64__ */
|
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
|
||||||
|
|
||||||
#elif 0
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Hypothetical platform with no float or int64 support
|
|
||||||
*/
|
|
||||||
typedef int khronos_int32_t;
|
|
||||||
typedef unsigned int khronos_uint32_t;
|
|
||||||
#define KHRONOS_SUPPORT_INT64 0
|
|
||||||
#define KHRONOS_SUPPORT_FLOAT 0
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Generic fallback
|
|
||||||
*/
|
|
||||||
#include <stdint.h>
|
|
||||||
typedef int32_t khronos_int32_t;
|
|
||||||
typedef uint32_t khronos_uint32_t;
|
|
||||||
typedef int64_t khronos_int64_t;
|
|
||||||
typedef uint64_t khronos_uint64_t;
|
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Types that are (so far) the same on all platforms
|
|
||||||
*/
|
|
||||||
typedef signed char khronos_int8_t;
|
|
||||||
typedef unsigned char khronos_uint8_t;
|
|
||||||
typedef signed short int khronos_int16_t;
|
|
||||||
typedef unsigned short int khronos_uint16_t;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
|
||||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
|
||||||
* to be the only LLP64 architecture in current use.
|
|
||||||
*/
|
|
||||||
#ifdef _WIN64
|
|
||||||
typedef signed long long int khronos_intptr_t;
|
|
||||||
typedef unsigned long long int khronos_uintptr_t;
|
|
||||||
typedef signed long long int khronos_ssize_t;
|
|
||||||
typedef unsigned long long int khronos_usize_t;
|
|
||||||
#else
|
|
||||||
typedef signed long int khronos_intptr_t;
|
|
||||||
typedef unsigned long int khronos_uintptr_t;
|
|
||||||
typedef signed long int khronos_ssize_t;
|
|
||||||
typedef unsigned long int khronos_usize_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if KHRONOS_SUPPORT_FLOAT
|
|
||||||
/*
|
|
||||||
* Float type
|
|
||||||
*/
|
|
||||||
typedef float khronos_float_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if KHRONOS_SUPPORT_INT64
|
|
||||||
/* Time types
|
|
||||||
*
|
|
||||||
* These types can be used to represent a time interval in nanoseconds or
|
|
||||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
|
||||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
|
||||||
* time the system booted). The Unadjusted System Time is an unsigned
|
|
||||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
|
||||||
* may be either signed or unsigned.
|
|
||||||
*/
|
|
||||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
|
||||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Dummy value used to pad enum types to 32 bits.
|
|
||||||
*/
|
|
||||||
#ifndef KHRONOS_MAX_ENUM
|
|
||||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enumerated boolean type
|
|
||||||
*
|
|
||||||
* Values other than zero should be considered to be true. Therefore
|
|
||||||
* comparisons should not be made against KHRONOS_TRUE.
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
KHRONOS_FALSE = 0,
|
|
||||||
KHRONOS_TRUE = 1,
|
|
||||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
|
||||||
} khronos_boolean_enum_t;
|
|
||||||
|
|
||||||
#endif /* __khrplatform_h_ */
|
|
@ -1,479 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_pixels.h
|
|
||||||
*
|
|
||||||
* Header for the enumerated pixel format definitions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_pixels_h_
|
|
||||||
#define SDL_pixels_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_endian.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Transparency definitions
|
|
||||||
*
|
|
||||||
* These define alpha as the opacity of a surface.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_ALPHA_OPAQUE 255
|
|
||||||
#define SDL_ALPHA_TRANSPARENT 0
|
|
||||||
/* @} */
|
|
||||||
|
|
||||||
/** Pixel type. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PIXELTYPE_UNKNOWN,
|
|
||||||
SDL_PIXELTYPE_INDEX1,
|
|
||||||
SDL_PIXELTYPE_INDEX4,
|
|
||||||
SDL_PIXELTYPE_INDEX8,
|
|
||||||
SDL_PIXELTYPE_PACKED8,
|
|
||||||
SDL_PIXELTYPE_PACKED16,
|
|
||||||
SDL_PIXELTYPE_PACKED32,
|
|
||||||
SDL_PIXELTYPE_ARRAYU8,
|
|
||||||
SDL_PIXELTYPE_ARRAYU16,
|
|
||||||
SDL_PIXELTYPE_ARRAYU32,
|
|
||||||
SDL_PIXELTYPE_ARRAYF16,
|
|
||||||
SDL_PIXELTYPE_ARRAYF32
|
|
||||||
} SDL_PixelType;
|
|
||||||
|
|
||||||
/** Bitmap pixel order, high bit -> low bit. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_BITMAPORDER_NONE,
|
|
||||||
SDL_BITMAPORDER_4321,
|
|
||||||
SDL_BITMAPORDER_1234
|
|
||||||
} SDL_BitmapOrder;
|
|
||||||
|
|
||||||
/** Packed component order, high bit -> low bit. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PACKEDORDER_NONE,
|
|
||||||
SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDORDER_RGBX,
|
|
||||||
SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDORDER_BGRX,
|
|
||||||
SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDORDER_BGRA
|
|
||||||
} SDL_PackedOrder;
|
|
||||||
|
|
||||||
/** Array component order, low byte -> high byte. */
|
|
||||||
/* !!! FIXME: in 2.1, make these not overlap differently with
|
|
||||||
!!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_ARRAYORDER_NONE,
|
|
||||||
SDL_ARRAYORDER_RGB,
|
|
||||||
SDL_ARRAYORDER_RGBA,
|
|
||||||
SDL_ARRAYORDER_ARGB,
|
|
||||||
SDL_ARRAYORDER_BGR,
|
|
||||||
SDL_ARRAYORDER_BGRA,
|
|
||||||
SDL_ARRAYORDER_ABGR
|
|
||||||
} SDL_ArrayOrder;
|
|
||||||
|
|
||||||
/** Packed component layout. */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PACKEDLAYOUT_NONE,
|
|
||||||
SDL_PACKEDLAYOUT_332,
|
|
||||||
SDL_PACKEDLAYOUT_4444,
|
|
||||||
SDL_PACKEDLAYOUT_1555,
|
|
||||||
SDL_PACKEDLAYOUT_5551,
|
|
||||||
SDL_PACKEDLAYOUT_565,
|
|
||||||
SDL_PACKEDLAYOUT_8888,
|
|
||||||
SDL_PACKEDLAYOUT_2101010,
|
|
||||||
SDL_PACKEDLAYOUT_1010102
|
|
||||||
} SDL_PackedLayout;
|
|
||||||
|
|
||||||
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
|
|
||||||
|
|
||||||
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
|
|
||||||
((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
|
|
||||||
((bits) << 8) | ((bytes) << 0))
|
|
||||||
|
|
||||||
#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
|
|
||||||
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
|
|
||||||
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
|
|
||||||
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
|
|
||||||
#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
|
|
||||||
#define SDL_BYTESPERPIXEL(X) \
|
|
||||||
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
|
|
||||||
((((X) == SDL_PIXELFORMAT_YUY2) || \
|
|
||||||
((X) == SDL_PIXELFORMAT_UYVY) || \
|
|
||||||
((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
|
||||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
|
||||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_PACKED(format) \
|
|
||||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
|
||||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_ARRAY(format) \
|
|
||||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
|
||||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
|
|
||||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
|
|
||||||
|
|
||||||
#define SDL_ISPIXELFORMAT_ALPHA(format) \
|
|
||||||
((SDL_ISPIXELFORMAT_PACKED(format) && \
|
|
||||||
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
|
|
||||||
(SDL_ISPIXELFORMAT_ARRAY(format) && \
|
|
||||||
((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
|
|
||||||
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
|
|
||||||
|
|
||||||
/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
|
|
||||||
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
|
||||||
((format) && (SDL_PIXELFLAG(format) != 1))
|
|
||||||
|
|
||||||
/* Note: If you modify this list, update SDL_GetPixelFormatName() */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_PIXELFORMAT_UNKNOWN,
|
|
||||||
SDL_PIXELFORMAT_INDEX1LSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
|
|
||||||
1, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX1MSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
|
|
||||||
1, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX4LSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
|
|
||||||
4, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX4MSB =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
|
|
||||||
4, 0),
|
|
||||||
SDL_PIXELFORMAT_INDEX8 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
|
|
||||||
SDL_PIXELFORMAT_RGB332 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_332, 8, 1),
|
|
||||||
SDL_PIXELFORMAT_XRGB4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 12, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444,
|
|
||||||
SDL_PIXELFORMAT_XBGR4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 12, 2),
|
|
||||||
SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444,
|
|
||||||
SDL_PIXELFORMAT_XRGB1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555,
|
|
||||||
SDL_PIXELFORMAT_XBGR1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
|
||||||
SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555,
|
|
||||||
SDL_PIXELFORMAT_ARGB4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGBA4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_ABGR4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_BGRA4444 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
|
|
||||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_ARGB1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGBA5551 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDLAYOUT_5551, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_ABGR1555 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_BGRA5551 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
|
|
||||||
SDL_PACKEDLAYOUT_5551, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB565 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_BGR565 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
|
||||||
SDL_PIXELFORMAT_RGB24 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
|
|
||||||
24, 3),
|
|
||||||
SDL_PIXELFORMAT_BGR24 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
|
|
||||||
24, 3),
|
|
||||||
SDL_PIXELFORMAT_XRGB8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888,
|
|
||||||
SDL_PIXELFORMAT_RGBX8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_XBGR8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888,
|
|
||||||
SDL_PIXELFORMAT_BGRX8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
|
||||||
SDL_PIXELFORMAT_ARGB8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_RGBA8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_ABGR8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_BGRA8888 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
|
|
||||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
|
||||||
SDL_PIXELFORMAT_ARGB2101010 =
|
|
||||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
|
||||||
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
|
||||||
|
|
||||||
/* Aliases for RGBA byte arrays of color data, for the current platform */
|
|
||||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
|
||||||
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
|
|
||||||
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
|
|
||||||
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
|
|
||||||
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
|
|
||||||
#else
|
|
||||||
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
|
|
||||||
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
|
|
||||||
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
|
|
||||||
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
|
||||||
SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
|
|
||||||
SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
|
|
||||||
SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
|
|
||||||
SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
|
|
||||||
SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
|
|
||||||
SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
|
|
||||||
SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
|
|
||||||
SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
|
|
||||||
} SDL_PixelFormatEnum;
|
|
||||||
|
|
||||||
typedef struct SDL_Color
|
|
||||||
{
|
|
||||||
Uint8 r;
|
|
||||||
Uint8 g;
|
|
||||||
Uint8 b;
|
|
||||||
Uint8 a;
|
|
||||||
} SDL_Color;
|
|
||||||
#define SDL_Colour SDL_Color
|
|
||||||
|
|
||||||
typedef struct SDL_Palette
|
|
||||||
{
|
|
||||||
int ncolors;
|
|
||||||
SDL_Color *colors;
|
|
||||||
Uint32 version;
|
|
||||||
int refcount;
|
|
||||||
} SDL_Palette;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \note Everything in the pixel format structure is read-only.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_PixelFormat
|
|
||||||
{
|
|
||||||
Uint32 format;
|
|
||||||
SDL_Palette *palette;
|
|
||||||
Uint8 BitsPerPixel;
|
|
||||||
Uint8 BytesPerPixel;
|
|
||||||
Uint8 padding[2];
|
|
||||||
Uint32 Rmask;
|
|
||||||
Uint32 Gmask;
|
|
||||||
Uint32 Bmask;
|
|
||||||
Uint32 Amask;
|
|
||||||
Uint8 Rloss;
|
|
||||||
Uint8 Gloss;
|
|
||||||
Uint8 Bloss;
|
|
||||||
Uint8 Aloss;
|
|
||||||
Uint8 Rshift;
|
|
||||||
Uint8 Gshift;
|
|
||||||
Uint8 Bshift;
|
|
||||||
Uint8 Ashift;
|
|
||||||
int refcount;
|
|
||||||
struct SDL_PixelFormat *next;
|
|
||||||
} SDL_PixelFormat;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the human readable name of a pixel format
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
|
|
||||||
*
|
|
||||||
* \sa SDL_MasksToPixelFormatEnum()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
|
||||||
int *bpp,
|
|
||||||
Uint32 * Rmask,
|
|
||||||
Uint32 * Gmask,
|
|
||||||
Uint32 * Bmask,
|
|
||||||
Uint32 * Amask);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Convert a bpp and RGBA masks to an enumerated pixel format.
|
|
||||||
*
|
|
||||||
* \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
|
|
||||||
* wasn't possible.
|
|
||||||
*
|
|
||||||
* \sa SDL_PixelFormatEnumToMasks()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
|
||||||
Uint32 Rmask,
|
|
||||||
Uint32 Gmask,
|
|
||||||
Uint32 Bmask,
|
|
||||||
Uint32 Amask);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create an SDL_PixelFormat structure from a pixel format enum.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Free an SDL_PixelFormat structure.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a palette structure with the specified number of color
|
|
||||||
* entries.
|
|
||||||
*
|
|
||||||
* \return A new palette, or NULL if there wasn't enough memory.
|
|
||||||
*
|
|
||||||
* \note The palette entries are initialized to white.
|
|
||||||
*
|
|
||||||
* \sa SDL_FreePalette()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the palette for a pixel format structure.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
|
||||||
SDL_Palette *palette);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set a range of colors in a palette.
|
|
||||||
*
|
|
||||||
* \param palette The palette to modify.
|
|
||||||
* \param colors An array of colors to copy into the palette.
|
|
||||||
* \param firstcolor The index of the first palette entry to modify.
|
|
||||||
* \param ncolors The number of entries to modify.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if not all of the colors could be set.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
|
||||||
const SDL_Color * colors,
|
|
||||||
int firstcolor, int ncolors);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Free a palette created with SDL_AllocPalette().
|
|
||||||
*
|
|
||||||
* \sa SDL_AllocPalette()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
|
|
||||||
*
|
|
||||||
* \sa SDL_MapRGBA
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
|
||||||
Uint8 r, Uint8 g, Uint8 b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
|
|
||||||
*
|
|
||||||
* \sa SDL_MapRGB
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
|
||||||
Uint8 r, Uint8 g, Uint8 b,
|
|
||||||
Uint8 a);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the RGB components from a pixel of the specified format.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRGBA
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
|
||||||
const SDL_PixelFormat * format,
|
|
||||||
Uint8 * r, Uint8 * g, Uint8 * b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the RGBA components from a pixel of the specified format.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetRGB
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
|
||||||
const SDL_PixelFormat * format,
|
|
||||||
Uint8 * r, Uint8 * g, Uint8 * b,
|
|
||||||
Uint8 * a);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Calculate a 256 entry gamma ramp for a gamma value.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_pixels_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,198 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_platform.h
|
|
||||||
*
|
|
||||||
* Try to get a standard set of platform defines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_platform_h_
|
|
||||||
#define SDL_platform_h_
|
|
||||||
|
|
||||||
#if defined(_AIX)
|
|
||||||
#undef __AIX__
|
|
||||||
#define __AIX__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__HAIKU__)
|
|
||||||
#undef __HAIKU__
|
|
||||||
#define __HAIKU__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
|
|
||||||
#undef __BSDI__
|
|
||||||
#define __BSDI__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(_arch_dreamcast)
|
|
||||||
#undef __DREAMCAST__
|
|
||||||
#define __DREAMCAST__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
|
||||||
#undef __FREEBSD__
|
|
||||||
#define __FREEBSD__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
|
|
||||||
#undef __HPUX__
|
|
||||||
#define __HPUX__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
|
|
||||||
#undef __IRIX__
|
|
||||||
#define __IRIX__ 1
|
|
||||||
#endif
|
|
||||||
#if (defined(linux) || defined(__linux) || defined(__linux__))
|
|
||||||
#undef __LINUX__
|
|
||||||
#define __LINUX__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(ANDROID) || defined(__ANDROID__)
|
|
||||||
#undef __ANDROID__
|
|
||||||
#undef __LINUX__ /* do we need to do this? */
|
|
||||||
#define __ANDROID__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
|
||||||
/* lets us know what version of Mac OS X we're compiling on */
|
|
||||||
#include "AvailabilityMacros.h"
|
|
||||||
#include "TargetConditionals.h"
|
|
||||||
#if TARGET_OS_TV
|
|
||||||
#undef __TVOS__
|
|
||||||
#define __TVOS__ 1
|
|
||||||
#endif
|
|
||||||
#if TARGET_OS_IPHONE
|
|
||||||
/* if compiling for iOS */
|
|
||||||
#undef __IPHONEOS__
|
|
||||||
#define __IPHONEOS__ 1
|
|
||||||
#undef __MACOSX__
|
|
||||||
#else
|
|
||||||
/* if not compiling for iOS */
|
|
||||||
#undef __MACOSX__
|
|
||||||
#define __MACOSX__ 1
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
|
||||||
# error SDL for Mac OS X only supports deploying on 10.6 and above.
|
|
||||||
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
|
|
||||||
#endif /* TARGET_OS_IPHONE */
|
|
||||||
#endif /* defined(__APPLE__) */
|
|
||||||
|
|
||||||
#if defined(__NetBSD__)
|
|
||||||
#undef __NETBSD__
|
|
||||||
#define __NETBSD__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__OpenBSD__)
|
|
||||||
#undef __OPENBSD__
|
|
||||||
#define __OPENBSD__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__OS2__) || defined(__EMX__)
|
|
||||||
#undef __OS2__
|
|
||||||
#define __OS2__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
|
|
||||||
#undef __OSF__
|
|
||||||
#define __OSF__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__QNXNTO__)
|
|
||||||
#undef __QNXNTO__
|
|
||||||
#define __QNXNTO__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
|
|
||||||
#undef __RISCOS__
|
|
||||||
#define __RISCOS__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__sun) && defined(__SVR4)
|
|
||||||
#undef __SOLARIS__
|
|
||||||
#define __SOLARIS__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
|
||||||
/* Try to find out if we're compiling for WinRT or non-WinRT */
|
|
||||||
#if defined(_MSC_VER) && defined(__has_include)
|
|
||||||
#if __has_include(<winapifamily.h>)
|
|
||||||
#define HAVE_WINAPIFAMILY_H 1
|
|
||||||
#else
|
|
||||||
#define HAVE_WINAPIFAMILY_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
|
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */
|
|
||||||
#define HAVE_WINAPIFAMILY_H 1
|
|
||||||
#else
|
|
||||||
#define HAVE_WINAPIFAMILY_H 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_WINAPIFAMILY_H
|
|
||||||
#include <winapifamily.h>
|
|
||||||
#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP))
|
|
||||||
#else
|
|
||||||
#define WINAPI_FAMILY_WINRT 0
|
|
||||||
#endif /* HAVE_WINAPIFAMILY_H */
|
|
||||||
|
|
||||||
#if WINAPI_FAMILY_WINRT
|
|
||||||
#undef __WINRT__
|
|
||||||
#define __WINRT__ 1
|
|
||||||
#else
|
|
||||||
#undef __WINDOWS__
|
|
||||||
#define __WINDOWS__ 1
|
|
||||||
#endif
|
|
||||||
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
|
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
|
||||||
#undef __WIN32__
|
|
||||||
#define __WIN32__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__PSP__)
|
|
||||||
#undef __PSP__
|
|
||||||
#define __PSP__ 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The NACL compiler defines __native_client__ and __pnacl__
|
|
||||||
* Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
|
|
||||||
*/
|
|
||||||
#if defined(__native_client__)
|
|
||||||
#undef __LINUX__
|
|
||||||
#undef __NACL__
|
|
||||||
#define __NACL__ 1
|
|
||||||
#endif
|
|
||||||
#if defined(__pnacl__)
|
|
||||||
#undef __LINUX__
|
|
||||||
#undef __PNACL__
|
|
||||||
#define __PNACL__ 1
|
|
||||||
/* PNACL with newlib supports static linking only */
|
|
||||||
#define __SDL_NOGETPROCADDR__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Gets the name of the platform.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_platform_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_power_h_
|
|
||||||
#define SDL_power_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_power.h
|
|
||||||
*
|
|
||||||
* Header for the SDL power management routines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The basic state for the system's power supply.
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
|
|
||||||
SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
|
|
||||||
SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
|
|
||||||
SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
|
|
||||||
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
|
|
||||||
} SDL_PowerState;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current power supply details.
|
|
||||||
*
|
|
||||||
* \param secs Seconds of battery life left. You can pass a NULL here if
|
|
||||||
* you don't care. Will return -1 if we can't determine a
|
|
||||||
* value, or we're not running on a battery.
|
|
||||||
*
|
|
||||||
* \param pct Percentage of battery life left, between 0 and 100. You can
|
|
||||||
* pass a NULL here if you don't care. Will return -1 if we
|
|
||||||
* can't determine a value, or we're not running on a battery.
|
|
||||||
*
|
|
||||||
* \return The state of the battery (if any).
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_power_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_quit.h
|
|
||||||
*
|
|
||||||
* Include file for SDL quit event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_quit_h_
|
|
||||||
#define SDL_quit_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_quit.h
|
|
||||||
*
|
|
||||||
* An ::SDL_QUIT event is generated when the user tries to close the application
|
|
||||||
* window. If it is ignored or filtered out, the window will remain open.
|
|
||||||
* If it is not ignored or filtered, it is queued normally and the window
|
|
||||||
* is allowed to close. When the window is closed, screen updates will
|
|
||||||
* 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_QUIT events as well. There is no way
|
|
||||||
* to determine the cause of an ::SDL_QUIT event, but setting a signal
|
|
||||||
* handler in your application will override the default generation of
|
|
||||||
* quit events for that signal.
|
|
||||||
*
|
|
||||||
* \sa SDL_Quit()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* There are no functions directly affecting the quit event */
|
|
||||||
|
|
||||||
#define SDL_QuitRequested() \
|
|
||||||
(SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
|
|
||||||
|
|
||||||
#endif /* SDL_quit_h_ */
|
|
@ -1,174 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_rect.h
|
|
||||||
*
|
|
||||||
* Header file for SDL_rect definition and management functions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_rect_h_
|
|
||||||
#define SDL_rect_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_pixels.h"
|
|
||||||
#include "SDL_rwops.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The structure that defines a point (integer)
|
|
||||||
*
|
|
||||||
* \sa SDL_EnclosePoints
|
|
||||||
* \sa SDL_PointInRect
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Point
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
} SDL_Point;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The structure that defines a point (floating point)
|
|
||||||
*
|
|
||||||
* \sa SDL_EnclosePoints
|
|
||||||
* \sa SDL_PointInRect
|
|
||||||
*/
|
|
||||||
typedef struct SDL_FPoint
|
|
||||||
{
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
} SDL_FPoint;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A rectangle, with the origin at the upper left (integer).
|
|
||||||
*
|
|
||||||
* \sa SDL_RectEmpty
|
|
||||||
* \sa SDL_RectEquals
|
|
||||||
* \sa SDL_HasIntersection
|
|
||||||
* \sa SDL_IntersectRect
|
|
||||||
* \sa SDL_UnionRect
|
|
||||||
* \sa SDL_EnclosePoints
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Rect
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
int w, h;
|
|
||||||
} SDL_Rect;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A rectangle, with the origin at the upper left (floating point).
|
|
||||||
*/
|
|
||||||
typedef struct SDL_FRect
|
|
||||||
{
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float w;
|
|
||||||
float h;
|
|
||||||
} SDL_FRect;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns true if point resides inside a rectangle.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
|
||||||
{
|
|
||||||
return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
|
||||||
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns true if the rectangle has no area.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
|
|
||||||
{
|
|
||||||
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns true if the two rectangles are equal.
|
|
||||||
*/
|
|
||||||
SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
|
|
||||||
{
|
|
||||||
return (a && b && (a->x == b->x) && (a->y == b->y) &&
|
|
||||||
(a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Determine whether two rectangles intersect.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
|
|
||||||
const SDL_Rect * B);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Calculate the intersection of two rectangles.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
|
|
||||||
const SDL_Rect * B,
|
|
||||||
SDL_Rect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Calculate the union of two rectangles.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
|
|
||||||
const SDL_Rect * B,
|
|
||||||
SDL_Rect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Calculate a minimal rectangle enclosing a set of points
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if any points were within the clipping rect
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
|
|
||||||
int count,
|
|
||||||
const SDL_Rect * clip,
|
|
||||||
SDL_Rect * result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Calculate the intersection of a rectangle and line segment.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
|
|
||||||
rect, int *X1,
|
|
||||||
int *Y1, int *X2,
|
|
||||||
int *Y2);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_rect_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
|||||||
#define SDL_REVISION "hg-0:aaaaaaaaaaah"
|
|
||||||
#define SDL_REVISION_NUMBER 0
|
|
@ -1,283 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_rwops.h
|
|
||||||
*
|
|
||||||
* This file provides a general interface for SDL to read and write
|
|
||||||
* data streams. It can easily be extended to files, memory, etc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_rwops_h_
|
|
||||||
#define SDL_rwops_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* RWops Types */
|
|
||||||
#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */
|
|
||||||
#define SDL_RWOPS_WINFILE 1U /**< Win32 file */
|
|
||||||
#define SDL_RWOPS_STDFILE 2U /**< Stdio file */
|
|
||||||
#define SDL_RWOPS_JNIFILE 3U /**< Android asset */
|
|
||||||
#define SDL_RWOPS_MEMORY 4U /**< Memory stream */
|
|
||||||
#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the read/write operation structure -- very basic.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_RWops
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Return the size of the file in this rwops, or -1 if unknown
|
|
||||||
*/
|
|
||||||
Sint64 (SDLCALL * size) (struct SDL_RWops * context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
|
||||||
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
|
||||||
*
|
|
||||||
* \return the final offset in the data stream, or -1 on error.
|
|
||||||
*/
|
|
||||||
Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
|
|
||||||
int whence);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read up to \c maxnum objects each of size \c size from the data
|
|
||||||
* stream to the area pointed at by \c ptr.
|
|
||||||
*
|
|
||||||
* \return the number of objects read, or 0 at error or end of file.
|
|
||||||
*/
|
|
||||||
size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
|
|
||||||
size_t size, size_t maxnum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write exactly \c num objects each of size \c size from the area
|
|
||||||
* pointed at by \c ptr to data stream.
|
|
||||||
*
|
|
||||||
* \return the number of objects written, or 0 at error or end of file.
|
|
||||||
*/
|
|
||||||
size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
|
|
||||||
size_t size, size_t num);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close and free an allocated SDL_RWops structure.
|
|
||||||
*
|
|
||||||
* \return 0 if successful or -1 on write error when flushing data.
|
|
||||||
*/
|
|
||||||
int (SDLCALL * close) (struct SDL_RWops * context);
|
|
||||||
|
|
||||||
Uint32 type;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
#if defined(__ANDROID__)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *asset;
|
|
||||||
} androidio;
|
|
||||||
#elif defined(__WIN32__)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
SDL_bool append;
|
|
||||||
void *h;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *data;
|
|
||||||
size_t size;
|
|
||||||
size_t left;
|
|
||||||
} buffer;
|
|
||||||
} windowsio;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
SDL_bool autoclose;
|
|
||||||
FILE *fp;
|
|
||||||
} stdio;
|
|
||||||
#endif
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Uint8 *base;
|
|
||||||
Uint8 *here;
|
|
||||||
Uint8 *stop;
|
|
||||||
} mem;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *data1;
|
|
||||||
void *data2;
|
|
||||||
} unknown;
|
|
||||||
} hidden;
|
|
||||||
|
|
||||||
} SDL_RWops;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name RWFrom functions
|
|
||||||
*
|
|
||||||
* Functions to create SDL_RWops structures from various data streams.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
|
||||||
const char *mode);
|
|
||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
|
|
||||||
SDL_bool autoclose);
|
|
||||||
#else
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
|
|
||||||
SDL_bool autoclose);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
|
||||||
int size);
|
|
||||||
|
|
||||||
/* @} *//* RWFrom functions */
|
|
||||||
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
|
||||||
|
|
||||||
#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
|
||||||
#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
|
||||||
#define RW_SEEK_END 2 /**< Seek relative to the end of data */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the size of the file in this rwops, or -1 if unknown
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
|
||||||
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
|
|
||||||
*
|
|
||||||
* \return the final offset in the data stream, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
|
|
||||||
Sint64 offset, int whence);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the current offset in the data stream, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read up to \c maxnum objects each of size \c size from the data
|
|
||||||
* stream to the area pointed at by \c ptr.
|
|
||||||
*
|
|
||||||
* \return the number of objects read, or 0 at error or end of file.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
|
|
||||||
void *ptr, size_t size, size_t maxnum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write exactly \c num objects each of size \c size from the area
|
|
||||||
* pointed at by \c ptr to data stream.
|
|
||||||
*
|
|
||||||
* \return the number of objects written, or 0 at error or end of file.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
|
|
||||||
const void *ptr, size_t size, size_t num);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close and free an allocated SDL_RWops structure.
|
|
||||||
*
|
|
||||||
* \return 0 if successful or -1 on write error when flushing data.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load all the data from an SDL data stream.
|
|
||||||
*
|
|
||||||
* The data is allocated with a zero byte at the end (null terminated)
|
|
||||||
*
|
|
||||||
* If \c datasize is not NULL, it is filled with the size of the data read.
|
|
||||||
*
|
|
||||||
* If \c freesrc is non-zero, the stream will be closed after being read.
|
|
||||||
*
|
|
||||||
* The data should be freed with SDL_free().
|
|
||||||
*
|
|
||||||
* \return the data, or NULL if there was an error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
|
|
||||||
int freesrc);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load an entire file.
|
|
||||||
*
|
|
||||||
* The data is allocated with a zero byte at the end (null terminated)
|
|
||||||
*
|
|
||||||
* If \c datasize is not NULL, it is filled with the size of the data read.
|
|
||||||
*
|
|
||||||
* If \c freesrc is non-zero, the stream will be closed after being read.
|
|
||||||
*
|
|
||||||
* The data should be freed with SDL_free().
|
|
||||||
*
|
|
||||||
* \return the data, or NULL if there was an error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Read endian functions
|
|
||||||
*
|
|
||||||
* Read an item of the specified endianness and return in native format.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
|
||||||
/* @} *//* Read endian functions */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Write endian functions
|
|
||||||
*
|
|
||||||
* Write an item of native format to the specified endianness.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
|
|
||||||
/* @} *//* Write endian functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_rwops_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,413 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_scancode.h
|
|
||||||
*
|
|
||||||
* Defines keyboard scancodes.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_scancode_h_
|
|
||||||
#define SDL_scancode_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The SDL keyboard scancode representation.
|
|
||||||
*
|
|
||||||
* Values of this type are used to represent keyboard keys, among other places
|
|
||||||
* in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
|
|
||||||
* SDL_Event structure.
|
|
||||||
*
|
|
||||||
* The values in this enumeration are based on the USB usage page standard:
|
|
||||||
* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_SCANCODE_UNKNOWN = 0,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Usage page 0x07
|
|
||||||
*
|
|
||||||
* These values are from usage page 0x07 (USB keyboard page).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
SDL_SCANCODE_A = 4,
|
|
||||||
SDL_SCANCODE_B = 5,
|
|
||||||
SDL_SCANCODE_C = 6,
|
|
||||||
SDL_SCANCODE_D = 7,
|
|
||||||
SDL_SCANCODE_E = 8,
|
|
||||||
SDL_SCANCODE_F = 9,
|
|
||||||
SDL_SCANCODE_G = 10,
|
|
||||||
SDL_SCANCODE_H = 11,
|
|
||||||
SDL_SCANCODE_I = 12,
|
|
||||||
SDL_SCANCODE_J = 13,
|
|
||||||
SDL_SCANCODE_K = 14,
|
|
||||||
SDL_SCANCODE_L = 15,
|
|
||||||
SDL_SCANCODE_M = 16,
|
|
||||||
SDL_SCANCODE_N = 17,
|
|
||||||
SDL_SCANCODE_O = 18,
|
|
||||||
SDL_SCANCODE_P = 19,
|
|
||||||
SDL_SCANCODE_Q = 20,
|
|
||||||
SDL_SCANCODE_R = 21,
|
|
||||||
SDL_SCANCODE_S = 22,
|
|
||||||
SDL_SCANCODE_T = 23,
|
|
||||||
SDL_SCANCODE_U = 24,
|
|
||||||
SDL_SCANCODE_V = 25,
|
|
||||||
SDL_SCANCODE_W = 26,
|
|
||||||
SDL_SCANCODE_X = 27,
|
|
||||||
SDL_SCANCODE_Y = 28,
|
|
||||||
SDL_SCANCODE_Z = 29,
|
|
||||||
|
|
||||||
SDL_SCANCODE_1 = 30,
|
|
||||||
SDL_SCANCODE_2 = 31,
|
|
||||||
SDL_SCANCODE_3 = 32,
|
|
||||||
SDL_SCANCODE_4 = 33,
|
|
||||||
SDL_SCANCODE_5 = 34,
|
|
||||||
SDL_SCANCODE_6 = 35,
|
|
||||||
SDL_SCANCODE_7 = 36,
|
|
||||||
SDL_SCANCODE_8 = 37,
|
|
||||||
SDL_SCANCODE_9 = 38,
|
|
||||||
SDL_SCANCODE_0 = 39,
|
|
||||||
|
|
||||||
SDL_SCANCODE_RETURN = 40,
|
|
||||||
SDL_SCANCODE_ESCAPE = 41,
|
|
||||||
SDL_SCANCODE_BACKSPACE = 42,
|
|
||||||
SDL_SCANCODE_TAB = 43,
|
|
||||||
SDL_SCANCODE_SPACE = 44,
|
|
||||||
|
|
||||||
SDL_SCANCODE_MINUS = 45,
|
|
||||||
SDL_SCANCODE_EQUALS = 46,
|
|
||||||
SDL_SCANCODE_LEFTBRACKET = 47,
|
|
||||||
SDL_SCANCODE_RIGHTBRACKET = 48,
|
|
||||||
SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
|
|
||||||
* key on ISO keyboards and at the right end
|
|
||||||
* of the QWERTY row on ANSI keyboards.
|
|
||||||
* Produces REVERSE SOLIDUS (backslash) and
|
|
||||||
* VERTICAL LINE in a US layout, REVERSE
|
|
||||||
* SOLIDUS and VERTICAL LINE in a UK Mac
|
|
||||||
* layout, NUMBER SIGN and TILDE in a UK
|
|
||||||
* Windows layout, DOLLAR SIGN and POUND SIGN
|
|
||||||
* in a Swiss German layout, NUMBER SIGN and
|
|
||||||
* APOSTROPHE in a German layout, GRAVE
|
|
||||||
* ACCENT and POUND SIGN in a French Mac
|
|
||||||
* layout, and ASTERISK and MICRO SIGN in a
|
|
||||||
* French Windows layout.
|
|
||||||
*/
|
|
||||||
SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
|
|
||||||
* instead of 49 for the same key, but all
|
|
||||||
* OSes I've seen treat the two codes
|
|
||||||
* identically. So, as an implementor, unless
|
|
||||||
* your keyboard generates both of those
|
|
||||||
* codes and your OS treats them differently,
|
|
||||||
* you should generate SDL_SCANCODE_BACKSLASH
|
|
||||||
* instead of this code. As a user, you
|
|
||||||
* should not rely on this code because SDL
|
|
||||||
* will never generate it with most (all?)
|
|
||||||
* keyboards.
|
|
||||||
*/
|
|
||||||
SDL_SCANCODE_SEMICOLON = 51,
|
|
||||||
SDL_SCANCODE_APOSTROPHE = 52,
|
|
||||||
SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
|
|
||||||
* and ISO keyboards). Produces GRAVE ACCENT and
|
|
||||||
* TILDE in a US Windows layout and in US and UK
|
|
||||||
* Mac layouts on ANSI keyboards, GRAVE ACCENT
|
|
||||||
* and NOT SIGN in a UK Windows layout, SECTION
|
|
||||||
* SIGN and PLUS-MINUS SIGN in US and UK Mac
|
|
||||||
* layouts on ISO keyboards, SECTION SIGN and
|
|
||||||
* DEGREE SIGN in a Swiss German layout (Mac:
|
|
||||||
* only on ISO keyboards), CIRCUMFLEX ACCENT and
|
|
||||||
* DEGREE SIGN in a German layout (Mac: only on
|
|
||||||
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
|
|
||||||
* French Windows layout, COMMERCIAL AT and
|
|
||||||
* NUMBER SIGN in a French Mac layout on ISO
|
|
||||||
* keyboards, and LESS-THAN SIGN and GREATER-THAN
|
|
||||||
* SIGN in a Swiss German, German, or French Mac
|
|
||||||
* layout on ANSI keyboards.
|
|
||||||
*/
|
|
||||||
SDL_SCANCODE_COMMA = 54,
|
|
||||||
SDL_SCANCODE_PERIOD = 55,
|
|
||||||
SDL_SCANCODE_SLASH = 56,
|
|
||||||
|
|
||||||
SDL_SCANCODE_CAPSLOCK = 57,
|
|
||||||
|
|
||||||
SDL_SCANCODE_F1 = 58,
|
|
||||||
SDL_SCANCODE_F2 = 59,
|
|
||||||
SDL_SCANCODE_F3 = 60,
|
|
||||||
SDL_SCANCODE_F4 = 61,
|
|
||||||
SDL_SCANCODE_F5 = 62,
|
|
||||||
SDL_SCANCODE_F6 = 63,
|
|
||||||
SDL_SCANCODE_F7 = 64,
|
|
||||||
SDL_SCANCODE_F8 = 65,
|
|
||||||
SDL_SCANCODE_F9 = 66,
|
|
||||||
SDL_SCANCODE_F10 = 67,
|
|
||||||
SDL_SCANCODE_F11 = 68,
|
|
||||||
SDL_SCANCODE_F12 = 69,
|
|
||||||
|
|
||||||
SDL_SCANCODE_PRINTSCREEN = 70,
|
|
||||||
SDL_SCANCODE_SCROLLLOCK = 71,
|
|
||||||
SDL_SCANCODE_PAUSE = 72,
|
|
||||||
SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
|
|
||||||
does send code 73, not 117) */
|
|
||||||
SDL_SCANCODE_HOME = 74,
|
|
||||||
SDL_SCANCODE_PAGEUP = 75,
|
|
||||||
SDL_SCANCODE_DELETE = 76,
|
|
||||||
SDL_SCANCODE_END = 77,
|
|
||||||
SDL_SCANCODE_PAGEDOWN = 78,
|
|
||||||
SDL_SCANCODE_RIGHT = 79,
|
|
||||||
SDL_SCANCODE_LEFT = 80,
|
|
||||||
SDL_SCANCODE_DOWN = 81,
|
|
||||||
SDL_SCANCODE_UP = 82,
|
|
||||||
|
|
||||||
SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
|
|
||||||
*/
|
|
||||||
SDL_SCANCODE_KP_DIVIDE = 84,
|
|
||||||
SDL_SCANCODE_KP_MULTIPLY = 85,
|
|
||||||
SDL_SCANCODE_KP_MINUS = 86,
|
|
||||||
SDL_SCANCODE_KP_PLUS = 87,
|
|
||||||
SDL_SCANCODE_KP_ENTER = 88,
|
|
||||||
SDL_SCANCODE_KP_1 = 89,
|
|
||||||
SDL_SCANCODE_KP_2 = 90,
|
|
||||||
SDL_SCANCODE_KP_3 = 91,
|
|
||||||
SDL_SCANCODE_KP_4 = 92,
|
|
||||||
SDL_SCANCODE_KP_5 = 93,
|
|
||||||
SDL_SCANCODE_KP_6 = 94,
|
|
||||||
SDL_SCANCODE_KP_7 = 95,
|
|
||||||
SDL_SCANCODE_KP_8 = 96,
|
|
||||||
SDL_SCANCODE_KP_9 = 97,
|
|
||||||
SDL_SCANCODE_KP_0 = 98,
|
|
||||||
SDL_SCANCODE_KP_PERIOD = 99,
|
|
||||||
|
|
||||||
SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
|
|
||||||
* keyboards have over ANSI ones,
|
|
||||||
* located between left shift and Y.
|
|
||||||
* Produces GRAVE ACCENT and TILDE in a
|
|
||||||
* US or UK Mac layout, REVERSE SOLIDUS
|
|
||||||
* (backslash) and VERTICAL LINE in a
|
|
||||||
* US or UK Windows layout, and
|
|
||||||
* LESS-THAN SIGN and GREATER-THAN SIGN
|
|
||||||
* in a Swiss German, German, or French
|
|
||||||
* layout. */
|
|
||||||
SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
|
|
||||||
SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
|
|
||||||
* not a physical key - but some Mac keyboards
|
|
||||||
* do have a power key. */
|
|
||||||
SDL_SCANCODE_KP_EQUALS = 103,
|
|
||||||
SDL_SCANCODE_F13 = 104,
|
|
||||||
SDL_SCANCODE_F14 = 105,
|
|
||||||
SDL_SCANCODE_F15 = 106,
|
|
||||||
SDL_SCANCODE_F16 = 107,
|
|
||||||
SDL_SCANCODE_F17 = 108,
|
|
||||||
SDL_SCANCODE_F18 = 109,
|
|
||||||
SDL_SCANCODE_F19 = 110,
|
|
||||||
SDL_SCANCODE_F20 = 111,
|
|
||||||
SDL_SCANCODE_F21 = 112,
|
|
||||||
SDL_SCANCODE_F22 = 113,
|
|
||||||
SDL_SCANCODE_F23 = 114,
|
|
||||||
SDL_SCANCODE_F24 = 115,
|
|
||||||
SDL_SCANCODE_EXECUTE = 116,
|
|
||||||
SDL_SCANCODE_HELP = 117,
|
|
||||||
SDL_SCANCODE_MENU = 118,
|
|
||||||
SDL_SCANCODE_SELECT = 119,
|
|
||||||
SDL_SCANCODE_STOP = 120,
|
|
||||||
SDL_SCANCODE_AGAIN = 121, /**< redo */
|
|
||||||
SDL_SCANCODE_UNDO = 122,
|
|
||||||
SDL_SCANCODE_CUT = 123,
|
|
||||||
SDL_SCANCODE_COPY = 124,
|
|
||||||
SDL_SCANCODE_PASTE = 125,
|
|
||||||
SDL_SCANCODE_FIND = 126,
|
|
||||||
SDL_SCANCODE_MUTE = 127,
|
|
||||||
SDL_SCANCODE_VOLUMEUP = 128,
|
|
||||||
SDL_SCANCODE_VOLUMEDOWN = 129,
|
|
||||||
/* not sure whether there's a reason to enable these */
|
|
||||||
/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
|
|
||||||
/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
|
|
||||||
/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
|
|
||||||
SDL_SCANCODE_KP_COMMA = 133,
|
|
||||||
SDL_SCANCODE_KP_EQUALSAS400 = 134,
|
|
||||||
|
|
||||||
SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
|
|
||||||
footnotes in USB doc */
|
|
||||||
SDL_SCANCODE_INTERNATIONAL2 = 136,
|
|
||||||
SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
|
|
||||||
SDL_SCANCODE_INTERNATIONAL4 = 138,
|
|
||||||
SDL_SCANCODE_INTERNATIONAL5 = 139,
|
|
||||||
SDL_SCANCODE_INTERNATIONAL6 = 140,
|
|
||||||
SDL_SCANCODE_INTERNATIONAL7 = 141,
|
|
||||||
SDL_SCANCODE_INTERNATIONAL8 = 142,
|
|
||||||
SDL_SCANCODE_INTERNATIONAL9 = 143,
|
|
||||||
SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
|
|
||||||
SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
|
|
||||||
SDL_SCANCODE_LANG3 = 146, /**< Katakana */
|
|
||||||
SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
|
|
||||||
SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
|
|
||||||
SDL_SCANCODE_LANG6 = 149, /**< reserved */
|
|
||||||
SDL_SCANCODE_LANG7 = 150, /**< reserved */
|
|
||||||
SDL_SCANCODE_LANG8 = 151, /**< reserved */
|
|
||||||
SDL_SCANCODE_LANG9 = 152, /**< reserved */
|
|
||||||
|
|
||||||
SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
|
|
||||||
SDL_SCANCODE_SYSREQ = 154,
|
|
||||||
SDL_SCANCODE_CANCEL = 155,
|
|
||||||
SDL_SCANCODE_CLEAR = 156,
|
|
||||||
SDL_SCANCODE_PRIOR = 157,
|
|
||||||
SDL_SCANCODE_RETURN2 = 158,
|
|
||||||
SDL_SCANCODE_SEPARATOR = 159,
|
|
||||||
SDL_SCANCODE_OUT = 160,
|
|
||||||
SDL_SCANCODE_OPER = 161,
|
|
||||||
SDL_SCANCODE_CLEARAGAIN = 162,
|
|
||||||
SDL_SCANCODE_CRSEL = 163,
|
|
||||||
SDL_SCANCODE_EXSEL = 164,
|
|
||||||
|
|
||||||
SDL_SCANCODE_KP_00 = 176,
|
|
||||||
SDL_SCANCODE_KP_000 = 177,
|
|
||||||
SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
|
|
||||||
SDL_SCANCODE_DECIMALSEPARATOR = 179,
|
|
||||||
SDL_SCANCODE_CURRENCYUNIT = 180,
|
|
||||||
SDL_SCANCODE_CURRENCYSUBUNIT = 181,
|
|
||||||
SDL_SCANCODE_KP_LEFTPAREN = 182,
|
|
||||||
SDL_SCANCODE_KP_RIGHTPAREN = 183,
|
|
||||||
SDL_SCANCODE_KP_LEFTBRACE = 184,
|
|
||||||
SDL_SCANCODE_KP_RIGHTBRACE = 185,
|
|
||||||
SDL_SCANCODE_KP_TAB = 186,
|
|
||||||
SDL_SCANCODE_KP_BACKSPACE = 187,
|
|
||||||
SDL_SCANCODE_KP_A = 188,
|
|
||||||
SDL_SCANCODE_KP_B = 189,
|
|
||||||
SDL_SCANCODE_KP_C = 190,
|
|
||||||
SDL_SCANCODE_KP_D = 191,
|
|
||||||
SDL_SCANCODE_KP_E = 192,
|
|
||||||
SDL_SCANCODE_KP_F = 193,
|
|
||||||
SDL_SCANCODE_KP_XOR = 194,
|
|
||||||
SDL_SCANCODE_KP_POWER = 195,
|
|
||||||
SDL_SCANCODE_KP_PERCENT = 196,
|
|
||||||
SDL_SCANCODE_KP_LESS = 197,
|
|
||||||
SDL_SCANCODE_KP_GREATER = 198,
|
|
||||||
SDL_SCANCODE_KP_AMPERSAND = 199,
|
|
||||||
SDL_SCANCODE_KP_DBLAMPERSAND = 200,
|
|
||||||
SDL_SCANCODE_KP_VERTICALBAR = 201,
|
|
||||||
SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
|
|
||||||
SDL_SCANCODE_KP_COLON = 203,
|
|
||||||
SDL_SCANCODE_KP_HASH = 204,
|
|
||||||
SDL_SCANCODE_KP_SPACE = 205,
|
|
||||||
SDL_SCANCODE_KP_AT = 206,
|
|
||||||
SDL_SCANCODE_KP_EXCLAM = 207,
|
|
||||||
SDL_SCANCODE_KP_MEMSTORE = 208,
|
|
||||||
SDL_SCANCODE_KP_MEMRECALL = 209,
|
|
||||||
SDL_SCANCODE_KP_MEMCLEAR = 210,
|
|
||||||
SDL_SCANCODE_KP_MEMADD = 211,
|
|
||||||
SDL_SCANCODE_KP_MEMSUBTRACT = 212,
|
|
||||||
SDL_SCANCODE_KP_MEMMULTIPLY = 213,
|
|
||||||
SDL_SCANCODE_KP_MEMDIVIDE = 214,
|
|
||||||
SDL_SCANCODE_KP_PLUSMINUS = 215,
|
|
||||||
SDL_SCANCODE_KP_CLEAR = 216,
|
|
||||||
SDL_SCANCODE_KP_CLEARENTRY = 217,
|
|
||||||
SDL_SCANCODE_KP_BINARY = 218,
|
|
||||||
SDL_SCANCODE_KP_OCTAL = 219,
|
|
||||||
SDL_SCANCODE_KP_DECIMAL = 220,
|
|
||||||
SDL_SCANCODE_KP_HEXADECIMAL = 221,
|
|
||||||
|
|
||||||
SDL_SCANCODE_LCTRL = 224,
|
|
||||||
SDL_SCANCODE_LSHIFT = 225,
|
|
||||||
SDL_SCANCODE_LALT = 226, /**< alt, option */
|
|
||||||
SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
|
|
||||||
SDL_SCANCODE_RCTRL = 228,
|
|
||||||
SDL_SCANCODE_RSHIFT = 229,
|
|
||||||
SDL_SCANCODE_RALT = 230, /**< alt gr, option */
|
|
||||||
SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
|
|
||||||
|
|
||||||
SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered
|
|
||||||
* by any of the above, but since there's a
|
|
||||||
* special KMOD_MODE for it I'm adding it here
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* @} *//* Usage page 0x07 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Usage page 0x0C
|
|
||||||
*
|
|
||||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
SDL_SCANCODE_AUDIONEXT = 258,
|
|
||||||
SDL_SCANCODE_AUDIOPREV = 259,
|
|
||||||
SDL_SCANCODE_AUDIOSTOP = 260,
|
|
||||||
SDL_SCANCODE_AUDIOPLAY = 261,
|
|
||||||
SDL_SCANCODE_AUDIOMUTE = 262,
|
|
||||||
SDL_SCANCODE_MEDIASELECT = 263,
|
|
||||||
SDL_SCANCODE_WWW = 264,
|
|
||||||
SDL_SCANCODE_MAIL = 265,
|
|
||||||
SDL_SCANCODE_CALCULATOR = 266,
|
|
||||||
SDL_SCANCODE_COMPUTER = 267,
|
|
||||||
SDL_SCANCODE_AC_SEARCH = 268,
|
|
||||||
SDL_SCANCODE_AC_HOME = 269,
|
|
||||||
SDL_SCANCODE_AC_BACK = 270,
|
|
||||||
SDL_SCANCODE_AC_FORWARD = 271,
|
|
||||||
SDL_SCANCODE_AC_STOP = 272,
|
|
||||||
SDL_SCANCODE_AC_REFRESH = 273,
|
|
||||||
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
|
||||||
|
|
||||||
/* @} *//* Usage page 0x0C */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Walther keys
|
|
||||||
*
|
|
||||||
* These are values that Christian Walther added (for mac keyboard?).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
|
|
||||||
SDL_SCANCODE_BRIGHTNESSUP = 276,
|
|
||||||
SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
|
|
||||||
switch, video mode switch */
|
|
||||||
SDL_SCANCODE_KBDILLUMTOGGLE = 278,
|
|
||||||
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
|
||||||
SDL_SCANCODE_KBDILLUMUP = 280,
|
|
||||||
SDL_SCANCODE_EJECT = 281,
|
|
||||||
SDL_SCANCODE_SLEEP = 282,
|
|
||||||
|
|
||||||
SDL_SCANCODE_APP1 = 283,
|
|
||||||
SDL_SCANCODE_APP2 = 284,
|
|
||||||
|
|
||||||
/* @} *//* Walther keys */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Usage page 0x0C (additional media keys)
|
|
||||||
*
|
|
||||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
SDL_SCANCODE_AUDIOREWIND = 285,
|
|
||||||
SDL_SCANCODE_AUDIOFASTFORWARD = 286,
|
|
||||||
|
|
||||||
/* @} *//* Usage page 0x0C (additional media keys) */
|
|
||||||
|
|
||||||
/* Add any other keys here. */
|
|
||||||
|
|
||||||
SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
|
|
||||||
for array bounds */
|
|
||||||
} SDL_Scancode;
|
|
||||||
|
|
||||||
#endif /* SDL_scancode_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,267 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_sensor.h
|
|
||||||
*
|
|
||||||
* Include file for SDL sensor event handling
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_sensor_h_
|
|
||||||
#define SDL_sensor_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
/* *INDENT-OFF* */
|
|
||||||
extern "C" {
|
|
||||||
/* *INDENT-ON* */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief SDL_sensor.h
|
|
||||||
*
|
|
||||||
* In order to use these functions, SDL_Init() must have been called
|
|
||||||
* with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
|
|
||||||
* for sensors, and load appropriate drivers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct _SDL_Sensor;
|
|
||||||
typedef struct _SDL_Sensor SDL_Sensor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a unique ID for a sensor for the time it is connected to the system,
|
|
||||||
* and is never reused for the lifetime of the application.
|
|
||||||
*
|
|
||||||
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
|
|
||||||
*/
|
|
||||||
typedef Sint32 SDL_SensorID;
|
|
||||||
|
|
||||||
/* The different sensors defined by SDL
|
|
||||||
*
|
|
||||||
* Additional sensors may be available, using platform dependent semantics.
|
|
||||||
*
|
|
||||||
* Hare are the additional Android sensors:
|
|
||||||
* https://developer.android.com/reference/android/hardware/SensorEvent.html#values
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */
|
|
||||||
SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */
|
|
||||||
SDL_SENSOR_ACCEL, /**< Accelerometer */
|
|
||||||
SDL_SENSOR_GYRO /**< Gyroscope */
|
|
||||||
} SDL_SensorType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Accelerometer sensor
|
|
||||||
*
|
|
||||||
* The accelerometer returns the current acceleration in SI meters per
|
|
||||||
* second squared. This measurement includes the force of gravity, so
|
|
||||||
* a device at rest will have an value of SDL_STANDARD_GRAVITY away
|
|
||||||
* from the center of the earth.
|
|
||||||
*
|
|
||||||
* values[0]: Acceleration on the x axis
|
|
||||||
* values[1]: Acceleration on the y axis
|
|
||||||
* values[2]: Acceleration on the z axis
|
|
||||||
*
|
|
||||||
* For phones held in portrait mode and game controllers held in front of you,
|
|
||||||
* the axes are defined as follows:
|
|
||||||
* -X ... +X : left ... right
|
|
||||||
* -Y ... +Y : bottom ... top
|
|
||||||
* -Z ... +Z : farther ... closer
|
|
||||||
*
|
|
||||||
* The axis data is not changed when the phone is rotated.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetDisplayOrientation()
|
|
||||||
*/
|
|
||||||
#define SDL_STANDARD_GRAVITY 9.80665f
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gyroscope sensor
|
|
||||||
*
|
|
||||||
* The gyroscope returns the current rate of rotation in radians per second.
|
|
||||||
* The rotation is positive in the counter-clockwise direction. That is,
|
|
||||||
* an observer looking from a positive location on one of the axes would
|
|
||||||
* see positive rotation on that axis when it appeared to be rotating
|
|
||||||
* counter-clockwise.
|
|
||||||
*
|
|
||||||
* values[0]: Angular speed around the x axis (pitch)
|
|
||||||
* values[1]: Angular speed around the y axis (yaw)
|
|
||||||
* values[2]: Angular speed around the z axis (roll)
|
|
||||||
*
|
|
||||||
* For phones held in portrait mode and game controllers held in front of you,
|
|
||||||
* the axes are defined as follows:
|
|
||||||
* -X ... +X : left ... right
|
|
||||||
* -Y ... +Y : bottom ... top
|
|
||||||
* -Z ... +Z : farther ... closer
|
|
||||||
*
|
|
||||||
* The axis data is not changed when the phone or controller is rotated.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetDisplayOrientation()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Locking for multi-threaded access to the sensor API
|
|
||||||
*
|
|
||||||
* If you are using the sensor API or handling events from multiple threads
|
|
||||||
* you should use these locking functions to protect access to the sensors.
|
|
||||||
*
|
|
||||||
* In particular, you are guaranteed that the sensor list won't change, so
|
|
||||||
* the API functions that take a sensor index will be valid, and sensor
|
|
||||||
* events will not be delivered.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_LockSensors(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockSensors(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Count the number of sensors attached to the system right now
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_NumSensors(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the implementation dependent name of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor name, or NULL if device_index is out of range.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the type of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the platform dependent type of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor platform dependent type, or -1 if device_index is out of range.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the instance ID of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor instance ID, or -1 if device_index is out of range.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Open a sensor for use.
|
|
||||||
*
|
|
||||||
* The index passed as an argument refers to the N'th sensor on the system.
|
|
||||||
*
|
|
||||||
* \return A sensor identifier, or NULL if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the SDL_Sensor associated with an instance id.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the implementation dependent name of a sensor.
|
|
||||||
*
|
|
||||||
* \return The sensor name, or NULL if the sensor is NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the type of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the platform dependent type of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor platform dependent type, or -1 if the sensor is NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the instance ID of a sensor.
|
|
||||||
*
|
|
||||||
* This can be called before any sensors are opened.
|
|
||||||
*
|
|
||||||
* \return The sensor instance ID, or -1 if the sensor is NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the current state of an opened sensor.
|
|
||||||
*
|
|
||||||
* The number of values and interpretation of the data is sensor dependent.
|
|
||||||
*
|
|
||||||
* \param sensor The sensor to query
|
|
||||||
* \param data A pointer filled with the current sensor state
|
|
||||||
* \param num_values The number of values to write to data
|
|
||||||
*
|
|
||||||
* \return 0 or -1 if an error occurred.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a sensor previously opened with SDL_SensorOpen()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the current state of the open sensors.
|
|
||||||
*
|
|
||||||
* This is called automatically by the event loop if sensor events are enabled.
|
|
||||||
*
|
|
||||||
* This needs to be called from the thread that initialized the sensor subsystem.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
/* *INDENT-OFF* */
|
|
||||||
}
|
|
||||||
/* *INDENT-ON* */
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_sensor_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,144 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_shape_h_
|
|
||||||
#define SDL_shape_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_pixels.h"
|
|
||||||
#include "SDL_rect.h"
|
|
||||||
#include "SDL_surface.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** \file SDL_shape.h
|
|
||||||
*
|
|
||||||
* Header file for the shaped window API.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SDL_NONSHAPEABLE_WINDOW -1
|
|
||||||
#define SDL_INVALID_SHAPE_ARGUMENT -2
|
|
||||||
#define SDL_WINDOW_LACKS_SHAPE -3
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a window that can be shaped with the specified position, dimensions, and flags.
|
|
||||||
*
|
|
||||||
* \param title The title of the window, in UTF-8 encoding.
|
|
||||||
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
|
||||||
* ::SDL_WINDOWPOS_UNDEFINED.
|
|
||||||
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
|
|
||||||
* ::SDL_WINDOWPOS_UNDEFINED.
|
|
||||||
* \param w The width of the window.
|
|
||||||
* \param h The height of the window.
|
|
||||||
* \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
|
|
||||||
* ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
|
|
||||||
* ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE,
|
|
||||||
* ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
|
|
||||||
* ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
|
|
||||||
*
|
|
||||||
* \return The window created, or NULL if window creation failed.
|
|
||||||
*
|
|
||||||
* \sa SDL_DestroyWindow()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Return whether the given window is a shaped window.
|
|
||||||
*
|
|
||||||
* \param window The window to query for being shaped.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
|
|
||||||
*
|
|
||||||
* \sa SDL_CreateShapedWindow
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
|
|
||||||
|
|
||||||
/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
|
|
||||||
typedef enum {
|
|
||||||
/** \brief The default mode, a binarized alpha cutoff of 1. */
|
|
||||||
ShapeModeDefault,
|
|
||||||
/** \brief A binarized alpha cutoff with a given integer value. */
|
|
||||||
ShapeModeBinarizeAlpha,
|
|
||||||
/** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */
|
|
||||||
ShapeModeReverseBinarizeAlpha,
|
|
||||||
/** \brief A color key is applied. */
|
|
||||||
ShapeModeColorKey
|
|
||||||
} WindowShapeMode;
|
|
||||||
|
|
||||||
#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
|
|
||||||
|
|
||||||
/** \brief A union containing parameters for shaped windows. */
|
|
||||||
typedef union {
|
|
||||||
/** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */
|
|
||||||
Uint8 binarizationCutoff;
|
|
||||||
SDL_Color colorKey;
|
|
||||||
} SDL_WindowShapeParams;
|
|
||||||
|
|
||||||
/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
|
|
||||||
typedef struct SDL_WindowShapeMode {
|
|
||||||
/** \brief The mode of these window-shape parameters. */
|
|
||||||
WindowShapeMode mode;
|
|
||||||
/** \brief Window-shape parameters. */
|
|
||||||
SDL_WindowShapeParams parameters;
|
|
||||||
} SDL_WindowShapeMode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the shape and parameters of a shaped window.
|
|
||||||
*
|
|
||||||
* \param window The shaped window whose parameters should be set.
|
|
||||||
* \param shape A surface encoding the desired shape for the window.
|
|
||||||
* \param shape_mode The parameters to set for the shaped window.
|
|
||||||
*
|
|
||||||
* \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
|
|
||||||
* if the SDL_Window given does not reference a valid shaped window.
|
|
||||||
*
|
|
||||||
* \sa SDL_WindowShapeMode
|
|
||||||
* \sa SDL_GetShapedWindowMode.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the shape parameters of a shaped window.
|
|
||||||
*
|
|
||||||
* \param window The shaped window whose parameters should be retrieved.
|
|
||||||
* \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
|
|
||||||
*
|
|
||||||
* \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
|
|
||||||
* data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
|
|
||||||
* the SDL_Window given is a shapeable window currently lacking a shape.
|
|
||||||
*
|
|
||||||
* \sa SDL_WindowShapeMode
|
|
||||||
* \sa SDL_SetWindowShape
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_shape_h_ */
|
|
@ -1,651 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_stdinc.h
|
|
||||||
*
|
|
||||||
* This is a general header that includes C language support.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_stdinc_h_
|
|
||||||
#define SDL_stdinc_h_
|
|
||||||
|
|
||||||
#include "SDL_config.h"
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#ifndef _DARWIN_C_SOURCE
|
|
||||||
#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STDIO_H
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
#if defined(STDC_HEADERS)
|
|
||||||
# include <stdlib.h>
|
|
||||||
# include <stddef.h>
|
|
||||||
# include <stdarg.h>
|
|
||||||
#else
|
|
||||||
# if defined(HAVE_STDLIB_H)
|
|
||||||
# include <stdlib.h>
|
|
||||||
# elif defined(HAVE_MALLOC_H)
|
|
||||||
# include <malloc.h>
|
|
||||||
# endif
|
|
||||||
# if defined(HAVE_STDDEF_H)
|
|
||||||
# include <stddef.h>
|
|
||||||
# endif
|
|
||||||
# if defined(HAVE_STDARG_H)
|
|
||||||
# include <stdarg.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STRING_H
|
|
||||||
# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
|
|
||||||
# include <memory.h>
|
|
||||||
# endif
|
|
||||||
# include <string.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STRINGS_H
|
|
||||||
# include <strings.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_WCHAR_H
|
|
||||||
# include <wchar.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_INTTYPES_H)
|
|
||||||
# include <inttypes.h>
|
|
||||||
#elif defined(HAVE_STDINT_H)
|
|
||||||
# include <stdint.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_CTYPE_H
|
|
||||||
# include <ctype.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_MATH_H
|
|
||||||
# if defined(__WINRT__)
|
|
||||||
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
|
|
||||||
WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
|
|
||||||
for more information.
|
|
||||||
*/
|
|
||||||
# define _USE_MATH_DEFINES
|
|
||||||
# endif
|
|
||||||
# include <math.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_FLOAT_H
|
|
||||||
# include <float.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_ALLOCA) && !defined(alloca)
|
|
||||||
# if defined(HAVE_ALLOCA_H)
|
|
||||||
# include <alloca.h>
|
|
||||||
# elif defined(__GNUC__)
|
|
||||||
# define alloca __builtin_alloca
|
|
||||||
# elif defined(_MSC_VER)
|
|
||||||
# include <malloc.h>
|
|
||||||
# define alloca _alloca
|
|
||||||
# elif defined(__WATCOMC__)
|
|
||||||
# include <malloc.h>
|
|
||||||
# elif defined(__BORLANDC__)
|
|
||||||
# include <malloc.h>
|
|
||||||
# elif defined(__DMC__)
|
|
||||||
# include <stdlib.h>
|
|
||||||
# elif defined(__AIX__)
|
|
||||||
#pragma alloca
|
|
||||||
# elif defined(__MRC__)
|
|
||||||
void *alloca(unsigned);
|
|
||||||
# else
|
|
||||||
char *alloca();
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The number of elements in an array.
|
|
||||||
*/
|
|
||||||
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
|
|
||||||
#define SDL_TABLESIZE(table) SDL_arraysize(table)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Macro useful for building other macros with strings in them
|
|
||||||
*
|
|
||||||
* e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
|
|
||||||
*/
|
|
||||||
#define SDL_STRINGIFY_ARG(arg) #arg
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Cast operators
|
|
||||||
*
|
|
||||||
* Use proper C++ casts when compiled as C++ to be compatible with the option
|
|
||||||
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
|
|
||||||
#define SDL_static_cast(type, expression) static_cast<type>(expression)
|
|
||||||
#define SDL_const_cast(type, expression) const_cast<type>(expression)
|
|
||||||
#else
|
|
||||||
#define SDL_reinterpret_cast(type, expression) ((type)(expression))
|
|
||||||
#define SDL_static_cast(type, expression) ((type)(expression))
|
|
||||||
#define SDL_const_cast(type, expression) ((type)(expression))
|
|
||||||
#endif
|
|
||||||
/* @} *//* Cast operators */
|
|
||||||
|
|
||||||
/* Define a four character code as a Uint32 */
|
|
||||||
#define SDL_FOURCC(A, B, C, D) \
|
|
||||||
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
|
|
||||||
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
|
|
||||||
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
|
|
||||||
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Basic data types
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
#ifdef __CC_ARM
|
|
||||||
/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */
|
|
||||||
#define SDL_FALSE 0
|
|
||||||
#define SDL_TRUE 1
|
|
||||||
typedef int SDL_bool;
|
|
||||||
#else
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_FALSE = 0,
|
|
||||||
SDL_TRUE = 1
|
|
||||||
} SDL_bool;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A signed 8-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */
|
|
||||||
#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */
|
|
||||||
typedef int8_t Sint8;
|
|
||||||
/**
|
|
||||||
* \brief An unsigned 8-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */
|
|
||||||
#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */
|
|
||||||
typedef uint8_t Uint8;
|
|
||||||
/**
|
|
||||||
* \brief A signed 16-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */
|
|
||||||
#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */
|
|
||||||
typedef int16_t Sint16;
|
|
||||||
/**
|
|
||||||
* \brief An unsigned 16-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */
|
|
||||||
#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */
|
|
||||||
typedef uint16_t Uint16;
|
|
||||||
/**
|
|
||||||
* \brief A signed 32-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */
|
|
||||||
#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
|
|
||||||
typedef int32_t Sint32;
|
|
||||||
/**
|
|
||||||
* \brief An unsigned 32-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */
|
|
||||||
#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */
|
|
||||||
typedef uint32_t Uint32;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A signed 64-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */
|
|
||||||
#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */
|
|
||||||
typedef int64_t Sint64;
|
|
||||||
/**
|
|
||||||
* \brief An unsigned 64-bit integer type.
|
|
||||||
*/
|
|
||||||
#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */
|
|
||||||
#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
|
|
||||||
typedef uint64_t Uint64;
|
|
||||||
|
|
||||||
/* @} *//* Basic data types */
|
|
||||||
|
|
||||||
/* Make sure we have macros for printing 64 bit values.
|
|
||||||
* <stdint.h> should define these but this is not true all platforms.
|
|
||||||
* (for example win32) */
|
|
||||||
#ifndef SDL_PRIs64
|
|
||||||
#ifdef PRIs64
|
|
||||||
#define SDL_PRIs64 PRIs64
|
|
||||||
#elif defined(__WIN32__)
|
|
||||||
#define SDL_PRIs64 "I64d"
|
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
|
||||||
#define SDL_PRIs64 "ld"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIs64 "lld"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIu64
|
|
||||||
#ifdef PRIu64
|
|
||||||
#define SDL_PRIu64 PRIu64
|
|
||||||
#elif defined(__WIN32__)
|
|
||||||
#define SDL_PRIu64 "I64u"
|
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
|
||||||
#define SDL_PRIu64 "lu"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIu64 "llu"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIx64
|
|
||||||
#ifdef PRIx64
|
|
||||||
#define SDL_PRIx64 PRIx64
|
|
||||||
#elif defined(__WIN32__)
|
|
||||||
#define SDL_PRIx64 "I64x"
|
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
|
||||||
#define SDL_PRIx64 "lx"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIx64 "llx"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_PRIX64
|
|
||||||
#ifdef PRIX64
|
|
||||||
#define SDL_PRIX64 PRIX64
|
|
||||||
#elif defined(__WIN32__)
|
|
||||||
#define SDL_PRIX64 "I64X"
|
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
|
||||||
#define SDL_PRIX64 "lX"
|
|
||||||
#else
|
|
||||||
#define SDL_PRIX64 "llX"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Annotations to help code analysis tools */
|
|
||||||
#ifdef SDL_DISABLE_ANALYZE_MACROS
|
|
||||||
#define SDL_IN_BYTECAP(x)
|
|
||||||
#define SDL_INOUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_CAP(x)
|
|
||||||
#define SDL_OUT_BYTECAP(x)
|
|
||||||
#define SDL_OUT_Z_BYTECAP(x)
|
|
||||||
#define SDL_PRINTF_FORMAT_STRING
|
|
||||||
#define SDL_SCANF_FORMAT_STRING
|
|
||||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#else
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
|
|
||||||
#include <sal.h>
|
|
||||||
|
|
||||||
#define SDL_IN_BYTECAP(x) _In_bytecount_(x)
|
|
||||||
#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x)
|
|
||||||
#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x)
|
|
||||||
#define SDL_OUT_CAP(x) _Out_cap_(x)
|
|
||||||
#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x)
|
|
||||||
#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x)
|
|
||||||
|
|
||||||
#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_
|
|
||||||
#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_
|
|
||||||
#else
|
|
||||||
#define SDL_IN_BYTECAP(x)
|
|
||||||
#define SDL_INOUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_Z_CAP(x)
|
|
||||||
#define SDL_OUT_CAP(x)
|
|
||||||
#define SDL_OUT_BYTECAP(x)
|
|
||||||
#define SDL_OUT_Z_BYTECAP(x)
|
|
||||||
#define SDL_PRINTF_FORMAT_STRING
|
|
||||||
#define SDL_SCANF_FORMAT_STRING
|
|
||||||
#endif
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
|
|
||||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
|
|
||||||
#else
|
|
||||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
|
||||||
|
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
|
||||||
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
|
|
||||||
/** \cond */
|
|
||||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
|
|
||||||
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
|
||||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
|
||||||
/** \endcond */
|
|
||||||
|
|
||||||
/* Check to make sure enums are the size of ints, for structure packing.
|
|
||||||
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
|
|
||||||
enums having the size of an int must be enabled.
|
|
||||||
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** \cond */
|
|
||||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
|
||||||
#if !defined(__ANDROID__)
|
|
||||||
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
DUMMY_ENUM_VALUE
|
|
||||||
} SDL_DUMMY_ENUM;
|
|
||||||
|
|
||||||
SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
|
|
||||||
#endif
|
|
||||||
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
|
|
||||||
/** \endcond */
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ALLOCA
|
|
||||||
#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
|
|
||||||
#define SDL_stack_free(data)
|
|
||||||
#else
|
|
||||||
#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
|
|
||||||
#define SDL_stack_free(data) SDL_free(data)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
|
||||||
|
|
||||||
typedef void *(SDLCALL *SDL_malloc_func)(size_t size);
|
|
||||||
typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
|
|
||||||
typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
|
|
||||||
typedef void (SDLCALL *SDL_free_func)(void *mem);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current set of SDL memory functions
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
|
|
||||||
SDL_calloc_func *calloc_func,
|
|
||||||
SDL_realloc_func *realloc_func,
|
|
||||||
SDL_free_func *free_func);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Replace SDL's memory allocation functions with a custom set
|
|
||||||
*
|
|
||||||
* \note If you are replacing SDL's memory functions, you should call
|
|
||||||
* SDL_GetNumAllocations() and be very careful if it returns non-zero.
|
|
||||||
* That means that your free function will be called with memory
|
|
||||||
* allocated by the previous memory allocation functions.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
|
||||||
SDL_calloc_func calloc_func,
|
|
||||||
SDL_realloc_func realloc_func,
|
|
||||||
SDL_free_func free_func);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the number of outstanding (unfreed) allocations
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
|
||||||
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
|
||||||
|
|
||||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
|
||||||
|
|
||||||
/* !!! FIXME: these have side effects. You probably shouldn't use them. */
|
|
||||||
/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
|
|
||||||
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
|
|
||||||
#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isdigit(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isspace(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_isupper(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_islower(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_tolower(int x);
|
|
||||||
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
|
||||||
|
|
||||||
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
|
||||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
|
||||||
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
|
||||||
|
|
||||||
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
|
|
||||||
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
|
||||||
{
|
|
||||||
#ifdef __APPLE__
|
|
||||||
memset_pattern4(dst, &val, dwords * 4);
|
|
||||||
#elif defined(__GNUC__) && defined(i386)
|
|
||||||
int u0, u1, u2;
|
|
||||||
__asm__ __volatile__ (
|
|
||||||
"cld \n\t"
|
|
||||||
"rep ; stosl \n\t"
|
|
||||||
: "=&D" (u0), "=&a" (u1), "=&c" (u2)
|
|
||||||
: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
|
|
||||||
: "memory"
|
|
||||||
);
|
|
||||||
#else
|
|
||||||
size_t _n = (dwords + 3) / 4;
|
|
||||||
Uint32 *_p = SDL_static_cast(Uint32 *, dst);
|
|
||||||
Uint32 _val = (val);
|
|
||||||
if (dwords == 0)
|
|
||||||
return;
|
|
||||||
switch (dwords % 4)
|
|
||||||
{
|
|
||||||
case 0: do { *_p++ = _val; /* fallthrough */
|
|
||||||
case 3: *_p++ = _val; /* fallthrough */
|
|
||||||
case 2: *_p++ = _val; /* fallthrough */
|
|
||||||
case 1: *_p++ = _val; /* fallthrough */
|
|
||||||
} while ( --_n );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
|
||||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
|
|
||||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strdup(const char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
|
||||||
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_atof(const char *str);
|
|
||||||
extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
|
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap);
|
|
||||||
|
|
||||||
#ifndef HAVE_M_PI
|
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.14159265358979323846264338327950288 /**< pi */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC double SDLCALL SDL_acos(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_acosf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_asin(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_asinf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_atan(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_atanf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_ceil(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_ceilf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_cos(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_cosf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_exp(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_expf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_fabs(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_fabsf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_floor(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_floorf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_trunc(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_truncf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_log(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_logf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_log10(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_log10f(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_round(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_roundf(float x);
|
|
||||||
extern DECLSPEC long SDLCALL SDL_lround(double x);
|
|
||||||
extern DECLSPEC long SDLCALL SDL_lroundf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_sin(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_sinf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_sqrt(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_sqrtf(float x);
|
|
||||||
extern DECLSPEC double SDLCALL SDL_tan(double x);
|
|
||||||
extern DECLSPEC float SDLCALL SDL_tanf(float x);
|
|
||||||
|
|
||||||
/* The SDL implementation of iconv() returns these error codes */
|
|
||||||
#define SDL_ICONV_ERROR (size_t)-1
|
|
||||||
#define SDL_ICONV_E2BIG (size_t)-2
|
|
||||||
#define SDL_ICONV_EILSEQ (size_t)-3
|
|
||||||
#define SDL_ICONV_EINVAL (size_t)-4
|
|
||||||
|
|
||||||
/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
|
|
||||||
typedef struct _SDL_iconv_t *SDL_iconv_t;
|
|
||||||
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
|
|
||||||
const char *fromcode);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
|
||||||
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
|
||||||
size_t * inbytesleft, char **outbuf,
|
|
||||||
size_t * outbytesleft);
|
|
||||||
/**
|
|
||||||
* This function converts a string between encodings in one pass, returning a
|
|
||||||
* string that must be freed with SDL_free() or NULL on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
|
||||||
const char *fromcode,
|
|
||||||
const char *inbuf,
|
|
||||||
size_t inbytesleft);
|
|
||||||
#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
|
|
||||||
#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
|
|
||||||
#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
|
|
||||||
|
|
||||||
/* force builds using Clang's static analysis tools to use literal C runtime
|
|
||||||
here, since there are possibly tests that are ineffective otherwise. */
|
|
||||||
#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
|
|
||||||
|
|
||||||
/* The analyzer knows about strlcpy even when the system doesn't provide it */
|
|
||||||
#ifndef HAVE_STRLCPY
|
|
||||||
size_t strlcpy(char* dst, const char* src, size_t size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The analyzer knows about strlcat even when the system doesn't provide it */
|
|
||||||
#ifndef HAVE_STRLCAT
|
|
||||||
size_t strlcat(char* dst, const char* src, size_t size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SDL_malloc malloc
|
|
||||||
#define SDL_calloc calloc
|
|
||||||
#define SDL_realloc realloc
|
|
||||||
#define SDL_free free
|
|
||||||
#define SDL_memset memset
|
|
||||||
#define SDL_memcpy memcpy
|
|
||||||
#define SDL_memmove memmove
|
|
||||||
#define SDL_memcmp memcmp
|
|
||||||
#define SDL_strlcpy strlcpy
|
|
||||||
#define SDL_strlcat strlcat
|
|
||||||
#define SDL_strlen strlen
|
|
||||||
#define SDL_wcslen wcslen
|
|
||||||
#define SDL_wcslcpy wcslcpy
|
|
||||||
#define SDL_wcslcat wcslcat
|
|
||||||
#define SDL_strdup strdup
|
|
||||||
#define SDL_wcsdup wcsdup
|
|
||||||
#define SDL_strchr strchr
|
|
||||||
#define SDL_strrchr strrchr
|
|
||||||
#define SDL_strstr strstr
|
|
||||||
#define SDL_wcsstr wcsstr
|
|
||||||
#define SDL_strtokr strtok_r
|
|
||||||
#define SDL_strcmp strcmp
|
|
||||||
#define SDL_wcscmp wcscmp
|
|
||||||
#define SDL_strncmp strncmp
|
|
||||||
#define SDL_wcsncmp wcsncmp
|
|
||||||
#define SDL_strcasecmp strcasecmp
|
|
||||||
#define SDL_strncasecmp strncasecmp
|
|
||||||
#define SDL_sscanf sscanf
|
|
||||||
#define SDL_vsscanf vsscanf
|
|
||||||
#define SDL_snprintf snprintf
|
|
||||||
#define SDL_vsnprintf vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords)
|
|
||||||
{
|
|
||||||
return SDL_memcpy(dst, src, dwords * 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_stdinc_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,574 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_surface.h
|
|
||||||
*
|
|
||||||
* Header file for ::SDL_Surface definition and management functions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_surface_h_
|
|
||||||
#define SDL_surface_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_pixels.h"
|
|
||||||
#include "SDL_rect.h"
|
|
||||||
#include "SDL_blendmode.h"
|
|
||||||
#include "SDL_rwops.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Surface flags
|
|
||||||
*
|
|
||||||
* These are the currently supported flags for the ::SDL_Surface.
|
|
||||||
*
|
|
||||||
* \internal
|
|
||||||
* Used internally (read-only).
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
#define SDL_SWSURFACE 0 /**< Just here for compatibility */
|
|
||||||
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
|
|
||||||
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
|
|
||||||
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
|
|
||||||
#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
|
|
||||||
/* @} *//* Surface flags */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Evaluates to true if the surface needs to be locked before access.
|
|
||||||
*/
|
|
||||||
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief A collection of pixels used in software blitting.
|
|
||||||
*
|
|
||||||
* \note This structure should be treated as read-only, except for \c pixels,
|
|
||||||
* which, if not NULL, contains the raw pixel data for the surface.
|
|
||||||
*/
|
|
||||||
typedef struct SDL_Surface
|
|
||||||
{
|
|
||||||
Uint32 flags; /**< Read-only */
|
|
||||||
SDL_PixelFormat *format; /**< Read-only */
|
|
||||||
int w, h; /**< Read-only */
|
|
||||||
int pitch; /**< Read-only */
|
|
||||||
void *pixels; /**< Read-write */
|
|
||||||
|
|
||||||
/** Application data associated with the surface */
|
|
||||||
void *userdata; /**< Read-write */
|
|
||||||
|
|
||||||
/** information needed for surfaces requiring locks */
|
|
||||||
int locked; /**< Read-only */
|
|
||||||
|
|
||||||
/** list of BlitMap that hold a reference to this surface */
|
|
||||||
void *list_blitmap; /**< Private */
|
|
||||||
|
|
||||||
/** clipping information */
|
|
||||||
SDL_Rect clip_rect; /**< Read-only */
|
|
||||||
|
|
||||||
/** info for fast blit mapping to other surfaces */
|
|
||||||
struct SDL_BlitMap *map; /**< Private */
|
|
||||||
|
|
||||||
/** Reference count -- used when freeing surface */
|
|
||||||
int refcount; /**< Read-mostly */
|
|
||||||
} SDL_Surface;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The type of function used for surface blitting functions.
|
|
||||||
*/
|
|
||||||
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
|
||||||
struct SDL_Surface * dst, SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief The formula used for converting between YUV and RGB
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
|
|
||||||
SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
|
|
||||||
SDL_YUV_CONVERSION_BT709, /**< BT.709 */
|
|
||||||
SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
|
|
||||||
} SDL_YUV_CONVERSION_MODE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allocate and free an RGB surface.
|
|
||||||
*
|
|
||||||
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
|
|
||||||
* If the depth is greater than 8 bits, the pixel format is set using the
|
|
||||||
* flags '[RGB]mask'.
|
|
||||||
*
|
|
||||||
* If the function runs out of memory, it will return NULL.
|
|
||||||
*
|
|
||||||
* \param flags The \c flags are obsolete and should be set to 0.
|
|
||||||
* \param width The width in pixels of the surface to create.
|
|
||||||
* \param height The height in pixels of the surface to create.
|
|
||||||
* \param depth The depth in bits of the surface to create.
|
|
||||||
* \param Rmask The red mask of the surface to create.
|
|
||||||
* \param Gmask The green mask of the surface to create.
|
|
||||||
* \param Bmask The blue mask of the surface to create.
|
|
||||||
* \param Amask The alpha mask of the surface to create.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
|
||||||
(Uint32 flags, int width, int height, int depth,
|
|
||||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
|
||||||
|
|
||||||
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
|
|
||||||
(Uint32 flags, int width, int height, int depth, Uint32 format);
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
int depth,
|
|
||||||
int pitch,
|
|
||||||
Uint32 Rmask,
|
|
||||||
Uint32 Gmask,
|
|
||||||
Uint32 Bmask,
|
|
||||||
Uint32 Amask);
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
|
|
||||||
(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the palette used by a surface.
|
|
||||||
*
|
|
||||||
* \return 0, or -1 if the surface format doesn't use a palette.
|
|
||||||
*
|
|
||||||
* \note A single palette can be shared with many surfaces.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
|
|
||||||
SDL_Palette * palette);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Sets up a surface for directly accessing the pixels.
|
|
||||||
*
|
|
||||||
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
|
|
||||||
* to and read from \c surface->pixels, using the pixel format stored in
|
|
||||||
* \c surface->format. Once you are done accessing the surface, you should
|
|
||||||
* use SDL_UnlockSurface() to release it.
|
|
||||||
*
|
|
||||||
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
|
|
||||||
* to 0, then you can read and write to the surface at any time, and the
|
|
||||||
* pixel format of the surface will not change.
|
|
||||||
*
|
|
||||||
* No operating system or library calls should be made between lock/unlock
|
|
||||||
* pairs, as critical system locks may be held during this time.
|
|
||||||
*
|
|
||||||
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
|
|
||||||
*
|
|
||||||
* \sa SDL_UnlockSurface()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
|
|
||||||
/** \sa SDL_LockSurface() */
|
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a surface from a seekable SDL data stream (memory or file).
|
|
||||||
*
|
|
||||||
* If \c freesrc is non-zero, the stream will be closed after being read.
|
|
||||||
*
|
|
||||||
* The new surface should be freed with SDL_FreeSurface().
|
|
||||||
*
|
|
||||||
* \return the new surface, or NULL if there was an error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
|
||||||
int freesrc);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load a surface from a file.
|
|
||||||
*
|
|
||||||
* Convenience macro.
|
|
||||||
*/
|
|
||||||
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save a surface to a seekable SDL data stream (memory or file).
|
|
||||||
*
|
|
||||||
* Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
|
|
||||||
* BMP directly. Other RGB formats with 8-bit or higher get converted to a
|
|
||||||
* 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
|
|
||||||
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
|
|
||||||
* not supported.
|
|
||||||
*
|
|
||||||
* If \c freedst is non-zero, the stream will be closed after being written.
|
|
||||||
*
|
|
||||||
* \return 0 if successful or -1 if there was an error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
|
||||||
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save a surface to a file.
|
|
||||||
*
|
|
||||||
* Convenience macro.
|
|
||||||
*/
|
|
||||||
#define SDL_SaveBMP(surface, file) \
|
|
||||||
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Sets the RLE acceleration hint for a surface.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid
|
|
||||||
*
|
|
||||||
* \note If RLE is enabled, colorkey and alpha blending blits are much faster,
|
|
||||||
* but the surface must be locked before directly accessing the pixels.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
|
|
||||||
int flag);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns whether the surface is RLE enabled
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Sets the color key (transparent pixel) in a blittable surface.
|
|
||||||
*
|
|
||||||
* \param surface The surface to update
|
|
||||||
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
|
|
||||||
* \param key The transparent pixel in the native surface format
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid
|
|
||||||
*
|
|
||||||
* You can pass SDL_RLEACCEL to enable RLE accelerated blits.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
|
|
||||||
int flag, Uint32 key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Returns whether the surface has a color key
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Gets the color key (transparent pixel) in a blittable surface.
|
|
||||||
*
|
|
||||||
* \param surface The surface to update
|
|
||||||
* \param key A pointer filled in with the transparent pixel in the native
|
|
||||||
* surface format
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid or colorkey is not
|
|
||||||
* enabled.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
|
|
||||||
Uint32 * key);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set an additional color value used in blit operations.
|
|
||||||
*
|
|
||||||
* \param surface The surface to update.
|
|
||||||
* \param r The red color value multiplied into blit operations.
|
|
||||||
* \param g The green color value multiplied into blit operations.
|
|
||||||
* \param b The blue color value multiplied into blit operations.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetSurfaceColorMod()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
|
|
||||||
Uint8 r, Uint8 g, Uint8 b);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the additional color value used in blit operations.
|
|
||||||
*
|
|
||||||
* \param surface The surface to query.
|
|
||||||
* \param r A pointer filled in with the current red color value.
|
|
||||||
* \param g A pointer filled in with the current green color value.
|
|
||||||
* \param b A pointer filled in with the current blue color value.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetSurfaceColorMod()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
|
|
||||||
Uint8 * r, Uint8 * g,
|
|
||||||
Uint8 * b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set an additional alpha value used in blit operations.
|
|
||||||
*
|
|
||||||
* \param surface The surface to update.
|
|
||||||
* \param alpha The alpha value multiplied into blit operations.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetSurfaceAlphaMod()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
|
|
||||||
Uint8 alpha);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the additional alpha value used in blit operations.
|
|
||||||
*
|
|
||||||
* \param surface The surface to query.
|
|
||||||
* \param alpha A pointer filled in with the current alpha value.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetSurfaceAlphaMod()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
|
|
||||||
Uint8 * alpha);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the blend mode used for blit operations.
|
|
||||||
*
|
|
||||||
* \param surface The surface to update.
|
|
||||||
* \param blendMode ::SDL_BlendMode to use for blit blending.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the parameters are not valid.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetSurfaceBlendMode()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
|
||||||
SDL_BlendMode blendMode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the blend mode used for blit operations.
|
|
||||||
*
|
|
||||||
* \param surface The surface to query.
|
|
||||||
* \param blendMode A pointer filled in with the current blend mode.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if the surface is not valid.
|
|
||||||
*
|
|
||||||
* \sa SDL_SetSurfaceBlendMode()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
|
||||||
SDL_BlendMode *blendMode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the clipping rectangle for the destination surface in a blit.
|
|
||||||
*
|
|
||||||
* If the clip rectangle is NULL, clipping will be disabled.
|
|
||||||
*
|
|
||||||
* If the clip rectangle doesn't intersect the surface, the function will
|
|
||||||
* return SDL_FALSE and blits will be completely clipped. Otherwise the
|
|
||||||
* function returns SDL_TRUE and blits to the surface will be clipped to
|
|
||||||
* the intersection of the surface area and the clipping rectangle.
|
|
||||||
*
|
|
||||||
* Note that blits are automatically clipped to the edges of the source
|
|
||||||
* and destination surfaces.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
|
|
||||||
const SDL_Rect * rect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the clipping rectangle for the destination surface in a blit.
|
|
||||||
*
|
|
||||||
* \c rect must be a pointer to a valid rectangle which will be filled
|
|
||||||
* with the correct values.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
|
|
||||||
SDL_Rect * rect);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Creates a new surface identical to the existing surface
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new surface of the specified format, and then copies and maps
|
|
||||||
* the given surface to it so the blit of the converted surface will be as
|
|
||||||
* fast as possible. If this function fails, it returns NULL.
|
|
||||||
*
|
|
||||||
* The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
|
|
||||||
* semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
|
|
||||||
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
|
|
||||||
* surface.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
|
|
||||||
(SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
|
|
||||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
|
|
||||||
(SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Copy a block of pixels of one format to another format
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 if there was an error
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
|
||||||
Uint32 src_format,
|
|
||||||
const void * src, int src_pitch,
|
|
||||||
Uint32 dst_format,
|
|
||||||
void * dst, int dst_pitch);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs a fast fill of the given rectangle with \c color.
|
|
||||||
*
|
|
||||||
* If \c rect is NULL, the whole surface will be filled with \c color.
|
|
||||||
*
|
|
||||||
* The color should be a pixel of the format used by the surface, and
|
|
||||||
* can be generated by the SDL_MapRGB() function.
|
|
||||||
*
|
|
||||||
* \return 0 on success, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_FillRect
|
|
||||||
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
|
|
||||||
extern DECLSPEC int SDLCALL SDL_FillRects
|
|
||||||
(SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs a fast blit from the source surface to the destination surface.
|
|
||||||
*
|
|
||||||
* This assumes that the source and destination rectangles are
|
|
||||||
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
|
|
||||||
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
|
|
||||||
* in \c srcrect and \c dstrect after all clipping is performed.
|
|
||||||
*
|
|
||||||
* \return If the blit is successful, it returns 0, otherwise it returns -1.
|
|
||||||
*
|
|
||||||
* The blit function should not be called on a locked surface.
|
|
||||||
*
|
|
||||||
* The blit semantics for surfaces with and without blending and colorkey
|
|
||||||
* are defined as follows:
|
|
||||||
* \verbatim
|
|
||||||
RGBA->RGB:
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
|
||||||
alpha-blend (using the source alpha-channel and per-surface alpha)
|
|
||||||
SDL_SRCCOLORKEY ignored.
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
|
||||||
copy RGB.
|
|
||||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
|
||||||
RGB values of the source color key, ignoring alpha in the
|
|
||||||
comparison.
|
|
||||||
|
|
||||||
RGB->RGBA:
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
|
||||||
alpha-blend (using the source per-surface alpha)
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
|
||||||
copy RGB, set destination alpha to source per-surface alpha value.
|
|
||||||
both:
|
|
||||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
|
||||||
source color key.
|
|
||||||
|
|
||||||
RGBA->RGBA:
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
|
||||||
alpha-blend (using the source alpha-channel and per-surface alpha)
|
|
||||||
SDL_SRCCOLORKEY ignored.
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
|
||||||
copy all of RGBA to the destination.
|
|
||||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
|
||||||
RGB values of the source color key, ignoring alpha in the
|
|
||||||
comparison.
|
|
||||||
|
|
||||||
RGB->RGB:
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_BLEND:
|
|
||||||
alpha-blend (using the source per-surface alpha)
|
|
||||||
Source surface blend mode set to SDL_BLENDMODE_NONE:
|
|
||||||
copy RGB.
|
|
||||||
both:
|
|
||||||
if SDL_SRCCOLORKEY set, only copy the pixels matching the
|
|
||||||
source color key.
|
|
||||||
\endverbatim
|
|
||||||
*
|
|
||||||
* You should call SDL_BlitSurface() unless you know exactly how SDL
|
|
||||||
* blitting works internally and how to use the other blit functions.
|
|
||||||
*/
|
|
||||||
#define SDL_BlitSurface SDL_UpperBlit
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the public blit function, SDL_BlitSurface(), and it performs
|
|
||||||
* rectangle validation and clipping before passing it to SDL_LowerBlit()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_UpperBlit
|
|
||||||
(SDL_Surface * src, const SDL_Rect * srcrect,
|
|
||||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a semi-private blit function and it performs low-level surface
|
|
||||||
* blitting only.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
|
||||||
(SDL_Surface * src, SDL_Rect * srcrect,
|
|
||||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Perform a fast, low quality, stretch blit between two surfaces of the
|
|
||||||
* same pixel format.
|
|
||||||
*
|
|
||||||
* \note This function uses a static buffer, and is not thread-safe.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
|
|
||||||
const SDL_Rect * srcrect,
|
|
||||||
SDL_Surface * dst,
|
|
||||||
const SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Perform a bilinear scaling between two surfaces of the
|
|
||||||
* same pixel format, 32BPP.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
|
|
||||||
const SDL_Rect * srcrect,
|
|
||||||
SDL_Surface * dst,
|
|
||||||
const SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
|
|
||||||
#define SDL_BlitScaled SDL_UpperBlitScaled
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the public scaled blit function, SDL_BlitScaled(), and it performs
|
|
||||||
* rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
|
|
||||||
(SDL_Surface * src, const SDL_Rect * srcrect,
|
|
||||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a semi-private blit function and it performs low-level surface
|
|
||||||
* scaled blitting only.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
|
|
||||||
(SDL_Surface * src, SDL_Rect * srcrect,
|
|
||||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the YUV conversion mode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the YUV conversion mode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_surface_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,333 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_system.h
|
|
||||||
*
|
|
||||||
* Include file for platform specific SDL API functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_system_h_
|
|
||||||
#define SDL_system_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_keyboard.h"
|
|
||||||
#include "SDL_render.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Windows */
|
|
||||||
#ifdef __WIN32__
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Set a function that is called for every windows message, before TranslateMessage()
|
|
||||||
*/
|
|
||||||
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Returns the D3D9 adapter index that matches the specified display index.
|
|
||||||
|
|
||||||
This adapter index can be passed to IDirect3D9::CreateDevice and controls
|
|
||||||
on which monitor a full screen application will appear.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
|
|
||||||
|
|
||||||
typedef struct IDirect3DDevice9 IDirect3DDevice9;
|
|
||||||
/**
|
|
||||||
\brief Returns the D3D9 device associated with a renderer, or NULL if it's not a D3D9 renderer.
|
|
||||||
|
|
||||||
Once you are done using the device, you should release it to avoid a resource leak.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
|
|
||||||
|
|
||||||
typedef struct ID3D11Device ID3D11Device;
|
|
||||||
/**
|
|
||||||
\brief Returns the D3D11 device associated with a renderer, or NULL if it's not a D3D11 renderer.
|
|
||||||
|
|
||||||
Once you are done using the device, you should release it to avoid a resource leak.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Returns the DXGI Adapter and Output indices for the specified display index.
|
|
||||||
|
|
||||||
These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
|
|
||||||
required to create a DX10 or DX11 device and swap chain.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
|
|
||||||
|
|
||||||
#endif /* __WIN32__ */
|
|
||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Linux */
|
|
||||||
#ifdef __LINUX__
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
|
|
||||||
|
|
||||||
\return 0 on success, or -1 on error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
|
|
||||||
|
|
||||||
#endif /* __LINUX__ */
|
|
||||||
|
|
||||||
/* Platform specific functions for iOS */
|
|
||||||
#ifdef __IPHONEOS__
|
|
||||||
|
|
||||||
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
|
||||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
|
||||||
|
|
||||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
|
||||||
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
|
||||||
|
|
||||||
#endif /* __IPHONEOS__ */
|
|
||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Android */
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Get the JNI environment for the current thread
|
|
||||||
|
|
||||||
This returns JNIEnv*, but the prototype is void* so we don't need jni.h
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Get the SDL Activity object for the application
|
|
||||||
|
|
||||||
This returns jobject, but the prototype is void* so we don't need jni.h
|
|
||||||
The jobject returned by SDL_AndroidGetActivity is a local reference.
|
|
||||||
It is the caller's responsibility to properly release it
|
|
||||||
(using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Return API level of the current device
|
|
||||||
|
|
||||||
API level 30: Android 11
|
|
||||||
API level 29: Android 10
|
|
||||||
API level 28: Android 9
|
|
||||||
API level 27: Android 8.1
|
|
||||||
API level 26: Android 8.0
|
|
||||||
API level 25: Android 7.1
|
|
||||||
API level 24: Android 7.0
|
|
||||||
API level 23: Android 6.0
|
|
||||||
API level 22: Android 5.1
|
|
||||||
API level 21: Android 5.0
|
|
||||||
API level 20: Android 4.4W
|
|
||||||
API level 19: Android 4.4
|
|
||||||
API level 18: Android 4.3
|
|
||||||
API level 17: Android 4.2
|
|
||||||
API level 16: Android 4.1
|
|
||||||
API level 15: Android 4.0.3
|
|
||||||
API level 14: Android 4.0
|
|
||||||
API level 13: Android 3.2
|
|
||||||
API level 12: Android 3.1
|
|
||||||
API level 11: Android 3.0
|
|
||||||
API level 10: Android 2.3.3
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Return true if the application is running on Android TV
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Return true if the application is running on a Chromebook
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Return true is the application is running on a Samsung DeX docking station
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Trigger the Android system back button behavior.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
See the official Android developer guide for more information:
|
|
||||||
http://developer.android.com/guide/topics/data/data-storage.html
|
|
||||||
*/
|
|
||||||
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
|
|
||||||
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Get the path used for internal storage for this application.
|
|
||||||
|
|
||||||
This path is unique to your application and cannot be written to
|
|
||||||
by other applications.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Get the current state of external storage, a bitmask of these values:
|
|
||||||
SDL_ANDROID_EXTERNAL_STORAGE_READ
|
|
||||||
SDL_ANDROID_EXTERNAL_STORAGE_WRITE
|
|
||||||
|
|
||||||
If external storage is currently unavailable, this will return 0.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Get the path used for external storage for this application.
|
|
||||||
|
|
||||||
This path is unique to your application, but is public and can be
|
|
||||||
written to by other applications.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Request permissions at runtime.
|
|
||||||
|
|
||||||
This blocks the calling thread until the permission is granted or
|
|
||||||
denied. Returns SDL_TRUE if the permission was granted.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
|
|
||||||
|
|
||||||
#endif /* __ANDROID__ */
|
|
||||||
|
|
||||||
/* Platform specific functions for WinRT */
|
|
||||||
#ifdef __WINRT__
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief WinRT / Windows Phone path types
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
/** \brief The installed app's root directory.
|
|
||||||
Files here are likely to be read-only. */
|
|
||||||
SDL_WINRT_PATH_INSTALLED_LOCATION,
|
|
||||||
|
|
||||||
/** \brief The app's local data store. Files may be written here */
|
|
||||||
SDL_WINRT_PATH_LOCAL_FOLDER,
|
|
||||||
|
|
||||||
/** \brief The app's roaming data store. Unsupported on Windows Phone.
|
|
||||||
Files written here may be copied to other machines via a network
|
|
||||||
connection.
|
|
||||||
*/
|
|
||||||
SDL_WINRT_PATH_ROAMING_FOLDER,
|
|
||||||
|
|
||||||
/** \brief The app's temporary data store. Unsupported on Windows Phone.
|
|
||||||
Files written here may be deleted at any time. */
|
|
||||||
SDL_WINRT_PATH_TEMP_FOLDER
|
|
||||||
} SDL_WinRT_Path;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief WinRT Device Family
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
/** \brief Unknown family */
|
|
||||||
SDL_WINRT_DEVICEFAMILY_UNKNOWN,
|
|
||||||
|
|
||||||
/** \brief Desktop family*/
|
|
||||||
SDL_WINRT_DEVICEFAMILY_DESKTOP,
|
|
||||||
|
|
||||||
/** \brief Mobile family (for example smartphone) */
|
|
||||||
SDL_WINRT_DEVICEFAMILY_MOBILE,
|
|
||||||
|
|
||||||
/** \brief XBox family */
|
|
||||||
SDL_WINRT_DEVICEFAMILY_XBOX,
|
|
||||||
} SDL_WinRT_DeviceFamily;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Retrieves a WinRT defined path on the local file system
|
|
||||||
*
|
|
||||||
* \note Documentation on most app-specific path types on WinRT
|
|
||||||
* can be found on MSDN, at the URL:
|
|
||||||
* http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
|
||||||
*
|
|
||||||
* \param pathType The type of path to retrieve.
|
|
||||||
* \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
|
|
||||||
* if the path is not available for any reason. Not all paths are
|
|
||||||
* available on all versions of Windows. This is especially true on
|
|
||||||
* Windows Phone. Check the documentation for the given
|
|
||||||
* SDL_WinRT_Path for more information on which path types are
|
|
||||||
* supported where.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Retrieves a WinRT defined path on the local file system
|
|
||||||
*
|
|
||||||
* \note Documentation on most app-specific path types on WinRT
|
|
||||||
* can be found on MSDN, at the URL:
|
|
||||||
* http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
|
||||||
*
|
|
||||||
* \param pathType The type of path to retrieve.
|
|
||||||
* \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
|
|
||||||
* if the path is not available for any reason. Not all paths are
|
|
||||||
* available on all versions of Windows. This is especially true on
|
|
||||||
* Windows Phone. Check the documentation for the given
|
|
||||||
* SDL_WinRT_Path for more information on which path types are
|
|
||||||
* supported where.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Detects the device family of WinRT plattform on runtime
|
|
||||||
*
|
|
||||||
* \return Device family
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
|
||||||
|
|
||||||
#endif /* __WINRT__ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Return true if the current device is a tablet.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
|
||||||
|
|
||||||
/* Functions used by iOS application delegates to notify SDL about state changes */
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
|
||||||
#ifdef __IPHONEOS__
|
|
||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_system_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,355 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_syswm.h
|
|
||||||
*
|
|
||||||
* Include file for SDL custom system window manager hooks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_syswm_h_
|
|
||||||
#define SDL_syswm_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
#include "SDL_version.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief SDL_syswm.h
|
|
||||||
*
|
|
||||||
* Your application has access to a special type of event ::SDL_SYSWMEVENT,
|
|
||||||
* which contains window-manager specific information and arrives whenever
|
|
||||||
* an unhandled window event occurs. This event is ignored by default, but
|
|
||||||
* you can enable it with SDL_EventState().
|
|
||||||
*/
|
|
||||||
struct SDL_SysWMinfo;
|
|
||||||
|
|
||||||
#if !defined(SDL_PROTOTYPES_ONLY)
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#ifndef NOMINMAX /* don't define min() and max(). */
|
|
||||||
#define NOMINMAX
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINRT)
|
|
||||||
#include <Inspectable.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is the structure for custom window manager events */
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
/* conflicts with Quickdraw.h */
|
|
||||||
#define Cursor X11Cursor
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xatom.h>
|
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
/* matches the re-define above */
|
|
||||||
#undef Cursor
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* defined(SDL_VIDEO_DRIVER_X11) */
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
|
||||||
#include <directfb.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
|
||||||
#ifdef __OBJC__
|
|
||||||
@class NSWindow;
|
|
||||||
#else
|
|
||||||
typedef struct _NSWindow NSWindow;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
|
||||||
#ifdef __OBJC__
|
|
||||||
#include <UIKit/UIKit.h>
|
|
||||||
#else
|
|
||||||
typedef struct _UIWindow UIWindow;
|
|
||||||
typedef struct _UIViewController UIViewController;
|
|
||||||
#endif
|
|
||||||
typedef Uint32 GLuint;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_ANDROID)
|
|
||||||
typedef struct ANativeWindow ANativeWindow;
|
|
||||||
typedef void *EGLSurface;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
|
||||||
#include "SDL_egl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_OS2)
|
|
||||||
#define INCL_WIN
|
|
||||||
#include <os2.h>
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_PROTOTYPES_ONLY */
|
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SDL_PROTOTYPES_ONLY)
|
|
||||||
/**
|
|
||||||
* These are the various supported windowing subsystems
|
|
||||||
*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_SYSWM_UNKNOWN,
|
|
||||||
SDL_SYSWM_WINDOWS,
|
|
||||||
SDL_SYSWM_X11,
|
|
||||||
SDL_SYSWM_DIRECTFB,
|
|
||||||
SDL_SYSWM_COCOA,
|
|
||||||
SDL_SYSWM_UIKIT,
|
|
||||||
SDL_SYSWM_WAYLAND,
|
|
||||||
SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
|
||||||
SDL_SYSWM_WINRT,
|
|
||||||
SDL_SYSWM_ANDROID,
|
|
||||||
SDL_SYSWM_VIVANTE,
|
|
||||||
SDL_SYSWM_OS2,
|
|
||||||
SDL_SYSWM_HAIKU
|
|
||||||
} SDL_SYSWM_TYPE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The custom event structure.
|
|
||||||
*/
|
|
||||||
struct SDL_SysWMmsg
|
|
||||||
{
|
|
||||||
SDL_version version;
|
|
||||||
SDL_SYSWM_TYPE subsystem;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
|
||||||
struct {
|
|
||||||
HWND hwnd; /**< The window for the message */
|
|
||||||
UINT msg; /**< The type of message */
|
|
||||||
WPARAM wParam; /**< WORD message parameter */
|
|
||||||
LPARAM lParam; /**< LONG message parameter */
|
|
||||||
} win;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
|
||||||
struct {
|
|
||||||
XEvent event;
|
|
||||||
} x11;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
|
||||||
struct {
|
|
||||||
DFBEvent event;
|
|
||||||
} dfb;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
/* Latest version of Xcode clang complains about empty structs in C v. C++:
|
|
||||||
error: empty struct has size 0 in C, size 1 in C++
|
|
||||||
*/
|
|
||||||
int dummy;
|
|
||||||
/* No Cocoa window events yet */
|
|
||||||
} cocoa;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
/* No UIKit window events yet */
|
|
||||||
} uikit;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
/* No Vivante window events yet */
|
|
||||||
} vivante;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_OS2)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
BOOL fFrame; /**< TRUE if hwnd is a frame window */
|
|
||||||
HWND hwnd; /**< The window receiving the message */
|
|
||||||
ULONG msg; /**< The message identifier */
|
|
||||||
MPARAM mp1; /**< The first first message parameter */
|
|
||||||
MPARAM mp2; /**< The second first message parameter */
|
|
||||||
} os2;
|
|
||||||
#endif
|
|
||||||
/* Can't have an empty union */
|
|
||||||
int dummy;
|
|
||||||
} msg;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The 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.
|
|
||||||
*/
|
|
||||||
struct SDL_SysWMinfo
|
|
||||||
{
|
|
||||||
SDL_version version;
|
|
||||||
SDL_SYSWM_TYPE subsystem;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
HWND window; /**< The window handle */
|
|
||||||
HDC hdc; /**< The window device context */
|
|
||||||
HINSTANCE hinstance; /**< The instance handle */
|
|
||||||
} win;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WINRT)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
IInspectable * window; /**< The WinRT CoreWindow */
|
|
||||||
} winrt;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Display *display; /**< The X11 display */
|
|
||||||
Window window; /**< The X11 window */
|
|
||||||
} x11;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_DIRECTFB)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
IDirectFB *dfb; /**< The directfb main interface */
|
|
||||||
IDirectFBWindow *window; /**< The directfb window handle */
|
|
||||||
IDirectFBSurface *surface; /**< The directfb client surface */
|
|
||||||
} dfb;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
|
|
||||||
NSWindow __unsafe_unretained *window; /**< The Cocoa window */
|
|
||||||
#else
|
|
||||||
NSWindow *window; /**< The Cocoa window */
|
|
||||||
#endif
|
|
||||||
} cocoa;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_UIKIT)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
|
|
||||||
UIWindow __unsafe_unretained *window; /**< The UIKit window */
|
|
||||||
#else
|
|
||||||
UIWindow *window; /**< The UIKit window */
|
|
||||||
#endif
|
|
||||||
GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
|
|
||||||
GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
|
|
||||||
GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
|
|
||||||
} uikit;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_WAYLAND)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_display *display; /**< Wayland display */
|
|
||||||
struct wl_surface *surface; /**< Wayland surface */
|
|
||||||
struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
|
|
||||||
struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
|
|
||||||
} wl;
|
|
||||||
#endif
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *connection; /**< Mir display server connection */
|
|
||||||
void *surface; /**< Mir surface */
|
|
||||||
} mir;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_ANDROID)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
ANativeWindow *window;
|
|
||||||
EGLSurface surface;
|
|
||||||
} android;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_OS2)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
HWND hwnd; /**< The window handle */
|
|
||||||
HWND hwndFrame; /**< The frame window handle */
|
|
||||||
} os2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SDL_VIDEO_DRIVER_VIVANTE)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
EGLNativeDisplayType display;
|
|
||||||
EGLNativeWindowType window;
|
|
||||||
} vivante;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
|
|
||||||
/* Be careful not to overflow this if you add a new target! */
|
|
||||||
Uint8 dummy[64];
|
|
||||||
} info;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* SDL_PROTOTYPES_ONLY */
|
|
||||||
|
|
||||||
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
/**
|
|
||||||
* \brief This function allows access to driver-dependent window information.
|
|
||||||
*
|
|
||||||
* \param window The window about which information is being requested
|
|
||||||
* \param info This structure must be initialized with the SDL version, and is
|
|
||||||
* then filled in with information about the given window.
|
|
||||||
*
|
|
||||||
* \return SDL_TRUE if the function is implemented and the version member of
|
|
||||||
* the \c info struct is valid, SDL_FALSE otherwise.
|
|
||||||
*
|
|
||||||
* You typically use this function like this:
|
|
||||||
* \code
|
|
||||||
* SDL_SysWMinfo info;
|
|
||||||
* SDL_VERSION(&info.version);
|
|
||||||
* if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
|
|
||||||
* \endcode
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
|
|
||||||
SDL_SysWMinfo * info);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_syswm_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,366 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_thread_h_
|
|
||||||
#define SDL_thread_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_thread.h
|
|
||||||
*
|
|
||||||
* Header for the SDL thread management routines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
/* Thread synchronization primitives */
|
|
||||||
#include "SDL_atomic.h"
|
|
||||||
#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;
|
|
||||||
|
|
||||||
/* The SDL thread ID */
|
|
||||||
typedef unsigned long SDL_threadID;
|
|
||||||
|
|
||||||
/* Thread local storage ID, 0 is the invalid ID */
|
|
||||||
typedef unsigned int SDL_TLSID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The SDL thread priority.
|
|
||||||
*
|
|
||||||
* SDL will make system changes as necessary in order to apply the thread priority.
|
|
||||||
* Code which attempts to control thread state related to priority should be aware
|
|
||||||
* that calling SDL_SetThreadPriority may alter such state.
|
|
||||||
* SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior.
|
|
||||||
*
|
|
||||||
* \note On many systems you require special privileges to set high or time critical priority.
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
SDL_THREAD_PRIORITY_LOW,
|
|
||||||
SDL_THREAD_PRIORITY_NORMAL,
|
|
||||||
SDL_THREAD_PRIORITY_HIGH,
|
|
||||||
SDL_THREAD_PRIORITY_TIME_CRITICAL
|
|
||||||
} SDL_ThreadPriority;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The function passed to SDL_CreateThread().
|
|
||||||
* It is passed a void* user context parameter and returns an int.
|
|
||||||
*/
|
|
||||||
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
|
|
||||||
|
|
||||||
#if defined(__WIN32__)
|
|
||||||
/**
|
|
||||||
* \file SDL_thread.h
|
|
||||||
*
|
|
||||||
* We compile SDL into a DLL. This means, that it's the DLL which
|
|
||||||
* creates a new thread for the calling process with the SDL_CreateThread()
|
|
||||||
* API. There is a problem with this, that only the RTL of the SDL2.DLL will
|
|
||||||
* be initialized for those threads, and not the RTL of the calling
|
|
||||||
* application!
|
|
||||||
*
|
|
||||||
* To solve this, we make a little hack here.
|
|
||||||
*
|
|
||||||
* We'll always use the caller's _beginthread() and _endthread() APIs to
|
|
||||||
* start a new thread. This way, if it's the SDL2.DLL which uses this API,
|
|
||||||
* then the RTL of SDL2.DLL will be used to create the new thread, and if it's
|
|
||||||
* the application, then the RTL of the application will be used.
|
|
||||||
*
|
|
||||||
* So, in short:
|
|
||||||
* Always use the _beginthread() and _endthread() of the calling runtime
|
|
||||||
* library!
|
|
||||||
*/
|
|
||||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
|
||||||
#include <process.h> /* _beginthreadex() and _endthreadex() */
|
|
||||||
|
|
||||||
typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
|
|
||||||
(void *, unsigned, unsigned (__stdcall *func)(void *),
|
|
||||||
void * /*arg*/, unsigned, unsigned * /* threadID */);
|
|
||||||
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
|
||||||
|
|
||||||
#ifndef SDL_beginthread
|
|
||||||
#define SDL_beginthread _beginthreadex
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_endthread
|
|
||||||
#define SDL_endthread _endthreadex
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a thread.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
|
|
||||||
const char *name, const size_t stacksize, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a thread.
|
|
||||||
*/
|
|
||||||
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
|
||||||
#undef SDL_CreateThread
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#undef SDL_CreateThreadWithStackSize
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#else
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(__OS2__)
|
|
||||||
/*
|
|
||||||
* just like the windows case above: We compile SDL2
|
|
||||||
* into a dll with Watcom's runtime statically linked.
|
|
||||||
*/
|
|
||||||
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
|
||||||
|
|
||||||
#ifndef __EMX__
|
|
||||||
#include <process.h>
|
|
||||||
#else
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
|
|
||||||
typedef void (*pfnSDL_CurrentEndThread)(void);
|
|
||||||
|
|
||||||
#ifndef SDL_beginthread
|
|
||||||
#define SDL_beginthread _beginthread
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_endthread
|
|
||||||
#define SDL_endthread _endthread
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data,
|
|
||||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
|
||||||
pfnSDL_CurrentEndThread pfnEndThread);
|
|
||||||
|
|
||||||
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
|
||||||
#undef SDL_CreateThread
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#undef SDL_CreateThreadWithStackSize
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#else
|
|
||||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a thread with a default stack size.
|
|
||||||
*
|
|
||||||
* This is equivalent to calling:
|
|
||||||
* SDL_CreateThreadWithStackSize(fn, name, 0, data);
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a thread.
|
|
||||||
*
|
|
||||||
* Thread naming is a little complicated: Most systems have very small
|
|
||||||
* limits for the string length (Haiku has 32 bytes, Linux currently has 16,
|
|
||||||
* Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
|
|
||||||
* have to see what happens with your system's debugger. The name should be
|
|
||||||
* UTF-8 (but using the naming limits of C identifiers is a better bet).
|
|
||||||
* There are no requirements for thread naming conventions, so long as the
|
|
||||||
* string is null-terminated UTF-8, but these guidelines are helpful in
|
|
||||||
* choosing a name:
|
|
||||||
*
|
|
||||||
* http://stackoverflow.com/questions/149932/naming-conventions-for-threads
|
|
||||||
*
|
|
||||||
* If a system imposes requirements, SDL will try to munge the string for
|
|
||||||
* it (truncate, etc), but the original string contents will be available
|
|
||||||
* from SDL_GetThreadName().
|
|
||||||
*
|
|
||||||
* The size (in bytes) of the new stack can be specified. Zero means "use
|
|
||||||
* the system default" which might be wildly different between platforms
|
|
||||||
* (x86 Linux generally defaults to eight megabytes, an embedded device
|
|
||||||
* might be a few kilobytes instead).
|
|
||||||
*
|
|
||||||
* In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
|
|
||||||
* function.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Thread *SDLCALL
|
|
||||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the thread name, as it was specified in SDL_CreateThread().
|
|
||||||
* This function returns a pointer to a UTF-8 string that names the
|
|
||||||
* specified thread, or NULL if it doesn't have a name. This is internal
|
|
||||||
* memory, not to be free()'d by the caller, and remains valid until the
|
|
||||||
* specified thread is cleaned up by SDL_WaitThread().
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the thread identifier for the current thread.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the thread identifier for the specified thread.
|
|
||||||
*
|
|
||||||
* Equivalent to SDL_ThreadID() if the specified thread is NULL.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the priority for the current thread
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait for a thread to finish. Threads that haven't been detached will
|
|
||||||
* remain (as a "zombie") until this function cleans them up. Not doing so
|
|
||||||
* is a resource leak.
|
|
||||||
*
|
|
||||||
* Once a thread has been cleaned up through this function, the SDL_Thread
|
|
||||||
* that references it becomes invalid and should not be referenced again.
|
|
||||||
* As such, only one thread may call SDL_WaitThread() on another.
|
|
||||||
*
|
|
||||||
* The return code for the thread function is placed in the area
|
|
||||||
* pointed to by \c status, if \c status is not NULL.
|
|
||||||
*
|
|
||||||
* You may not wait on a thread that has been used in a call to
|
|
||||||
* SDL_DetachThread(). Use either that function or this one, but not
|
|
||||||
* both, or behavior is undefined.
|
|
||||||
*
|
|
||||||
* It is safe to pass NULL to this function; it is a no-op.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A thread may be "detached" to signify that it should not remain until
|
|
||||||
* another thread has called SDL_WaitThread() on it. Detaching a thread
|
|
||||||
* is useful for long-running threads that nothing needs to synchronize
|
|
||||||
* with or further manage. When a detached thread is done, it simply
|
|
||||||
* goes away.
|
|
||||||
*
|
|
||||||
* There is no way to recover the return code of a detached thread. If you
|
|
||||||
* need this, don't detach the thread and instead use SDL_WaitThread().
|
|
||||||
*
|
|
||||||
* Once a thread is detached, you should usually assume the SDL_Thread isn't
|
|
||||||
* safe to reference again, as it will become invalid immediately upon
|
|
||||||
* the detached thread's exit, instead of remaining until someone has called
|
|
||||||
* SDL_WaitThread() to finally clean it up. As such, don't detach the same
|
|
||||||
* thread more than once.
|
|
||||||
*
|
|
||||||
* If a thread has already exited when passed to SDL_DetachThread(), it will
|
|
||||||
* stop waiting for a call to SDL_WaitThread() and clean up immediately.
|
|
||||||
* It is not safe to detach a thread that might be used with SDL_WaitThread().
|
|
||||||
*
|
|
||||||
* You may not call SDL_WaitThread() on a thread that has been detached.
|
|
||||||
* Use either that function or this one, but not both, or behavior is
|
|
||||||
* undefined.
|
|
||||||
*
|
|
||||||
* It is safe to pass NULL to this function; it is a no-op.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
|
|
||||||
*
|
|
||||||
* \return The newly created thread local storage identifier, or 0 on error
|
|
||||||
*
|
|
||||||
* \code
|
|
||||||
* static SDL_SpinLock tls_lock;
|
|
||||||
* static SDL_TLSID thread_local_storage;
|
|
||||||
*
|
|
||||||
* void SetMyThreadData(void *value)
|
|
||||||
* {
|
|
||||||
* if (!thread_local_storage) {
|
|
||||||
* SDL_AtomicLock(&tls_lock);
|
|
||||||
* if (!thread_local_storage) {
|
|
||||||
* thread_local_storage = SDL_TLSCreate();
|
|
||||||
* }
|
|
||||||
* SDL_AtomicUnlock(&tls_lock);
|
|
||||||
* }
|
|
||||||
* SDL_TLSSet(thread_local_storage, value, 0);
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* void *GetMyThreadData(void)
|
|
||||||
* {
|
|
||||||
* return SDL_TLSGet(thread_local_storage);
|
|
||||||
* }
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* \sa SDL_TLSGet()
|
|
||||||
* \sa SDL_TLSSet()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the value associated with a thread local storage ID for the current thread.
|
|
||||||
*
|
|
||||||
* \param id The thread local storage ID
|
|
||||||
*
|
|
||||||
* \return The value associated with the ID for the current thread, or NULL if no value has been set.
|
|
||||||
*
|
|
||||||
* \sa SDL_TLSCreate()
|
|
||||||
* \sa SDL_TLSSet()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Set the value associated with a thread local storage ID for the current thread.
|
|
||||||
*
|
|
||||||
* \param id The thread local storage ID
|
|
||||||
* \param value The value to associate with the ID for the current thread
|
|
||||||
* \param destructor A function called when the thread exits, to free the value.
|
|
||||||
*
|
|
||||||
* \return 0 on success, -1 on error
|
|
||||||
*
|
|
||||||
* \sa SDL_TLSCreate()
|
|
||||||
* \sa SDL_TLSGet()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_thread_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,115 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_timer_h_
|
|
||||||
#define SDL_timer_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_timer.h
|
|
||||||
*
|
|
||||||
* Header for the SDL time management routines.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the number of milliseconds since the SDL library initialization.
|
|
||||||
*
|
|
||||||
* \note This value wraps if the program runs for more than ~49 days.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Compare SDL ticks values, and return true if A has passed B
|
|
||||||
*
|
|
||||||
* e.g. if you want to wait 100 ms, you could do this:
|
|
||||||
* Uint32 timeout = SDL_GetTicks() + 100;
|
|
||||||
* while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
|
|
||||||
* ... do work until timeout has elapsed
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the current value of the high resolution counter
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the count per second of the high resolution counter
|
|
||||||
*/
|
|
||||||
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Wait a specified number of milliseconds before returning.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function prototype for the timer callback function.
|
|
||||||
*
|
|
||||||
* The callback function is passed the current timer interval and returns
|
|
||||||
* the next timer interval. If the returned value is the same as the one
|
|
||||||
* passed in, the periodic alarm continues, otherwise a new alarm is
|
|
||||||
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
|
|
||||||
*/
|
|
||||||
typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Definition of the timer ID type.
|
|
||||||
*/
|
|
||||||
typedef int SDL_TimerID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Add a new timer to the pool of timers already running.
|
|
||||||
*
|
|
||||||
* \return A timer ID, or 0 when an error occurs.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
|
||||||
SDL_TimerCallback callback,
|
|
||||||
void *param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Remove a timer knowing its ID.
|
|
||||||
*
|
|
||||||
* \return A boolean value indicating success or failure.
|
|
||||||
*
|
|
||||||
* \warning It is not safe to remove a timer multiple times.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_timer_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_touch.h
|
|
||||||
*
|
|
||||||
* Include file for SDL touch event handling.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_touch_h_
|
|
||||||
#define SDL_touch_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
#include "SDL_error.h"
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef Sint64 SDL_TouchID;
|
|
||||||
typedef Sint64 SDL_FingerID;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SDL_TOUCH_DEVICE_INVALID = -1,
|
|
||||||
SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */
|
|
||||||
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
|
|
||||||
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */
|
|
||||||
} SDL_TouchDeviceType;
|
|
||||||
|
|
||||||
typedef struct SDL_Finger
|
|
||||||
{
|
|
||||||
SDL_FingerID id;
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float pressure;
|
|
||||||
} SDL_Finger;
|
|
||||||
|
|
||||||
/* Used as the device ID for mouse events simulated with touch input */
|
|
||||||
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
|
|
||||||
|
|
||||||
/* Used as the SDL_TouchID for touch events simulated with mouse input */
|
|
||||||
#define SDL_MOUSE_TOUCHID ((Sint64)-1)
|
|
||||||
|
|
||||||
|
|
||||||
/* Function prototypes */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the number of registered touch devices.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the touch ID with the given index, or 0 if the index is invalid.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the type of the given touch device.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the number of active fingers for a given touch device.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the finger object of the given touch, with the given index.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_touch_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_types.h
|
|
||||||
*
|
|
||||||
* \deprecated
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* DEPRECATED */
|
|
||||||
#include "SDL_stdinc.h"
|
|
@ -1,162 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_version.h
|
|
||||||
*
|
|
||||||
* This header defines the current SDL version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_version_h_
|
|
||||||
#define SDL_version_h_
|
|
||||||
|
|
||||||
#include "SDL_stdinc.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Information the version of SDL in use.
|
|
||||||
*
|
|
||||||
* Represents the library's version as three levels: major revision
|
|
||||||
* (increments with massive changes, additions, and enhancements),
|
|
||||||
* minor revision (increments with backwards-compatible changes to the
|
|
||||||
* major revision), and patchlevel (increments with fixes to the minor
|
|
||||||
* revision).
|
|
||||||
*
|
|
||||||
* \sa SDL_VERSION
|
|
||||||
* \sa SDL_GetVersion
|
|
||||||
*/
|
|
||||||
typedef struct SDL_version
|
|
||||||
{
|
|
||||||
Uint8 major; /**< major version */
|
|
||||||
Uint8 minor; /**< minor version */
|
|
||||||
Uint8 patch; /**< update version */
|
|
||||||
} SDL_version;
|
|
||||||
|
|
||||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
|
||||||
*/
|
|
||||||
#define SDL_MAJOR_VERSION 2
|
|
||||||
#define SDL_MINOR_VERSION 0
|
|
||||||
#define SDL_PATCHLEVEL 15
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Macro to determine SDL version program was compiled against.
|
|
||||||
*
|
|
||||||
* This macro fills in a SDL_version structure with the version of the
|
|
||||||
* library you compiled against. This is determined by what header the
|
|
||||||
* compiler uses. Note that if you dynamically linked the library, you might
|
|
||||||
* have a slightly newer or older version at runtime. That version can be
|
|
||||||
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
|
|
||||||
* is not a macro.
|
|
||||||
*
|
|
||||||
* \param x A pointer to a SDL_version struct to initialize.
|
|
||||||
*
|
|
||||||
* \sa SDL_version
|
|
||||||
* \sa SDL_GetVersion
|
|
||||||
*/
|
|
||||||
#define SDL_VERSION(x) \
|
|
||||||
{ \
|
|
||||||
(x)->major = SDL_MAJOR_VERSION; \
|
|
||||||
(x)->minor = SDL_MINOR_VERSION; \
|
|
||||||
(x)->patch = SDL_PATCHLEVEL; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This macro turns the version numbers into a numeric value:
|
|
||||||
* \verbatim
|
|
||||||
(1,2,3) -> (1203)
|
|
||||||
\endverbatim
|
|
||||||
*
|
|
||||||
* This assumes that there will never be more than 100 patchlevels.
|
|
||||||
*/
|
|
||||||
#define SDL_VERSIONNUM(X, Y, Z) \
|
|
||||||
((X)*1000 + (Y)*100 + (Z))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the version number macro for the current SDL version.
|
|
||||||
*/
|
|
||||||
#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))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the version of SDL that is linked against your program.
|
|
||||||
*
|
|
||||||
* If you are linking to SDL dynamically, then it is possible that the
|
|
||||||
* current version will be different than the version you compiled against.
|
|
||||||
* This function returns the current version, while SDL_VERSION() is a
|
|
||||||
* macro that tells you what version you compiled with.
|
|
||||||
*
|
|
||||||
* \code
|
|
||||||
* SDL_version compiled;
|
|
||||||
* SDL_version linked;
|
|
||||||
*
|
|
||||||
* SDL_VERSION(&compiled);
|
|
||||||
* SDL_GetVersion(&linked);
|
|
||||||
* printf("We compiled against SDL version %d.%d.%d ...\n",
|
|
||||||
* compiled.major, compiled.minor, compiled.patch);
|
|
||||||
* printf("But we linked against SDL version %d.%d.%d.\n",
|
|
||||||
* linked.major, linked.minor, linked.patch);
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* This function may be called safely at any time, even before SDL_Init().
|
|
||||||
*
|
|
||||||
* \sa SDL_VERSION
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the code revision of SDL that is linked against your program.
|
|
||||||
*
|
|
||||||
* Returns an arbitrary string (a hash value) uniquely identifying the
|
|
||||||
* exact revision of the SDL library in use, and is only useful in comparing
|
|
||||||
* against other revisions. It is NOT an incrementing number.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the revision number of SDL that is linked against your program.
|
|
||||||
*
|
|
||||||
* Returns a number uniquely identifying the exact revision of the SDL
|
|
||||||
* library in use. It is an incrementing number based on commits to
|
|
||||||
* hg.libsdl.org.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
|
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_version_h_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
File diff suppressed because it is too large
Load Diff
@ -1,276 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 2017, Mark Callow
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_vulkan.h
|
|
||||||
*
|
|
||||||
* Header file for functions to creating Vulkan surfaces on SDL windows.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_vulkan_h_
|
|
||||||
#define SDL_vulkan_h_
|
|
||||||
|
|
||||||
#include "SDL_video.h"
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
|
||||||
/* Set up for C function definitions, even when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Avoid including vulkan.h, don't define VkInstance if it's already included */
|
|
||||||
#ifdef VULKAN_H_
|
|
||||||
#define NO_SDL_VULKAN_TYPEDEFS
|
|
||||||
#endif
|
|
||||||
#ifndef NO_SDL_VULKAN_TYPEDEFS
|
|
||||||
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
|
|
||||||
|
|
||||||
#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
|
||||||
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
|
|
||||||
#else
|
|
||||||
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VK_DEFINE_HANDLE(VkInstance)
|
|
||||||
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
|
|
||||||
|
|
||||||
#endif /* !NO_SDL_VULKAN_TYPEDEFS */
|
|
||||||
|
|
||||||
typedef VkInstance SDL_vulkanInstance;
|
|
||||||
typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \name Vulkan support functions
|
|
||||||
*
|
|
||||||
* \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API
|
|
||||||
* is compatable with Tizen's implementation of Vulkan in SDL.
|
|
||||||
*/
|
|
||||||
/* @{ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Dynamically load a Vulkan loader library.
|
|
||||||
*
|
|
||||||
* \param [in] path The platform dependent Vulkan loader library name, or
|
|
||||||
* \c NULL.
|
|
||||||
*
|
|
||||||
* \return \c 0 on success, or \c -1 if the library couldn't be loaded.
|
|
||||||
*
|
|
||||||
* If \a path is NULL SDL will use the value of the environment variable
|
|
||||||
* \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan
|
|
||||||
* loader library.
|
|
||||||
*
|
|
||||||
* This should be called after initializing the video driver, but before
|
|
||||||
* creating any Vulkan windows. If no Vulkan loader library is loaded, the
|
|
||||||
* default library will be loaded upon creation of the first Vulkan window.
|
|
||||||
*
|
|
||||||
* \note It is fairly common for Vulkan applications to link with \a libvulkan
|
|
||||||
* instead of explicitly loading it at run time. This will work with
|
|
||||||
* SDL provided the application links to a dynamic library and both it
|
|
||||||
* and SDL use the same search path.
|
|
||||||
*
|
|
||||||
* \note If you specify a non-NULL \c path, an application should retrieve all
|
|
||||||
* of the Vulkan functions it uses from the dynamic library using
|
|
||||||
* \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee
|
|
||||||
* \c path points to the same vulkan loader library the application
|
|
||||||
* linked to.
|
|
||||||
*
|
|
||||||
* \note On Apple devices, if \a path is NULL, SDL will attempt to find
|
|
||||||
* the vkGetInstanceProcAddr address within all the mach-o images of
|
|
||||||
* the current process. This is because it is fairly common for Vulkan
|
|
||||||
* applications to link with libvulkan (and historically MoltenVK was
|
|
||||||
* provided as a static library). If it is not found then, on macOS, SDL
|
|
||||||
* will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib,
|
|
||||||
* followed by \c libvulkan.dylib, in that order.
|
|
||||||
* On iOS SDL will attempt to load \c libvulkan.dylib only. Applications
|
|
||||||
* using a dynamic framework or .dylib must ensure it is included in its
|
|
||||||
* application bundle.
|
|
||||||
*
|
|
||||||
* \note On non-Apple devices, application linking with a static libvulkan is
|
|
||||||
* not supported. Either do not link to the Vulkan loader or link to a
|
|
||||||
* dynamic library version.
|
|
||||||
*
|
|
||||||
* \note This function will fail if there are no working Vulkan drivers
|
|
||||||
* installed.
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_GetVkGetInstanceProcAddr()
|
|
||||||
* \sa SDL_Vulkan_UnloadLibrary()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the address of the \c vkGetInstanceProcAddr function.
|
|
||||||
*
|
|
||||||
* \note This should be called after either calling SDL_Vulkan_LoadLibrary
|
|
||||||
* or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Unload the Vulkan loader library previously loaded by
|
|
||||||
* \c SDL_Vulkan_LoadLibrary().
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_LoadLibrary()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the names of the Vulkan instance extensions needed to create
|
|
||||||
* a surface with \c SDL_Vulkan_CreateSurface().
|
|
||||||
*
|
|
||||||
* \param [in] \c NULL or window Window for which the required Vulkan instance
|
|
||||||
* extensions should be retrieved
|
|
||||||
* \param [in,out] pCount pointer to an \c unsigned related to the number of
|
|
||||||
* required Vulkan instance extensions
|
|
||||||
* \param [out] pNames \c NULL or a pointer to an array to be filled with the
|
|
||||||
* required Vulkan instance extensions
|
|
||||||
*
|
|
||||||
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
|
|
||||||
*
|
|
||||||
* If \a pNames is \c NULL, then the number of required Vulkan instance
|
|
||||||
* extensions is returned in pCount. Otherwise, \a pCount must point to a
|
|
||||||
* variable set to the number of elements in the \a pNames array, and on
|
|
||||||
* return the variable is overwritten with the number of names actually
|
|
||||||
* written to \a pNames. If \a pCount is less than the number of required
|
|
||||||
* extensions, at most \a pCount structures will be written. If \a pCount
|
|
||||||
* is smaller than the number of required extensions, \c SDL_FALSE will be
|
|
||||||
* returned instead of \c SDL_TRUE, to indicate that not all the required
|
|
||||||
* extensions were returned.
|
|
||||||
*
|
|
||||||
* \note If \c window is not NULL, it will be checked against its creation
|
|
||||||
* flags to ensure that the Vulkan flag is present. This parameter
|
|
||||||
* will be removed in a future major release.
|
|
||||||
*
|
|
||||||
* \note The returned list of extensions will contain \c VK_KHR_surface
|
|
||||||
* and zero or more platform specific extensions
|
|
||||||
*
|
|
||||||
* \note The extension names queried here must be enabled when calling
|
|
||||||
* VkCreateInstance, otherwise surface creation will fail.
|
|
||||||
*
|
|
||||||
* \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag
|
|
||||||
* or be \c NULL
|
|
||||||
*
|
|
||||||
* \code
|
|
||||||
* unsigned int count;
|
|
||||||
* // get count of required extensions
|
|
||||||
* if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL))
|
|
||||||
* handle_error();
|
|
||||||
*
|
|
||||||
* static const char *const additionalExtensions[] =
|
|
||||||
* {
|
|
||||||
* VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension
|
|
||||||
* };
|
|
||||||
* size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]);
|
|
||||||
* size_t extensionCount = count + additionalExtensionsCount;
|
|
||||||
* const char **names = malloc(sizeof(const char *) * extensionCount);
|
|
||||||
* if(!names)
|
|
||||||
* handle_error();
|
|
||||||
*
|
|
||||||
* // get names of required extensions
|
|
||||||
* if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names))
|
|
||||||
* handle_error();
|
|
||||||
*
|
|
||||||
* // copy additional extensions after required extensions
|
|
||||||
* for(size_t i = 0; i < additionalExtensionsCount; i++)
|
|
||||||
* names[i + count] = additionalExtensions[i];
|
|
||||||
*
|
|
||||||
* VkInstanceCreateInfo instanceCreateInfo = {};
|
|
||||||
* instanceCreateInfo.enabledExtensionCount = extensionCount;
|
|
||||||
* instanceCreateInfo.ppEnabledExtensionNames = names;
|
|
||||||
* // fill in rest of instanceCreateInfo
|
|
||||||
*
|
|
||||||
* VkInstance instance;
|
|
||||||
* // create the Vulkan instance
|
|
||||||
* VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance);
|
|
||||||
* free(names);
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_CreateSurface()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
|
|
||||||
unsigned int *pCount,
|
|
||||||
const char **pNames);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Create a Vulkan rendering surface for a window.
|
|
||||||
*
|
|
||||||
* \param [in] window SDL_Window to which to attach the rendering surface.
|
|
||||||
* \param [in] instance handle to the Vulkan instance to use.
|
|
||||||
* \param [out] surface pointer to a VkSurfaceKHR handle to receive the
|
|
||||||
* handle of the newly created surface.
|
|
||||||
*
|
|
||||||
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
|
|
||||||
*
|
|
||||||
* \code
|
|
||||||
* VkInstance instance;
|
|
||||||
* SDL_Window *window;
|
|
||||||
*
|
|
||||||
* // create instance and window
|
|
||||||
*
|
|
||||||
* // create the Vulkan surface
|
|
||||||
* VkSurfaceKHR surface;
|
|
||||||
* if(!SDL_Vulkan_CreateSurface(window, instance, &surface))
|
|
||||||
* handle_error();
|
|
||||||
* \endcode
|
|
||||||
*
|
|
||||||
* \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag.
|
|
||||||
*
|
|
||||||
* \note \a instance should have been created with the extensions returned
|
|
||||||
* by \c SDL_Vulkan_CreateSurface() enabled.
|
|
||||||
*
|
|
||||||
* \sa SDL_Vulkan_GetInstanceExtensions()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
|
|
||||||
VkInstance instance,
|
|
||||||
VkSurfaceKHR* surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Get the size of a window's underlying drawable in pixels (for use
|
|
||||||
* with setting viewport, scissor & etc).
|
|
||||||
*
|
|
||||||
* \param window SDL_Window from which the drawable size should be queried
|
|
||||||
* \param w Pointer to variable for storing the width in pixels,
|
|
||||||
* may be NULL
|
|
||||||
* \param h Pointer to variable for storing the height in pixels,
|
|
||||||
* may be NULL
|
|
||||||
*
|
|
||||||
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
|
||||||
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
|
|
||||||
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
|
|
||||||
* by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
|
|
||||||
*
|
|
||||||
* \note On macOS high-DPI support must be enabled for an application by
|
|
||||||
* setting NSHighResolutionCapable to true in its Info.plist.
|
|
||||||
*
|
|
||||||
* \sa SDL_GetWindowSize()
|
|
||||||
* \sa SDL_CreateWindow()
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
|
|
||||||
int *w, int *h);
|
|
||||||
|
|
||||||
/* @} *//* Vulkan support functions */
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#include "close_code.h"
|
|
||||||
|
|
||||||
#endif /* SDL_vulkan_h_ */
|
|
@ -1,166 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file begin_code.h
|
|
||||||
*
|
|
||||||
* This file sets things up for C dynamic library function definitions,
|
|
||||||
* static inlined functions, and structures aligned at 4-byte alignment.
|
|
||||||
* If you don't like ugly C preprocessor code, don't look at this file. :)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
#ifndef SDL_DEPRECATED
|
|
||||||
# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
|
|
||||||
# define SDL_DEPRECATED __attribute__((deprecated))
|
|
||||||
# else
|
|
||||||
# define SDL_DEPRECATED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_UNUSED
|
|
||||||
# ifdef __GNUC__
|
|
||||||
# define SDL_UNUSED __attribute__((unused))
|
|
||||||
# else
|
|
||||||
# define SDL_UNUSED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Some compilers use a special export keyword */
|
|
||||||
#ifndef DECLSPEC
|
|
||||||
# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__)
|
|
||||||
# ifdef DLL_EXPORT
|
|
||||||
# define DECLSPEC __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define DECLSPEC
|
|
||||||
# endif
|
|
||||||
# elif defined(__OS2__)
|
|
||||||
# ifdef BUILD_SDL
|
|
||||||
# define DECLSPEC __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define DECLSPEC
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# if defined(__GNUC__) && __GNUC__ >= 4
|
|
||||||
# define DECLSPEC __attribute__ ((visibility("default")))
|
|
||||||
# else
|
|
||||||
# define DECLSPEC
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* By default SDL uses the C calling convention */
|
|
||||||
#ifndef SDLCALL
|
|
||||||
#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
|
|
||||||
#define SDLCALL __cdecl
|
|
||||||
#elif defined(__OS2__) || defined(__EMX__)
|
|
||||||
#define SDLCALL _System
|
|
||||||
# if defined (__GNUC__) && !defined(_System)
|
|
||||||
# define _System /* for old EMX/GCC compat. */
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
#define SDLCALL
|
|
||||||
#endif
|
|
||||||
#endif /* SDLCALL */
|
|
||||||
|
|
||||||
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
|
|
||||||
#ifdef __SYMBIAN32__
|
|
||||||
#undef DECLSPEC
|
|
||||||
#define DECLSPEC
|
|
||||||
#endif /* __SYMBIAN32__ */
|
|
||||||
|
|
||||||
/* Force structure packing at 4 byte alignment.
|
|
||||||
This is necessary if the header is included in code which has structure
|
|
||||||
packing set to an alternate value, say for loading structures from disk.
|
|
||||||
The packing is reset to the previous value in close_code.h
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(disable: 4103)
|
|
||||||
#endif
|
|
||||||
#ifdef __clang__
|
|
||||||
#pragma clang diagnostic ignored "-Wpragma-pack"
|
|
||||||
#endif
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
#pragma nopackwarning
|
|
||||||
#endif
|
|
||||||
#ifdef _M_X64
|
|
||||||
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
|
|
||||||
#pragma pack(push,8)
|
|
||||||
#else
|
|
||||||
#pragma pack(push,4)
|
|
||||||
#endif
|
|
||||||
#endif /* Compiler needs structure packing set */
|
|
||||||
|
|
||||||
#ifndef SDL_INLINE
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define SDL_INLINE __inline__
|
|
||||||
#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
|
|
||||||
defined(__DMC__) || defined(__SC__) || \
|
|
||||||
defined(__WATCOMC__) || defined(__LCC__) || \
|
|
||||||
defined(__DECC) || defined(__CC_ARM)
|
|
||||||
#define SDL_INLINE __inline
|
|
||||||
#ifndef __inline__
|
|
||||||
#define __inline__ __inline
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define SDL_INLINE inline
|
|
||||||
#ifndef __inline__
|
|
||||||
#define __inline__ inline
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_INLINE not defined */
|
|
||||||
|
|
||||||
#ifndef SDL_FORCE_INLINE
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#define SDL_FORCE_INLINE __forceinline
|
|
||||||
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
|
||||||
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
|
|
||||||
#else
|
|
||||||
#define SDL_FORCE_INLINE static SDL_INLINE
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_FORCE_INLINE not defined */
|
|
||||||
|
|
||||||
#ifndef SDL_NORETURN
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define SDL_NORETURN __attribute__((noreturn))
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define SDL_NORETURN __declspec(noreturn)
|
|
||||||
#else
|
|
||||||
#define SDL_NORETURN
|
|
||||||
#endif
|
|
||||||
#endif /* SDL_NORETURN not defined */
|
|
||||||
|
|
||||||
/* Apparently this is needed by several Windows compilers */
|
|
||||||
#if !defined(__MACH__)
|
|
||||||
#ifndef NULL
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define NULL 0
|
|
||||||
#else
|
|
||||||
#define NULL ((void *)0)
|
|
||||||
#endif
|
|
||||||
#endif /* NULL */
|
|
||||||
#endif /* ! Mac OS X - breaks precompiled headers */
|
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file close_code.h
|
|
||||||
*
|
|
||||||
* This file reverses the effects of begin_code.h and should be included
|
|
||||||
* after you finish any function and structure declarations in your headers
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _begin_code_h
|
|
||||||
#error close_code.h included without matching begin_code.h
|
|
||||||
#endif
|
|
||||||
#undef _begin_code_h
|
|
||||||
|
|
||||||
/* Reset structure packing at previous byte alignment */
|
|
||||||
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
#pragma nopackwarning
|
|
||||||
#endif
|
|
||||||
#pragma pack(pop)
|
|
||||||
#endif /* Compiler needs structure packing set */
|
|
@ -1,50 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BuildMachineOSBuild</key>
|
|
||||||
<string>19H114</string>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>English</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>SDL2</string>
|
|
||||||
<key>CFBundleGetInfoString</key>
|
|
||||||
<string>http://www.libsdl.org</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.libsdl.SDL2</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>Simple DirectMedia Layer</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>2.0.15</string>
|
|
||||||
<key>CFBundleSignature</key>
|
|
||||||
<string>SDLX</string>
|
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
|
||||||
<array>
|
|
||||||
<string>MacOSX</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>2.0.15</string>
|
|
||||||
<key>DTCompiler</key>
|
|
||||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
||||||
<key>DTPlatformBuild</key>
|
|
||||||
<string>12C33</string>
|
|
||||||
<key>DTPlatformName</key>
|
|
||||||
<string>macosx</string>
|
|
||||||
<key>DTPlatformVersion</key>
|
|
||||||
<string>11.1</string>
|
|
||||||
<key>DTSDKBuild</key>
|
|
||||||
<string>20C63</string>
|
|
||||||
<key>DTSDKName</key>
|
|
||||||
<string>macosx11.1</string>
|
|
||||||
<key>DTXcode</key>
|
|
||||||
<string>1230</string>
|
|
||||||
<key>DTXcodeBuild</key>
|
|
||||||
<string>12C33</string>
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
|
||||||
<string>10.6</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,19 +0,0 @@
|
|||||||
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
@ -1,32 +0,0 @@
|
|||||||
The Simple DirectMedia Layer (SDL for short) is a cross-platform
|
|
||||||
library designed to make it easy to write multi-media software,
|
|
||||||
such as games and emulators.
|
|
||||||
|
|
||||||
The Simple DirectMedia Layer library source code is available from:
|
|
||||||
http://www.libsdl.org/
|
|
||||||
|
|
||||||
This library is distributed under the terms of the zlib license:
|
|
||||||
http://zlib.net/zlib_license.html
|
|
||||||
|
|
||||||
|
|
||||||
This packages contains the SDL framework for OS X.
|
|
||||||
Conforming with Apple guidelines, this framework
|
|
||||||
contains both the SDL runtime component and development header files.
|
|
||||||
|
|
||||||
|
|
||||||
To Install:
|
|
||||||
Copy the SDL2.framework to /Library/Frameworks
|
|
||||||
|
|
||||||
You may alternatively install it in <Your home directory>/Library/Frameworks
|
|
||||||
if your access privileges are not high enough.
|
|
||||||
|
|
||||||
|
|
||||||
Additional References:
|
|
||||||
|
|
||||||
- Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are
|
|
||||||
available at:
|
|
||||||
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips
|
|
||||||
Though these are OpenSceneGraph centric, the same exact concepts apply to
|
|
||||||
SDL, thus the videos are recommended for everybody getting started with
|
|
||||||
developing on Mac OS X. (You can skim over the PlugIns stuff since SDL
|
|
||||||
doesn't have any PlugIns to worry about.)
|
|
Binary file not shown.
Binary file not shown.
@ -1,890 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>files</key>
|
|
||||||
<dict>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<data>
|
|
||||||
akVFnWoaAhBOlpXfxiwztLRw3FY=
|
|
||||||
</data>
|
|
||||||
<key>Resources/License.txt</key>
|
|
||||||
<data>
|
|
||||||
s91T1Kwm3AMSbQtGQrmCGovO9hU=
|
|
||||||
</data>
|
|
||||||
<key>Resources/ReadMe.txt</key>
|
|
||||||
<data>
|
|
||||||
JbxWZUxpvG/D7Yb/DvLh6Aunla0=
|
|
||||||
</data>
|
|
||||||
<key>Resources/default.metallib</key>
|
|
||||||
<data>
|
|
||||||
4BwgaOSOLU3sjhjYkfLYp8Bg0y0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>files2</key>
|
|
||||||
<dict>
|
|
||||||
<key>Frameworks/hidapi.framework</key>
|
|
||||||
<dict>
|
|
||||||
<key>cdhash</key>
|
|
||||||
<data>
|
|
||||||
PhgHozinkAzD8nahJaBZ1/oJU2g=
|
|
||||||
</data>
|
|
||||||
<key>requirement</key>
|
|
||||||
<string>identifier "org.libsdl.hidapi" and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "45U78722YL"</string>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
0JBFoOt5FIaoxVwOK/5/51nHtFg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
lnY0/OiW5YWD1SAjw8I/c40wWnHOjKVMm+dalXFyHRA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_assert.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
1DPiXYesyNHEpDx6O6DAQtDDVpM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
RivNhNmxSfSv5F3G6U6zXGpL03d7McfcUPOziuiwl9o=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_atomic.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Jheq/oFNjtM/CVJfmJRMMjXpEPo=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
cJVgTyHA8dzobXT5VaJgNy3DBvQQa3PdusBQuPxYTro=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_audio.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
NCLh53AVUxy8DVwibS6JOpbec7c=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
NI5GINTjWMqzmA8s2Xshibkk8N+QZ01LkrYcxsCyMs0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_bits.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
fpmofY0dot0lXD8r+rL6E0dOmRc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
W/Gd1atZLiHaDYHqs6TN5Pj/ThW2/MymiX+cEbtKNWk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_blendmode.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
q7EnpKCkIHYlgYhy408UJgzmM2U=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
1n0iR8yZnKzCkuNEU52LEv7dfk27WL0k+VH9VqJL4w0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_clipboard.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
60U8QvdNvC4LtNSc7iFwCWH+9os=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
C2lli6q7cU62GWskVMiK33J1WxjlMwaCfNukIebY8UA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_config.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
aytRh8+xvpYYsAdb7F7yLmg0kis=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
dzGHhY4lHdr+Vh/w9XIV8P9SQjSQnoL/dYvOHKmBZfs=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_config_macosx.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
JEidzq0po54FZOh7krZbUI60t1s=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
LuggXYC8c40AAtgPMrdFUYvc0dHbPFRNPpME5uuJ6tQ=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_copying.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
yrYOm/q+6NqPxYH5MLEonLnwIxY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Ziie3rOwX+j6M2NBdENO350Ubg9tI0Z6wHxLmkPA5eM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_cpuinfo.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
HeR0lxK4+WPAiTGHNk5IQ8nXYJw=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
BiqK+8M8UM20+3787B+3+BDhy4awblONzluqHMTn3e8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_endian.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
hkyJa4gVy1aMdCZOAPK6cT7xNAE=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
SgvWbxqzwH7UcmOtDI3qTOgCKEIkSxWs5QY0k4RBBRs=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_error.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
hZgg4KnUfiGBhHos+AWdv7CUZ5Y=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
mX6UorvOrvuQuXs/9jfjdN9YbwAg3qW5673flKUXj6Y=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_events.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
wda1DNLVHzNX8cKEbQgklUKw6tQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
E3yhmpNWbGS80jscJvQeU06b9CDzVH0ImLDS/xXRYZI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_filesystem.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
4IwdOm+5TQBEyd4flcIm3ZHqPHo=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
bwA7CS8HsGN2trGn5aXSU+A/X0PG/bVmnhT/M1pNXos=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_gamecontroller.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
v3dLCsjfEYMTkSJk1inStLgIdgo=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
83y/RY7fkiAfDHNHxWcb9lWurIzRmvq/hNk3vwzAAoM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_gesture.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Yoid0ard6LeUCjfyJZT3dKXQ9Z4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
oNgmPNACpXoTCqejZscd4u7EhMb68uvur4wJRtnk6mg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_haptic.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
uBRoWqexPy9bznz66e6U7T3BK1s=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
oKMwzskYKVG3P5dBghdbFoYPUjBZVTV/J6bATIDA3Eo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_hints.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Y7VSqYxvagfJ/LcXdw49dNy0jdQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
yBrr96jYaOpoX1i9R5BOdOrCU9ZX0YejzhvJY8tjKH8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_joystick.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
2mgG3DEdJFAwBdBaNb2QSxJ+1i4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
YfeQgKW8YtcCIM9FHE1rgukr+Oz8eLilqDs0w3eLlvM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_keyboard.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
a+BS1NPV6C1hI2XkNqAO8pkCK7o=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
YrbmqtGNtLlVVZIrI/epYgszbxB7r1qN5NYdXiD1ra0=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_keycode.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
08TpEC2wER6rhjZeWOzHJGHzrw0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
UgVGYelUtuuXFT8Wc0kXOsP0bbvScYswlaRbDXLeYPE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_loadso.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
lmuG8gz25J7p68260fMG2595cLU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
6VYyLzl2OG544HKGl9hLQzppensYqU8iGa+iiWz4clo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_locale.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
QuJLqhXH9adugjzs/kCVQj5kQvY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
3SpJ0NKzd/WdpKKQ9q8a22lCkRz+HvwhO4XIyaYV/uU=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_log.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ObKXKSy4RNu3whdteSlhrthqB8c=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
p2LpsNReIb8qom6R5Uw0tBRhr3B8OzYKDzdb8KwDDBI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_main.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
wvuZmRT4/USCZsYFKtcgUAudv4s=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
bTez5TFSQkp4e/yT+M96IxPwhzcogMVPCyVgQt9LoNE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_messagebox.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
OEd+/9vUgeFdaJjzMslzOTK6DQ0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Wq/kniGzwLXivUOM7IOAHL/hJ37K0S9JfaRLrQmy+xA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_metal.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
4+NCJcrSGUIIHqUbrDRq2r/fw7A=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
7qj9sDitEOiA+Bp6TnPJrWn7FUbNpNHKIU9aq4QkkLk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_misc.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
hToyxNSFjRJl5e1+IeQDf/YkWtI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
dMqYy+hdWSxDHSkASlRw0gQhSP2t+pMMBIgrr8+8UUI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_mouse.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
evGnfshpNncsADHGLKiAiMGeNBg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
zCbmSJzIdZrNzOIhWfPWuxAqaiOpMLC8yAh6w4IcubM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_mutex.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
de5PQM9snasMeBkpPoQAWuqX9Gc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
bRjRo28JwXr7dD/j7iTwXPSN1zvnnQs1oyKDAApABN8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_name.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
0HvLxBYQQtk7wc6fhKV8GKak0bI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
SEGMU9JT6Mb8M9/0YUh9mWmrB5qKLDXkdFVfUJEsr8k=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengl.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
uwnVFA4drG7Fk24RWefE3aSgdBU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
1n0BVfF+6lgJ/hrvp6R1e46STzWzx5tgbCA22DspNoY=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengl_glext.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
R1nHUIy7DpXf2BZyzO+VT33j3bE=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
RwZcYEr740srGsvbe4jQhHYTTNwp+e05VGDjqyNkYr4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
1+h2kdTJu34MsWwgpjTvVYoubz8=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
MAu5WuH9K7Jj+zBksjLrT+tROjsnUobxsNI1yE/SeW4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
8Y6DWw9z+26AHmj6uUgz9LpyUGw=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
/sd7hb3YEJNdm6wAFV2Wpo0aEpI2w/qoRS2gEaM10qo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_gl2.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
g4y04zPFy1H/qujSNGRd0vB7ClQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
9GAwK0cg8YPrZHWVqMGpyVwKFz3Ay9VHiyz70jzWltA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_gl2ext.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
bTlnL+42kbi+n/gH//X2p0pqeuM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
5404JOHXH4pGO60gR/uLhz9zW6fKy9jvdMw5i1WTcpo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_gl2platform.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ByFMXJFtjcRglS/e0+DujyjC3dM=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
wlKRTsmTMrnniYqSvQklJfb9VF07J0MDpqzYOcfiDDY=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_opengles2_khrplatform.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
NLpJq9uBqjOpWhXISOQHPnTp/XQ=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
djHeDyzmR0e/2JNIbqpBqgi56MXlxlAbgcBFxuvwSyo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_pixels.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
nHf9SirykPlkF4Qq2IocqHMwchk=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
nJR8fSzYd5xElrhq0V20EGq662rv2/XVXSnrlapXZMw=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_platform.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
P3ywFdJcJ3sqewLBcOqYtyYZ5zs=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
vMRy/5/ntZ2fkkoY4pt321wFYTgSDwdTsgyWWt+xcXM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_power.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
3K+7bfCens8XmuOSFfXHy+/lyhc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
9ICCDELH2Ed9rlpJZeoB2rEu7yTN4dq09fR/st7Rzaw=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_quit.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
XQQQtH9jbx8abQdutRGJP0cguHI=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
MXrcuLRy7H8TBhWnJxqy7PgnxfGuP+O+IAnsNJYUeYI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_rect.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
LpnQn0xkbBfCpvYN0w1W3N0wgOY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
jGCMSSOpGaDki4qoOXQDucdALmP8RzMtBMzEUBeL4Tg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_render.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
pL0tJ4b3SyxKSLPbQL7SKASDzyo=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
cV02MkytdxcxkwEW20dpU6qlEh6br/XBFSu8qpIkdsI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_revision.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
ixjPDg2DQUEDn7ID2l4wMHDUvDk=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
LUUZKxelLmuZXjHwFWFSYH8HA96Px1JVmtuv79n+gYY=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_rwops.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
gPdg9CLyA6caQw0TRjN7hOR3P9c=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
JbzZdvQjp0GK65Uxt7M8FKJFA3r/HckNBlbfcDVO9Vg=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_scancode.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
BR9njO+36nUhbXVDGT/wIiSmyoE=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
YkvjTqe1cQcJ3CA4NSaHNNQnowdi0+AtS6EITFlVu5w=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_sensor.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
SOEs8j1MM6xz7BLPYEc02fjjbbE=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
cxPTev3K9ctekkcBFQs3Ti07ds7VSqyqjRm8a/Uw+Eo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_shape.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
wbVSAZU9CVx/r6Tdo6DzPEidSQU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
mXI9OgcZGGUQNN+C6yzO0ksGOJ8tkhpInWczWB6lEkU=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_stdinc.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
8BND4MMxaq5H6YuCjeFCnrmcn+k=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
tRQ15156KgHNyphV7ZJcgOUPgdCyJO0w3JIE/ulShuw=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_surface.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
d/GRmZzBQtmZnBMoZQAXm7B6ha4=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
EXE4VuWBAydUUGgmwGnVMgTzsnjAsz989EbAL6b4Dnw=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_system.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Z47HJw4GQ2OarNyHTgNpRoX8Rog=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
djnyElj4XgGuzv0Cb7s7m6xAdQoyMZvaCr97rlHzZmE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_syswm.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
SRx/vJZF0gB/BMNwqk99jiFOzv0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
/1aFRHr+7TVJ57vEMAOl6EtytMgiUb0ZN50zJD11gZo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_thread.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
D5G4LUX4q1wJmpTTPiTuBrE6lMA=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
xLwsI0AKjHEU066Yc3e56p76+Btd1w2ZukC836MkmXw=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_timer.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
fQAqPyLQoocbu4e5y1LS26F2S7s=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
uO7Lc7V3+1qhX7/uspiGmc1bTPNMJ7DLoG9Tr0zGxmo=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_touch.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
yZ05VZ0uIi8UVFmogN2ZJ9PIQFw=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
XLzZs80ks1GElyhScoqhdOhhwsKo+gs1Br99B5jPZlA=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_types.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
1kwNWT8AEGlRutTtjdXBKXmu3W8=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
5gon+jmSul14lqvd6E1FqnGF5XqtThux2OZbB4tGcY8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_version.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
HDSpjbZplrIuvX2i6+4onoPlEOw=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
bj2oig64kpZLOXbtKOGNX1E9Nc6TgUjGcmT5vZSVSmE=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_video.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
XaU9UXABuYIUptiZfOk+phppMTc=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
KVerRbWCWaJETVDMBrl642aDRpTWAF9k9ys/DlSOUU8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/SDL_vulkan.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
Hd6qVU8OT67v88A0rMVhZpceGQg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
rD48rqfdCs8UEGgpQilcPwZo50sH0NXKds0uYKXnkc8=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/begin_code.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
3xUwaBaGVisXlRH2l1msEFlxCiY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
ZJ6BXE9Mwhy8qa+RH5hPSGI0uS1wFefHYPemTQalX/s=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Headers/close_code.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
oc7GPSdH45BO+P4WzoKrFjAseXg=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
xKU9Y8NHTpwIk0CudiA5juPU1zAN28e5MEKNO8Kuers=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
akVFnWoaAhBOlpXfxiwztLRw3FY=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
x8nq97SfkUJzNl+76CJD2HYW8e0zq0aGw7/b2AaY8jU=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/License.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
s91T1Kwm3AMSbQtGQrmCGovO9hU=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Y1CgmkCNqrRO4L6QBkaOL0A3reSeBWGRk676hb4lOtI=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/ReadMe.txt</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
JbxWZUxpvG/D7Yb/DvLh6Aunla0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
pOpMHiFjj3pIWQqZ5KDvYNyp0twU7vCZmLwAQJLVkT4=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/default.metallib</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
4BwgaOSOLU3sjhjYkfLYp8Bg0y0=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
bs9aWIr93QMzHkPmqydkE8toDd+BGAITxZX+AC17FSk=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>rules</key>
|
|
||||||
<dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version.plist$</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>rules2</key>
|
|
||||||
<dict>
|
|
||||||
<key>.*\.dSYM($|/)</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>11</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(.*/)?\.DS_Store$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>2000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Info\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^PkgInfo$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^[^/]+$</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^embedded\.provisionprofile$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1 +0,0 @@
|
|||||||
A
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/Headers
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/Resources
|
|
@ -1 +0,0 @@
|
|||||||
Versions/Current/SDL2_ttf
|
|
@ -1,294 +0,0 @@
|
|||||||
/*
|
|
||||||
SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts
|
|
||||||
Copyright (C) 2001-2019 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* This library is a wrapper around the excellent FreeType 2.0 library,
|
|
||||||
available at:
|
|
||||||
http://www.freetype.org/
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Note: In many places, SDL_ttf will say "glyph" when it means "code point."
|
|
||||||
Unicode is hard, we learn as we go, and we apologize for adding to the
|
|
||||||
confusion. */
|
|
||||||
|
|
||||||
#ifndef SDL_TTF_H_
|
|
||||||
#define SDL_TTF_H_
|
|
||||||
|
|
||||||
#include <SDL.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_TTF_MAJOR_VERSION 2
|
|
||||||
#define SDL_TTF_MINOR_VERSION 0
|
|
||||||
#define SDL_TTF_PATCHLEVEL 15
|
|
||||||
|
|
||||||
/* This macro can be used to fill a version structure with the compile-time
|
|
||||||
* version of the SDL_ttf library.
|
|
||||||
*/
|
|
||||||
#define SDL_TTF_VERSION(X) \
|
|
||||||
{ \
|
|
||||||
(X)->major = SDL_TTF_MAJOR_VERSION; \
|
|
||||||
(X)->minor = SDL_TTF_MINOR_VERSION; \
|
|
||||||
(X)->patch = SDL_TTF_PATCHLEVEL; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Backwards compatibility */
|
|
||||||
#define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION
|
|
||||||
#define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION
|
|
||||||
#define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL
|
|
||||||
#define TTF_VERSION(X) SDL_TTF_VERSION(X)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the version number macro for the current SDL_ttf version.
|
|
||||||
*/
|
|
||||||
#define SDL_TTF_COMPILEDVERSION \
|
|
||||||
SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This macro will evaluate to true if compiled with SDL_ttf at least X.Y.Z.
|
|
||||||
*/
|
|
||||||
#define SDL_TTF_VERSION_ATLEAST(X, Y, Z) \
|
|
||||||
(SDL_TTF_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
|
||||||
|
|
||||||
/* Make sure this is defined (only available in newer SDL versions) */
|
|
||||||
#ifndef SDL_DEPRECATED
|
|
||||||
#define SDL_DEPRECATED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This function gets the version of the dynamically linked SDL_ttf library.
|
|
||||||
it should NOT be used to fill a version structure, instead you should
|
|
||||||
use the SDL_TTF_VERSION() macro.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void);
|
|
||||||
|
|
||||||
/* ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark) */
|
|
||||||
#define UNICODE_BOM_NATIVE 0xFEFF
|
|
||||||
#define UNICODE_BOM_SWAPPED 0xFFFE
|
|
||||||
|
|
||||||
/* This function tells the library whether UNICODE text is generally
|
|
||||||
byteswapped. A UNICODE BOM character in a string will override
|
|
||||||
this setting for the remainder of that string.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC void SDLCALL TTF_ByteSwappedUNICODE(int swapped);
|
|
||||||
|
|
||||||
/* 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 SDLCALL TTF_Init(void);
|
|
||||||
|
|
||||||
/* Open a font file and create a font of the specified point size.
|
|
||||||
* Some .fon fonts will have several sizes embedded in the file, so the
|
|
||||||
* point size becomes the index of choosing which size. If the value
|
|
||||||
* is too high, the last indexed size will be the default. */
|
|
||||||
extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFont(const char *file, int ptsize);
|
|
||||||
extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndex(const char *file, int ptsize, long index);
|
|
||||||
extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize);
|
|
||||||
extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, long index);
|
|
||||||
|
|
||||||
/* Set and retrieve the font style */
|
|
||||||
#define TTF_STYLE_NORMAL 0x00
|
|
||||||
#define TTF_STYLE_BOLD 0x01
|
|
||||||
#define TTF_STYLE_ITALIC 0x02
|
|
||||||
#define TTF_STYLE_UNDERLINE 0x04
|
|
||||||
#define TTF_STYLE_STRIKETHROUGH 0x08
|
|
||||||
extern DECLSPEC int SDLCALL TTF_GetFontStyle(const TTF_Font *font);
|
|
||||||
extern DECLSPEC void SDLCALL TTF_SetFontStyle(TTF_Font *font, int style);
|
|
||||||
extern DECLSPEC int SDLCALL TTF_GetFontOutline(const TTF_Font *font);
|
|
||||||
extern DECLSPEC void SDLCALL TTF_SetFontOutline(TTF_Font *font, int outline);
|
|
||||||
|
|
||||||
/* Set and retrieve FreeType hinter settings */
|
|
||||||
#define TTF_HINTING_NORMAL 0
|
|
||||||
#define TTF_HINTING_LIGHT 1
|
|
||||||
#define TTF_HINTING_MONO 2
|
|
||||||
#define TTF_HINTING_NONE 3
|
|
||||||
extern DECLSPEC int SDLCALL TTF_GetFontHinting(const TTF_Font *font);
|
|
||||||
extern DECLSPEC void SDLCALL TTF_SetFontHinting(TTF_Font *font, int hinting);
|
|
||||||
|
|
||||||
/* Get the total height of the font - usually equal to point size */
|
|
||||||
extern DECLSPEC int SDLCALL TTF_FontHeight(const 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 SDLCALL TTF_FontAscent(const 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 SDLCALL TTF_FontDescent(const TTF_Font *font);
|
|
||||||
|
|
||||||
/* Get the recommended spacing between lines of text for this font */
|
|
||||||
extern DECLSPEC int SDLCALL TTF_FontLineSkip(const TTF_Font *font);
|
|
||||||
|
|
||||||
/* Get/Set whether or not kerning is allowed for this font */
|
|
||||||
extern DECLSPEC int SDLCALL TTF_GetFontKerning(const TTF_Font *font);
|
|
||||||
extern DECLSPEC void SDLCALL TTF_SetFontKerning(TTF_Font *font, int allowed);
|
|
||||||
|
|
||||||
/* Get the number of faces of the font */
|
|
||||||
extern DECLSPEC long SDLCALL TTF_FontFaces(const TTF_Font *font);
|
|
||||||
|
|
||||||
/* Get the font face attributes, if any */
|
|
||||||
extern DECLSPEC int SDLCALL TTF_FontFaceIsFixedWidth(const TTF_Font *font);
|
|
||||||
extern DECLSPEC char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font);
|
|
||||||
extern DECLSPEC char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font);
|
|
||||||
|
|
||||||
/* Check wether a glyph is provided by the font or not */
|
|
||||||
extern DECLSPEC int SDLCALL TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch);
|
|
||||||
|
|
||||||
/* Get the metrics (dimensions) of a glyph
|
|
||||||
To understand what these metrics mean, here is a useful link:
|
|
||||||
http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html
|
|
||||||
*/
|
|
||||||
extern DECLSPEC int SDLCALL 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 SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h);
|
|
||||||
extern DECLSPEC int SDLCALL TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h);
|
|
||||||
extern DECLSPEC int SDLCALL 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 * SDLCALL TTF_RenderText_Solid(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL 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 * SDLCALL 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 * SDLCALL TTF_RenderText_Shaded(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg, SDL_Color bg);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg, SDL_Color bg);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL 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 * SDLCALL 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 * SDLCALL TTF_RenderText_Blended(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended(TTF_Font *font,
|
|
||||||
const Uint16 *text, SDL_Color fg);
|
|
||||||
|
|
||||||
|
|
||||||
/* 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.
|
|
||||||
Text is wrapped to multiple lines on line endings and on word boundaries
|
|
||||||
if it extends beyond wrapLength in pixels.
|
|
||||||
This function returns the new surface, or NULL if there was an error.
|
|
||||||
*/
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended_Wrapped(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg, Uint32 wrapLength);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended_Wrapped(TTF_Font *font,
|
|
||||||
const char *text, SDL_Color fg, Uint32 wrapLength);
|
|
||||||
extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended_Wrapped(TTF_Font *font,
|
|
||||||
const Uint16 *text, SDL_Color fg, Uint32 wrapLength);
|
|
||||||
|
|
||||||
/* 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 * SDLCALL 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 SDLCALL TTF_CloseFont(TTF_Font *font);
|
|
||||||
|
|
||||||
/* De-initialize the TTF engine */
|
|
||||||
extern DECLSPEC void SDLCALL TTF_Quit(void);
|
|
||||||
|
|
||||||
/* Check if the TTF engine is initialized */
|
|
||||||
extern DECLSPEC int SDLCALL TTF_WasInit(void);
|
|
||||||
|
|
||||||
/* Get the kerning size of two glyphs indices */
|
|
||||||
/* DEPRECATED: this function requires FreeType font indexes, not glyphs,
|
|
||||||
by accident, which we don't expose through this API, so it could give
|
|
||||||
wildly incorrect results, especially with non-ASCII values.
|
|
||||||
Going forward, please use TTF_GetFontKerningSizeGlyphs() instead, which
|
|
||||||
does what you probably expected this function to do. */
|
|
||||||
extern DECLSPEC int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int index) SDL_DEPRECATED;
|
|
||||||
|
|
||||||
/* Get the kerning size of two glyphs */
|
|
||||||
extern DECLSPEC int TTF_GetFontKerningSizeGlyphs(TTF_Font *font, Uint16 previous_ch, Uint16 ch);
|
|
||||||
|
|
||||||
/* 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 /* SDL_TTF_H_ */
|
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,46 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>BuildMachineOSBuild</key>
|
|
||||||
<string>20C69</string>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>English</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>SDL2_ttf</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>org.libsdl.SDL2-ttf</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>SDL2_ttf</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>FMWK</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>2.0.15</string>
|
|
||||||
<key>CFBundleSupportedPlatforms</key>
|
|
||||||
<array>
|
|
||||||
<string>MacOSX</string>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>2.0.15</string>
|
|
||||||
<key>DTCompiler</key>
|
|
||||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
||||||
<key>DTPlatformBuild</key>
|
|
||||||
<string>12C33</string>
|
|
||||||
<key>DTPlatformName</key>
|
|
||||||
<string>macosx</string>
|
|
||||||
<key>DTPlatformVersion</key>
|
|
||||||
<string>11.1</string>
|
|
||||||
<key>DTSDKBuild</key>
|
|
||||||
<string>20C63</string>
|
|
||||||
<key>DTSDKName</key>
|
|
||||||
<string>macosx11.1</string>
|
|
||||||
<key>DTXcode</key>
|
|
||||||
<string>1230</string>
|
|
||||||
<key>DTXcodeBuild</key>
|
|
||||||
<string>12C33</string>
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
|
||||||
<string>10.6</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Binary file not shown.
@ -1,143 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>files</key>
|
|
||||||
<dict>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<data>
|
|
||||||
k7Av9aS5Xq5V94y0oXhg1dJQKis=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>files2</key>
|
|
||||||
<dict>
|
|
||||||
<key>Headers/SDL_ttf.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
cDVQTTFmmTw5dpLXeVXP6xykLOs=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
nSF57Fh6OtJdIL7HmMPMYZm07ewBZn00X0uk0mXaKzM=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>Resources/Info.plist</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
k7Av9aS5Xq5V94y0oXhg1dJQKis=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
Xk1zZ6iF+O+FU096EIOJJrrzKhHeYO/T41XXITvszBw=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>rules</key>
|
|
||||||
<dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version.plist$</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>rules2</key>
|
|
||||||
<dict>
|
|
||||||
<key>.*\.dSYM($|/)</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>11</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(.*/)?\.DS_Store$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>2000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*</key>
|
|
||||||
<true/>
|
|
||||||
<key>^Info\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^PkgInfo$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Resources/Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^[^/]+$</key>
|
|
||||||
<dict>
|
|
||||||
<key>nested</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>10</real>
|
|
||||||
</dict>
|
|
||||||
<key>^embedded\.provisionprofile$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1 +0,0 @@
|
|||||||
A
|
|
@ -1,26 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#if defined(DISCORD_DYNAMIC_LIB)
|
|
||||||
#if defined(_WIN32)
|
|
||||||
#if defined(DISCORD_BUILDING_SDK)
|
|
||||||
#define DISCORD_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
#define DISCORD_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define DISCORD_EXPORT __attribute__((visibility("default")))
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define DISCORD_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DISCORD_EXPORT void Discord_Register(const char* applicationId, const char* command);
|
|
||||||
DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, const char* steamId);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1,90 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#if defined(DISCORD_DYNAMIC_LIB)
|
|
||||||
# if defined(_WIN32)
|
|
||||||
# if defined(DISCORD_BUILDING_SDK)
|
|
||||||
# define DISCORD_EXPORT __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define DISCORD_EXPORT __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define DISCORD_EXPORT __attribute__((visibility("default")))
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define DISCORD_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct DiscordRichPresence {
|
|
||||||
const char* state; /* max 128 bytes */
|
|
||||||
const char* details; /* max 128 bytes */
|
|
||||||
int64_t startTimestamp;
|
|
||||||
int64_t endTimestamp;
|
|
||||||
const char* largeImageKey; /* max 32 bytes */
|
|
||||||
const char* largeImageText; /* max 128 bytes */
|
|
||||||
const char* smallImageKey; /* max 32 bytes */
|
|
||||||
const char* smallImageText; /* max 128 bytes */
|
|
||||||
const char* partyId; /* max 128 bytes */
|
|
||||||
int partySize;
|
|
||||||
int partyMax;
|
|
||||||
int partyPrivacy;
|
|
||||||
const char* matchSecret; /* max 128 bytes */
|
|
||||||
const char* joinSecret; /* max 128 bytes */
|
|
||||||
const char* spectateSecret; /* max 128 bytes */
|
|
||||||
int8_t instance;
|
|
||||||
} DiscordRichPresence;
|
|
||||||
|
|
||||||
typedef struct DiscordUser {
|
|
||||||
const char* userId;
|
|
||||||
const char* username;
|
|
||||||
const char* discriminator;
|
|
||||||
const char* avatar;
|
|
||||||
} DiscordUser;
|
|
||||||
|
|
||||||
typedef struct DiscordEventHandlers {
|
|
||||||
void (*ready)(const DiscordUser* request);
|
|
||||||
void (*disconnected)(int errorCode, const char* message);
|
|
||||||
void (*errored)(int errorCode, const char* message);
|
|
||||||
void (*joinGame)(const char* joinSecret);
|
|
||||||
void (*spectateGame)(const char* spectateSecret);
|
|
||||||
void (*joinRequest)(const DiscordUser* request);
|
|
||||||
} DiscordEventHandlers;
|
|
||||||
|
|
||||||
#define DISCORD_REPLY_NO 0
|
|
||||||
#define DISCORD_REPLY_YES 1
|
|
||||||
#define DISCORD_REPLY_IGNORE 2
|
|
||||||
#define DISCORD_PARTY_PRIVATE 0
|
|
||||||
#define DISCORD_PARTY_PUBLIC 1
|
|
||||||
|
|
||||||
DISCORD_EXPORT void Discord_Initialize(const char* applicationId,
|
|
||||||
DiscordEventHandlers* handlers,
|
|
||||||
int autoRegister,
|
|
||||||
const char* optionalSteamId);
|
|
||||||
DISCORD_EXPORT void Discord_Shutdown(void);
|
|
||||||
|
|
||||||
/* checks for incoming messages, dispatches callbacks */
|
|
||||||
DISCORD_EXPORT void Discord_RunCallbacks(void);
|
|
||||||
|
|
||||||
/* If you disable the lib starting its own io thread, you'll need to call this from your own */
|
|
||||||
#ifdef DISCORD_DISABLE_IO_THREAD
|
|
||||||
DISCORD_EXPORT void Discord_UpdateConnection(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence);
|
|
||||||
DISCORD_EXPORT void Discord_ClearPresence(void);
|
|
||||||
|
|
||||||
DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ int reply);
|
|
||||||
|
|
||||||
DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* handlers);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* AC-3 parser prototypes
|
|
||||||
* Copyright (c) 2003 Fabrice Bellard
|
|
||||||
* Copyright (c) 2003 Michael Niedermayer
|
|
||||||
*
|
|
||||||
* This file is part of FFmpeg.
|
|
||||||
*
|
|
||||||
* FFmpeg 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.
|
|
||||||
*
|
|
||||||
* FFmpeg 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 FFmpeg; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AVCODEC_AC3_PARSER_H
|
|
||||||
#define AVCODEC_AC3_PARSER_H
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extract the bitstream ID and the frame size from AC-3 data.
|
|
||||||
*/
|
|
||||||
int av_ac3_parse_header(const uint8_t *buf, size_t size,
|
|
||||||
uint8_t *bitstream_id, uint16_t *frame_size);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* AVCODEC_AC3_PARSER_H */
|
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of FFmpeg.
|
|
||||||
*
|
|
||||||
* FFmpeg 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.
|
|
||||||
*
|
|
||||||
* FFmpeg 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 FFmpeg; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AVCODEC_ADTS_PARSER_H
|
|
||||||
#define AVCODEC_ADTS_PARSER_H
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#define AV_AAC_ADTS_HEADER_SIZE 7
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extract the number of samples and frames from AAC data.
|
|
||||||
* @param[in] buf pointer to AAC data buffer
|
|
||||||
* @param[out] samples Pointer to where number of samples is written
|
|
||||||
* @param[out] frames Pointer to where number of frames is written
|
|
||||||
* @return Returns 0 on success, error code on failure.
|
|
||||||
*/
|
|
||||||
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
|
|
||||||
uint8_t *frames);
|
|
||||||
|
|
||||||
#endif /* AVCODEC_ADTS_PARSER_H */
|
|
File diff suppressed because it is too large
Load Diff
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of FFmpeg.
|
|
||||||
*
|
|
||||||
* FFmpeg 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.
|
|
||||||
*
|
|
||||||
* FFmpeg 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 FFmpeg; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AVCODEC_AVDCT_H
|
|
||||||
#define AVCODEC_AVDCT_H
|
|
||||||
|
|
||||||
#include "libavutil/opt.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* AVDCT context.
|
|
||||||
* @note function pointers can be NULL if the specific features have been
|
|
||||||
* disabled at build time.
|
|
||||||
*/
|
|
||||||
typedef struct AVDCT {
|
|
||||||
const AVClass *av_class;
|
|
||||||
|
|
||||||
void (*idct)(int16_t *block /* align 16 */);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IDCT input permutation.
|
|
||||||
* Several optimized IDCTs need a permutated input (relative to the
|
|
||||||
* normal order of the reference IDCT).
|
|
||||||
* This permutation must be performed before the idct_put/add.
|
|
||||||
* Note, normally this can be merged with the zigzag/alternate scan<br>
|
|
||||||
* An example to avoid confusion:
|
|
||||||
* - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
|
|
||||||
* - (x -> reference DCT -> reference IDCT -> x)
|
|
||||||
* - (x -> reference DCT -> simple_mmx_perm = idct_permutation
|
|
||||||
* -> simple_idct_mmx -> x)
|
|
||||||
* - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
|
|
||||||
* -> simple_idct_mmx -> ...)
|
|
||||||
*/
|
|
||||||
uint8_t idct_permutation[64];
|
|
||||||
|
|
||||||
void (*fdct)(int16_t *block /* align 16 */);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DCT algorithm.
|
|
||||||
* must use AVOptions to set this field.
|
|
||||||
*/
|
|
||||||
int dct_algo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IDCT algorithm.
|
|
||||||
* must use AVOptions to set this field.
|
|
||||||
*/
|
|
||||||
int idct_algo;
|
|
||||||
|
|
||||||
void (*get_pixels)(int16_t *block /* align 16 */,
|
|
||||||
const uint8_t *pixels /* align 8 */,
|
|
||||||
ptrdiff_t line_size);
|
|
||||||
|
|
||||||
int bits_per_sample;
|
|
||||||
|
|
||||||
void (*get_pixels_unaligned)(int16_t *block /* align 16 */,
|
|
||||||
const uint8_t *pixels,
|
|
||||||
ptrdiff_t line_size);
|
|
||||||
} AVDCT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allocates a AVDCT context.
|
|
||||||
* This needs to be initialized with avcodec_dct_init() after optionally
|
|
||||||
* configuring it with AVOptions.
|
|
||||||
*
|
|
||||||
* To free it use av_free()
|
|
||||||
*/
|
|
||||||
AVDCT *avcodec_dct_alloc(void);
|
|
||||||
int avcodec_dct_init(AVDCT *);
|
|
||||||
|
|
||||||
const AVClass *avcodec_dct_get_class(void);
|
|
||||||
|
|
||||||
#endif /* AVCODEC_AVDCT_H */
|
|
@ -1,118 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of FFmpeg.
|
|
||||||
*
|
|
||||||
* FFmpeg 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.
|
|
||||||
*
|
|
||||||
* FFmpeg 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 FFmpeg; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AVCODEC_AVFFT_H
|
|
||||||
#define AVCODEC_AVFFT_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file
|
|
||||||
* @ingroup lavc_fft
|
|
||||||
* FFT functions
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup lavc_fft FFT functions
|
|
||||||
* @ingroup lavc_misc
|
|
||||||
*
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef float FFTSample;
|
|
||||||
|
|
||||||
typedef struct FFTComplex {
|
|
||||||
FFTSample re, im;
|
|
||||||
} FFTComplex;
|
|
||||||
|
|
||||||
typedef struct FFTContext FFTContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up a complex FFT.
|
|
||||||
* @param nbits log2 of the length of the input array
|
|
||||||
* @param inverse if 0 perform the forward transform, if 1 perform the inverse
|
|
||||||
*/
|
|
||||||
FFTContext *av_fft_init(int nbits, int inverse);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Do the permutation needed BEFORE calling ff_fft_calc().
|
|
||||||
*/
|
|
||||||
void av_fft_permute(FFTContext *s, FFTComplex *z);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Do a complex FFT with the parameters defined in av_fft_init(). The
|
|
||||||
* input data must be permuted before. No 1.0/sqrt(n) normalization is done.
|
|
||||||
*/
|
|
||||||
void av_fft_calc(FFTContext *s, FFTComplex *z);
|
|
||||||
|
|
||||||
void av_fft_end(FFTContext *s);
|
|
||||||
|
|
||||||
FFTContext *av_mdct_init(int nbits, int inverse, double scale);
|
|
||||||
void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
|
|
||||||
void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
|
|
||||||
void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
|
|
||||||
void av_mdct_end(FFTContext *s);
|
|
||||||
|
|
||||||
/* Real Discrete Fourier Transform */
|
|
||||||
|
|
||||||
enum RDFTransformType {
|
|
||||||
DFT_R2C,
|
|
||||||
IDFT_C2R,
|
|
||||||
IDFT_R2C,
|
|
||||||
DFT_C2R,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct RDFTContext RDFTContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up a real FFT.
|
|
||||||
* @param nbits log2 of the length of the input array
|
|
||||||
* @param trans the type of transform
|
|
||||||
*/
|
|
||||||
RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
|
|
||||||
void av_rdft_calc(RDFTContext *s, FFTSample *data);
|
|
||||||
void av_rdft_end(RDFTContext *s);
|
|
||||||
|
|
||||||
/* Discrete Cosine Transform */
|
|
||||||
|
|
||||||
typedef struct DCTContext DCTContext;
|
|
||||||
|
|
||||||
enum DCTTransformType {
|
|
||||||
DCT_II = 0,
|
|
||||||
DCT_III,
|
|
||||||
DCT_I,
|
|
||||||
DST_I,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up DCT.
|
|
||||||
*
|
|
||||||
* @param nbits size of the input array:
|
|
||||||
* (1 << nbits) for DCT-II, DCT-III and DST-I
|
|
||||||
* (1 << nbits) + 1 for DCT-I
|
|
||||||
* @param type the type of transform
|
|
||||||
*
|
|
||||||
* @note the first element of the input of DST-I is ignored
|
|
||||||
*/
|
|
||||||
DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
|
|
||||||
void av_dct_calc(DCTContext *s, FFTSample *data);
|
|
||||||
void av_dct_end (DCTContext *s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* AVCODEC_AVFFT_H */
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user